/* ============================================================
   FOXIZER — Enterprise Design System v4.0 "Platinum"
   Clean · Scalable · Investor-Ready · Enterprise-Grade
   Comparable to Stripe, Linear, Notion, Vercel
   Architecture: Tokens → Reset → Typography → Layout → Components → Pages → Responsive
   ============================================================ */


/* ══════════════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ══════════════════════════════════════════════════════════════ */
:root {

  /* ── Brand ───────────────────────────────────────────────── */
  --brand:        #E85A00;
  --brand-dark:   #C94A00;
  --brand-hover:  #D55200;
  --brand-faint:  rgba(232, 90, 0, .06);
  --brand-muted:  rgba(232, 90, 0, .12);
  --brand-shadow: rgba(232, 90, 0, .24);

  /* ── Neutral Scale (blue-slate tinted) ───────────────────── */
  --n-0:   #FFFFFF;
  --n-50:  #FAFBFC;
  --n-75:  #F5F7FA;
  --n-100: #EEF2F7;
  --n-150: #E4EAF2;
  --n-200: #D6DEE8;
  --n-300: #B3BFCF;
  --n-400: #8898AD;
  --n-500: #5E7087;
  --n-600: #435468;
  --n-700: #2D3D52;
  --n-800: #1A283C;
  --n-900: #0E1826;
  --n-950: #070E1A;

  /* ── Semantic States ─────────────────────────────────────── */
  --c-success:        #059669;
  --c-success-bg:     #F0FDF9;
  --c-success-border: #A7F3D0;
  --c-success-text:   #065F46;

  --c-warning:        #D97706;
  --c-warning-bg:     #FFFBEB;
  --c-warning-border: #FCD34D;
  --c-warning-text:   #92400E;

  --c-danger:        #DC2626;
  --c-danger-bg:     #FEF2F2;
  --c-danger-border: #FECACA;
  --c-danger-text:   #991B1B;

  --c-info:        #2563EB;
  --c-info-bg:     #EFF6FF;
  --c-info-border: #BFDBFE;
  --c-info-text:   #1E40AF;

  /* ── Typography ──────────────────────────────────────────── */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --text-xs:   0.6875rem;   /* 11px */
  --text-sm:   0.75rem;     /* 12px */
  --text-base: 0.875rem;    /* 14px */
  --text-md:   1rem;        /* 16px */
  --text-lg:   1.125rem;    /* 18px */
  --text-xl:   1.25rem;     /* 20px */
  --text-2xl:  1.5rem;      /* 24px */
  --text-3xl:  1.875rem;    /* 30px */

  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    800;

  --lh-tight:  1.25;
  --lh-snug:   1.375;
  --lh-base:   1.5;
  --lh-relaxed: 1.625;

  /* ── Spacing (8px grid) ──────────────────────────────────── */
  --sp-1:  0.25rem;    /* 4px */
  --sp-2:  0.5rem;     /* 8px */
  --sp-3:  0.75rem;    /* 12px */
  --sp-4:  1rem;       /* 16px */
  --sp-5:  1.25rem;    /* 20px */
  --sp-6:  1.5rem;     /* 24px */
  --sp-8:  2rem;       /* 32px */
  --sp-10: 2.5rem;     /* 40px */
  --sp-12: 3rem;       /* 48px */
  --sp-16: 4rem;       /* 64px */

  /* ── Border Radius ───────────────────────────────────────── */
  --r-xs:   3px;
  --r-sm:   5px;
  --r-md:   7px;
  --r-lg:   10px;
  --r-xl:   12px;
  --r-2xl:  16px;
  --r-full: 9999px;

  /* ── Shadows ─────────────────────────────────────────────── */
  --shadow-xs:    0 1px 2px rgba(0, 0, 0, .05);
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md:    0 3px 8px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-lg:    0 6px 20px rgba(0, 0, 0, .09), 0 2px 6px rgba(0, 0, 0, .05);
  --shadow-xl:    0 12px 40px rgba(0, 0, 0, .12), 0 4px 12px rgba(0, 0, 0, .07);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, .20), 0 8px 24px rgba(0, 0, 0, .12);
  --shadow-brand: 0 4px 16px var(--brand-shadow);

  /* ── Layout ──────────────────────────────────────────────── */
  --sidebar-w:   220px;
  --topbar-h:    56px;
  --content-max: 1280px;

  /* ── Transitions ─────────────────────────────────────────── */
  --t-fast: 100ms ease;
  --t-base: 175ms ease;
  --t-slow: 270ms ease;

  /* ── Semantic Layout Colors ──────────────────────────────── */
  --sb-bg:           #0C111D;
  --sb-border:       rgba(255, 255, 255, .07);
  --sb-text-dim:     rgba(255, 255, 255, .40);
  --sb-text-muted:   rgba(255, 255, 255, .55);
  --sb-text-default: rgba(255, 255, 255, .70);
  --sb-text-active:  #FFFFFF;
  --sb-hover-bg:     rgba(255, 255, 255, .06);
  --sb-active-bg:    rgba(255, 255, 255, .10);

  --bg-canvas:   var(--n-75);
  --bg-surface:  var(--n-0);
  --border:      var(--n-150);
  --border-strong: var(--n-200);

  --text-primary: var(--n-900);
  --text-secondary: var(--n-600);
  --text-muted:   var(--n-500);
}


/* ══════════════════════════════════════════════════════════════
   2. RESET & BASE
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-base);
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--brand-muted); color: var(--brand-dark); }

img, svg { display: block; }
a { color: inherit; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ══════════════════════════════════════════════════════════════
   3. TYPOGRAPHY SYSTEM
   ══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

h1 { font-size: var(--text-2xl); font-weight: var(--fw-black); }
h2 { font-size: var(--text-xl);  font-weight: var(--fw-bold); }
h3 { font-size: var(--text-lg);  font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-md);  font-weight: var(--fw-semibold); }

p { margin: 0; line-height: var(--lh-relaxed); }


/* ══════════════════════════════════════════════════════════════
   4. BUTTON SYSTEM
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0 var(--sp-4);
  height: 36px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Primary */
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 3px var(--brand-shadow);
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active { transform: scale(.98); }

/* Secondary */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--n-50); border-color: var(--n-300); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--n-100); color: var(--text-primary); }

/* Danger */
.btn-danger {
  background: var(--c-danger-bg);
  color: var(--c-danger-text);
  border-color: var(--c-danger-border);
}
.btn-danger:hover { background: #fee2e2; }

/* Sizes */
.btn-xs { height: 26px; padding: 0 var(--sp-2); font-size: var(--text-xs); border-radius: var(--r-sm); gap: var(--sp-1); }
.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--text-sm); border-radius: var(--r-sm); }
.btn-lg { height: 44px; padding: 0 var(--sp-6); font-size: var(--text-md); border-radius: var(--r-lg); }

/* Icon buttons */
.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.btn-icon-sm:hover { background: var(--n-100); color: var(--text-primary); border-color: var(--n-300); }
.btn-icon-sm--danger:hover { background: var(--c-danger-bg); color: var(--c-danger-text); border-color: var(--c-danger-border); }


/* ══════════════════════════════════════════════════════════════
   5. FORM SYSTEM
   ══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: var(--sp-1); }

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="week"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

textarea { height: auto; padding: var(--sp-2) var(--sp-3); resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-faint);
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

.form-hint { font-size: var(--text-xs); color: var(--text-muted); }
.form-error { font-size: var(--text-xs); color: var(--c-danger-text); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%238898AD' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 32px;
}

/* Checkbox */
input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}


/* ══════════════════════════════════════════════════════════════
   6. BADGES & STATUS CHIPS
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  padding: 3px 7px;
  border-radius: var(--r-full);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-success { background: var(--c-success-bg); color: var(--c-success-text); border: 1px solid var(--c-success-border); }
.badge-danger  { background: var(--c-danger-bg);  color: var(--c-danger-text);  border: 1px solid var(--c-danger-border); }
.badge-warning { background: var(--c-warning-bg); color: var(--c-warning-text); border: 1px solid var(--c-warning-border); }
.badge-info    { background: var(--c-info-bg);    color: var(--c-info-text);    border: 1px solid var(--c-info-border); }
.badge-neutral { background: var(--n-100);        color: var(--n-600);          border: 1px solid var(--n-200); }
.badge-brand   { background: var(--brand-faint);  color: var(--brand-dark);     border: 1px solid var(--brand-muted); }
.badge-youth   { background: #f0f9ff;             color: #0369a1;               border: 1px solid #bae6fd; }

/* Live badge (optimizer running) */
.badge-live {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}
.badge-live-bar-wrap {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: rgba(0,0,0,.1);
}
.badge-live-bar {
  height: 100%; background: var(--c-warning-text);
  transition: width 0.4s ease;
}

/* Skill tags */
.skill-tag {
  display: inline-flex; align-items: center;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--n-100);
  color: var(--n-700);
  border: 1px solid var(--n-200);
  white-space: nowrap;
}


/* ══════════════════════════════════════════════════════════════
   7. CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.card-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: var(--sp-5); }
.card-footer {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--n-50);
}


/* ══════════════════════════════════════════════════════════════
   8. TABLE SYSTEM
   ══════════════════════════════════════════════════════════════ */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

thead { background: var(--n-50); border-bottom: 1px solid var(--border); }

th {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  padding: var(--sp-3) var(--sp-4);
  vertical-align: middle;
  border-bottom: 1px solid var(--n-75);
  color: var(--text-primary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--n-50); }
tbody tr { transition: background var(--t-fast); }

th:last-child, td:last-child { text-align: right; }

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
}


/* ══════════════════════════════════════════════════════════════
   9. ALERTS & MESSAGES
   ══════════════════════════════════════════════════════════════ */
.messages { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  border: 1px solid;
}

.alert.success, .alert.messages-success { background: var(--c-success-bg); color: var(--c-success-text); border-color: var(--c-success-border); }
.alert.warning, .alert.messages-warning { background: var(--c-warning-bg); color: var(--c-warning-text); border-color: var(--c-warning-border); }
.alert.error,   .alert.messages-error   { background: var(--c-danger-bg);  color: var(--c-danger-text);  border-color: var(--c-danger-border); }
.alert.info,    .alert.messages-info    { background: var(--c-info-bg);    color: var(--c-info-text);    border-color: var(--c-info-border); }


/* ══════════════════════════════════════════════════════════════
   10. INFO MODAL SYSTEM
   ══════════════════════════════════════════════════════════════ */
.im-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 14, 26, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.im-backdrop.im-open { display: flex; }

.im-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-modal);
  width: min(520px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  animation: imSlideIn .2s ease;
}

@keyframes imSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.im-header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.im-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-faint); border: 1px solid var(--brand-muted);
  color: var(--brand); font-size: var(--text-sm);
  font-weight: var(--fw-black);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-style: italic;
}

.im-title {
  flex: 1;
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.im-close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.im-close:hover { background: var(--n-100); color: var(--text-primary); }

.im-body {
  padding: var(--sp-5);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}
.im-body ul { margin: 0; padding-left: var(--sp-5); }
.im-body li { margin-bottom: var(--sp-2); }
.im-body strong { color: var(--text-primary); font-weight: var(--fw-semibold); }

.im-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--n-50);
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
}
.im-btn-dismiss {
  height: 34px; padding: 0 var(--sp-4);
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--text-xs); font-weight: var(--fw-medium);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none; display: inline-flex; align-items: center; gap: .3rem;
}
.im-btn-dismiss:hover {
  background: var(--n-100); color: var(--text-primary);
}

.im-btn-ok {
  height: 34px; padding: 0 var(--sp-5);
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  cursor: pointer; transition: background var(--t-fast);
}
.im-btn-ok:hover { background: var(--brand-hover); }

/* Info trigger button */
.im-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--n-200);
  background: var(--n-100); color: var(--n-500);
  font-size: var(--text-xs); font-weight: var(--fw-black);
  font-style: italic;
  cursor: pointer; vertical-align: middle; margin-left: var(--sp-2);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.im-trigger:hover { background: var(--brand-faint); border-color: var(--brand-muted); color: var(--brand); }


/* ══════════════════════════════════════════════════════════════
   11. EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.empty-state-icon {
  width: 52px; height: 52px; border-radius: var(--r-xl);
  background: var(--n-100); border: 1px solid var(--n-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--n-400);
  margin-bottom: var(--sp-5);
}

.empty-state h3 {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.empty-state p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 360px;
  margin-bottom: var(--sp-6);
}

.empty-state-actions {
  display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center;
}


/* ══════════════════════════════════════════════════════════════
   12. PAGE HEADER
   ══════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.page-header-text { flex: 1; min-width: 0; }

.page-header-text h1 {
  font-size: var(--text-xl);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-1);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.page-header-text p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.page-back {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--text-sm); color: var(--text-muted);
  text-decoration: none; margin-bottom: var(--sp-4);
  transition: color var(--t-fast);
}
.page-back:hover { color: var(--text-primary); }


/* ══════════════════════════════════════════════════════════════
   13. APP LAYOUT — SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.app-layout { background: var(--bg-canvas); }

.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

/* Logo */
.sb-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: 1.1rem var(--sp-4) .9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-logo-img {
  width: 88px; height: 88px;
  object-fit: contain;
  flex-shrink: 0;
}
.sb-logo-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sb-brand {
  font-size: var(--text-md);
  font-weight: var(--fw-black);
  color: var(--sb-text-active);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sb-tagline {
  font-size: .6rem;
  color: rgba(255,255,255,.38);
  letter-spacing: .05em;
  font-weight: 400;
  text-transform: uppercase;
}

/* Navigation */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sb-section { margin-bottom: var(--sp-4); }

.sb-section-title {
  display: block;
  font-size: 10px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sb-text-dim);
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px var(--sp-3);
  margin: 1px var(--sp-2);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--sb-text-muted);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.sb-item:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-text-default);
}
.sb-item.is-active {
  background: var(--sb-active-bg);
  color: var(--sb-text-active);
  font-weight: var(--fw-semibold);
}

.sb-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.sb-item.is-active .sb-icon { opacity: 1; }

/* Optimization item highlight */
.sb-item-opt.is-active {
  background: rgba(232, 90, 0, .15);
  color: #FFB380;
}
.sb-item-opt.is-active .sb-icon { opacity: 1; }

/* Sidebar Footer */
.sb-footer {
  border-top: 1px solid var(--sb-border);
  padding: var(--sp-3);
  flex-shrink: 0;
}

.sb-coin-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--t-fast);
  margin-bottom: var(--sp-2);
}
.sb-coin-link:hover { background: var(--sb-hover-bg); }
.sb-coin-link--warn { opacity: 0.7; }

.sb-coin-icon {
  font-size: 18px;
  color: var(--brand);
  flex-shrink: 0;
}
.sb-coin-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sb-coin-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sb-text-dim);
}
.sb-coin-val {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--sb-text-default);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-1);
}

.sb-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: var(--text-xs); font-weight: var(--fw-black);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sb-user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.sb-username {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--sb-text-default);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-user-project {
  font-size: var(--text-xs);
  color: var(--sb-text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sb-logout-form { margin: 0; }
.sb-logout-btn {
  width: 100%;
  height: 30px;
  background: transparent;
  border: 1px solid var(--sb-border);
  border-radius: var(--r-sm);
  color: var(--sb-text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.sb-logout-btn:hover { background: var(--sb-hover-bg); color: var(--sb-text-default); }

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,.5);
}
.sidebar-backdrop.is-visible { display: block; }


/* ══════════════════════════════════════════════════════════════
   14. APP LAYOUT — TOPBAR
   ══════════════════════════════════════════════════════════════ */
.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-left { display: flex; align-items: center; gap: var(--sp-3); }
.topbar-right { display: flex; align-items: center; gap: var(--sp-3); }

.sidebar-toggle {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  border-radius: var(--r-sm); color: var(--text-secondary);
  transition: background var(--t-fast);
}
.sidebar-toggle:hover { background: var(--n-100); }

.topbar-project-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 30px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.topbar-project-chip:hover { background: var(--n-50); border-color: var(--n-300); }

.topbar-project-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-success);
  flex-shrink: 0;
}

.topbar-coin {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 28px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--n-50);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.topbar-coin:hover { background: var(--n-100); border-color: var(--n-300); color: var(--text-primary); }
.topbar-coin--warn { border-color: var(--c-warning-border); background: var(--c-warning-bg); color: var(--c-warning-text); }
.topbar-coin--warn:hover { opacity: 0.9; }
.topbar-verify-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 28px;
  padding: 0 var(--sp-3);
  border: 1px solid #fbbf24;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: #92400e;
  text-decoration: none;
  background: #fef3c7;
  transition: background var(--t-fast);
}
.topbar-verify-badge:hover { background: #fde68a; }


/* ══════════════════════════════════════════════════════════════
   15. PAGE CONTENT AREA
   ══════════════════════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: var(--sp-8) var(--sp-8);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.app-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.app-footer-links { display: flex; gap: var(--sp-4); }
.app-footer-links a { color: var(--text-muted); text-decoration: none; transition: color var(--t-fast); }
.app-footer-links a:hover { color: var(--text-secondary); }


/* ══════════════════════════════════════════════════════════════
   16. PUBLIC LAYOUT
   ══════════════════════════════════════════════════════════════ */
.public-layout { background: var(--n-50); }

.main-header {
  position: sticky; top: 0; z-index: 90;
  height: 56px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-8);
  backdrop-filter: blur(8px);
}
.logo-area {
  display: flex; align-items: center; gap: var(--sp-3);
  text-decoration: none;
}
.brand {
  font-size: var(--text-md);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.auth-links { display: flex; gap: var(--sp-2); align-items: center; }
.btn-auth {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand);
  text-decoration: none;
  transition: background var(--t-fast);
}
.btn-auth:hover { background: var(--brand-hover); }
.btn-auth.secondary {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-auth.secondary:hover { background: var(--n-100); color: var(--text-primary); }

.main-footer {
  padding: var(--sp-8);
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.footer-links { display: flex; justify-content: center; gap: var(--sp-5); margin-bottom: var(--sp-3); }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-secondary); }


/* ══════════════════════════════════════════════════════════════
   17. KPI GRID & STAT CARDS
   ══════════════════════════════════════════════════════════════ */
/* KPI-Zeile: zwei Gruppen nebeneinander */
.kpi-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: var(--sp-6);
}
.kpi-group {
  flex: 1;
  min-width: 0;
}
.kpi-group-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 var(--sp-4);
  flex-shrink: 0;
}
.kpi-section-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: 0;
}

.kpi-card {
  min-width: 0;
  min-height: 80px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.kpi-label {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: 100%;
}

.kpi-card-icon {
  width: 22px; height: 22px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-card-icon svg { width: 12px; height: 12px; }
.kpi-card-icon--success  { background: var(--c-success-bg);  color: var(--c-success); }
.kpi-card-icon--danger   { background: var(--c-danger-bg);   color: var(--c-danger); }
.kpi-card-icon--warning  { background: var(--c-warning-bg);  color: var(--c-warning); }
.kpi-card-icon--info     { background: var(--c-info-bg);     color: var(--c-info); }
.kpi-card-icon--brand    { background: var(--brand-faint);   color: var(--brand); }
.kpi-card-icon--neutral  { background: var(--n-100);         color: var(--n-500); }

.kpi-value {
  font-size: var(--text-lg);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}
.kpi-value--success { color: var(--c-success); }
.kpi-value--danger  { color: var(--c-danger); }
.kpi-value--warning { color: var(--c-warning); }

.kpi-label {
  font-size: 10px;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  line-height: 1.25;
}

.kpi-card-value { font-size: var(--text-2xl); font-weight: var(--fw-black); color: var(--text-primary); line-height: 1; letter-spacing: -0.03em; }
.kpi-card-label { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--text-muted); margin-top: var(--sp-1); }
.kpi-card-body { display: flex; flex-direction: column; }


/* ══════════════════════════════════════════════════════════════
   18. CHART CARDS
   ══════════════════════════════════════════════════════════════ */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.chart-grid--single { grid-template-columns: 1fr; }
.chart-grid--wide   { grid-template-columns: 1fr; }
.chart-grid--3      { grid-template-columns: repeat(3, 1fr); }
.chart-grid--4      { grid-template-columns: repeat(4, 1fr); }

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.chart-card--full { grid-column: 1 / -1; }

.chart-card-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--n-75);
  display: flex; align-items: flex-start; justify-content: space-between;
}

.chart-card-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}
.chart-card-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-wrap {
  padding: var(--sp-4);
  position: relative;
  height: 220px;
}
.chart-wrap--sm {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  height: auto;
}

/* Im 4-Spalten-Kontext: einheitliche Höhe für alle Chart-Wraps */
.chart-grid--4 .chart-wrap     { height: 200px; }
.chart-grid--4 .chart-wrap--sm { height: 200px; }

.chart-no-data {
  padding: var(--sp-8);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  padding: 0 var(--sp-5) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  justify-content: center;
}
.chart-legend-item {
  display: flex; align-items: center; gap: 5px;
}
.chart-legend-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════════
   19. OPTIMIZATION PROGRESS TOAST
   ══════════════════════════════════════════════════════════════ */
#opt-toast {
  display: none;
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: 950;
  width: 280px;
  background: var(--n-900);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.opt-toast-header {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.opt-toast-icon { font-size: 16px; }
.opt-toast-title {
  flex: 1;
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  color: #fff;
}
.opt-toast-close {
  background: transparent; border: none; color: rgba(255,255,255,.5);
  cursor: pointer; font-size: 18px; line-height: 1;
  padding: 0; transition: color var(--t-fast);
}
.opt-toast-close:hover { color: #fff; }

.opt-toast-body { padding: var(--sp-3) var(--sp-4); }

.opt-toast-bar-wrap {
  height: 4px; background: rgba(255,255,255,.1);
  border-radius: var(--r-full); overflow: hidden; margin-bottom: var(--sp-2);
}
.opt-toast-bar {
  height: 100%; background: var(--brand);
  border-radius: var(--r-full);
  transition: width .4s ease;
  width: 0%;
}

.opt-toast-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--text-xs); color: rgba(255,255,255,.7);
  margin-bottom: 2px;
}
.opt-toast-eta { color: rgba(255,255,255,.4); }
.opt-toast-row2 {
  display: flex; justify-content: space-between; align-items: center;
}
.opt-toast-msg { font-size: var(--text-xs); color: rgba(255,255,255,.5); }
.opt-toast-link {
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
  color: var(--brand); text-decoration: none;
}
.opt-toast-link:hover { opacity: .85; }


/* ══════════════════════════════════════════════════════════════
   20. AUTH / FORM PAGE
   ══════════════════════════════════════════════════════════════ */
.auth-container {
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-lg);
}
.auth-card h2 {
  font-size: var(--text-xl);
  font-weight: var(--fw-black);
  margin-bottom: var(--sp-6);
}

.form-page-container {
  max-width: 640px;
  margin: 0 auto;
}
.form-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
}
.form-section-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.form-actions {
  display: flex; gap: var(--sp-3); align-items: center;
  padding-top: var(--sp-2);
}


/* ══════════════════════════════════════════════════════════════
   21. EMPLOYEE LIST
   ══════════════════════════════════════════════════════════════ */
.emp-name {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}
.emp-sub { margin-top: 2px; }

.emp-col-hours { min-width: 140px; }
.emp-col-week  { min-width: 150px; }
.emp-col-delta { min-width: 120px; }

.emp-hours-value {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.2;
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.emp-limit-badge {
  font-size: .65rem; font-weight: 700; padding: 1px 5px;
  border-radius: var(--r-full); white-space: nowrap;
}
.emp-limit-badge--over { background: #fee2e2; color: #b91c1c; }
.emp-limit-badge--max  { background: #fef9c3; color: #92400e; }
.emp-hours-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.emp-delta-inline {
  color: var(--brand);
  font-weight: var(--fw-semibold);
}
.emp-bar-wrap {
  height: 3px; background: var(--n-100);
  border-radius: var(--r-full); margin-top: 5px;
  overflow: hidden;
}
.emp-bar-fill {
  height: 100%; background: var(--brand);
  border-radius: var(--r-full); max-width: 100%;
}

/* Week availability pills */
.emp-week {
  display: flex; gap: 3px; flex-wrap: nowrap;
}
.emp-day {
  width: 24px; height: 20px;
  border-radius: 4px;
  font-size: 10px; font-weight: var(--fw-bold);
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}
.emp-day--on  { background: var(--c-success-bg); color: var(--c-success); }
.emp-day--off { background: var(--n-100); color: var(--n-400); }

/* Skill tags */
.emp-tags { display: flex; flex-wrap: wrap; gap: 3px; max-width: 200px; }

/* Delta adjustment */
.emp-delta-group {
  display: flex; align-items: center; gap: var(--sp-1);
}
.emp-delta-select {
  height: 28px; width: auto; min-width: 90px;
  font-size: var(--text-xs); padding: 0 24px 0 8px;
  border-radius: var(--r-sm);
}
.emp-reset-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--r-sm);
  color: var(--text-muted); text-decoration: none;
  border: 1px solid var(--border);
  background: var(--n-50);
  transition: color var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}
.emp-reset-btn:hover { color: var(--brand); background: var(--brand-faint); border-color: var(--brand-muted); }

@media (max-width: 900px) { .emp-col-hours { display: none; } }
@media (max-width: 768px) { .emp-col-week { display: none; } }
@media (max-width: 640px) { .emp-col-delta { display: none; } }


/* ══════════════════════════════════════════════════════════════
   22. SKILL TABLE
   ══════════════════════════════════════════════════════════════ */
.sk-col-weight { min-width: 260px; }
.sk-col-hint {
  display: block;
  font-size: var(--text-xs); font-weight: var(--fw-medium);
  color: var(--n-400); text-transform: none; letter-spacing: 0; margin-top: 2px;
}

.skill-slider-row {
  display: flex; align-items: center; gap: var(--sp-3);
}
.skill-weight-val {
  font-size: var(--text-xs); font-weight: var(--fw-bold);
  color: var(--text-secondary);
  min-width: 44px; text-align: right;
}

.weight-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: var(--r-full);
  background: linear-gradient(to right, var(--brand) 0%, var(--brand) var(--p, 50%), var(--n-200) var(--p, 50%), var(--n-200) 100%);
  outline: none; cursor: pointer;
  border: none; padding: 0;
}
.weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--brand);
  cursor: pointer; transition: transform var(--t-fast);
}
.weight-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.weight-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--brand);
  cursor: pointer;
}

@media (max-width: 700px) { .sk-col-weight { display: none; } }


/* ══════════════════════════════════════════════════════════════
   23. PROJECT CARD GRID
   ══════════════════════════════════════════════════════════════ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}

.proj-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.proj-card:hover {
  border-color: var(--n-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.proj-card--active {
  border-color: var(--brand-muted);
  background: var(--brand-faint);
}
.proj-card--active:hover { border-color: var(--brand); }

.proj-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.proj-name { font-size: var(--text-md); font-weight: var(--fw-bold); color: var(--text-primary); }
.proj-date { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.proj-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--lh-relaxed); margin: 0; }
.proj-youth-row {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin-top: var(--sp-2);
}
.proj-youth-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 600;
  background: #ede9fe; color: #5b21b6;
  border: 1px solid #ddd6fe; border-radius: var(--r-full);
  padding: 2px 8px;
}
.proj-gastro-chip {
  font-size: .72rem; font-weight: 600;
  border-radius: var(--r-full); padding: 2px 8px;
  border: 1px solid transparent; text-decoration: none;
  cursor: default;
}
.proj-gastro-chip--on  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.proj-gastro-chip--off {
  background: #fff7ed; color: #c2410c; border-color: #fed7aa;
  cursor: pointer; text-decoration: none;
}
.proj-gastro-chip--off:hover { background: #ffedd5; }

.opt-legal-action-link {
  display: inline-block; margin-left: .4rem;
  font-size: .72rem; font-weight: 600;
  color: inherit; text-decoration: underline; white-space: nowrap;
}
.opt-legal-action-link:hover { opacity: .75; }

.proj-dashboard-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 36px; border-radius: var(--r-md);
  background: var(--n-50); border: 1px solid var(--border-strong);
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  color: var(--text-primary); text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.proj-dashboard-btn:hover { background: var(--n-100); border-color: var(--n-300); }
.proj-card--active .proj-dashboard-btn {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.proj-card--active .proj-dashboard-btn:hover { background: var(--brand-hover); }

.proj-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.proj-action-btn {
  display: flex; align-items: center; justify-content: center;
  height: 30px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
  text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.proj-action-btn--default {
  background: var(--bg-surface); color: var(--text-secondary);
}
.proj-action-btn--default:hover { background: var(--n-100); color: var(--text-primary); border-color: var(--n-300); }
.proj-action-btn--loaded {
  background: var(--c-success-bg); color: var(--c-success-text);
  border-color: var(--c-success-border); cursor: default;
}
.proj-action-btn--danger {
  background: var(--bg-surface); color: var(--c-danger-text);
  border-color: var(--c-danger-border);
}
.proj-action-btn--danger:hover { background: var(--c-danger-bg); }

.proj-empty {
  text-align: center; padding: var(--sp-16) var(--sp-8);
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
.proj-empty-icon { font-size: 2.5rem; margin-bottom: var(--sp-4); }
.proj-empty h3 { font-size: var(--text-lg); font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); }
.proj-empty p { color: var(--text-secondary); margin-bottom: var(--sp-6); }


/* ══════════════════════════════════════════════════════════════
   24. ABSENCE PAGE
   ══════════════════════════════════════════════════════════════ */
.ab-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.ab-card--form { margin-bottom: var(--sp-5); }

/* Section anchor + heading */
.ab-section-anchor { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.ab-section-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--brand);
}

/* Anchor card navigation */
.ab-nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.ab-nav-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ab-nav-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,90,0,.07);
}
.ab-nav-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
}
.ab-nav-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
}
.ab-nav-type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ab-nav-type-dot--urlaub     { background: var(--c-info-text); }
.ab-nav-type-dot--krank      { background: var(--c-danger-text); }
.ab-nav-type-dot--elternzeit { background: #be123c; }
.ab-nav-type-dot--wunschfrei { background: #c2410c; }
.ab-nav-type-dot--seminar    { background: #6d28d9; }

.ab-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--n-100);
  color: var(--n-600);
  font-size: 11px;
  font-weight: var(--fw-bold);
  line-height: 1;
  margin-left: auto;
}

.ab-section-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.ab-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: flex-end;
}
.ab-field { display: flex; flex-direction: column; gap: 4px; }
.ab-field--date  { flex: 1; min-width: 140px; }
.ab-field--type  { flex: 1; min-width: 130px; }
.ab-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}
.ab-err { font-size: var(--text-xs); color: var(--c-danger-text); margin-top: 2px; }

.ab-table { width: 100%; border-collapse: collapse; }
.ab-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.ab-table td {
  padding: var(--sp-3);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--n-75);
  vertical-align: middle;
}
.ab-table tr:last-child td { border-bottom: none; }
.ab-table tr:hover td { background: var(--n-50); }
.ab-td-name  { font-weight: var(--fw-semibold); color: var(--text-primary); }
.ab-td-range { color: var(--text-secondary); }
.ab-td-count { text-align: center; }
.ab-td-action { text-align: right; }
.ab-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--n-100); color: var(--text-secondary);
  font-size: var(--text-xs); font-weight: var(--fw-bold);
}
.ab-badge--urlaub     { background: var(--c-info-bg);    color: var(--c-info-text);    border: 1px solid var(--c-info-border); }
.ab-badge--krank      { background: var(--c-danger-bg);  color: var(--c-danger-text);  border: 1px solid var(--c-danger-border); }
.ab-badge--wunschfrei { background: #fff7ed;             color: #c2410c;               border: 1px solid #fed7aa; }
.ab-badge--seminar    { background: #f5f3ff;             color: #6d28d9;               border: 1px solid #ddd6fe; }
.ab-badge--elternzeit { background: #fff1f2;             color: #be123c;               border: 1px solid #fecdd3; }
.ab-badge--schule     { background: #f0fdfa;             color: #0f766e;               border: 1px solid #99f6e4; }
.ab-badge--sonstig    { background: var(--n-100);        color: var(--n-600);          border: 1px solid var(--n-200); }
.ab-badge--ferien     { background: #fefce8;             color: #854d0e;               border: 1px solid #fde68a; }
.ab-badge--feiertag   { background: #f0fdf4;             color: #15803d;               border: 1px solid #86efac; }
.ab-badge--frei       { background: #f0f9ff;             color: #0369a1;               border: 1px solid #bae6fd; }

/* ── Planungskalender ──────────────────────────────────────── */
.pp-apply-details { display: inline-block; position: relative; }
.pp-apply-details summary { list-style: none; }
.pp-apply-details summary::-webkit-details-marker { display: none; }
.pp-apply-panel {
  position: absolute; z-index: 200; top: calc(100% + 6px); left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3) var(--sp-4);
  min-width: 220px;
}
.pp-emp-checklist {
  display: flex; flex-direction: column; gap: var(--sp-1);
  max-height: 200px; overflow-y: auto;
}
.pp-emp-check {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); cursor: pointer;
  padding: 2px 0;
}
.pp-emp-check input { accent-color: var(--brand); width: 14px; height: 14px; }

/* Weekday chip selector (Planungskalender) */
.pp-wd-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.pp-wd-chip {
  display: flex; align-items: center; gap: 5px;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.pp-wd-chip input[type="checkbox"] { display: none; }
.pp-wd-chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pp-wd-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.pp-wd-tag--active {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.pp-wd-tag--inactive {
  background: var(--n-100);
  color: var(--n-400);
  border-color: var(--n-200);
  text-decoration: line-through;
}


.ab-empty { color: var(--text-muted); font-size: var(--text-sm); padding: var(--sp-5) 0; text-align: center; }


/* ══════════════════════════════════════════════════════════════
   25. REQUIREMENTS / BEDARFSPLANUNG
   ══════════════════════════════════════════════════════════════ */
.rq-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.rq-table { width: 100%; border-collapse: collapse; }
.rq-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--n-50);
  border-bottom: 1px solid var(--border);
}
.rq-table td {
  padding: var(--sp-3) var(--sp-4);
  vertical-align: middle;
  border-bottom: 1px solid var(--n-75);
}
.rq-table tr:last-child td { border-bottom: none; }
.rq-row:hover td { background: var(--n-50); cursor: pointer; }

/* Day separator row */
.rq-day-row td { background: var(--n-75) !important; padding: var(--sp-2) var(--sp-4); }
.rq-day-row-inner {
  display: flex; align-items: center; gap: var(--sp-3);
}
.rq-day-abbr {
  width: 28px; height: 28px; border-radius: var(--r-md);
  background: var(--brand); color: #fff;
  font-size: var(--text-xs); font-weight: var(--fw-black);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rq-day-name {
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

/* Chips */
.rq-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
  cursor: default;
}
.rq-chip--gray   { background: var(--n-100); color: var(--n-600); border: 1px solid var(--n-200); }
.rq-chip--green  { background: var(--c-success-bg); color: var(--c-success-text); border: 1px solid var(--c-success-border); }
.rq-chip--warn   { background: var(--c-warning-bg); color: var(--c-warning-text); border: 1px solid var(--c-warning-border); }
.rq-chip--add {
  background: var(--brand-faint); color: var(--brand);
  border: 1px dashed var(--brand-muted); cursor: pointer;
  text-decoration: none; transition: background var(--t-fast);
}
.rq-chip--add:hover { background: var(--brand-muted); }

/* Ampel-Chips: Verfügbarkeit je Wochentag */
.rq-chip--avail-green,
.rq-chip--avail-lime,
.rq-chip--avail-amber,
.rq-chip--avail-orange,
.rq-chip--avail-red    { padding: 2px 6px; gap: 0; }
.rq-chip--avail-green  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.rq-chip--avail-lime   { background: #f0fdf4; color: #4d7c0f; border: 1px solid #d9f99d; }
.rq-chip--avail-amber  { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.rq-chip--avail-orange { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.rq-chip--avail-red    { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.rq-avail-ist  { font-weight: 700; font-size: .72rem; letter-spacing: -.01em; }
.rq-avail-div  { opacity: .35; margin: 0 .1em; font-weight: 400; font-size: .72rem; }
.rq-avail-soll { font-weight: 700; font-size: .72rem; letter-spacing: -.01em; }

.rq-time {
  font-size: var(--text-base); font-weight: var(--fw-semibold);
  color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.rq-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rq-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--n-100); border: 1px solid var(--n-200);
  border-radius: var(--r-full);
  padding: 2px 8px; font-size: var(--text-xs); font-weight: var(--fw-medium);
  color: var(--n-700);
}
.rq-count {
  font-weight: var(--fw-bold); color: var(--brand);
}
.rq-empty-val { font-size: var(--text-xs); color: var(--text-muted); }

.rq-actions { display: flex; align-items: center; gap: var(--sp-1); justify-content: flex-end; }
.rq-td-actions { text-align: right; }
.rq-select { height: 32px; font-size: var(--text-sm); }

/* Duplicate day panel */
.rq-dup-form {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-4);
}
.rq-dup-field { display: flex; flex-direction: column; gap: 4px; }
.rq-dup-label { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-secondary); }

/* Slot controls */
.slot-controls {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  overflow: hidden; background: var(--bg-surface);
}
.inc-btn, .dec-btn {
  width: 26px; height: 26px;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 16px; font-weight: var(--fw-bold);
  transition: background var(--t-fast), color var(--t-fast);
  user-select: none;
}
.inc-btn:hover { background: var(--n-100); color: var(--text-primary); }
.dec-btn:hover { background: var(--n-100); color: var(--text-primary); }
.needed-val {
  min-width: 26px; text-align: center;
  font-size: var(--text-sm); font-weight: var(--fw-bold);
  color: var(--text-primary);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}


/* ══════════════════════════════════════════════════════════════
   26. OPTIMIZER DASHBOARD
   ══════════════════════════════════════════════════════════════ */

/* Main two-column layout */
.opt-main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-5);
  align-items: start;
}

/* Left column KPI row */
.opt-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.opt-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.opt-kpi-val {
  font-size: var(--text-lg);
  font-weight: var(--fw-black);
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.opt-kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  line-height: 1.25;
}

/* Left column charts */
.opt-donut-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.opt-chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
}
.opt-chart-card--wide { margin-bottom: var(--sp-3); }
.opt-chart-title {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}
.opt-legend {
  display: flex; flex-wrap: wrap; gap: 3px 8px;
  justify-content: center; margin-top: var(--sp-2);
  font-size: 10px; color: var(--text-muted);
}
.opt-legend-item { display: flex; align-items: center; gap: 4px; }
.opt-legend-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.opt-empty-hint {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8); text-align: center;
  color: var(--text-secondary);
}
.opt-empty-hint p { margin: var(--sp-2) 0 0; font-size: var(--text-sm); }

/* Right column — optimizer form */
.opt-right { position: sticky; top: calc(var(--topbar-h) + var(--sp-4)); }

.opt-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.opt-form-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

/* Form fields inside optimizer */
.opt-form-card form { padding: var(--sp-4) var(--sp-5); }

.opt-field { margin-bottom: var(--sp-4); }
.opt-field-label {
  display: block;
  font-size: var(--text-xs); font-weight: var(--fw-bold);
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}
.opt-input {
  width: 100%; height: 36px; box-sizing: border-box;
  border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  padding: 0 var(--sp-3); font-size: var(--text-base);
  font-family: var(--font-sans); color: var(--text-primary);
  outline: none; -webkit-appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.opt-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-faint); }

/* Speed mode cards */
.opt-mode-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2);
}
.opt-mode-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: var(--sp-3) var(--sp-2);
  border: 1.5px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--bg-surface); cursor: pointer; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
}
.opt-mode-card:hover { border-color: var(--n-300); background: var(--n-50); }
.opt-mode-card--default { border-color: var(--n-300); }
.opt-mode-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-mode-card:has(.opt-mode-radio:checked) {
  border-color: var(--brand);
  background: var(--brand-faint);
  box-shadow: 0 0 0 3px var(--brand-muted);
}
.opt-mode-icon  { font-size: 1.25rem; line-height: 1; }
.opt-mode-name  { font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--text-primary); }
.opt-mode-desc  { font-size: 10px; color: var(--text-muted); line-height: 1.3; }
.opt-mode-cost  { font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--brand); margin-top: 2px; }
.opt-mode-badge {
  position: absolute; top: -1px; right: -1px;
  background: var(--brand); color: #fff;
  font-size: 9px; font-weight: var(--fw-black);
  padding: 2px 6px; border-radius: 0 var(--r-lg) 0 var(--r-sm);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Multitasking chips */
.opt-btn-group { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.opt-radio-wrap input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; min-width: 36px; padding: 0 var(--sp-3);
  border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: var(--text-sm); font-weight: var(--fw-medium);
  cursor: pointer; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.opt-radio-wrap:hover .opt-chip { background: var(--n-100); border-color: var(--n-300); }
.opt-radio-wrap input[type="radio"]:checked + .opt-chip {
  background: var(--brand); color: #fff; border-color: var(--brand);
}

/* Legal / compliance – dynamischer Arbeitszeitcheck */
.opt-legal-block {
  display: flex; flex-direction: column; gap: var(--sp-2);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.opt-legal-header {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .75rem; border-radius: var(--r-md);
  font-size: .78rem; font-weight: 600;
}
.opt-legal-header--ok     { background: var(--c-success-bg); color: var(--c-success-text); }
.opt-legal-header--warn   { background: #fef9c3; color: #92400e; }
.opt-legal-header--error  { background: #fee2e2; color: #991b1b; }
.opt-legal-count {
  margin-left: auto;
  background: rgba(0,0,0,.1); border-radius: 999px;
  padding: 0 .45em; font-size: .72rem;
}
.opt-legal-issues {
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: .5rem .75rem;
  background: var(--n-50); border: 1px solid var(--n-200); border-radius: var(--r-md);
}
.opt-legal-group-block { display: flex; flex-direction: column; gap: .18rem; }
.opt-legal-group-label {
  font-size: .67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: .12rem;
}
.opt-legal-issue {
  display: flex; align-items: flex-start; gap: .35rem;
  font-size: .75rem; line-height: 1.4;
}
.opt-legal-issue--error { color: #b91c1c; }
.opt-legal-issue--warn  { color: #92400e; }
.opt-legal-issue svg    { flex-shrink: 0; margin-top: .18rem; }
.opt-legal-confirm {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  font-size: .78rem; font-weight: 500; color: var(--text-primary);
  padding: .4rem .6rem; border-radius: var(--r-md);
  border: 1px solid var(--n-300); background: #fff;
  transition: background var(--t-fast);
}
.opt-legal-confirm:hover { background: var(--n-50); }
.opt-legal-confirm:has(input:checked) {
  border-color: var(--c-success-border);
  background: var(--c-success-bg);
  color: var(--c-success-text);
}

/* Legal / compliance checkbox (legacy, kept for reference) */
.opt-legal-single {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--n-50); cursor: pointer;
  font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-primary);
  margin-bottom: var(--sp-4);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.opt-legal-single:hover { background: var(--n-100); }
.opt-legal-single input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.opt-legal-single:has(input:checked) {
  border-color: var(--c-success-border);
  background: var(--c-success-bg);
  color: var(--c-success-text);
}
.opt-legal-refs {
  display: flex; flex-direction: column; gap: 1px; margin-top: var(--sp-1);
}
.opt-legal-refs span {
  font-size: 10px; font-weight: var(--fw-medium); color: var(--text-muted);
}
.opt-legal-refs span::before { content: "· "; }
.opt-legal-group {
  font-size: 10px !important; font-weight: var(--fw-bold) !important;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary) !important; margin-top: var(--sp-2);
}
.opt-legal-group::before { content: "" !important; }
.opt-legal-single:has(input:checked) .opt-legal-refs span { color: var(--c-success-text); opacity: 0.75; }
.opt-legal-single:has(input:checked) .opt-legal-group { color: var(--c-success-text) !important; opacity: 0.85; }

/* Coin hint */
.optimizer-coin-hint {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--n-50); border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-xs); color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}
.optimizer-coin-hint a { color: var(--brand); text-decoration: none; font-weight: var(--fw-semibold); }
.optimizer-coin-hint a:hover { text-decoration: underline; }
.opt-coin-topup {
  background: var(--c-warning-bg); border: 1px solid var(--c-warning-border);
  color: var(--c-warning-text) !important;
  padding: 3px 8px; border-radius: var(--r-sm);
  font-weight: var(--fw-semibold); white-space: nowrap;
}

/* Submit button */
.opt-submit-btn {
  width: 100%; height: 42px; margin-top: var(--sp-1);
  background: var(--brand);
  color: #fff; font-weight: var(--fw-bold); font-size: var(--text-base);
  border: none; border-radius: var(--r-lg); cursor: pointer;
  box-shadow: var(--shadow-brand);
  font-family: var(--font-sans);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.opt-submit-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.opt-submit-btn:disabled {
  background: var(--n-200); color: var(--n-400);
  box-shadow: none; cursor: not-allowed; transform: none;
}
.opt-setup-missing {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin: 0 var(--sp-5) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid #fbbf24;
  border-radius: var(--r-md);
  background: #fffbeb;
  color: #92400e;
  font-size: .8rem;
}
.opt-submit-hint {
  font-size: var(--text-xs); color: var(--text-muted);
  margin: var(--sp-2) 0 0; text-align: center; transition: opacity var(--t-fast);
}


/* ══════════════════════════════════════════════════════════════
   27. OPTIMIZER HISTORY
   ══════════════════════════════════════════════════════════════ */
.hist-filter-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.hist-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.hist-filter-actions { display: flex; gap: var(--sp-2); }

.hist-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: var(--sp-3);
}
.hist-group-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer; list-style: none;
  background: var(--n-50);
  border-bottom: 1px solid transparent;
  user-select: none;
  transition: background var(--t-fast);
}
.hist-group[open] .hist-group-summary { border-bottom-color: var(--border); }
.hist-group-summary::-webkit-details-marker { display: none; }
.hist-group-summary:hover { background: var(--n-100); }

.hist-kw-label {
  font-size: var(--text-sm); font-weight: var(--fw-bold);
  color: var(--text-primary); letter-spacing: -0.01em;
}
.hist-count-pill {
  display: inline-flex;
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--n-200); color: var(--n-600);
}
.hist-chevron { color: var(--text-muted); transition: transform var(--t-base); }
.hist-group[open] .hist-chevron { transform: rotate(180deg); }

.hist-cards { padding: var(--sp-2) 0; }
.hist-run-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--n-75);
  transition: background var(--t-fast);
}
.hist-run-row:last-child { border-bottom: none; }
.hist-run-row:hover { background: var(--n-50); }
.hist-run-info { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0; }
.hist-run-text { min-width: 0; }
.hist-run-name {
  font-size: var(--text-base); font-weight: var(--fw-semibold);
  color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hist-run-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.hist-run-side { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.hist-empty-kw { padding: var(--sp-4) var(--sp-5); color: var(--text-muted); font-size: var(--text-sm); margin: 0; }


/* ══════════════════════════════════════════════════════════════
   28. OPTIMIZER RESULT / WAIT
   ══════════════════════════════════════════════════════════════ */
.opt-run-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.opt-status-done    { color: var(--c-success); }
.opt-status-running { color: var(--c-warning); }
.opt-status-failed  { color: var(--c-danger); }


/* ══════════════════════════════════════════════════════════════
   29. COIN SHOP (was inline)
   ══════════════════════════════════════════════════════════════ */
.page-content.shop-page {
  max-width: none; margin: 0; padding: 0;
}

/* Hero banner */
.cs2-hero {
  background: linear-gradient(160deg, #0A0F1E 0%, #111827 55%, #0A0F1E 100%);
  padding: var(--sp-16) var(--sp-6) var(--sp-12);
  text-align: center; position: relative; overflow: hidden;
}
.cs2-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 100%, rgba(232,90,0,.18) 0%, transparent 70%);
  pointer-events: none;
}
.cs2-hero-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.cs2-container  { max-width: 1040px; margin: 0 auto; padding: 0 var(--sp-6); }

.cs2-hero-eyebrow {
  display: inline-block;
  font-size: var(--text-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #FF8C38; margin-bottom: var(--sp-4);
  border: 1px solid rgba(255,140,56,.3);
  padding: 3px 12px; border-radius: var(--r-full);
}
.cs2-hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: var(--fw-black); color: #fff; line-height: 1.1;
  letter-spacing: -0.03em; margin-bottom: var(--sp-4);
}
.cs2-hero-title span { color: var(--brand); }
.cs2-hero-sub {
  font-size: var(--text-base); color: rgba(255,255,255,.7);
  margin: 0 0 var(--sp-6); line-height: var(--lh-relaxed);
}

.cs2-hero-stats {
  display: flex; justify-content: center; gap: var(--sp-5); flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.cs2-stat-chip {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-xl); padding: var(--sp-3) var(--sp-5);
}
.cs2-stat-chip-val { font-size: var(--text-xl); font-weight: var(--fw-black); color: #fff; line-height: 1; }
.cs2-stat-chip-label { font-size: 10px; color: rgba(255,255,255,.5); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.07em; }

.cs2-runs-chip--danger {
  background: rgba(220, 38, 38, .1) !important;
  border-color: rgba(220, 38, 38, .3) !important;
  color: #EF4444 !important;
}

.cs2-runs-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: rgba(232,90,0,.12); border: 1px solid rgba(232,90,0,.3);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-5);
  color: #FF8C38; font-size: var(--text-sm); font-weight: var(--fw-bold);
  margin-bottom: var(--sp-5);
}
.cs2-runs-chip-icon { font-size: 1rem; }

.cs2-hero-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.cs2-ghost-btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 var(--sp-4);
  border-radius: var(--r-md); background: transparent; color: rgba(255,255,255,.65);
  font-size: var(--text-sm); font-weight: var(--fw-semibold); font-family: inherit;
  text-decoration: none; border: 1px solid rgba(255,255,255,.2); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast); white-space: nowrap;
}
.cs2-ghost-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.cs2-test-badge {
  display: inline-flex; align-items: center; height: 28px; padding: 0 var(--sp-3);
  border-radius: var(--r-full); background: rgba(251,191,36,.12); color: #FBBF24;
  font-size: var(--text-xs); font-weight: var(--fw-bold); border: 1px solid rgba(251,191,36,.25);
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* Body */
.cs2-body { background: var(--bg-canvas); padding: var(--sp-12) var(--sp-6) var(--sp-16); }
.cs2-section-head { margin-bottom: var(--sp-5); }
.cs2-section-eyebrow {
  font-size: var(--text-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 3px;
}
.cs2-section-title { font-size: var(--text-xl); font-weight: var(--fw-black); color: var(--text-primary); margin: 0; }

/* Active subscription */
.cs2-sub-section { margin-bottom: var(--sp-10); }
.cs2-sub-active {
  background: var(--c-success-bg); border: 1px solid var(--c-success-border);
  border-left: 4px solid var(--c-success);
  border-radius: var(--r-xl); padding: var(--sp-5) var(--sp-6);
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: var(--sp-5); margin-bottom: var(--sp-4);
}
.cs2-sub-active-icon {
  width: 40px; height: 40px; border-radius: 50%; background: var(--c-success);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.cs2-sub-active-title { font-size: var(--text-md); font-weight: var(--fw-bold); color: var(--c-success-text); margin-bottom: var(--sp-1); }
.cs2-sub-active-meta { font-size: var(--text-sm); color: var(--c-success-text); display: flex; gap: var(--sp-4); flex-wrap: wrap; opacity: 0.85; }
.cs2-sub-active-badge {
  display: inline-flex; align-items: center;
  background: rgba(5,150,105,.15); border: 1px solid rgba(5,150,105,.3);
  border-radius: var(--r-full); padding: 2px 8px;
  font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--c-success-text);
}
.cs2-sub-cancel-btn {
  height: 34px; padding: 0 var(--sp-4); border-radius: var(--r-md);
  background: var(--bg-surface); color: var(--c-danger-text);
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  font-family: inherit; border: 1px solid var(--c-danger-border);
  cursor: pointer; white-space: nowrap; transition: background var(--t-fast); flex-shrink: 0;
}
.cs2-sub-cancel-btn:hover { background: var(--c-danger-bg); }

.cs2-quota-bar-wrap { margin-top: var(--sp-3); }
.cs2-quota-bar-label { font-size: var(--text-xs); color: var(--c-success-text); opacity: 0.8; margin-bottom: var(--sp-2); }
.cs2-quota-bar-bg { background: rgba(5,150,105,.15); border-radius: var(--r-full); height: 6px; overflow: hidden; }
.cs2-quota-bar-fill { height: 100%; background: var(--c-success); border-radius: var(--r-full); transition: width .4s; }

/* Plan grid */
.cs2-plan-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-3);
}
.cs2-plan-card {
  background: var(--bg-surface); border-radius: var(--r-2xl);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-1);
  position: relative;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.cs2-plan-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: var(--n-300);
}
.cs2-plan-card--popular {
  border-color: var(--c-info);
  box-shadow: 0 4px 20px rgba(37,99,235,.15);
}
.cs2-plan-popular-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--c-info); color: #fff;
  font-size: 10px; font-weight: var(--fw-black);
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 12px; border-radius: var(--r-full); white-space: nowrap;
  box-shadow: 0 2px 10px rgba(37,99,235,.3);
}
.cs2-plan-card--extra {
  border-color: var(--n-200);
  background: var(--n-50);
}
.cs2-extra-inline-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--c-success-text); color: #fff;
  font-size: 10px; font-weight: var(--fw-black);
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 12px; border-radius: var(--r-full); white-space: nowrap;
}
.cs2-plan-btn--extra {
  background: var(--n-100); color: var(--text-primary);
  border: 1px solid var(--n-300);
}
.cs2-plan-btn--extra:hover:not(:disabled) { background: var(--n-200); }
.cs2-plan-btn--extra:disabled { opacity: .45; cursor: not-allowed; }
.cs2-plan-name {
  font-size: var(--text-xs); font-weight: var(--fw-black);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c-info); margin-bottom: var(--sp-2);
}
.cs2-plan-price-row { display: flex; align-items: baseline; gap: 4px; margin-bottom: 2px; }
.cs2-plan-price-val { font-size: 2rem; font-weight: var(--fw-black); color: var(--text-primary); line-height: 1; }
.cs2-plan-price-period { font-size: var(--text-sm); color: var(--text-muted); }
.cs2-plan-features { list-style: none; margin: var(--sp-4) 0 var(--sp-4); padding: 0; flex: 1; }
.cs2-plan-features li {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  font-size: var(--text-sm); color: var(--text-secondary); padding: 5px 0;
  border-bottom: 1px solid var(--n-75);
}
.cs2-plan-features li:last-child { border-bottom: none; }
.cs2-plan-feature-icon { color: var(--c-success); font-weight: var(--fw-bold); flex-shrink: 0; }
.cs2-plan-feature-highlight { color: var(--text-primary); font-weight: var(--fw-semibold); }
.cs2-plan-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 40px; border-radius: var(--r-lg);
  background: var(--c-info); color: #fff;
  font-size: var(--text-sm); font-weight: var(--fw-bold);
  font-family: inherit; border: none; cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,.28);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.cs2-plan-btn:hover { opacity: .9; transform: translateY(-1px); }
.cs2-plan-btn--current {
  background: var(--n-100); color: var(--text-secondary);
  border: 1px solid var(--n-300); box-shadow: none;
  cursor: default;
}
.cs2-plan-btn--current:hover { opacity: 1; transform: none; }

.cs2-upgrade-hint {
  background: var(--c-warning-bg); border: 1px solid var(--c-warning-border);
  border-left: 4px solid var(--c-warning);
  border-radius: var(--r-xl); padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4); font-size: var(--text-sm); color: var(--c-warning-text);
  display: flex; align-items: center; gap: var(--sp-3);
}

.cs2-enterprise-card {
  background: linear-gradient(135deg, #0C111D, #1A2840);
  border-radius: var(--r-xl); padding: var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap;
  margin-top: var(--sp-4); border: 1px solid rgba(255,255,255,.07);
}
.cs2-enterprise-left { flex: 1; }
.cs2-enterprise-title { font-size: var(--text-md); font-weight: var(--fw-black); color: #fff; margin-bottom: var(--sp-1); }
.cs2-enterprise-desc { font-size: var(--text-sm); color: rgba(255,255,255,.6); margin: 0; }
.cs2-enterprise-btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 var(--sp-5);
  border-radius: var(--r-md); background: var(--brand); color: #fff;
  font-size: var(--text-sm); font-weight: var(--fw-bold); text-decoration: none;
  white-space: nowrap; transition: background var(--t-fast);
}
.cs2-enterprise-btn:hover { background: var(--brand-hover); }

/* Extra runs */
.cs2-extra-section { margin-bottom: var(--sp-10); }
.cs2-extra-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-4);
}
.cs2-extra-card {
  background: var(--bg-surface); border-radius: var(--r-xl);
  border: 1.5px solid var(--border);
  padding: var(--sp-6) var(--sp-5); text-align: center;
  display: flex; flex-direction: column; gap: 3px;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.cs2-extra-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: rgba(232,90,0,.3);
}
.cs2-extra-name { font-size: var(--text-xs); font-weight: var(--fw-black); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: var(--sp-2); }
.cs2-extra-runs { font-size: 2.5rem; font-weight: var(--fw-black); color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1; }
.cs2-extra-runs-label { font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--c-warning); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-2); }
.cs2-extra-note { font-size: var(--text-xs); color: var(--text-muted); margin: 2px 0 var(--sp-3); }
.cs2-extra-price { font-size: var(--text-xl); font-weight: var(--fw-black); color: var(--text-primary); margin-bottom: var(--sp-4); }
.cs2-extra-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 36px; border-radius: var(--r-md);
  background: var(--brand); color: #fff;
  font-size: var(--text-sm); font-weight: var(--fw-bold);
  font-family: inherit; border: none; cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.cs2-extra-btn:hover { opacity: .9; transform: translateY(-1px); }
.cs2-no-sub-warning {
  background: var(--c-danger-bg); border: 1px solid var(--c-danger-border);
  border-radius: var(--r-xl); padding: var(--sp-4) var(--sp-5);
  font-size: var(--text-sm); color: var(--c-danger-text);
  margin-bottom: var(--sp-4); display: flex; align-items: center; gap: var(--sp-3);
}

/* Referral */
.cs2-ref-section { margin-bottom: var(--sp-4); }
.cs2-ref-card {
  background: var(--bg-surface); border-radius: var(--r-xl);
  border: 1px solid var(--border); border-left: 4px solid var(--c-warning);
  padding: var(--sp-6);
}
.cs2-ref-top { display: flex; align-items: flex-start; gap: var(--sp-6); margin-bottom: var(--sp-5); }
.cs2-ref-info { flex: 1; }
.cs2-ref-headline { font-size: var(--text-md); font-weight: var(--fw-bold); color: var(--text-primary); margin-bottom: var(--sp-2); }
.cs2-ref-desc { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; line-height: var(--lh-relaxed); }
.cs2-ref-badge {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3);
  border-radius: var(--r-xl); padding: var(--sp-3) var(--sp-5); flex-shrink: 0;
}
.cs2-ref-badge-val { font-size: var(--text-2xl); font-weight: var(--fw-black); color: var(--c-warning); line-height: 1; }
.cs2-ref-badge-label { font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--c-warning-text); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.cs2-ref-link-row { display: flex; gap: var(--sp-2); }
.cs2-ref-input {
  flex: 1; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 0 var(--sp-3); font-size: var(--text-sm); color: var(--text-secondary);
  background: var(--n-50); font-family: inherit; min-width: 0; outline: none;
}
.cs2-ref-copy-btn {
  height: 38px; padding: 0 var(--sp-4); border-radius: var(--r-md);
  background: var(--n-900); color: #fff; font-size: var(--text-sm); font-weight: var(--fw-bold);
  font-family: inherit; border: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast);
}
.cs2-ref-copy-btn:hover { background: var(--n-800); }
.cs2-ref-copy-btn.copied { background: var(--c-success); }


/* small utility classes used in coin shop */
.cs2-plan-vat-note   { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--sp-2); }
.lp-price-vat        { font-size: .72rem; color: var(--text-muted); margin: .15rem 0 .4rem; }
.pr-plan-vat         { font-size: .72rem; color: var(--text-muted); margin: .15rem 0 .5rem; }
.cs2-plan-feature-sub { font-size: var(--text-xs); color: var(--text-muted); }
.cs2-plan-switch-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--sp-2); }
.cs2-empty-plans {
  background: var(--bg-surface); border-radius: var(--r-xl);
  padding: var(--sp-10); text-align: center; color: var(--text-muted);
  font-size: var(--text-sm); border: 1px solid var(--border);
}
.cs2-extra-vat { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--sp-2); }


/* ══════════════════════════════════════════════════════════════
   30. DASHBOARD SPECIFIC
   ══════════════════════════════════════════════════════════════ */
.dash-section-label {
  font-size: var(--text-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin: var(--sp-6) 0 var(--sp-3);
}
.dash-divider { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }


/* ══════════════════════════════════════════════════════════════
   31. BILLING / INVOICES
   ══════════════════════════════════════════════════════════════ */
.billing-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-6); margin-bottom: var(--sp-4);
}


/* ══════════════════════════════════════════════════════════════
   33. REQUIREMENT SLOT DETAIL
   ══════════════════════════════════════════════════════════════ */

/* Compact table wrapper */
.skills-compact {
  overflow-x: auto;
}
.skills-compact .skills-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 700px;
}
.skills-compact thead th,
.skills-compact tbody td {
  padding: 0.35rem 0.45rem;
  text-align: center;
}
.skills-compact .col-time,
.skills-compact .cell-time {
  text-align: left;
  min-width: 84px;
  width: 84px;
  padding-left: 0.6rem;
}
.skills-compact .col-skill,
.skills-compact .cell-skill {
  width: 80px;
}
@media (min-width: 1300px) {
  .skills-compact .col-skill,
  .skills-compact .cell-skill { width: 72px; }
}
.skills-compact.tiny .skills-table thead th,
.skills-compact.tiny .skills-table tbody td { padding: 0.25rem 0.35rem; }
.skills-compact.tiny .col-skill,
.skills-compact.tiny .cell-skill { width: 70px; }

/* Slot controls (– value +) */
.slot-controls {
  --slot-h: 28px;
  --slot-gap: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--slot-gap);
}
.skills-compact.tiny .slot-controls { --slot-h: 24px; }

/* Value badge */
.slot-value {
  height: var(--slot-h);
  min-width: 32px;
  padding: 0 6px;
  border-radius: var(--r-md);
  background: var(--n-150);
  color: var(--n-900);
  font-weight: var(--fw-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
}
.slot-value--pulse {
  transform: scale(1.15);
  background: var(--brand-muted) !important;
}

/* Slot buttons */
.btn-slot {
  height: var(--slot-h);
  min-width: 28px;
  padding: 0 8px;
  border-radius: var(--r-md);
  font-weight: var(--fw-bold);
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.btn-slot--icon {
  width: var(--slot-h);
  min-width: 0;
  padding: 0;
}
.btn-slot--minus {
  background: var(--n-150);
  color: var(--n-900);
}
.btn-slot--minus:hover {
  background: var(--n-200);
  transform: translateY(-1px);
}
.btn-slot--plus {
  background: var(--brand);
  color: #fff;
}
.btn-slot--plus:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

/* Readonly chip (used in skill summary bar) */
.readonly-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--n-100);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 0.2rem 0.65rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}


/* ══════════════════════════════════════════════════════════════
   32. RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */

/* Ultrawide (21:9+): größerer Content-Bereich, mehr Chart-Spalten */
@media (min-width: 1600px) {
  :root { --content-max: 1440px; }
  .chart-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-card--full { grid-column: 1 / -1; }
}

/* Large tablets (1100px) */
@media (max-width: 1100px) {
  .opt-main-grid { grid-template-columns: 1fr 280px; }
  .opt-kpi-row   { grid-template-columns: repeat(5, 1fr); }
}

/* Tablets / small desktops (1024px) */
@media (max-width: 1024px) {
  .page-content   { padding: var(--sp-6) var(--sp-6); }
  .chart-grid     { grid-template-columns: 1fr 1fr; }
  .chart-grid--3  { grid-template-columns: repeat(2, 1fr); }
  .chart-grid--4  { grid-template-columns: repeat(2, 1fr); }
  .opt-kpi-row    { grid-template-columns: repeat(3, 1fr); }
}

/* Optimizer stack (860px): Formular unter Charts */
@media (max-width: 860px) {
  .opt-main-grid { grid-template-columns: 1fr; }
  .opt-right     { position: static; top: auto; }
  .opt-donut-row { grid-template-columns: 1fr 1fr; }
  .opt-kpi-row   { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile (768px) */
@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-base);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-main  { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }

  .page-content { padding: var(--sp-5) var(--sp-4); }
  .page-header  { margin-bottom: var(--sp-4); }

  .chart-grid    { grid-template-columns: 1fr; }
  .opt-donut-row { grid-template-columns: 1fr; }
  .opt-kpi-row   { grid-template-columns: repeat(3, 1fr); }
  .kpi-row-wrap  { flex-direction: column; }
  .kpi-group-divider { width: auto; height: 1px; margin: var(--sp-2) 0; align-self: auto; }
  .kpi-grid      { grid-template-columns: repeat(2, 1fr); }
  .opt-input     { height: 42px; }

  .form-row { grid-template-columns: 1fr; }
  .ab-form-row { flex-direction: column; }
  .hist-filter-grid { grid-template-columns: 1fr; }
  .cs2-sub-active { grid-template-columns: auto 1fr; }
  .cs2-sub-cancel-btn { grid-column: 1 / -1; }
  .cs2-ref-top { flex-direction: column; }
  .cs2-hero { padding: var(--sp-10) var(--sp-4) var(--sp-8); }
  .cs2-body { padding: var(--sp-8) var(--sp-4) var(--sp-10); }
}

/* Small mobile (600px) */
@media (max-width: 600px) {
  .proj-grid     { grid-template-columns: 1fr; }
  .opt-donut-row { grid-template-columns: 1fr; }
  .opt-kpi-row   { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid      { grid-template-columns: repeat(2, 1fr); }
  .opt-mode-grid { grid-template-columns: repeat(2, 1fr); }

  .app-topbar   { padding: 0 var(--sp-4); }
  .page-content { padding: var(--sp-4) var(--sp-3); }
}

/* Extra small (480px) */
@media (max-width: 480px) {
  .cs2-plan-grid  { grid-template-columns: 1fr; }
  .cs2-extra-grid { grid-template-columns: 1fr; }
  .opt-kpi-row    { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid       { grid-template-columns: repeat(2, 1fr); }
  .opt-mode-grid  { grid-template-columns: 1fr; }
}

/* ── Sidebar: kompakte Höhen (max-height Breakpoints) ─────────── */

/* Mittlere Screens: Logo verkleinern, weniger Padding */
@media (max-height: 750px) {
  .sb-logo { padding: .6rem var(--sp-4) .5rem; gap: var(--sp-1); }
  .sb-logo-img { width: 56px; height: 56px; }
  .sb-section { margin-bottom: var(--sp-2); }
  .sb-section-title { padding: var(--sp-2) var(--sp-4) 2px; }
  .sb-item { padding: 4px var(--sp-3); }
  .sb-footer { padding: var(--sp-2); }
}

/* Kleine Screens: Logo noch kompakter */
@media (max-height: 620px) {
  .sb-logo { padding: .4rem var(--sp-3) .4rem; flex-direction: row; gap: var(--sp-2); }
  .sb-logo-img { width: 32px; height: 32px; }
  .sb-tagline { display: none; }
  .sb-section { margin-bottom: var(--sp-1); }
  .sb-item { padding: 3px var(--sp-3); font-size: var(--text-xs); }
}

/* ══════════════════════════════════════════════════════════════
   33. KW-NAVIGATOR (Dashboard Kalenderwochen-Auswahl)
   ══════════════════════════════════════════════════════════════ */

/* ── Toolbar-Leiste ───────────────────────────────────────────── */
.kw-nav {
  display: flex;
  align-items: stretch;
  height: 52px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}

/* ── Pfeil-Buttons (links / rechts, volle Höhe) ─────────────── */
.kw-nav-step {
  display: flex; align-items: center; justify-content: center;
  width: 44px; flex-shrink: 0;
  color: var(--text-secondary);
  text-decoration: none;
  border-right: 1px solid var(--border);
  transition: background var(--t-fast), color var(--t-fast);
}
.kw-nav-step--right {
  border-right: none;
  border-left: 1px solid var(--border);
}
.kw-nav-step:hover { background: var(--n-75); color: var(--text-primary); }

/* ── Mitte: KW-Info ─────────────────────────────────────────── */
.kw-nav-info {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--sp-5);
  gap: 1px;
  min-width: 0;
}
.kw-nav-title {
  display: flex; align-items: baseline; gap: var(--sp-2);
  line-height: var(--lh-tight);
}
.kw-nav-kw {
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  white-space: nowrap;
}
.kw-nav-dot {
  color: var(--text-muted);
  font-weight: var(--fw-normal);
  font-size: var(--text-sm);
}
.kw-nav-yr {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}
.kw-nav-range {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: .01em;
  white-space: nowrap;
}

/* ── Rechte Actions-Gruppe ───────────────────────────────────── */
.kw-nav-actions {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 var(--sp-3) 0 0;
  flex-shrink: 0;
}
.kw-nav-today-btn {
  height: 28px; padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: var(--brand-faint);
  border: 1px solid var(--brand-muted);
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  font-family: var(--font-sans);
  text-decoration: none;
  display: inline-flex; align-items: center;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.kw-nav-today-btn:hover {
  background: var(--brand-muted);
  border-color: var(--brand);
}

/* Kalender-Icon-Picker: Icon sichtbar, Input unsichtbar darüber */
.kw-nav-picker {
  position: relative;
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--bg-canvas);
  transition: border-color var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.kw-nav-picker:hover { border-color: var(--n-300); color: var(--text-secondary); }
.kw-nav-picker-form {
  position: absolute; inset: 0;
  overflow: hidden; border-radius: var(--r-md);
}
.kw-nav-picker-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
  padding: 0;
}

/* ── KW-Abwesenheiten Sektion ────────────────────────────────── */
.kw-absent-section { margin-bottom: var(--sp-6); }
.kw-absent-body { padding: var(--sp-4); }

.kw-absent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-2);
}
.kw-absent-card {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--t-fast);
}
.kw-absent-card:hover { border-color: var(--border-strong); }
.kw-absent-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--n-100); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--fw-bold);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.kw-absent-info { min-width: 0; flex: 1; }
.kw-absent-name {
  font-size: var(--text-base); font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: var(--lh-snug);
}
.kw-absent-meta {
  font-size: var(--text-xs); color: var(--text-muted);
  margin-top: 2px; display: flex; align-items: center; gap: var(--sp-2);
}

/* ── Feiertags-Chips ─────────────────────────────────────────── */
.kw-holiday-list {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.kw-holiday-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: .2rem .65rem;
  border-radius: var(--r-full);
  background: var(--c-info-bg);
  color: var(--c-info-text);
  border: 1px solid var(--c-info-border);
  font-size: var(--text-xs); font-weight: var(--fw-semibold);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .kw-nav-range  { display: none; }
  .kw-nav-info   { padding: 0 var(--sp-3); }
  .kw-absent-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   33. NÜTZLICHE LINKS – Ressourcen-Seite
   ══════════════════════════════════════════════════════════════ */
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  max-width: 900px;
}
@media (max-width: 720px) { .res-grid { grid-template-columns: 1fr; } }

.res-card {
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  overflow: hidden;
}
.res-card-header {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--n-100);
}
.res-card-icon {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  font-size: 1rem; font-weight: 700;
}
.res-card-icon--law  { background: var(--brand-faint); color: var(--brand-dark); }
.res-card-icon--inst { background: var(--n-100); color: var(--n-600); font-size: .85rem; }
.res-card-title {
  font-size: .9rem; font-weight: var(--fw-semibold);
  color: var(--text-primary); margin: 0 0 .15rem;
}
.res-card-sub { font-size: .75rem; color: var(--text-muted); margin: 0; }

.res-list { padding: .4rem .5rem .6rem; }

.res-link {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .6rem .5rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: background .15s;
}
.res-link:hover { background: var(--n-50); }
.res-link:hover .res-link-title { color: var(--brand); }
.res-link-body { flex: 1; min-width: 0; }
.res-link-title {
  display: block; font-size: .83rem; font-weight: var(--fw-semibold);
  transition: color .15s;
}
.res-link-desc {
  display: block; font-size: .75rem; color: var(--text-muted);
  margin-top: .2rem; line-height: 1.45;
}
.res-link-url {
  display: block; font-size: .7rem; color: var(--n-400);
  margin-top: .25rem; font-family: monospace;
}
.res-ext-icon { flex-shrink: 0; margin-top: 3px; color: var(--n-400); }

/* ── E-Mail-Verifizierungs-Banner ─────────────────────────────────── */
.email-verify-banner {
  display: flex; align-items: center; gap: .6rem;
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  color: #92400e; font-size: .82rem; padding: .55rem 1.25rem;
}
.email-verify-banner-link {
  color: #b45309; font-weight: 600; text-decoration: underline;
}
.email-verify-banner-link:hover { color: #92400e; }


/* ══════════════════════════════════════════════════════════════
   34. PROFIL-SEITE (pf-*) + BILLING-LAYOUT (bf-*)
   ══════════════════════════════════════════════════════════════ */

/* ── Profil-Layout ─────────────────────────────────────────── */
.pf-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
  max-width: 1060px;
}
.pf-col-main, .pf-col-side { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── Karte ─────────────────────────────────────────────────── */
.pf-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}
.pf-card--danger { border-color: #fecaca; }
.pf-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}
.pf-card--danger .pf-card-head { background: #fff5f5; border-bottom-color: #fecaca; }
.pf-card-title-row { display: flex; align-items: center; gap: .5rem; }
.pf-card-icon { width: 18px; height: 18px; color: #64748b; flex-shrink: 0; }
.pf-card-icon--danger { color: #ef4444; }
.pf-card-title { margin: 0; font-size: .95rem; font-weight: 700; color: #0f172a; }
.pf-card-title--danger { color: #dc2626; }
.pf-card-link { font-size: .8rem; font-weight: 600; color: var(--brand, #E85A00); text-decoration: none; }
.pf-card-link:hover { text-decoration: underline; }
.pf-card-body { padding: 1rem 1.25rem; }
.pf-card-body--compact { padding: .85rem 1.25rem; }

/* ── Felder ────────────────────────────────────────────────── */
.pf-field-row {
  display: flex; align-items: baseline; gap: .75rem;
  padding: .4rem 0; border-bottom: 1px solid #f8fafc;
  font-size: .88rem;
}
.pf-field-row:last-child { border-bottom: none; }
.pf-field-label { flex-shrink: 0; width: 148px; color: #64748b; font-weight: 600; font-size: .8rem; }
.pf-field-val { color: #0f172a; flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.pf-muted { color: #64748b; font-size: .875rem; line-height: 1.6; }
.pf-action-link { font-size: .78rem; font-weight: 600; color: var(--brand, #E85A00); text-decoration: none; }
.pf-action-link:hover { text-decoration: underline; }

/* ── Badges ─────────────────────────────────────────────────── */
.pf-badge { font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 20px; }
.pf-badge--ok  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.pf-badge--warn { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }
.pf-badge--muted { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* ── Buttons: wide ──────────────────────────────────────────── */
.btn-wide { width: 100%; text-align: center; justify-content: center; }

/* ── Billing-Form Zwei-Spalten-Layout ───────────────────────── */
.bf-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
  max-width: 1060px;
}
.bf-form-col, .bf-info-col { display: flex; flex-direction: column; gap: 1.25rem; }
@media (max-width: 768px) { .bf-layout { grid-template-columns: 1fr; } }

/* ── Plan-Übersicht im Profil ───────────────────────────────── */
.pf-plans-section {
  max-width: 1060px;
  margin-top: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
}
.pf-plans-header {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.pf-plans-title { margin: 0; font-size: 1.05rem; font-weight: 800; color: #0f172a; }
.pf-plans-sub { margin: 0; font-size: .8rem; color: #64748b; flex: 1; }
.pf-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.pf-plan-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  transition: border-color .15s;
}
.pf-plan-item--active { border-color: var(--brand, #E85A00); background: #fff7f5; }
.pf-plan-active-chip {
  position: absolute; top: -10px; left: 1rem;
  background: var(--brand, #E85A00); color: #fff;
  font-size: .63rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; padding: .15rem .55rem; border-radius: 99px;
}
.pf-plan-item-name {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #64748b; margin-bottom: .5rem;
}
.pf-plan-item-price { margin-bottom: .5rem; }
.pf-plan-item-price-val { font-size: 1.3rem; font-weight: 800; color: #0f172a; }
.pf-plan-item-price-per { font-size: .78rem; color: #94a3b8; margin-left: .15rem; }
.pf-plan-bar-wrap {
  height: 4px; background: #e2e8f0;
  border-radius: 99px; margin: .6rem 0 .5rem; overflow: hidden;
}
.pf-plan-bar-fill {
  height: 100%; background: var(--brand, #E85A00);
  border-radius: 99px; transition: width .4s;
}
.pf-plan-item--active .pf-plan-bar-fill { background: var(--brand, #E85A00); }
.pf-plan-stats {
  display: flex; gap: .4rem; flex-wrap: wrap; font-size: .72rem; color: #64748b;
}
.pf-plan-stats span {
  background: #f1f5f9; border-radius: 6px; padding: .15rem .45rem;
}

@media (max-width: 860px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-col-side { order: -1; }
}
@media (max-width: 600px) {
  .pf-plans-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .pf-plans-grid { grid-template-columns: 1fr; }
  .pf-field-label { width: 110px; }
}

/* ── Profil Gefahrenzone (ganz unten) ──────────────────────── */
.pf-danger-zone {
  max-width: 1060px;
  margin-top: 1.5rem;
  border: 1px solid #fecaca;
  border-radius: 16px;
  overflow: hidden;
}
.pf-danger-zone-label {
  background: #fff5f5;
  border-bottom: 1px solid #fecaca;
  padding: .5rem 1.25rem;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #dc2626;
}
.pf-danger-zone-body {
  background: #fff;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.pf-danger-zone-title {
  margin: 0 0 .25rem;
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
}
.pf-danger-zone-desc {
  margin: 0;
  font-size: .82rem;
  color: #64748b;
  line-height: 1.5;
}
