    /* ── Design Tokens ─────────────────────────────────────────── */
    :root {
      --bg:          #f4f3f0;
      --surface:     #ffffff;
      --surface-2:   #edece9;
      --border:      #e2e0db;
      --text:        #1a1917;
      --text-muted:  #7a7670;
      --accent:      #2c5f4a;
      --accent-dim:  #e6efe9;
      --accent-text: #ffffff;
      --danger:      #b84040;
      --warning:     #c47c22;
      --info:        #2a5f8f;

      --sidebar-w:   240px;
      --header-h:    56px;
      --radius:      8px;
      --radius-sm:   5px;
      --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
      --shadow-md:   0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);

      --font:        "DM Sans", sans-serif;
      --font-mono:   "Consolas", "DM Mono", monospace;
    }

    /* ── Dark Mode Tokens ───────────────────────────────────────── */
    [data-theme="dark"] {
      --bg:          #111110;
      --surface:     #1c1c1a;
      --surface-2:   #242422;
      --border:      #2e2e2b;
      --text:        #e8e6e1;
      --text-muted:  #6b6963;
      --accent:      #4a9070;
      --accent-dim:  #1a2e25;
      --accent-text: #ffffff;
      --danger:      #c05555;
      --warning:     #c47c22;
      --info:        #3a7abf;
      --shadow:      0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
      --shadow-md:   0 4px 12px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.30);
    }

    /* ── Theme Transition ───────────────────────────────────────── */
    *, *::before, *::after {
      transition: background-color .2s ease, border-color .2s ease, color .15s ease, box-shadow .2s ease;
    }

    /* ── Reset ─────────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; }
    body {
      font-family: var(--font);
      font-size: 14px;
      line-height: 1.6;
      color: var(--text);
      background: var(--bg);
      -webkit-font-smoothing: antialiased;
    }
    a { color: var(--accent); text-decoration: none; }
    a:hover { text-decoration: underline; }
    button { cursor: pointer; font-family: inherit; }
    ul, ol { list-style: none; }

    /* ── Layout Shell ───────────────────────────────────────────── */
    .app {
      display: grid;
      grid-template-rows: var(--header-h) 1fr;
      grid-template-columns: var(--sidebar-w) 1fr;
      grid-template-areas:
        "header  header"
        "sidebar main";
      height: 100vh;
      overflow: hidden;
    }

    /* ── Header ─────────────────────────────────────────────────── */
    .header {
      grid-area: header;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 20px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      box-shadow: var(--shadow);
      z-index: 100;
    }

    .header__logo {
      display: flex;
      align-items: center;
      gap: 9px;
      font-size: 15px;
      font-weight: 600;
      letter-spacing: -.01em;
      color: var(--text);
      text-decoration: none;
      flex-shrink: 0;
      width: calc(var(--sidebar-w) - 20px);
    }
    .header__logo-icon {
      width: 28px; height: 28px;
      background: var(--accent);
      border-radius: var(--radius-sm);
      display: grid; place-items: center;
      color: #fff;
      font-size: 13px;
    }

    .header__divider {
      width: 1px; height: 22px;
      background: var(--border);
    }

    .header__title {
      font-size: 14px;
      font-weight: 500;
      color: var(--text-muted);
      flex: 1;
    }

    .header__search {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0 10px;
      height: 32px;
      width: 220px;
      transition: border-color .15s, box-shadow .15s;
    }
    .header__search:focus-within {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-dim);
    }
    .header__search input {
      border: none; background: none;
      font-family: var(--font); font-size: 13px;
      color: var(--text); outline: none; width: 100%;
    }
    .header__search input::placeholder { color: var(--text-muted); }

    .header__actions {
      display: flex; align-items: center; gap: 6px;
      margin-left: auto;
    }

    .icon-btn {
      width: 34px; height: 34px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: transparent;
      display: grid; place-items: center;
      color: var(--text-muted);
      transition: background .15s, color .15s;
    }
    .icon-btn:hover { background: var(--surface-2); color: var(--text); }

    .avatar {
      width: 32px; height: 32px;
      border-radius: 50%;
      background: var(--accent);
      color: var(--accent-text);
      display: grid; place-items: center;
      font-size: 12px; font-weight: 600;
      cursor: pointer;
      border: 2px solid transparent;
      transition: border-color .15s;
    }
    .avatar:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

    /* ── Theme Toggle ───────────────────────────────────────────── */
    .theme-toggle {
      width: 34px; height: 34px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: transparent;
      display: grid; place-items: center;
      color: var(--text-muted);
      position: relative;
      overflow: hidden;
      cursor: pointer;
    }
    .theme-toggle:hover { background: var(--surface-2); color: var(--text); }
    .theme-toggle .icon-sun,
    .theme-toggle .icon-moon {
      position: absolute;
      transition: opacity .25s, transform .3s;
    }
    .theme-toggle .icon-sun  { opacity: 1;  transform: rotate(0deg) scale(1); }
    .theme-toggle .icon-moon { opacity: 0;  transform: rotate(90deg) scale(.6); }
    [data-theme="dark"] .theme-toggle .icon-sun  { opacity: 0;  transform: rotate(-90deg) scale(.6); }
    [data-theme="dark"] .theme-toggle .icon-moon { opacity: 1;  transform: rotate(0deg) scale(1); }

    /* ── Sidebar ─────────────────────────────────────────────────── */
    .sidebar {
      grid-area: sidebar;
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      padding: 16px 0;
    }

    .nav-section {
      padding: 0 10px;
      margin-bottom: 4px;
    }
    .nav-section__label {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: var(--text-muted);
      padding: 8px 8px 4px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 7px 10px;
      border-radius: var(--radius-sm);
      font-size: 13.5px;
      font-weight: 400;
      color: var(--text-muted);
      cursor: pointer;
      transition: background .12s, color .12s;
      position: relative;
      text-decoration: none;
    }
    .nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
    .nav-item.active {
      background: var(--accent-dim);
      color: var(--accent);
      font-weight: 500;
    }
    .nav-item.active .nav-item__icon { color: var(--accent); }
    .nav-item__icon { width: 16px; text-align: center; flex-shrink: 0; }
    .nav-item__badge {
      margin-left: auto;
      background: var(--accent);
      color: #fff;
      font-size: 10px;
      font-weight: 600;
      font-family: var(--font-mono);
      padding: 1px 6px;
      border-radius: 99px;
    }

    .sidebar__footer {
      margin-top: auto;
      padding: 12px 10px 0;
      border-top: 1px solid var(--border);
    }

    /* ── Main Content ────────────────────────────────────────────── */
    .main {
      grid-area: main;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
    }

    /* Toolbar / Breadcrumb bar */
    .toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 28px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      flex-shrink: 0;
    }
    .breadcrumb {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      color: var(--text-muted);
    }
    .breadcrumb span:last-child { color: var(--text); font-weight: 500; }
    .breadcrumb__sep { opacity: .4; }

    .toolbar__actions {
      margin-left: auto;
      display: flex; gap: 8px;
    }

    /* Content area */
    .content {
      flex: 1;
      padding: 28px;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    /* ── Page Header ────────────────────────────────────────────── */
    .page-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }
    .page-header h1 {
      font-size: 22px;
      font-weight: 600;
      letter-spacing: -.02em;
      line-height: 1.2;
    }
    .page-header p {
      margin-top: 4px;
      color: var(--text-muted);
      font-size: 13.5px;
    }

    /* ── Stat Cards ─────────────────────────────────────────────── */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 14px;
    }
    .stat-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px 20px;
      box-shadow: var(--shadow);
    }
    .stat-card__label {
      font-size: 11.5px;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: var(--text-muted);
      margin-bottom: 8px;
    }
    .stat-card__value {
      font-size: 26px;
      font-weight: 600;
      letter-spacing: -.03em;
      font-family: var(--font-mono);
      line-height: 1;
    }
    .stat-card__delta {
      margin-top: 6px;
      font-size: 12px;
      color: var(--text-muted);
    }
    .stat-card__delta.up   { color: #2c7a4b; }
    .stat-card__delta.down { color: var(--danger); }

    /* ── Card ───────────────────────────────────────────────────── */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .card__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
    }
    .card__title {
      font-size: 14px;
      font-weight: 600;
    }
    .card__body {
      padding: 20px;
    }

    /* ── Table ──────────────────────────────────────────────────── */
    .table-wrap { overflow-x: auto; }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13.5px;
    }
    th {
      text-align: left;
      padding: 10px 16px;
      font-size: 11px;
      font-weight: 600;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }
    td {
      padding: 11px 16px;
      border-bottom: 1px solid var(--border);
      color: var(--text);
    }
    tr:last-child td { border-bottom: none; }
    tbody tr { transition: background .1s; }
    tbody tr:hover { background: var(--bg); }

    /* ── Badges / Tags ──────────────────────────────────────────── */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 2px 8px;
      border-radius: 99px;
      font-size: 11.5px;
      font-weight: 500;
    }
    .badge--green  { background: #e6f4ee; color: #1e6e42; }
    .badge--red    { background: #fce9e9; color: #9b2c2c; }
    .badge--yellow { background: #fef3de; color: #8a5100; }
    .badge--blue   { background: #e5eef8; color: #1e4d80; }
    .badge--gray   { background: var(--surface-2); color: var(--text-muted); }

    /* ── Buttons ────────────────────────────────────────────────── */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 14px;
      border-radius: var(--radius-sm);
      font-size: 13px;
      font-weight: 500;
      border: 1px solid transparent;
      transition: background .15s, box-shadow .15s, transform .1s;
    }
    .btn:active { transform: scale(.98); }
    .btn--primary {
      background: var(--accent);
      color: var(--accent-text);
      border-color: var(--accent);
    }
    .btn--primary:hover { background: #234f3d; }
    .btn--secondary {
      background: var(--surface);
      color: var(--text);
      border-color: var(--border);
      box-shadow: var(--shadow);
    }
    .btn--secondary:hover { background: var(--surface-2); }
    .btn--ghost {
      background: transparent;
      color: var(--text-muted);
    }
    .btn--ghost:hover { background: var(--surface-2); color: var(--text); }
    .btn--sm { padding: 5px 10px; font-size: 12px; }

    /* ── Form Elements ──────────────────────────────────────────── */
    .form-group { display: flex; flex-direction: column; gap: 5px; }
    .form-label {
      font-size: 12.5px;
      font-weight: 500;
      color: var(--text-muted);
    }
    .input {
      height: 36px;
      padding: 0 10px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: 13.5px;
      color: var(--text);
      background: var(--surface);
      transition: border-color .15s, box-shadow .15s;
      outline: none;
    }
    .input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-dim);
    }
    select.input { cursor: pointer; }

    /* ── Notification / Toast ───────────────────────────────────── */
    .toast-area {
      position: fixed; bottom: 24px; right: 24px;
      display: flex; flex-direction: column; gap: 10px;
      z-index: 999;
    }
    .toast {
      display: flex; align-items: flex-start; gap: 10px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-left: 3px solid var(--accent);
      border-radius: var(--radius);
      padding: 12px 16px;
      box-shadow: var(--shadow-md);
      max-width: 320px;
      font-size: 13px;
      animation: slideIn .2s ease;
    }
    .toast.error { border-left-color: var(--danger); }
    @keyframes slideIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── Scrollbar ──────────────────────────────────────────────── */
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
    ::-webkit-scrollbar-thumb:hover { background: #ccc; }

    /* ── Utility ────────────────────────────────────────────────── */
    .flex        { display: flex; }
    .items-center{ align-items: center; }
    .gap-2       { gap: 8px; }
    .ml-auto     { margin-left: auto; }
    .text-muted  { color: var(--text-muted); }
    .text-sm     { font-size: 12.5px; }
    .mono        { font-family: var(--font-mono); }
    .two-col     { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

    /* ── Responsive ─────────────────────────────────────────────── */
    @media (max-width: 720px) {
      .app {
        grid-template-columns: 1fr;
        grid-template-rows: var(--header-h) 1fr;
        grid-template-areas: "header" "main";
      }
      .sidebar { display: none; }
      .two-col { grid-template-columns: 1fr; }
      .stats-grid { grid-template-columns: 1fr 1fr; }
    }
