:root {
      color-scheme: dark;
      --bg: #07100b;
      --panel: #132019;
      --panel2: #192a20;
      --ink: #f3fbf0;
      --muted: #9aaca0;
      --line: #27382e;
      --accent: #8ee35b;
      --accent2: #d9b85f;
      --danger: #ff7468;
      --warn: #ffd36b;
      --ok: #8ee35b;
      --shadow: 0 24px 80px rgba(0,0,0,.42);
      --radius: 8px;
      --support: #63c8ff;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: linear-gradient(180deg, #0d1711, #07100b 48%, #050806);
      color: var(--ink);
      letter-spacing: 0;
      min-height: 100vh;
    }
    button, input, select, textarea { font: inherit; }
    button {
      min-height: 42px;
      border: 1px solid rgba(142,227,91,.22);
      border-radius: 7px;
      padding: 0 13px;
      color: var(--ink);
      background: linear-gradient(180deg, #1a251e, #111812);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 22px rgba(0,0,0,.16);
      font-weight: 800;
      cursor: pointer;
    }
    button.primary { color: #071006; background: linear-gradient(180deg, #b8ff7e, #73ca46); border-color: #c8ff9c; }
    button.danger { color: #ffe6e3; background: linear-gradient(180deg, #3a1715, #21100f); border-color: rgba(255,116,104,.52); }
    button.ghost { background: transparent; box-shadow: none; }
    input, select, textarea {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 0 12px;
      background: #0b100d;
      color: var(--ink);
      outline: none;
    }
    textarea { padding: 10px 12px; min-height: 84px; resize: vertical; }
    input:focus, select:focus, textarea:focus { border-color: rgba(142,227,91,.72); box-shadow: 0 0 0 3px rgba(142,227,91,.12); }
    label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
    .hidden { display: none !important; }
    .login {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 18px;
    }
    .login-box, .panel, .hero {
      background: linear-gradient(180deg, rgba(21,31,25,.98), rgba(12,18,14,.98));
      border: 1px solid rgba(142,227,91,.22);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }
    .login-box { width: min(440px, 100%); padding: 20px; display: grid; gap: 14px; }
    .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .mark { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(142,227,91,.26); background: #0e160f; flex: 0 0 auto; }
    .mark img { width: 100%; height: 100%; object-fit: cover; }
    h1, h2, h3 { margin: 0; }
    h1 { font-size: 18px; font-weight: 900; }
    h2 { font-size: 16px; font-weight: 900; }
    h3 { font-size: 13px; font-weight: 850; }
    .muted { color: var(--muted); font-size: 12px; }
    .app { min-height: 100vh; display: flex; flex-direction: column; }
    .topbar {
      position: sticky;
      top: 0;
      z-index: 10;
      min-height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      background: rgba(10,18,13,.96);
      border-bottom: 1px solid var(--line);
      backdrop-filter: blur(18px);
    }
    .topbar-nav {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1 1 auto;
      justify-content: flex-end;
      flex-wrap: wrap;
      min-width: 0;
    }
    .topbar-online { margin: 0; flex-shrink: 0; }
    .screen-picker {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1 1 220px;
      min-width: 0;
      max-width: min(440px, 100%);
    }
    .screen-picker-label {
      font-size: 12px;
      font-weight: 750;
      color: var(--muted);
      white-space: nowrap;
    }
    .screen-picker select {
      flex: 1;
      min-width: 0;
      cursor: pointer;
      font-weight: 800;
    }
    .usage-periods { display: flex; gap: 8px; flex-wrap: wrap; }
    .usage-periods button.active { color: #071006; border-color: #c8ff9c; background: linear-gradient(180deg, #b8ff7e, #73ca46); }
    .usage-row { display: grid; gap: 4px; font-size: 12px; }
    .usage-row strong { font-size: 14px; }
    main { flex: 1 1 auto; display: grid; gap: 14px; padding: 14px; max-width: 1380px; margin: 0 auto; width: 100%; }
    .hero { position: relative; overflow: hidden; padding: 20px; display: grid; gap: 10px; border-color: rgba(99,200,255,.28); }
    .hero:before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(142,227,91,.12), transparent 45%, rgba(217,184,95,.08)); pointer-events: none; }
    .hero > * { position: relative; }
    .hero-title { font-size: 25px; line-height: 1.05; font-weight: 950; }
    .status { display: inline-flex; align-items: center; gap: 8px; width: fit-content; border: 1px solid rgba(142,227,91,.25); border-radius: 999px; padding: 7px 10px; color: #ddffd3; background: rgba(142,227,91,.08); font-size: 12px; font-weight: 850; }
    .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 16px rgba(142,227,91,.68); }
    .dot.bad { background: var(--danger); box-shadow: 0 0 16px rgba(255,116,104,.58); }
    .grid { display: grid; gap: 12px; }
    .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stat { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #0d130f; }
    .stat .value { margin-top: 4px; font-size: 22px; font-weight: 950; color: #f7fff5; overflow-wrap: anywhere; }
    .panel { overflow: hidden; }
    .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg,#17221b,#111811); }
    .panel-body { padding: 14px; display: grid; gap: 12px; }
    .tools { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
    .form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .wide { grid-column: 1 / -1; }
    .actions { display: flex; gap: 9px; flex-wrap: wrap; }
    .quick-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(175px,1fr)); gap: 12px; }
    .quick-actions button { min-height: 76px; text-align: left; display: grid; align-content: center; gap: 4px; font-size: 15px; }
    .quick-actions small { color: #b7c9bd; font-size: 11px; font-weight: 750; }
    .help-strip { padding: 10px 12px; border: 1px solid rgba(99,200,255,.28); border-radius: 8px; background: rgba(99,200,255,.08); color: #d8f2ff; font-size: 13px; font-weight: 750; }
    .support-card { border-color: rgba(99,200,255,.34); }
    .list { display: grid; gap: 9px; }
    .row {
      display: grid;
      gap: 8px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #0b100d;
    }
    .row-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
    .person { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #061005; background: linear-gradient(145deg, #1d2b20, #82d84d); font-weight: 950; font-size: 12px; flex: 0 0 auto; }
    .pill { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: #17211a; color: #d9eadf; font-size: 12px; font-weight: 800; }
    .pill.ok { color: #dcffd1; background: rgba(142,227,91,.12); border-color: rgba(142,227,91,.34); }
    .pill.warn { color: #ffe4a1; background: rgba(217,184,95,.12); border-color: rgba(217,184,95,.34); }
    .pill.bad { color: #ffe3df; background: rgba(255,116,104,.12); border-color: rgba(255,116,104,.42); }
    .drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(2,5,3,.62); backdrop-filter: blur(5px); }
    .drawer {
      position: fixed;
      z-index: 31;
      left: 10px;
      right: 10px;
      top: 10px;
      bottom: 10px;
      overflow: auto;
      background: linear-gradient(180deg,#121b15,#0b100d);
      border: 1px solid rgba(142,227,91,.24);
      border-radius: 8px;
      box-shadow: 0 30px 100px rgba(0,0,0,.62);
    }
    .drawer .panel-head { position: sticky; top: 0; z-index: 1; }
    .drawer .panel-body { padding-bottom: 28px; }
    .table { display: grid; gap: 8px; }
    .kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
    .kv strong { color: #b9cabf; }
    .toast {
      position: fixed;
      left: 12px;
      right: 12px;
      bottom: 16px;
      z-index: 50;
      display: none;
      padding: 13px 14px;
      border: 1px solid rgba(142,227,91,.27);
      border-radius: 8px;
      background: #101712;
      color: var(--ink);
      box-shadow: var(--shadow);
      font-size: 13px;
    }
    .footer-brand {
      flex-shrink: 0;
      margin-top: 8px;
      padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
      display: grid;
      place-items: center;
      gap: 5px;
      background: rgba(6,10,8,.91);
      border-top: 1px solid var(--line);
      color: #9aac9f;
      font-size: 12px;
    }
    .store-ref-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .store-ref-table th, .store-ref-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
    .store-ref-table th { color: var(--muted); font-weight: 800; background: #0d130f; position: sticky; top: 0; }
    .store-ref-wrap { max-height: min(62vh, 640px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
    .footer-brand img { width: 100%; max-width: 288px; height: auto; border-radius: 6px; box-shadow: 0 18px 42px rgba(0,0,0,.38); }
    .empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
    .danger-zone { border-color: rgba(255,116,104,.36); }
    @media (min-width: 780px) {
      .stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
      .row { grid-template-columns: 1fr auto; align-items: center; }
      .drawer { left: auto; width: min(680px, calc(100vw - 32px)); }
    }
    @media (min-width: 1100px) {
      .drawer { width: min(820px, calc(100vw - 48px)); }
      #view-dashboard { grid-template-columns: 1.1fr .9fr; align-items: start; }
      #view-dashboard .hero, #view-dashboard #stats { grid-column: 1 / -1; }
    }
    @media (max-width: 480px) {
      .form { grid-template-columns: 1fr; }
      .topbar { align-items: flex-start; flex-direction: column; }
      .topbar-nav { width: 100%; justify-content: stretch; }
      .screen-picker { flex: 1 1 100%; max-width: none; }
      .screen-picker-label { display: none; }
      .topbar .brand h1 { font-size: 16px; }
      .hero-title { font-size: 22px; }
      button { min-height: 40px; }
    }
    body {
      background: #0f172a;
      color: #f1f5f9;
    }
    .app { background: linear-gradient(180deg, #0f172a 0%, #090d16 100%); }
    .topbar {
      background: rgba(15, 23, 42, 0.96);
      border-bottom: 1px solid rgba(16, 185, 129, 0.22);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }
    .topbar h1, .panel h2, .hero-title, strong { color: #f8fafc; }
    .muted { color: #94a3b8; }
    .screen-picker select {
      background: #1e293b;
      color: #f1f5f9;
      border-color: rgba(16, 185, 129, 0.28);
    }
    .hero, .panel, .login-box {
      background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
      border-color: rgba(16, 185, 129, 0.24);
      box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    }
    .hero:before { background: linear-gradient(100deg, rgba(16, 185, 129, 0.14), transparent 55%, rgba(125, 211, 252, 0.1)); }
    .panel-head {
      background: linear-gradient(180deg, #1e293b, #172033);
      border-bottom-color: rgba(16, 185, 129, 0.18);
    }
    .row, .stat, input, select, textarea {
      background: #111827;
      border-color: rgba(148, 163, 184, 0.22);
      color: #f1f5f9;
    }
    label { color: #94a3b8; }
    button {
      background: linear-gradient(180deg, #1e293b, #111827);
      border-color: rgba(16, 185, 129, 0.28);
      color: #ecfdf5;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    }
    button.primary {
      color: #042f1a;
      background: linear-gradient(180deg, #34d399, #10b981);
      border-color: #6ee7b7;
    }
    button.danger {
      color: #ffe4e6;
      background: linear-gradient(180deg, #7f1d1d, #450a0a);
      border-color: rgba(248, 113, 113, 0.45);
    }
    .status, .pill {
      background: rgba(16, 185, 129, 0.12);
      color: #6ee7b7;
      border-color: rgba(16, 185, 129, 0.34);
    }
    .pill.bad { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
    .pill.warn { background: rgba(250, 204, 21, 0.12); color: #fde68a; border-color: rgba(250, 204, 21, 0.35); }
    .help-strip {
      background: rgba(16, 185, 129, 0.1);
      color: #a7f3d0;
      border-color: rgba(16, 185, 129, 0.32);
    }
    .quick-actions button {
      background: #1e293b;
      border: 1px solid rgba(16, 185, 129, 0.22);
      color: #f8fafc;
    }
    .quick-actions button.primary {
      background: linear-gradient(180deg, #34d399, #10b981);
      color: #042f1a;
    }
    .quick-actions button.primary small { color: #064e3b; }
    .quick-actions small { color: #94a3b8; }
    .footer-brand {
      background: rgba(9, 13, 22, 0.94);
      border-top-color: rgba(16, 185, 129, 0.18);
      color: #94a3b8;
    }
    .drawer {
      background: linear-gradient(180deg, #1e293b, #0f172a);
      border-color: rgba(16, 185, 129, 0.24);
    }
    .store-ref-table th { background: #172033; color: #94a3b8; }
    .store-ref-table td { border-bottom-color: rgba(148, 163, 184, 0.16); }
    .store-ref-wrap { border-color: rgba(16, 185, 129, 0.2); }
    .feature-note {
      padding: 12px 14px;
      border: 1px solid rgba(125, 211, 252, 0.28);
      border-radius: 8px;
      background: rgba(125, 211, 252, 0.08);
      color: #bae6fd;
      font-size: 13px;
      line-height: 1.45;
    }
