/* =========================================================
   Essenzuschuss — Design System
   Stripe / Linear / Ramp / Revolut inspired
   ========================================================= */

:root {
  /* Color palette — light */
  --bg:           #f6f7fb;
  --bg-elev:      #ffffff;
  --bg-glass:     rgba(255,255,255,.72);
  --surface:      #ffffff;
  --surface-2:    #f1f2f7;
  --border:       rgba(15,17,28,.07);
  --border-strong:rgba(15,17,28,.12);
  --text:         #0a0d1c;
  --text-soft:    #4a5170;
  --text-muted:   #757c95;
  --brand:        #5b5bf5;
  --brand-2:      #8a5bff;
  --brand-3:      #38e1c4;
  --accent:       #ff7849;
  --success:      #16b985;
  --warning:      #f7a823;
  --danger:       #ef3b56;
  --shadow-sm:    0 1px 2px rgba(15,17,28,.04), 0 1px 3px rgba(15,17,28,.06);
  --shadow-md:    0 6px 24px -8px rgba(20,24,60,.18), 0 2px 6px rgba(20,24,60,.06);
  --shadow-lg:    0 24px 60px -20px rgba(20,24,60,.35);
  --shadow-glow:  0 0 0 6px rgba(91,91,245,.10);
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"] {
  --bg:           #07080f;
  --bg-elev:      #0d1020;
  --bg-glass:     rgba(13,16,32,.65);
  --surface:      #11142a;
  --surface-2:    #181c39;
  --border:       rgba(255,255,255,.06);
  --border-strong:rgba(255,255,255,.12);
  --text:         #f3f5fb;
  --text-soft:    #aab1cc;
  --text-muted:   #6c7395;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.4);
  --shadow-md:    0 8px 32px -8px rgba(0,0,0,.45);
  --shadow-lg:    0 28px 80px -20px rgba(0,0,0,.65);
  --shadow-glow:  0 0 0 6px rgba(91,91,245,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; font-size: 15px; line-height: 1.55; letter-spacing: -.005em; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ==== Background mesh (landing) ==== */
.mesh-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.mesh-bg::before, .mesh-bg::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(120px); opacity: .55; transition: opacity .6s var(--ease);
}
.mesh-bg::before { background: radial-gradient(circle, var(--brand) 0%, transparent 60%); top: -20vmax; left: -10vmax; }
.mesh-bg::after  { background: radial-gradient(circle, var(--brand-3) 0%, transparent 60%); bottom: -20vmax; right: -10vmax; }
[data-theme="dark"] .mesh-bg::before { opacity: .35; }
[data-theme="dark"] .mesh-bg::after  { opacity: .3; }

/* ==== Containers ==== */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 840px; margin: 0 auto; padding: 0 24px; }

/* ==== Typography ==== */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.2rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); padding: 8px 14px; background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 999px; }
.muted { color: var(--text-muted); }
.gradient-text { background: linear-gradient(120deg, var(--brand), var(--brand-2) 50%, var(--brand-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ==== Buttons ==== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; font-weight: 600; font-size: 14.5px; border-radius: 12px; border: 1px solid transparent; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .15s var(--ease); white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 80%, #000)); color: #fff; box-shadow: 0 6px 16px -8px var(--brand), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { box-shadow: 0 10px 24px -8px var(--brand), inset 0 1px 0 rgba(255,255,255,.22); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 15.5px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ==== Cards ==== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px; }
.card-hover { transition: transform .2s var(--ease), box-shadow .25s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.glass { backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); background: var(--bg-glass); border: 1px solid var(--border-strong); }

/* ==== Forms ==== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; transition: border .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--shadow-glow); }
.input-icon { position: relative; }
.input-icon .input { padding-left: 42px; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 18px; height: 18px; }

/* ==== Stat cards ==== */
.stat { display: flex; flex-direction: column; gap: 4px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.stat .stat-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 600; }
.stat .stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.stat .stat-delta { font-size: 12.5px; color: var(--success); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat .stat-delta.neg { color: var(--danger); }
.stat::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 30%, transparent) 0%, transparent 70%);
}

/* ==== Pills / Badges ==== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--surface-2); color: var(--text-soft); }
.badge.success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge.warn    { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge.danger  { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.info    { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }

/* ==== Tables ==== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); }
.table th, .table td { padding: 14px 18px; text-align: left; font-size: 14px; }
.table th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: .08em; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody td { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }

/* ==== Topbar ==== */
.topbar { position: sticky; top: 0; z-index: 50; padding: 14px 0; background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, var(--brand-3)); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -8px var(--brand); }
.brand .logo svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--text-soft); font-weight: 500; font-size: 14px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 80;
  position: relative;
}
.nav-toggle:hover { background: var(--surface-2); }

/* ========================================================
   Mobile-Nav — bulletproof Slide-In
   Wird IMMER auf body-Ebene gerendert, z-index 99999
   ======================================================== */
.nav-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.6) !important;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 99998 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity .25s ease, visibility .25s ease !important;
  pointer-events: none !important;
}
.nav-backdrop.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.nav-mobile {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: 86% !important;
  max-width: 360px !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
  padding: 22px 20px 30px !important;
  background: var(--bg-elev) !important;
  border-left: 1px solid var(--border-strong) !important;
  box-shadow: -10px 0 40px rgba(0,0,0,.45) !important;
  z-index: 99999 !important;
  overflow-y: auto !important;
  transform: translateX(100%) !important;
  transition: transform .28s cubic-bezier(.2,.8,.2,1) !important;
  visibility: hidden !important;
  display: flex !important;
}
.nav-mobile.open {
  transform: translateX(0) !important;
  visibility: visible !important;
}
.nav-mobile-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--text-muted);
}
.nav-mobile-close {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: grid !important;
  place-items: center;
  cursor: pointer;
}
.nav-mobile a {
  display: block !important;
  padding: 14px 18px !important;
  font-size: 16px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-align: left !important;
}
.nav-mobile a:hover, .nav-mobile a:active { background: var(--surface-2) !important; }
.nav-mobile .btn-primary {
  background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 80%, #000)) !important;
  color: #fff !important;
  border: none !important;
  text-align: center !important;
}
.nav-mobile .btn-secondary {
  background: var(--surface) !important;
  color: var(--text) !important;
  text-align: center !important;
}
.nav-mobile-theme {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
}

/* Desktop: Mobile-Nav komplett verstecken */
@media (min-width: 881px) {
  .nav-mobile { display: none !important; }
  .nav-backdrop { display: none !important; }
  .nav-toggle { display: none !important; }
}
@media (max-width: 880px) {
  .nav-desktop { display: none !important; }
  .nav-toggle { display: flex !important; }
  .topbar { padding: 12px 0; }
  .topbar .inner { gap: 8px; }
}

/* ==== Layout: Sidebar (app shell) ==== */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { padding: 22px 16px; border-right: 1px solid var(--border); background: var(--bg-elev); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 18px; }
.sidebar .nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); padding: 14px 12px 6px; font-weight: 600; }
.sidebar .nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-soft); font-weight: 500; font-size: 14px; transition: all .15s var(--ease); }
.sidebar .nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar .nav-item.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.sidebar .nav-item svg { width: 18px; height: 18px; opacity: .9; }
.main { padding: 28px 36px 80px; }
.main-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.main-head h1 { font-size: 28px; }
.main-head .sub { color: var(--text-muted); margin-top: 6px; }

/* ==== Grid utilities ==== */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.flex { display: flex; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-20 { gap: 20px; } .gap-30 { gap: 30px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ==== Landing hero ==== */
.hero { padding: 100px 0 80px; text-align: center; position: relative; }
.hero h1 .accent { display: inline-block; }
.hero .lead { font-size: 19px; color: var(--text-soft); max-width: 640px; margin: 24px auto 36px; line-height: 1.55; }
.hero .cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero .preview-card { margin-top: 70px; border-radius: 24px; padding: 12px; background: var(--bg-glass); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); max-width: 1000px; margin-left: auto; margin-right: auto; transform: perspective(2000px) rotateX(6deg); transition: transform .5s var(--ease); }
.hero .preview-card:hover { transform: perspective(2000px) rotateX(2deg); }
.hero .preview-card img, .hero .preview-card .mock-dashboard { border-radius: 16px; width: 100%; display: block; }

/* ==== Mock dashboard inside preview ==== */
.mock-dashboard { background: var(--bg); padding: 24px; }
.mock-dashboard .mock-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.mock-dashboard .mock-card { background: var(--surface); border-radius: 14px; padding: 16px; border: 1px solid var(--border); }
.mock-dashboard .mock-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 14px; }
.mock-dashboard .mock-bar { flex: 1; background: linear-gradient(180deg, var(--brand), var(--brand-2)); border-radius: 6px; opacity: .85; }

/* ==== Feature grid ==== */
.feature { padding: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); transition: all .2s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); margin-bottom: 14px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--text-soft); font-size: 14px; line-height: 1.55; margin: 0; }

/* ==== Pricing ==== */
.price-card { padding: 30px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); position: relative; }
.price-card.featured { border: 1.5px solid var(--brand); box-shadow: 0 24px 60px -25px var(--brand); transform: translateY(-6px); }
.price-card .price { font-size: 42px; font-weight: 700; letter-spacing: -.03em; }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.price-card ul li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-soft); font-size: 14px; }
.price-card ul li::before { content: ""; flex: 0 0 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--success) 18%, transparent); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316b985' stroke-width='3'><polyline points='5,12 10,17 19,8'/></svg>"); background-repeat: no-repeat; background-position: center; background-size: 12px; margin-top: 1px; }

/* ==== Auth screens ==== */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-shell .left { padding: 60px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-shell .right { position: relative; background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, var(--brand-3)); overflow: hidden; padding: 60px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.auth-shell .right::before, .auth-shell .right::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); }
.auth-shell .right::before { width: 320px; height: 320px; background: rgba(255,255,255,.25); top: -80px; right: -80px; }
.auth-shell .right::after { width: 360px; height: 360px; background: rgba(0,0,0,.25); bottom: -100px; left: -120px; }
.auth-form { max-width: 380px; width: 100%; margin: auto; }
@media (max-width: 880px) { .auth-shell { grid-template-columns: 1fr; } .auth-shell .right { display: none; } .auth-shell .left { padding: 30px; } }

/* ==== Upload / Camera ==== */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; background: var(--surface); transition: all .15s var(--ease); cursor: pointer; }
.dropzone.dragover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.dropzone .icon-wrap { width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, var(--brand) 12%, transparent); display: grid; place-items: center; margin: 0 auto 12px; color: var(--brand); }

.camera-stage { position: relative; aspect-ratio: 3/4; width: 100%; max-width: 480px; margin: 0 auto; border-radius: 22px; overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.camera-stage video, .camera-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-stage canvas.overlay { pointer-events: none; }
.camera-toolbar { display: flex; justify-content: center; gap: 14px; padding: 16px 0; }
.camera-shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--surface); background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--border-strong), 0 12px 28px -10px var(--brand); transition: transform .12s var(--ease); }
.camera-shutter:hover { transform: scale(1.05); }
.camera-shutter:active { transform: scale(.95); }
.scan-line { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--brand-3), transparent); box-shadow: 0 0 18px var(--brand-3); animation: scan 2.6s linear infinite; pointer-events: none; }
@keyframes scan { 0%{top:0; opacity:0} 10%{opacity:1} 90%{opacity:1} 100%{top:100%; opacity:0} }
.camera-quality { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.camera-quality .dot { width: 8px; height: 8px; border-radius: 50%; background: #16b985; box-shadow: 0 0 8px #16b985; }
.camera-quality.warn .dot { background: #f7a823; box-shadow: 0 0 8px #f7a823; }
.camera-quality.bad .dot  { background: #ef3b56; box-shadow: 0 0 8px #ef3b56; }

/* ==== Progress / loader ==== */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; transition: width .3s var(--ease); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shimmer { position: relative; overflow: hidden; background: var(--surface-2); }
.shimmer::after { content:""; position: absolute; inset:0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

/* ==== Toasts / Flash ==== */
.flash-stack { position: fixed; top: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash { padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); border: 1px solid var(--border-strong); display: flex; gap: 12px; align-items: flex-start; animation: slideIn .3s var(--ease); }
.flash.success { border-left: 3px solid var(--success); }
.flash.error   { border-left: 3px solid var(--danger); }
.flash.info    { border-left: 3px solid var(--brand); }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ==== Theme toggle ==== */
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-soft); }
.theme-toggle:hover { color: var(--text); }

/* ==== Mobile ==== */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; width: 280px; transition: left .3s var(--ease); z-index: 60; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .main { padding: 18px 18px 100px; }
  .hamburger { display: grid; }
}
.hamburger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft); place-items: center; }
.mobile-bar { display: none; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 8px 0; }

/* ==== Mobile App Topbar ==== */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.mobile-topbar .brand { font-size: 16px; gap: 8px; }
.mobile-topbar .brand .logo { width: 30px; height: 30px; }

/* ==== Bottom Navigation ==== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-strong);
  z-index: 50;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px -8px rgba(20,24,60,.1);
}
.bottom-nav-grid {
  display: grid;
  gap: 2px;
  max-width: 640px;
  margin: 0 auto;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  min-height: 54px;
  transition: color .15s var(--ease), background .15s var(--ease), transform .12s var(--ease);
}
.bottom-nav-item svg { width: 22px; height: 22px; stroke-width: 2; }
.bottom-nav-item.active {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.bottom-nav-item.active svg { stroke-width: 2.4; }
.bottom-nav-item:active { transform: scale(0.92); }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-bar { display: none; }
  .mobile-topbar { display: flex; }
  .bottom-nav { display: block; }
  .main { padding: 14px 14px 90px; }
  .main-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .main-head h1 { font-size: 22px; }
}

/* ==== Mobile-Card Layout für Tabellen ==== */
.hide-mobile { display: block; }
.show-mobile { display: none; }
@media (max-width: 720px) {
  .hide-mobile { display: none; }
  .show-mobile { display: block; }
}

.mobile-card-list { display: flex; flex-direction: column; gap: 10px; }
.mobile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.mobile-card:active { transform: scale(.99); }
.mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mobile-card-date {
  font-weight: 700;
  font-size: 14px;
}
.mobile-card-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
.mobile-card-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.mobile-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.mobile-card-amount {
  font-size: 17px;
  font-weight: 700;
}
.mobile-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mobile-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Tabellen die scrollen müssen → kompakter auf mobile */
@media (max-width: 720px) {
  .table-wrap { border-radius: 12px; }
  .table th, .table td { padding: 10px 12px; font-size: 13px; }
}

/* ==== Footer ==== */
.footer { padding: 60px 0 40px; border-top: 1px solid var(--border); margin-top: 80px; color: var(--text-muted); font-size: 14px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-soft); margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a:hover { color: var(--text); }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

/* ==== Misc ==== */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.kbd { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: 12px; color: var(--text-soft); }
.risk-bar { display: inline-block; height: 6px; width: 120px; border-radius: 999px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.risk-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--success), var(--warning) 50%, var(--danger)); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ==== Reveal on scroll ==== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================
   Crop-Stage (manuelles Zuschneiden)
   ========================================================== */
.crop-stage {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.crop-stage img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  pointer-events: none;
}
.crop-mask {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px solid #38e1c4;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25), inset 0 0 0 1px rgba(0,0,0,.25);
  pointer-events: none;
  border-radius: 2px;
}
.crop-handle {
  position: absolute;
  width: 32px; height: 32px;
  background: #fff;
  border: 3px solid #5b5bf5;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  z-index: 5;
}
.crop-handle:hover { transform: translate(-50%, -50%) scale(1.1); }
.crop-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.2);
  border-color: var(--brand-3);
}

/* ==========================================================
   Mitarbeiter-Wochenübersicht — Kalenderblatt-Design
   ========================================================== */

/* === Monats-Hero === */
.month-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 24px;
  padding: 28px 30px;
  margin-bottom: 28px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #5b5bf5 0%, #8a5bff 60%, #38e1c4 110%);
  box-shadow: 0 20px 50px -20px rgba(91,91,245,.55);
}
.month-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.25) 0%, transparent 40%),
    radial-gradient(circle at 10% 100%, rgba(0,0,0,.25) 0%, transparent 50%);
}
.month-hero-content { position: relative; z-index: 1; }
.month-hero-label {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em;
  font-weight: 700; opacity: .9;
}
.month-hero-value {
  font-size: clamp(38px, 5vw, 52px); font-weight: 800; line-height: 1;
  letter-spacing: -.025em; margin: 8px 0 6px;
}
.month-hero-meta { font-size: 14px; opacity: .9; }
.month-hero-meta .sep { margin: 0 8px; opacity: .5; }
.month-hero-icon {
  position: relative; z-index: 1;
  font-size: 80px; line-height: 1; opacity: .35;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.2));
}
@media (max-width: 640px) {
  .month-hero { padding: 20px 18px; }
  .month-hero-icon { display: none; }
  .month-hero-value { font-size: 34px !important; }
  .month-hero-meta { font-size: 13px; }
  .week-nav-range { font-size: 15px; }
  .week-nav-week { font-size: 11px; }
  .week-nav-btn { width: 38px; height: 38px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat .stat-value { font-size: 24px; }
  .card { padding: 16px; border-radius: 16px; }
  h1 { font-size: 22px !important; }
  .main-head { margin-bottom: 16px; }
}

/* === Wochen-Navigation === */
.week-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.week-nav-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-soft); transition: all .15s var(--ease);
  flex-shrink: 0;
}
.week-nav-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: scale(1.05); }
.week-nav-title { text-align: center; flex: 1; }
.week-nav-week {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em;
  font-weight: 700; color: var(--text-muted);
}
.week-nav-range {
  font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.01em;
  margin-top: 2px;
}

/* === Day grid === */
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1200px) { .day-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px)  { .day-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 380px)  { .day-grid { grid-template-columns: 1fr; } }

/* === Day card (Kalenderblatt) === */
.day-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px -10px rgba(20,24,60,.18), 0 2px 6px rgba(20,24,60,.05);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  aspect-ratio: 3 / 4;
  min-height: 200px;
}
.day-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 24px 40px -14px rgba(20,24,60,.32);
}
.day-card:active { transform: translateY(-2px) scale(1.0); }

/* Kopfband (rot/grün/grau) */
.day-card .day-head {
  position: relative;
  padding: 18px 12px 14px;
  color: #fff;
  text-align: center;
  background: linear-gradient(170deg, #ef4444 0%, #b91c1c 100%);
}
.day-card .day-head::before,
.day-card .day-head::after {
  content: "";
  position: absolute; top: 7px;
  width: 7px; height: 7px;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  box-shadow: inset 0 -1px 1px rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.18);
}
.day-card .day-head::before { left: 28%; }
.day-card .day-head::after  { right: 28%; }
.day-card .day-head-abbr {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .15em;
  margin-top: 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.day-card .day-head-today {
  position: absolute; top: 6px; right: 8px;
  font-size: 9px; font-weight: 800; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,.95); color: #b91c1c;
}

/* Kartenkörper */
.day-card .day-body {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 14px 10px 18px;
  background: var(--surface);
}
.day-card .day-num {
  font-size: clamp(38px, 4vw, 50px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--text);
}
.day-card .day-month {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-muted);
  font-weight: 700;
}
.day-card .day-amount {
  font-size: 17px;
  font-weight: 800;
  color: #16a34a;
  margin-top: 8px;
  letter-spacing: -.01em;
}
.day-card .day-pill {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.day-card .day-pill.ok      { background: rgba(34,197,94,.14);  color: #16a34a; }
.day-card .day-pill.bad     { background: rgba(239,68,68,.14);  color: #dc2626; }
.day-card .day-pill.neutral { background: var(--surface-2);     color: var(--text-muted); }

/* === Status-Varianten === */
.day-card.state-uploaded .day-head {
  background: linear-gradient(170deg, #22c55e 0%, #15803d 100%);
}
.day-card.state-rejected .day-head {
  background: linear-gradient(170deg, #b91c1c 0%, #7f1d1d 100%);
}
.day-card.state-future {
  opacity: .55;
  pointer-events: none;
}
.day-card.state-future .day-head {
  background: linear-gradient(170deg, #94a3b8 0%, #64748b 100%);
}

/* Heute = Outline-Highlight */
.day-card.is-today {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  z-index: 1;
}

/* === Legende === */
.day-legend {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 24px;
  margin-top: 30px;
  font-size: 13px;
  color: var(--text-muted);
}
.day-legend span { display: inline-flex; align-items: center; gap: 8px; }
.day-legend .dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.day-legend .dot.ok      { background: linear-gradient(135deg, #22c55e, #15803d); }
.day-legend .dot.bad     { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.day-legend .dot.neutral { background: linear-gradient(135deg, #94a3b8, #64748b); }

/* ==== Print ==== */
@media print { .sidebar, .topbar, .footer { display: none; } .main { padding: 0; } }
