/* ============================================================
   APOTEK TYA FARMA — stylesheet bertema (theme tokens)
   Tema dipilih lewat atribut data-theme pada <html>.
   ============================================================ */

/* ---------- TOKEN DASAR: tema "Tya Farma Green" ---------- */
:root, [data-theme="green"] {
  --em: #0e9f6e;
  --em-dark: #067a54;
  --em-soft: #e6f7f0;
  --em-soft-2: #f4fbf8;
  --em-grad: linear-gradient(180deg, #10b981, #0b8e63);
  --em-grad-brand: linear-gradient(145deg, #12b981, #0a7c58);
  --em-ring: rgba(14, 159, 110, .15);
  --em-glow: rgba(14, 159, 110, .24);
  --brand-shadow: 0 6px 14px rgba(14, 159, 110, .28);

  --ink: #16211d;
  --ink-2: #46524d;
  --muted: #7b8781;

  --line: #e4e9ec;
  --line-soft: #f0f3f2;
  --bg: #f4f7f6;
  --bg-image: radial-gradient(1200px 600px at 100% -10%, #e8f5ef 0%, rgba(232,245,239,0) 55%),
              radial-gradient(900px 500px at -10% 20%, #eef1fb 0%, rgba(238,241,251,0) 60%);

  --card: #ffffff;
  --card-2: #f8fbfa;
  --card-3: #fbfdfc;
  --card-border: var(--line);

  --input-bg: #ffffff;
  --input-border: #dde5e2;
  --input-disabled: #f6f8f7;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-hover: #f7faf9;

  --indigo: #4f46e5;  --indigo-soft: #eef0ff;  --indigo-ink: #4338ca;
  --amber: #d97706;   --amber-soft: #fef4e6;   --amber-ink: #b45309;
  --red: #dc2626;     --red-soft: #fdecec;     --red-ink: #b91c1c;
  --blue: #2563eb;    --blue-soft: #eaf1ff;    --blue-ink: #1d4ed8;
  --gray-soft: #f0f3f2; --gray-ink: #5d6a64;

  --shadow-sm: 0 1px 2px rgba(16, 32, 26, .05);
  --shadow: 0 8px 24px rgba(16, 32, 26, .07);
  --shadow-lg: 0 24px 70px rgba(9, 30, 22, .22);
  --shadow-hover: 0 6px 16px rgba(14, 159, 110, .10);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --sidebar-bg: rgba(255, 255, 255, .82);
  --sidebar-blur: blur(18px) saturate(150%);
  --sidebar-border: rgba(15, 32, 26, .07);
  --side-brand: #16211d;
  --side-ink: #46524d;
  --side-muted: #9aa5a0;
  --side-hover: #f1f6f4;
  --side-active-bg: linear-gradient(90deg, var(--em-soft), #f4fbf8);
  --side-active-ink: var(--em-dark);
  --side-dot: #c3cec9;
  --side-active-dot: var(--em);
  --side-tag-bg: #eef2f0;
  --side-tag-ink: #7b8781;

  --topbar-bg: rgba(255, 255, 255, .75);
  --topbar-blur: blur(16px);
  --topbar-border: rgba(15, 32, 26, .07);
  --chip-bg: #f3f8f6;
  --chip-border: #e2ede8;

  --table-head: #f8faf9;
  --row-hover: #fbfdfc;
  --chart-label: #96a19c;
  --overlay: rgba(12, 27, 21, .42);
  --toast-bg: #16211d;
  --toast-ink: #ffffff;

  --hero-grad: linear-gradient(150deg, #0d3f30 0%, #0e6b4d 45%, #0e9f6e 100%);
  --auth-panel: #ffffff;
  --auth-hint-bg: #f7faf9;

  --change-grad: linear-gradient(180deg, #ecfdf5, #e6f7f0);
  --change-border: #bfe6d6;
  --change-ink: #0b6b4c;
  --change-val: #067a54;

  --note-bg: #f8fbfa;
  --totals-bg: #f8fbfa;
  --summary-bg: #fbfdfc;
  --dash-line: #edf1ef;
  --card-radius-btn: 10px;
  color-scheme: light;
}

/* ---------- TEMA 2: POS Kekinian (sidebar gelap, aksen ungu) ---------- */
[data-theme="modern-pos"] {
  --em: #6d5efc;
  --em-dark: #5546e8;
  --em-soft: #eeedff;
  --em-soft-2: #f6f5ff;
  --em-grad: linear-gradient(180deg, #7c6bff, #5b4ee0);
  --em-grad-brand: linear-gradient(145deg, #8b7bff, #5546e8);
  --em-ring: rgba(109, 94, 252, .18);
  --em-glow: rgba(109, 94, 252, .26);
  --brand-shadow: 0 8px 18px rgba(109, 94, 252, .35);

  --ink: #101828;
  --ink-2: #475467;
  --muted: #8b95a7;

  --line: #e4e9f2;
  --line-soft: #eef2f8;
  --bg: #eef1f8;
  --bg-image: radial-gradient(900px 480px at 100% -10%, #e6e5ff 0%, rgba(230,229,255,0) 58%),
              radial-gradient(760px 420px at -10% 5%, #e3f7f1 0%, rgba(227,247,241,0) 60%);

  --card: #ffffff;
  --card-2: #f7f9fd;
  --card-3: #fbfcfe;

  --input-bg: #ffffff;
  --input-border: #dfe6f1;
  --input-disabled: #f4f6fa;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-hover: #f6f8fc;

  --indigo: #6d5efc;  --indigo-soft: #eeedff;  --indigo-ink: #5546e8;
  --amber-soft: #fff4e5; --amber-ink: #b25e09;
  --red-soft: #ffeceb;  --red-ink: #c02626;
  --blue: #2e90fa;     --blue-soft: #e8f2ff;   --blue-ink: #175cd3;
  --gray-soft: #eff2f7; --gray-ink: #566076;

  --shadow-sm: 0 2px 6px rgba(16, 24, 40, .05);
  --shadow: 0 14px 34px rgba(16, 24, 40, .10);
  --shadow-lg: 0 28px 80px rgba(16, 24, 40, .22);
  --shadow-hover: 0 10px 24px rgba(109, 94, 252, .18);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 20px;

  --sidebar-bg: linear-gradient(180deg, #141b2c 0%, #0d1320 100%);
  --sidebar-blur: none;
  --sidebar-border: rgba(255, 255, 255, .06);
  --side-brand: #ffffff;
  --side-ink: #c9d3e6;
  --side-muted: #7a87a1;
  --side-hover: rgba(255, 255, 255, .07);
  --side-active-bg: linear-gradient(90deg, #6d5efc, #8b5cf6);
  --side-active-ink: #ffffff;
  --side-dot: #46536e;
  --side-active-dot: #ffffff;
  --side-tag-bg: rgba(255, 255, 255, .1);
  --side-tag-ink: #b9c4d8;

  --topbar-bg: rgba(255, 255, 255, .85);
  --topbar-blur: blur(18px);
  --topbar-border: rgba(16, 24, 40, .07);
  --chip-bg: #f3f5fb;
  --chip-border: #e5e9f4;

  --table-head: #f7f9fd;
  --row-hover: #fafbff;
  --chart-label: #98a2b3;
  --overlay: rgba(13, 19, 32, .55);
  --toast-bg: #101828;
  --toast-ink: #ffffff;

  --hero-grad: linear-gradient(150deg, #1b1440 0%, #35267a 45%, #6d5efc 100%);
  --auth-panel: #ffffff;
  --auth-hint-bg: #f7f8fd;

  --change-grad: linear-gradient(180deg, #f3f1ff, #eeecff);
  --change-border: #d8d3ff;
  --change-ink: #5546e8;
  --change-val: #5546e8;

  --note-bg: #f7f9fd;
  --totals-bg: #f8f9fe;
  --summary-bg: #fbfcfe;
  --dash-line: #ebeff7;
  color-scheme: light;
}

/* ---------- TEMA 3: Mode Gelap ---------- */
[data-theme="dark"] {
  --em: #2dd4a7;
  --em-dark: #34e0b0;
  --em-soft: rgba(45, 212, 167, .14);
  --em-soft-2: rgba(45, 212, 167, .07);
  --em-grad: linear-gradient(180deg, #34d399, #0f9f76);
  --em-grad-brand: linear-gradient(145deg, #34d399, #0f7f5f);
  --em-ring: rgba(45, 212, 167, .22);
  --em-glow: rgba(45, 212, 167, .3);
  --brand-shadow: 0 8px 20px rgba(16, 185, 129, .3);

  --ink: #e8eef8;
  --ink-2: #a8b4c8;
  --muted: #7d8a9f;

  --line: #22304a;
  --line-soft: #1a253a;
  --bg: #0a1020;
  --bg-image: radial-gradient(900px 500px at 100% -10%, rgba(56, 189, 248, .12) 0%, rgba(56,189,248,0) 55%),
              radial-gradient(800px 460px at -10% 10%, rgba(45, 212, 167, .10) 0%, rgba(45,212,167,0) 60%);

  --card: #121b2d;
  --card-2: #16223a;
  --card-3: #18253d;

  --input-bg: #0f1829;
  --input-border: #26364f;
  --input-disabled: #141d2f;
  --btn-ghost-bg: #16223a;
  --btn-ghost-hover: #1c2b45;

  --indigo: #a78bfa;  --indigo-soft: rgba(167, 139, 250, .16);  --indigo-ink: #c4b5fd;
  --amber: #fbbf24;   --amber-soft: rgba(251, 191, 36, .16);    --amber-ink: #fcd34d;
  --red: #f87171;     --red-soft: rgba(248, 113, 113, .16);     --red-ink: #fca5a5;
  --blue: #60a5fa;    --blue-soft: rgba(96, 165, 250, .16);     --blue-ink: #93c5fd;
  --gray-soft: rgba(148, 163, 184, .14); --gray-ink: #cbd5e1;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .6);
  --shadow-hover: 0 10px 24px rgba(45, 212, 167, .18);

  --sidebar-bg: linear-gradient(180deg, #0d1526, #080e1a);
  --sidebar-blur: none;
  --sidebar-border: rgba(255, 255, 255, .06);
  --side-brand: #f1f5fb;
  --side-ink: #b6c2d6;
  --side-muted: #6b7a92;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active-bg: linear-gradient(90deg, rgba(45, 212, 167, .22), rgba(45, 212, 167, .06));
  --side-active-ink: #5eead4;
  --side-dot: #33415a;
  --side-active-dot: #2dd4a7;
  --side-tag-bg: rgba(255, 255, 255, .08);
  --side-tag-ink: #9fb0c7;

  --topbar-bg: rgba(12, 19, 33, .82);
  --topbar-blur: blur(16px);
  --topbar-border: rgba(255, 255, 255, .07);
  --chip-bg: #16223a;
  --chip-border: #23324b;

  --table-head: #17233a;
  --row-hover: #182842;
  --chart-label: #8296b1;
  --overlay: rgba(2, 6, 16, .68);
  --toast-bg: #1d2b44;
  --toast-ink: #eaf1fb;

  --hero-grad: linear-gradient(150deg, #061423 0%, #0b3b34 45%, #0f766e 100%);
  --auth-panel: #0d1626;
  --auth-hint-bg: #16223a;

  --change-grad: linear-gradient(180deg, rgba(45,212,167,.16), rgba(45,212,167,.06));
  --change-border: #1f6b58;
  --change-ink: #5eead4;
  --change-val: #34e0b0;

  --note-bg: #16223a;
  --totals-bg: #14203a;
  --summary-bg: #131f36;
  --dash-line: #22304a;
  color-scheme: dark;
}

/* ---------- TEMA 4: Violet Glass ---------- */
[data-theme="indigo"] {
  --em: #7c5cff;
  --em-dark: #6a49f2;
  --em-soft: rgba(124, 92, 255, .13);
  --em-soft-2: rgba(124, 92, 255, .06);
  --em-grad: linear-gradient(180deg, #8b6bff, #6a49f2);
  --em-grad-brand: linear-gradient(145deg, #9b7bff, #6a49f2);
  --em-ring: rgba(124, 92, 255, .2);
  --em-glow: rgba(124, 92, 255, .28);
  --brand-shadow: 0 8px 20px rgba(124, 92, 255, .32);

  --ink: #1f1b3a;
  --ink-2: #55507a;
  --muted: #8b87a8;

  --line: rgba(124, 92, 255, .14);
  --line-soft: rgba(124, 92, 255, .08);
  --bg: #f3f0ff;
  --bg-image: radial-gradient(900px 500px at 100% -10%, rgba(167, 139, 250, .35) 0%, rgba(167,139,250,0) 55%),
              radial-gradient(760px 420px at -10% 10%, rgba(125, 211, 252, .3) 0%, rgba(125,211,252,0) 60%),
              radial-gradient(700px 500px at 60% 110%, rgba(251, 207, 232, .35) 0%, rgba(251,207,232,0) 60%);

  --card: rgba(255, 255, 255, .72);
  --card-blur: blur(16px) saturate(160%);
  --card-2: rgba(255, 255, 255, .55);
  --card-3: rgba(255, 255, 255, .65);
  --card-border: rgba(255, 255, 255, .7);

  --input-bg: rgba(255, 255, 255, .8);
  --input-border: rgba(124, 92, 255, .22);
  --input-disabled: rgba(255, 255, 255, .5);
  --btn-ghost-bg: rgba(255, 255, 255, .75);
  --btn-ghost-hover: rgba(255, 255, 255, .95);

  --indigo: #7c5cff; --indigo-soft: rgba(124,92,255,.14); --indigo-ink: #6a49f2;
  --amber-soft: rgba(245,158,11,.14); --amber-ink: #b45309;
  --red-soft: rgba(244,63,94,.13); --red-ink: #be123c;
  --blue: #0ea5e9; --blue-soft: rgba(14,165,233,.13); --blue-ink: #0369a1;
  --gray-soft: rgba(100,116,139,.1); --gray-ink: #475569;

  --shadow-sm: 0 2px 8px rgba(76, 29, 149, .06);
  --shadow: 0 18px 40px rgba(76, 29, 149, .12);
  --shadow-lg: 0 30px 80px rgba(76, 29, 149, .25);
  --shadow-hover: 0 14px 30px rgba(124, 92, 255, .2);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 22px;

  --sidebar-bg: rgba(255, 255, 255, .62);
  --sidebar-blur: blur(22px) saturate(170%);
  --sidebar-border: rgba(255, 255, 255, .75);
  --side-brand: #1f1b3a;
  --side-ink: #55507a;
  --side-muted: #9d99b8;
  --side-hover: rgba(255, 255, 255, .7);
  --side-active-bg: linear-gradient(90deg, rgba(124, 92, 255, .9), rgba(236, 72, 153, .55));
  --side-active-ink: #ffffff;
  --side-dot: #c9c4e2;
  --side-active-dot: #ffffff;
  --side-tag-bg: rgba(124, 92, 255, .12);
  --side-tag-ink: #6a49f2;

  --topbar-bg: rgba(255, 255, 255, .62);
  --topbar-blur: blur(20px);
  --topbar-border: rgba(255, 255, 255, .8);
  --chip-bg: rgba(255, 255, 255, .7);
  --chip-border: rgba(124, 92, 255, .18);

  --table-head: rgba(255, 255, 255, .55);
  --row-hover: rgba(255, 255, 255, .6);
  --chart-label: #9d99b8;
  --overlay: rgba(31, 27, 58, .38);
  --toast-bg: #241f45;
  --toast-ink: #ffffff;

  --hero-grad: linear-gradient(150deg, #241c4f 0%, #4c2f8f 45%, #7c5cff 100%);
  --auth-panel: rgba(255, 255, 255, .8);
  --auth-hint-bg: rgba(255, 255, 255, .55);

  --change-grad: linear-gradient(180deg, rgba(124,92,255,.16), rgba(236,72,153,.1));
  --change-border: rgba(124, 92, 255, .3);
  --change-ink: #6a49f2;
  --change-val: #6a49f2;

  --note-bg: rgba(255, 255, 255, .55);
  --totals-bg: rgba(255, 255, 255, .5);
  --summary-bg: rgba(255, 255, 255, .55);
  --dash-line: rgba(124, 92, 255, .14);
  color-scheme: light;
}

/* ---------- TEMA 5: Ocean Blue ---------- */
[data-theme="ocean"] {
  --em: #0284c7;
  --em-dark: #0369a1;
  --em-soft: #e0f2fe;
  --em-soft-2: #f0f9ff;
  --em-grad: linear-gradient(180deg, #0ea5e9, #0369a1);
  --em-grad-brand: linear-gradient(145deg, #22d3ee, #0369a1);
  --em-ring: rgba(2, 132, 199, .16);
  --em-glow: rgba(2, 132, 199, .24);
  --brand-shadow: 0 8px 18px rgba(2, 132, 199, .3);

  --ink: #0b2b3c;
  --ink-2: #3d5f70;
  --muted: #7e97a4;

  --line: #dbe9f0;
  --line-soft: #eaf3f8;
  --bg: #f1f8fb;
  --bg-image: radial-gradient(1000px 520px at 100% -10%, #d9f1fb 0%, rgba(217,241,251,0) 55%),
              radial-gradient(820px 460px at -10% 15%, #e6f7f5 0%, rgba(230,247,245,0) 60%);

  --card: #ffffff;
  --card-2: #f5fbfd;
  --card-3: #fafdfe;

  --input-bg: #ffffff;
  --input-border: #d3e4ec;
  --input-disabled: #f1f6f9;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-hover: #f2f9fc;

  --indigo: #2563eb; --indigo-soft: #e8efff; --indigo-ink: #1d4ed8;
  --amber-soft: #fef3e2; --amber-ink: #b45309;
  --red-soft: #fdeaea; --red-ink: #b91c1c;
  --blue: #0284c7; --blue-soft: #e0f2fe; --blue-ink: #0369a1;
  --gray-soft: #eef4f7; --gray-ink: #526b78;

  --shadow-sm: 0 1px 2px rgba(8, 47, 73, .06);
  --shadow: 0 10px 26px rgba(8, 47, 73, .08);
  --shadow-lg: 0 24px 60px rgba(8, 47, 73, .2);
  --shadow-hover: 0 8px 20px rgba(2, 132, 199, .16);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;

  --sidebar-bg: linear-gradient(180deg, #062f4a 0%, #04222f 100%);
  --sidebar-blur: none;
  --sidebar-border: rgba(255, 255, 255, .07);
  --side-brand: #ffffff;
  --side-ink: #bcd6e4;
  --side-muted: #6d90a3;
  --side-hover: rgba(255, 255, 255, .08);
  --side-active-bg: linear-gradient(90deg, #0ea5e9, #22d3ee);
  --side-active-ink: #04222f;
  --side-dot: #24566e;
  --side-active-dot: #04222f;
  --side-tag-bg: rgba(255, 255, 255, .12);
  --side-tag-ink: #cfe6f1;

  --topbar-bg: rgba(255, 255, 255, .8);
  --topbar-blur: blur(16px);
  --topbar-border: rgba(8, 47, 73, .08);
  --chip-bg: #eef7fb;
  --chip-border: #d8ebf3;

  --table-head: #f4fafd;
  --row-hover: #f9fdfe;
  --chart-label: #8aa6b3;
  --overlay: rgba(4, 34, 47, .5);
  --toast-bg: #04222f;
  --toast-ink: #ffffff;

  --hero-grad: linear-gradient(150deg, #03212f 0%, #065a7d 45%, #0ea5e9 100%);
  --auth-panel: #ffffff;
  --auth-hint-bg: #f1f9fc;

  --change-grad: linear-gradient(180deg, #e0f7ff, #e0f2fe);
  --change-border: #b9e3f5;
  --change-ink: #0369a1;
  --change-val: #0284c7;

  --note-bg: #f4fafd;
  --totals-bg: #f5fbfd;
  --summary-bg: #fafdfe;
  --dash-line: #e6f1f6;
  color-scheme: light;
}

/* ---------- TEMA 6: Sunset Warm ---------- */
[data-theme="sunset"] {
  --em: #ea6a33;
  --em-dark: #c2410c;
  --em-soft: #ffeede;
  --em-soft-2: #fff6ef;
  --em-grad: linear-gradient(180deg, #fb8c4a, #e2531b);
  --em-grad-brand: linear-gradient(145deg, #fb923c, #db2777);
  --em-ring: rgba(234, 106, 51, .18);
  --em-glow: rgba(234, 106, 51, .26);
  --brand-shadow: 0 8px 18px rgba(234, 106, 51, .3);

  --ink: #35221a;
  --ink-2: #6b5548;
  --muted: #a08b7e;

  --line: #f0e2d8;
  --line-soft: #f8efe8;
  --bg: #fdf6f0;
  --bg-image: radial-gradient(1000px 520px at 100% -10%, #ffe6d5 0%, rgba(255,230,213,0) 55%),
              radial-gradient(820px 460px at -10% 15%, #ffe9f1 0%, rgba(255,233,241,0) 60%);

  --card: #ffffff;
  --card-2: #fffaf6;
  --card-3: #fffdfb;

  --input-bg: #ffffff;
  --input-border: #ecd9cc;
  --input-disabled: #faf3ee;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-hover: #fff7f1;

  --indigo: #7c3aed; --indigo-soft: #f1e9ff; --indigo-ink: #6d28d9;
  --amber: #d97706; --amber-soft: #fff2d8; --amber-ink: #b45309;
  --red: #e11d48; --red-soft: #ffe4e6; --red-ink: #be123c;
  --blue: #2563eb; --blue-soft: #e8efff; --blue-ink: #1d4ed8;
  --gray-soft: #f5ece6; --gray-ink: #6b5548;

  --shadow-sm: 0 1px 2px rgba(80, 40, 20, .06);
  --shadow: 0 12px 28px rgba(120, 60, 25, .1);
  --shadow-lg: 0 26px 64px rgba(120, 60, 25, .22);
  --shadow-hover: 0 10px 22px rgba(234, 106, 51, .18);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 20px;

  --sidebar-bg: linear-gradient(180deg, #4a2018 0%, #2f120d 100%);
  --sidebar-blur: none;
  --sidebar-border: rgba(255, 255, 255, .08);
  --side-brand: #fff4ec;
  --side-ink: #e8c9b8;
  --side-muted: #a8775f;
  --side-hover: rgba(255, 255, 255, .08);
  --side-active-bg: linear-gradient(90deg, #fb923c, #db2777);
  --side-active-ink: #ffffff;
  --side-dot: #7b4530;
  --side-active-dot: #ffffff;
  --side-tag-bg: rgba(255, 255, 255, .12);
  --side-tag-ink: #f3d6c6;

  --topbar-bg: rgba(255, 252, 249, .85);
  --topbar-blur: blur(16px);
  --topbar-border: rgba(80, 40, 20, .08);
  --chip-bg: #fff5ed;
  --chip-border: #f4e2d5;

  --table-head: #fff9f4;
  --row-hover: #fffdfb;
  --chart-label: #b09a8c;
  --overlay: rgba(47, 18, 13, .48);
  --toast-bg: #35221a;
  --toast-ink: #fff6ef;

  --hero-grad: linear-gradient(150deg, #3a1610 0%, #8a3418 45%, #ea6a33 100%);
  --auth-panel: #ffffff;
  --auth-hint-bg: #fff8f2;

  --change-grad: linear-gradient(180deg, #fff2e8, #ffe9dc);
  --change-border: #f6cdb2;
  --change-ink: #c2410c;
  --change-val: #c2410c;

  --note-bg: #fff9f4;
  --totals-bg: #fffaf6;
  --summary-bg: #fffdfb;
  --dash-line: #f6e8de;
  color-scheme: light;
}

/* ---------- TEMA 7: Minimalis ---------- */
[data-theme="minimal"] {
  --em: #111827;
  --em-dark: #111827;
  --em-soft: #f1f2f4;
  --em-soft-2: #f8f9fa;
  --em-grad: linear-gradient(180deg, #1f2937, #111827);
  --em-grad-brand: linear-gradient(145deg, #374151, #111827);
  --em-ring: rgba(17, 24, 39, .12);
  --em-glow: rgba(17, 24, 39, .16);
  --brand-shadow: 0 4px 10px rgba(17, 24, 39, .18);

  --ink: #111827;
  --ink-2: #4b5563;
  --muted: #8b93a1;

  --line: #e5e7eb;
  --line-soft: #f1f2f4;
  --bg: #fafafa;
  --bg-image: none;

  --card: #ffffff;
  --card-2: #fafafa;
  --card-3: #fcfcfc;

  --input-bg: #ffffff;
  --input-border: #e0e2e7;
  --input-disabled: #f6f6f7;
  --btn-ghost-bg: #ffffff;
  --btn-ghost-hover: #f7f7f8;

  --indigo: #111827; --indigo-soft: #f1f2f4; --indigo-ink: #111827;
  --amber: #92400e; --amber-soft: #fdf6e3; --amber-ink: #92400e;
  --red: #b91c1c;  --red-soft: #fdeeee;  --red-ink: #b91c1c;
  --blue: #1f2937; --blue-soft: #f1f2f4; --blue-ink: #1f2937;
  --gray-soft: #f3f4f6; --gray-ink: #4b5563;

  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow-lg: 0 16px 40px rgba(17, 24, 39, .16);
  --shadow-hover: 0 2px 6px rgba(17, 24, 39, .08);

  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 12px;

  --sidebar-bg: #ffffff;
  --sidebar-blur: none;
  --sidebar-border: #e5e7eb;
  --side-brand: #111827;
  --side-ink: #4b5563;
  --side-muted: #9aa1ad;
  --side-hover: #f5f5f6;
  --side-active-bg: #111827;
  --side-active-ink: #ffffff;
  --side-dot: #d1d5db;
  --side-active-dot: #ffffff;
  --side-tag-bg: #f3f4f6;
  --side-tag-ink: #4b5563;

  --topbar-bg: #ffffff;
  --topbar-blur: none;
  --topbar-border: #e5e7eb;
  --chip-bg: #fafafa;
  --chip-border: #e5e7eb;

  --table-head: #fafafa;
  --row-hover: #fcfcfc;
  --chart-label: #9aa1ad;
  --overlay: rgba(17, 24, 39, .35);
  --toast-bg: #111827;
  --toast-ink: #ffffff;

  --hero-grad: linear-gradient(150deg, #111827 0%, #1f2937 60%, #374151 100%);
  --auth-panel: #ffffff;
  --auth-hint-bg: #fafafa;

  --change-grad: #f6f6f7;
  --change-border: #e0e2e7;
  --change-ink: #111827;
  --change-val: #111827;

  --note-bg: #fafafa;
  --totals-bg: #fafafa;
  --summary-bg: #fcfcfc;
  --dash-line: #ededf0;
  color-scheme: light;
}

/* ---------- TEMA 8: Glassy Aurora (kaca transparan, gradasi hidup) ---------- */
[data-theme="glassy"] {
  --em: #6d8bff;
  --em-dark: #4b63f0;
  --em-soft: rgba(109, 139, 255, .16);
  --em-soft-2: rgba(109, 139, 255, .08);
  --em-grad: linear-gradient(135deg, #7aa2ff, #6d8bff 45%, #a855f7 100%);
  --em-grad-brand: linear-gradient(135deg, #8ab4ff, #6d8bff 40%, #a855f7 100%);
  --em-ring: rgba(109, 139, 255, .26);
  --em-glow: rgba(109, 139, 255, .38);
  --brand-shadow: 0 12px 28px rgba(109, 139, 255, .38);

  --ink: #14203c;
  --ink-2: #43507a;
  --muted: #7c86a8;

  --line: rgba(255, 255, 255, .55);
  --line-soft: rgba(120, 140, 200, .14);
  --bg: #eef2ff;
  --bg-image:
    radial-gradient(1000px 620px at 88% -12%, rgba(120, 190, 255, .55) 0%, rgba(120,190,255,0) 58%),
    radial-gradient(820px 560px at -8% 4%, rgba(186, 148, 255, .5) 0%, rgba(186,148,255,0) 60%),
    radial-gradient(760px 620px at 55% 108%, rgba(255, 168, 210, .42) 0%, rgba(255,168,210,0) 62%),
    radial-gradient(620px 460px at 20% 72%, rgba(120, 255, 226, .38) 0%, rgba(120,255,226,0) 65%),
    linear-gradient(180deg, #f4f6ff 0%, #eaf0ff 100%);

  --card: rgba(255, 255, 255, .5);
  --card-blur: blur(26px) saturate(190%);
  --card-2: rgba(255, 255, 255, .38);
  --card-3: rgba(255, 255, 255, .46);
  --card-border: rgba(255, 255, 255, .68);

  --input-bg: rgba(255, 255, 255, .68);
  --input-border: rgba(150, 170, 230, .38);
  --input-disabled: rgba(255, 255, 255, .42);
  --btn-ghost-bg: rgba(255, 255, 255, .58);
  --btn-ghost-hover: rgba(255, 255, 255, .82);

  --indigo: #7c6bff; --indigo-soft: rgba(124, 107, 255, .16); --indigo-ink: #5b49e6;
  --amber: #e08a12;  --amber-soft: rgba(245, 176, 65, .2);   --amber-ink: #a96206;
  --red: #f04460;    --red-soft: rgba(244, 63, 94, .16);     --red-ink: #c81e40;
  --blue: #2aa6f5;   --blue-soft: rgba(42, 166, 245, .16);   --blue-ink: #0f6fae;
  --gray-soft: rgba(120, 136, 180, .14); --gray-ink: #4d5878;

  --shadow-sm: 0 2px 10px rgba(70, 90, 160, .07);
  --shadow: 0 20px 45px -18px rgba(60, 80, 160, .3);
  --shadow-lg: 0 38px 90px -26px rgba(50, 70, 150, .38);
  --shadow-hover: 0 26px 52px -20px rgba(80, 100, 200, .34);

  --radius: 20px;
  --radius-sm: 13px;
  --radius-lg: 26px;

  --sidebar-bg: rgba(255, 255, 255, .46);
  --sidebar-blur: blur(30px) saturate(185%);
  --sidebar-border: rgba(255, 255, 255, .7);
  --side-brand: #16233f;
  --side-ink: #43507a;
  --side-muted: #96a0c0;
  --side-hover: rgba(255, 255, 255, .62);
  --side-active-bg: linear-gradient(100deg, rgba(109, 139, 255, .92), rgba(168, 85, 247, .72));
  --side-active-ink: #ffffff;
  --side-dot: #c6cee8;
  --side-active-dot: #ffffff;
  --side-tag-bg: rgba(109, 139, 255, .16);
  --side-tag-ink: #4b63f0;

  --topbar-bg: rgba(255, 255, 255, .42);
  --topbar-blur: blur(26px) saturate(180%);
  --topbar-border: rgba(255, 255, 255, .62);
  --chip-bg: rgba(255, 255, 255, .58);
  --chip-border: rgba(150, 170, 230, .34);

  --table-head: rgba(255, 255, 255, .5);
  --row-hover: rgba(255, 255, 255, .62);
  --chart-label: #8a94b4;
  --overlay: rgba(22, 33, 60, .34);
  --toast-bg: #1d2b4d;
  --toast-ink: #ffffff;

  --hero-grad: linear-gradient(135deg, #2a3f8f 0%, #4b63f0 38%, #7c5cff 66%, #d466c8 100%);
  --auth-panel: rgba(255, 255, 255, .62);
  --auth-hint-bg: rgba(255, 255, 255, .46);

  --change-grad: linear-gradient(135deg, rgba(109, 139, 255, .2), rgba(168, 85, 247, .14));
  --change-border: rgba(109, 139, 255, .34);
  --change-ink: #4b63f0;
  --change-val: #4450d8;

  --note-bg: rgba(255, 255, 255, .46);
  --totals-bg: rgba(255, 255, 255, .42);
  --summary-bg: rgba(255, 255, 255, .5);
  --dash-line: rgba(140, 160, 220, .18);
  --surface: #ffffff;
  color-scheme: light;
}
/* kilau kaca tambahan khusus tema glassy */
[data-theme="glassy"] .card,
[data-theme="glassy"] .kpi { position: relative; overflow: hidden; }
[data-theme="glassy"] .card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 42%);
  mix-blend-mode: screen; opacity: .7;
}
[data-theme="glassy"] .card > * { position: relative; z-index: 1; }
[data-theme="glassy"] .card:hover { box-shadow: var(--shadow-hover); }
[data-theme="glassy"] .table-wrap table thead th { background: rgba(255, 255, 255, .55); }
[data-theme="glassy"] .btn-primary { box-shadow: 0 14px 30px -12px rgba(120, 130, 255, .75); }
[data-theme="glassy"] .sidebar .nav-item.active { box-shadow: 0 14px 28px -14px rgba(109, 139, 255, .85); }
[data-theme="glassy"] body::before {
  content: ''; position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: .55;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .65), transparent 70%) 18% 12%/46% 46% no-repeat,
              radial-gradient(closest-side, rgba(160, 210, 255, .5), transparent 70%) 82% 24%/42% 42% no-repeat;
  filter: blur(30px); animation: glassy-drift 26s ease-in-out infinite alternate;
}
@keyframes glassy-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(2%, -3%, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { [data-theme="glassy"] body::before { animation: none; } }

/* ============================================================
   KOMPONEN
   ============================================================ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--bg-image);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--em-dark); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
button { font-family: inherit; }

/* boot & login */
.boot-screen { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--muted); }
.boot-logo { width: 56px; height: 56px; border-radius: 18px; background: var(--em-grad-brand); color: #fff; font-size: 32px; font-weight: 700; display: grid; place-items: center; box-shadow: var(--shadow); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-hero { background: var(--hero-grad); color: #fff; padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero:after { content: ''; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -220px; border-radius: 50%; background: rgba(255,255,255,.09); }
.auth-hero:before { content: ''; position: absolute; width: 260px; height: 260px; right: 90px; top: -90px; border-radius: 50%; background: rgba(255,255,255,.07); }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.auth-brand .logo { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.auth-hero h1 { font-size: 34px; line-height: 1.2; max-width: 460px; margin-bottom: 14px; }
.auth-hero p { color: rgba(255,255,255,.78); max-width: 430px; line-height: 1.7; }
.auth-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.auth-feats span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); padding: 7px 13px; border-radius: 999px; font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 40px; background: var(--auth-panel); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 23px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-hint { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.7; background: var(--auth-hint-bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; }

/* layout */
#app-root { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--sidebar-bg); backdrop-filter: var(--sidebar-blur); border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--sidebar-border); display: flex; gap: 11px; align-items: center; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--em-grad-brand); color: #fff; display: grid; place-items: center; font-size: 23px; font-weight: 700; box-shadow: var(--brand-shadow); }
.brand .nm { font-weight: 700; font-size: 13px; letter-spacing: .02em; line-height: 1.25; color: var(--side-brand); }
.brand .sl { font-size: 11px; color: var(--side-muted); margin-top: 2px; }
.nav { overflow-y: auto; padding: 10px 10px 26px; flex: 1; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--side-dot); border-radius: 3px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--side-ink); cursor: pointer; font-size: 13px; transition: background .14s, color .14s; }
.nav-item:hover { background: var(--side-hover); color: var(--side-brand); }
.nav-item.active { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 620; box-shadow: inset 2px 0 0 var(--em); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--side-dot); flex: 0 0 6px; }
.nav-item.active .dot { background: var(--side-active-dot); box-shadow: 0 0 0 3px var(--em-ring); }
.nav-item .tag { margin-left: auto; font-size: 10px; background: var(--side-tag-bg); color: var(--side-tag-ink); border-radius: 5px; padding: 1px 5px; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--topbar-border); background: var(--topbar-bg); backdrop-filter: var(--topbar-blur); position: sticky; top: 0; z-index: 30; }
.crumb { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.shift-chip { display: flex; align-items: center; gap: 8px; background: var(--chip-bg); border: 1px solid var(--chip-border); border-radius: 999px; padding: 5px 12px; font-size: 11.5px; color: var(--ink-2); }
.shift-chip .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--em); box-shadow: 0 0 0 3px var(--em-ring); }
.user-btn { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; color: var(--ink); }
.user-btn:hover { border-color: var(--em); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--em-grad-brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.user-btn .nm { font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.user-btn .rl { font-size: 10.5px; color: var(--muted); }
.icon-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--btn-ghost-hover); }
.content { padding: 22px 24px 60px; flex: 1; min-width: 0; }

/* page */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 14px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--em-dark); border-bottom-color: var(--em); font-weight: 640; }

/* cards */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); backdrop-filter: var(--card-blur, none); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 18px; }

/* kpi */
.kpi { display: flex; gap: 13px; padding: 16px; align-items: flex-start; }
.kpi .ic { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 16px; flex: 0 0 38px; }
.kpi .lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.kpi .val { font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.kpi .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.tint-em { background: var(--em-soft); color: var(--em-dark); }
.tint-indigo { background: var(--indigo-soft); color: var(--indigo-ink); }
.tint-amber { background: var(--amber-soft); color: var(--amber-ink); }
.tint-red { background: var(--red-soft); color: var(--red-ink); }
.tint-blue { background: var(--blue-soft); color: var(--blue-ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--em-grad); color: #fff; box-shadow: 0 2px 6px var(--em-glow); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--btn-ghost-bg); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--btn-ghost-hover); border-color: var(--em); }
.btn-danger { background: var(--btn-ghost-bg); border-color: var(--red-soft); color: var(--red-ink); }
.btn-danger:hover { background: var(--red-soft); }
.btn-soft { background: var(--em-soft); color: var(--em-dark); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: calc(var(--radius-sm) - 2px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 11px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13px;
  background: var(--input-bg); color: var(--ink); font-family: inherit; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--em); box-shadow: 0 0 0 3px var(--em-ring); }
.input:disabled, .input[readonly] { background: var(--input-disabled); color: var(--ink-2); }
.textarea { min-height: 74px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.check input { width: 15px; height: 15px; accent-color: var(--em); }
.search { position: relative; }
.search .input { padding-left: 32px; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }

/* table */
.table-wrap { overflow: auto; max-width: 100%; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 12px; background: var(--table-head); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover td { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty .big { font-size: 26px; margin-bottom: 8px; opacity: .5; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.b-green { background: var(--em-soft); color: var(--em-dark); }
.b-gray { background: var(--gray-soft); color: var(--gray-ink); }
.b-amber { background: var(--amber-soft); color: var(--amber-ink); }
.b-red { background: var(--red-soft); color: var(--red-ink); }
.b-blue { background: var(--blue-soft); color: var(--blue-ink); }
.b-indigo { background: var(--indigo-soft); color: var(--indigo-ink); }
.link { color: var(--em-dark); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--card); color: var(--ink); border: 1px solid var(--card-border); border-radius: var(--radius-lg); width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1180px; }
.modal.narrow { max-width: 420px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 15px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--card-3); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* toast */
.toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--toast-bg); color: var(--toast-ink); padding: 11px 16px; border-radius: var(--radius-sm); font-size: 12.5px; box-shadow: var(--shadow); animation: pop .18s ease-out; max-width: 340px; }
.toast.error { background: #b42318; color: #fff; }
.toast.success { background: var(--em-dark); color: #fff; }

/* kasir */
.kasir { display: grid; grid-template-columns: minmax(0, 1.25fr) 400px; gap: 18px; align-items: start; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; padding: 16px; }
.prod-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; transition: .14s; background: var(--card); color: var(--ink); display: flex; flex-direction: column; gap: 6px; position: relative; }
.prod-card:hover { border-color: var(--em); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.prod-card .nm { font-size: 12.5px; font-weight: 600; line-height: 1.35; min-height: 34px; }
.prod-card .pr { font-weight: 680; color: var(--em-dark); font-size: 13.5px; }
.prod-card .st { font-size: 10.5px; color: var(--muted); display: flex; justify-content: space-between; }
.prod-card .pc-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.prod-card .pc-gol { font-size: 9.5px; background: var(--gray-soft); color: var(--gray-ink); border-radius: 5px; padding: 1px 6px; }
.prod-card .pc-rack { font-size: 9.5px; background: var(--blue-soft); color: var(--blue-ink); border-radius: 5px; padding: 1px 6px; }
.prod-card .pc-manuf { font-size: 10px; color: var(--muted); line-height: 1.3; }
.prod-card .pc-aturan { font-size: 10.5px; color: var(--em-dark); font-weight: 600; background: var(--em-soft-2); border-radius: 6px; padding: 3px 6px; line-height: 1.3; }
/* fungsi obat (nama Kategori-3) — tampil di atas aturan pakai */
.prod-card .pc-fungsi { font-size: 10.5px; font-weight: 700; color: var(--indigo-ink, var(--ink-2)); letter-spacing: .01em; line-height: 1.3;
  border-left: 3px solid var(--em); padding-left: 6px; }
.prod-card .pc-fungsi::before { content: 'Fungsi: '; font-weight: 500; color: var(--muted); }
/* produk stok habis: tidak bisa dijual */
.prod-card.out { cursor: not-allowed; opacity: .62; }
.prod-card.out:hover { transform: none; box-shadow: none; border-color: var(--line); }
.prod-card .pc-habis { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 800; letter-spacing: .06em;
  background: var(--red-soft, #fee2e2); color: var(--red-ink); border-radius: 999px; padding: 2px 8px; }
.cart-box { position: sticky; top: 82px; }
.cart-items { max-height: 330px; overflow-y: auto; }
.cart-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.cart-row .nm { font-size: 12.5px; font-weight: 600; }
.cart-row .sub { font-size: 11px; color: var(--muted); }
.qty-ctrl { display: flex; align-items: center; gap: 4px; }
.qty-ctrl button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; line-height: 1; color: var(--ink-2); }
.qty-ctrl button:hover { background: var(--em-soft); }
.qty-ctrl .q { min-width: 30px; text-align: center; font-size: 12px; font-weight: 600; }
.totals { padding: 14px 16px; background: var(--totals-bg); border-top: 1px solid var(--line); }
.totals .line { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 7px; color: var(--ink-2); }
.totals .line.total { font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pay-grid { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.pay-quick { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.pay-quick .btn { flex: 1 0 auto; min-width: 62px; font-variant-numeric: tabular-nums; }
.change-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--change-grad); border: 1px solid var(--change-border); }
.change-box .lbl { font-size: 12.5px; color: var(--change-ink); font-weight: 600; }
.change-box .val { font-size: 26px; font-weight: 800; color: var(--change-val); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }

/* ---------- charts: gaya lembut & elegan (garis halus, gradien, hover) ---------- */
.chart { width: 100%; height: auto; overflow: visible; display: block;
  font-variant-numeric: tabular-nums; }
.chart text { font-size: 10px; fill: var(--chart-label); letter-spacing: .01em; }
.chart .cgrid { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 3 6; opacity: .9; }
.chart .cval { font-size: 9px; font-weight: 700; fill: var(--ink-2); opacity: 0; transition: opacity .18s; }
.chart-line .carea { opacity: 0; animation: chart-fade .9s .15s ease forwards; }
.chart-line .cline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: chart-draw 1.15s cubic-bezier(.22, 1, .36, 1) forwards;
  filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--em) 22%, transparent)); }
.chart-line .clast { fill: var(--card); stroke-width: 2.6; opacity: 0; animation: chart-fade .5s .95s ease forwards; }
.chart-line .cpt-hit { fill: transparent; cursor: pointer; }
.chart-line .cpt-dot { fill: var(--card); stroke: var(--em); stroke-width: 2.2; opacity: 0;
  transition: opacity .18s, r .18s; }
.chart-line:hover .cpt-dot { opacity: 1; }
.chart-line .cpt:hover .cpt-dot { r: 5.2; stroke-width: 2.8; }
.chart-bars .cbar { animation: chart-bar-grow .7s cubic-bezier(.22, 1, .36, 1) backwards;
  transform-box: fill-box; transform-origin: bottom center; transition: opacity .16s; cursor: pointer; }
.chart-bars .cbar:hover { opacity: .78; }
.chart-bars .cbar-g:hover .cval { opacity: 1; }
.chart-bars g > text { transition: opacity .16s; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* donut bercelah dengan cincin SVG */
.donut-wrap { display: flex; align-items: center; gap: 24px; padding: 18px 18px 20px; flex-wrap: wrap; }
.cdonut { position: relative; width: 156px; height: 156px; flex: 0 0 156px; }
.cdonut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--ink) 10%, transparent)); }
.cdonut-track { stroke: var(--line-soft); }
.cdonut-seg { transition: stroke-width .18s, opacity .18s; animation: chart-fade .6s ease backwards; cursor: pointer; }
.cdonut-seg:hover { stroke-width: 21; }
.cdonut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); }
.donut-list { flex: 1; min-width: 210px; display: flex; flex-direction: column; gap: 7px; }
.donut-list .it { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0;
  border-bottom: 1px dashed var(--line-soft); }
.donut-list .it:last-child { border-bottom: 0; }
.donut-list .it i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.donut-list .dl-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-list .dl-pct { font-size: 10.5px; color: var(--muted); margin-left: auto; }
.donut-list .it .val { font-weight: 700; min-width: 78px; text-align: right; color: var(--ink); }

/* kartu grafik di dashboard & laporan */
.chart-card .chart-body { padding: 8px 16px 16px; }
.chart-card .card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chart-card .chart-note { font-size: 11px; color: var(--muted); padding: 0 16px 14px; }
.grid-2 .chart-card, .dash-widget .chart-card { height: 100%; }
/* peringkat batang horizontal */
.hbar { display: flex; flex-direction: column; gap: 11px; padding: 16px 18px 18px; }
.hbar-row { display: flex; flex-direction: column; gap: 5px; }
.hbar-top { display: flex; align-items: baseline; gap: 10px; font-size: 12px; }
.hbar-lb { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-vl { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 999px; transform-origin: left center;
  animation: chart-hbar 0.8s cubic-bezier(.22, 1, .36, 1) backwards; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
@keyframes chart-fade { to { opacity: 1; } }
@keyframes chart-bar-grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes chart-hbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .chart-line .cline, .chart-line .carea, .chart-line .clast, .chart-bars .cbar, .hbar-fill, .cdonut-seg {
    animation: none !important; opacity: 1; stroke-dashoffset: 0; }
}

/* misc */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .search { min-width: 220px; flex: 1; max-width: 340px; }
.toolbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-range { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.date-range .input { width: 138px; height: 34px; padding: 6px 9px; }
.list-line { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.list-line:last-child { border-bottom: 0; }
.list-line .val { margin-left: auto; font-weight: 650; }
.progress { height: 6px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 4px; background: var(--em-grad); }
.note { background: var(--note-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12px; color: var(--ink-2); line-height: 1.65; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--dash-line); font-size: 12.5px; }
.stat-line:last-child { border-bottom: 0; }
.stat-line .k { color: var(--ink-2); }
.stat-line .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-strip { display: flex; gap: 26px; padding: 14px 18px; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--summary-bg); }
.summary-strip .it .l { font-size: 11px; color: var(--muted); }
.summary-strip .it .v { font-size: 14px; font-weight: 680; }
.steps { display: flex; gap: 0; margin-bottom: 22px; }
.step { flex: 1; padding: 12px 16px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.step + .step { border-left: 0; }
.step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--line-soft); color: var(--ink-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.step.active { background: var(--em-soft); color: var(--em-dark); font-weight: 650; border-color: var(--em); }
.step.active .n { background: var(--em); color: #fff; }
.step.done { color: var(--em-dark); }

/* receipt preview (selalu kertas putih) */
.receipt { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #1b1b1b; background: #fff; width: 300px; margin: 0 auto; padding: 12px; line-height: 1.5; }
.receipt .c { text-align: center; }
.receipt .b { font-weight: 700; }
.receipt .hr { border-top: 1px dashed #999; margin: 7px 0; }
.receipt table { font-size: 11px; }
.receipt td { padding: 1px 0; border: 0; }
.etiket { border: 1.5px dashed var(--em); border-radius: 8px; padding: 9px 11px; width: 250px; font-size: 11px; line-height: 1.5; margin: 6px auto; }
.etiket .head { font-weight: 700; text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 5px; font-size: 11.5px; }
.etiket .nm { font-weight: 700; font-size: 12px; }

/* etiket obat (putih / biru) */
.etiket-card { border: 1px solid #333; border-radius: 4px; overflow: hidden; background: #fff; font-family: Arial, Helvetica, sans-serif; color: #111; }
.etiket-card.luar { background: #d6e9ff; border-color: #1e5fa8; }
.etiket-card .et-logo { text-align: center; padding-top: 5px; }
.etiket-card .et-logo img { height: 24px; object-fit: contain; }
.etiket-card .et-head { text-align: center; padding: 3px 6px 5px; border-bottom: 1px solid #333; }
.etiket-card.luar .et-head { background: #9ecbff; }
.etiket-card .et-apotek { font-weight: 700; font-size: 10.5px; letter-spacing: .02em; }
.etiket-card .et-addr { font-size: 8px; line-height: 1.3; }
.etiket-card .et-row { display: flex; justify-content: space-between; font-size: 8.5px; padding: 3px 6px; border-bottom: 1px solid #333; }
.etiket-card .et-body { padding: 12px 8px; text-align: center; }
.etiket-card .et-pasien { font-weight: 700; font-size: 10.5px; }
.etiket-card .et-aturan { font-size: 12px; font-weight: 700; margin-top: 8px; }
.etiket-card .et-jumlah { font-size: 8.5px; margin-top: 4px; color: #333; }
.etiket-card .et-foot { text-align: center; font-weight: 700; font-size: 9px; padding: 3px; border-top: 1px solid #333; background: #f1f5f9; }
.etiket-card.luar .et-foot { background: #9ecbff; }

/* ============================================================
   PEMILIH TEMA
   ============================================================ */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.theme-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; cursor: pointer; transition: .16s; text-align: left; padding: 0; }
.theme-card:hover { border-color: var(--em); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.theme-card.active { border-color: var(--em); box-shadow: 0 0 0 2px var(--em-ring); }
.theme-card .theme-meta { padding: 10px 12px 12px; display: flex; align-items: center; gap: 8px; }
.theme-card .theme-meta .tt { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.theme-card .theme-meta .ts { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.theme-card .theme-check { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--card); flex: 0 0 18px; }
.theme-card.active .theme-check { background: var(--em-grad); border-color: transparent; color: #fff; box-shadow: 0 2px 6px var(--em-glow); }
.theme-prev { height: 118px; display: flex; background: var(--bg); background-image: var(--bg-image); border-bottom: 1px solid var(--line); }
.theme-prev .tp-side { width: 62px; flex: 0 0 62px; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); padding: 8px 7px; display: flex; flex-direction: column; gap: 6px; }
.theme-prev .tp-side i { display: block; height: 7px; border-radius: 3px; background: var(--side-dot); opacity: .75; }
.theme-prev .tp-side i.on { background: var(--side-active-bg); height: 9px; opacity: 1; }
.theme-prev .tp-main { flex: 1; padding: 7px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-prev .tp-bar { height: 10px; border-radius: 4px; background: var(--topbar-bg); border: 1px solid var(--topbar-border); }
.theme-prev .tp-cards { display: flex; gap: 6px; }
.theme-prev .tp-card { flex: 1; height: 30px; border-radius: calc(var(--radius) / 2); background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow-sm); }
.theme-prev .tp-card .tp-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--em-soft); margin: 4px; }
.theme-prev .tp-btn { margin-top: auto; height: 16px; border-radius: 5px; background: var(--em-grad); width: 62%; }
.theme-prev .tp-badges { display: flex; gap: 4px; }
.theme-prev .tp-badges b { font-size: 6px; font-weight: 700; padding: 2px 4px; border-radius: 3px; background: var(--em-soft); color: var(--em-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .kasir { grid-template-columns: minmax(0, 1fr) 350px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  #app-root { display: block; }
  .content { padding: 16px 14px 60px; }
  .kasir, .grid-2, .grid-3, .grid-4, .split-2 { grid-template-columns: minmax(0, 1fr); }
  .cart-box { position: static; }
  .topbar { padding: 0 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-body { max-height: 76vh; }
  .menu-toggle { display: grid !important; }
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
.menu-toggle { display: none; }

/* ============================================================
   DESIGN SYSTEM v2 — token spacing, tipografi, glassmorphism
   Semua halaman memakai variabel di bawah ini agar konsisten.
   ============================================================ */
:root, [data-theme] {
  /* spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  /* typography scale */
  --fs-2xs: 10px; --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px;
  --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 22px; --fs-3xl: 28px;
  --fw-normal: 450; --fw-medium: 560; --fw-semibold: 620; --fw-bold: 700;
  /* permukaan kaca */
  --glass-bg: color-mix(in srgb, var(--card) 68%, transparent);
  --glass-bg-strong: color-mix(in srgb, var(--card) 86%, transparent);
  --glass-border: color-mix(in srgb, var(--line) 65%, transparent);
  --glass-highlight: rgba(255, 255, 255, .55);
  --glass-blur: blur(18px) saturate(170%);
  --glass-shadow: 0 14px 34px color-mix(in srgb, var(--ink) 9%, transparent), inset 0 1px 0 var(--glass-highlight);
  --glass-glow: 0 0 0 1px color-mix(in srgb, var(--em) 22%, transparent), 0 16px 38px color-mix(in srgb, var(--em) 14%, transparent);
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}
[data-theme="dark"] {
  --glass-highlight: rgba(255, 255, 255, .10);
  --glass-border: rgba(255, 255, 255, .10);
  --glass-bg: color-mix(in srgb, var(--card) 78%, transparent);
  --glass-bg-strong: color-mix(in srgb, var(--card) 92%, transparent);
  --glass-shadow: 0 16px 38px rgba(0, 0, 0, .5), inset 0 1px 0 var(--glass-highlight);
}
[data-theme="minimal"] {
  --glass-bg: var(--card);
  --glass-border: var(--line);
  --glass-highlight: transparent;
  --glass-blur: none;
  --glass-shadow: var(--shadow-sm);
}

/* ---------- permukaan kaca ---------- */
.card {
  background-color: var(--glass-bg);
  background-image: linear-gradient(180deg, var(--glass-highlight), transparent 58%);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
.card:hover { border-color: color-mix(in srgb, var(--em) 26%, var(--glass-border)); }
.card .card { background-color: var(--glass-bg-strong); }
.modal {
  background-color: var(--glass-bg-strong);
  background-image: linear-gradient(180deg, var(--glass-highlight), transparent 40%);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.user-btn, .icon-btn, .btn-ghost, .theme-card, .steps, .step { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.btn-ghost { background-color: var(--glass-bg); }
.table-wrap { background: transparent; }
thead th { background: color-mix(in srgb, var(--table-head) 88%, transparent); }

/* ---------- tipografi & spasi konsisten ---------- */
.page-head { margin-bottom: var(--sp-5); gap: var(--sp-4); }
.page-head h1 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.02em; }
.page-head .desc { font-size: var(--fs-sm); }
.card-head { padding: var(--sp-4) var(--sp-5); }
.card-head h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.card-pad { padding: var(--sp-5); }
.grid { gap: var(--sp-5); }
.stack { gap: var(--sp-5); }
.mt { margin-top: var(--sp-5); }
.toolbar { padding: var(--sp-3) var(--sp-5); gap: var(--sp-3); }
.small { font-size: var(--fs-xs); }

/* ---------- badge status ---------- */
.badge { gap: 6px; border: 1px solid transparent; letter-spacing: .01em; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; opacity: .9; }
.b-green { border-color: color-mix(in srgb, var(--em) 26%, transparent); }
.b-amber { border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.b-red   { border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.b-blue  { border-color: color-mix(in srgb, var(--blue) 28%, transparent); }
.b-indigo{ border-color: color-mix(in srgb, var(--indigo) 28%, transparent); }
.b-gray  { border-color: var(--line); }

/* ---------- skeleton loading (shimmer) ---------- */
.sk {
  background: linear-gradient(90deg, var(--line-soft) 25%, color-mix(in srgb, var(--card-2) 90%, var(--line-soft)) 37%, var(--line-soft) 63%);
  background-size: 400% 100%;
  animation: skShimmer 1.3s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-page { display: flex; flex-direction: column; gap: var(--sp-4); }
.sk-card { display: flex; gap: var(--sp-3); padding: var(--sp-4); align-items: flex-start; }
.sk-ic { width: 38px; height: 38px; border-radius: var(--radius-sm); flex: 0 0 38px; }
.sk-head { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.sk-row { display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line-soft); }

/* ---------- transisi halaman ---------- */
.page-anim { animation: pageIn .34s var(--ease-out) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .page-anim, .boot-logo, .sk { animation: none !important; }
}

/* ---------- boot screen (logo berdenyut) ---------- */
.boot-screen {
  background: var(--bg);
  background-image: var(--bg-image);
  color: var(--ink);
  gap: 18px;
}
.boot-screen .boot-logo {
  width: 74px; height: 74px; border-radius: 24px;
  background: var(--em-grad-brand); color: #fff; font-size: 38px; font-weight: 700;
  display: grid; place-items: center; box-shadow: var(--brand-shadow);
  animation: bootPulse 1.7s ease-in-out infinite;
}
.boot-screen .boot-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: .04em; text-transform: uppercase; }
.boot-screen .boot-sub { font-size: var(--fs-sm); color: var(--muted); }
.boot-screen .boot-bar { width: 168px; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.boot-screen .boot-bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--em-grad); animation: bootSlide 1.25s ease-in-out infinite; }
.boot-screen .boot-img { width: 74px; height: 74px; border-radius: 24px; object-fit: contain; background: #fff; padding: 6px; box-shadow: var(--brand-shadow); animation: bootPulse 1.7s ease-in-out infinite; }
@keyframes bootPulse {
  0%, 100% { transform: scale(1); box-shadow: var(--brand-shadow), 0 0 0 0 var(--em-glow); }
  50% { transform: scale(1.07); box-shadow: var(--brand-shadow), 0 0 0 16px transparent; }
}
@keyframes bootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }

/* ---------- sidebar: collapse / expand ---------- */
.sidebar { transition: width .26s var(--ease-out), flex-basis .26s var(--ease-out); }
.brand { gap: var(--sp-3); }
.brand-logo-img { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: 0 0 40px; }
.brand-tx { min-width: 0; overflow: hidden; }
.brand-tx .nm, .brand-tx .sl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .18s ease; }
.nav-ic { width: 22px; flex: 0 0 22px; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.nav-tx { white-space: nowrap; overflow: hidden; transition: opacity .16s ease; }
.nav-item { gap: 10px; }
.nav-item .dot { display: none; }
.sb-toggle {
  display: flex; align-items: center; gap: 9px; margin: 4px 10px 2px; padding: 9px 10px;
  border-radius: var(--radius-sm); border: 1px dashed var(--sidebar-border); background: transparent;
  color: var(--side-muted); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; transition: .15s;
}
.sb-toggle:hover { background: var(--side-hover); color: var(--side-brand); border-style: solid; }
.sb-foot { padding: 10px 16px 12px; font-size: var(--fs-2xs); color: var(--side-muted); border-top: 1px solid var(--sidebar-border); white-space: nowrap; overflow: hidden; }
body.sidebar-collapsed .sidebar { width: 78px; flex: 0 0 78px; }
body.sidebar-collapsed .brand { padding: 16px 10px; justify-content: center; }
body.sidebar-collapsed .brand-tx { opacity: 0; width: 0; }
body.sidebar-collapsed .nav { padding: 10px 8px 20px; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; }
body.sidebar-collapsed .nav-tx { display: none; }
body.sidebar-collapsed .nav-ic { width: auto; flex: 0 0 auto; font-size: 16px; }
body.sidebar-collapsed .nav-label { padding: 8px 0; margin: 8px 12px; font-size: 0; border-top: 1px solid var(--sidebar-border); }
body.sidebar-collapsed .sb-toggle { justify-content: center; padding: 9px 0; }
body.sidebar-collapsed .sb-foot { display: none; }
.nav-item.active .nav-ic { filter: drop-shadow(0 1px 2px var(--em-glow)); }

/* ---------- 3D tilt ---------- */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
  will-change: transform;
  transform-style: preserve-3d;
}
.tilt:hover { box-shadow: var(--glass-glow), var(--shadow-hover); border-color: color-mix(in srgb, var(--em) 38%, var(--glass-border)); }
.prod-card:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); }

/* ---------- parallax ---------- */
[data-parallax] { will-change: transform; }

/* ---------- export bar ---------- */
.export-bar { display: flex; gap: 6px; }
.export-bar .btn { height: 34px; }

/* ---------- KASIR: keranjang & pembayaran terpisah ---------- */
.kasir { display: grid; grid-template-columns: minmax(0, 1fr) 330px 344px; gap: var(--sp-4); align-items: start; }
.kasir-col { min-width: 0; }
.kasir-cart .panel, .kasir-pay .panel { position: sticky; top: 74px; }
.kasir-cart .cart-items { max-height: calc(100vh - 360px); min-height: 140px; }
.pay-panel .pay-grid { padding: var(--sp-3) var(--sp-4); gap: 9px; }
.pay-panel .card-head { padding: 13px var(--sp-4); }
.pay-panel .change-box { padding: 10px 12px; }
.pay-panel .change-box .val { font-size: 22px; }
.piutang-box {
  display: flex; flex-direction: column; gap: 9px;
  border: 1px solid var(--change-border); background: var(--change-grad);
  border-radius: var(--radius); padding: 12px;
}
.piutang-box.hidden { display: none; }
.piutang-sum .line { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); padding: 3px 0; color: var(--ink-2); }
.piutang-sum .line b { font-variant-numeric: tabular-nums; }
.piutang-sum .line.sisa { border-top: 1px dashed var(--change-border); margin-top: 4px; padding-top: 8px; color: var(--change-ink); font-weight: 600; }
.piutang-sum .line.sisa b { font-size: 16px; color: var(--change-val); }
.pc-ed { font-size: var(--fs-2xs); font-weight: 700; border-radius: 6px; padding: 2px 7px; display: inline-block; }
.pc-ed.ok { background: var(--em-soft); color: var(--em-dark); }
.pc-ed.soon { background: var(--amber-soft); color: var(--amber-ink); }
.pc-ed.expired { background: var(--red-soft); color: var(--red-ink); }
.pc-ed.none { background: var(--gray-soft); color: var(--gray-ink); }
.cart-ed { font-size: var(--fs-2xs); margin-top: 3px; }
.cart-ed.ok { color: var(--muted); }
.cart-ed.soon { color: var(--amber-ink); font-weight: 700; }
.cart-ed.expired { color: var(--red-ink); font-weight: 700; }
.cart-ed.none { color: var(--muted); opacity: .7; }
.draft-list { display: flex; flex-direction: column; gap: 10px; }
.draft-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--card-2); }
.prod-card { background-color: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }

/* ---------- PENERIMAAN BARANG: layout ringkas ---------- */
.rec-table td { padding: 8px 10px; vertical-align: top; }
.rec-sub { display: flex; gap: 6px; margin-top: 6px; }
.rec-sub label { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.rec-sub label span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; flex: 0 0 auto; }
.rec-sub .input { height: 28px; padding: 3px 6px; font-size: var(--fs-xs); min-width: 0; }
.rec-disc { display: flex; gap: 5px; align-items: center; }
.rec-disc .input { min-width: 0; }

/* ---------- DASHBOARD: hero parallax + grid widget ---------- */
.dash-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: 30px 32px; margin-bottom: var(--sp-4); color: #fff;
  background: var(--hero-grad); box-shadow: 0 20px 50px color-mix(in srgb, var(--ink) 22%, transparent);
  isolation: isolate;
}
.dh-layer { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; opacity: .55; }
.dh-layer-1 { width: 420px; height: 420px; right: -110px; top: -180px; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.4), transparent 65%); }
.dh-layer-2 { width: 320px; height: 320px; left: -90px; bottom: -180px; background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.28), transparent 68%); }
.dh-layer-3 { width: 180px; height: 180px; right: 22%; bottom: -90px; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.22), transparent 70%); }
.dh-inner { position: relative; z-index: 1; max-width: 720px; }
.dh-kicker { font-size: var(--fs-2xs); letter-spacing: .16em; text-transform: uppercase; opacity: .72; font-weight: 700; margin-bottom: 8px; }
.dh-inner h2 { font-size: var(--fs-3xl); line-height: 1.18; margin-bottom: 8px; color: #fff; }
.dh-inner p { color: rgba(255,255,255,.82); line-height: 1.65; max-width: 560px; font-size: var(--fs-sm); }
.dh-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 20px; }
.dh-stats .l { display: block; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .1em; opacity: .72; }
.dh-stats .v { display: block; font-size: var(--fs-xl); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; margin-top: 3px; }
.dh-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.dh-actions .btn-ghost { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.dh-actions .btn-ghost:hover { background: rgba(255,255,255,.26); }
.dh-actions .btn-primary { background: #fff; color: var(--em-dark); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.dash-hint { font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--sp-4); }
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-5); }
.dash-widget { position: relative; grid-column: span 1; min-width: 0; }
.dash-widget[data-span="2"] { grid-column: span 2; }
.dash-widget[data-span="3"] { grid-column: span 3; }
.dash-widget[data-span="4"] { grid-column: span 4; }
.dash-widget > .card { height: 100%; }
.dash-widget.dragging { opacity: .5; }
.dw-handle {
  position: absolute; top: 7px; right: 8px; z-index: 4; cursor: grab;
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; color: var(--muted); background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border); opacity: 0; transition: opacity .15s, color .15s;
}
.dash-widget:hover .dw-handle { opacity: 1; }
.dw-handle:hover { color: var(--em-dark); border-color: var(--em); }
.dw-handle:active { cursor: grabbing; }
.kpi .val { font-variant-numeric: tabular-nums; }

/* ---------- responsive penyesuaian v2 ---------- */
@media (max-width: 1360px) and (min-width: 901px) {
  .kasir { grid-template-columns: minmax(0, 1fr) 340px; }
  .kasir-pay { grid-column: 1 / -1; }
  .kasir-pay .panel { position: static; }
  .kasir-cart .cart-items { max-height: 420px; }
}
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-widget[data-span="3"], .dash-widget[data-span="4"] { grid-column: span 2; }
}
@media (max-width: 900px) {
  body.sidebar-collapsed .sidebar { width: 252px; flex: 0 0 252px; }
  body.sidebar-collapsed .nav-tx { display: revert; }
  body.sidebar-collapsed .brand-tx { opacity: 1; width: auto; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 8px 10px; }
  body.sidebar-collapsed .nav-label { border-top: 0; font-size: 10px; }
  .kasir { grid-template-columns: minmax(0, 1fr); }
  .kasir-pay { grid-column: auto; }
  .kasir-cart .panel, .kasir-pay .panel { position: static; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-widget, .dash-widget[data-span="2"], .dash-widget[data-span="3"], .dash-widget[data-span="4"] { grid-column: span 1; }
  .dh-inner h2 { font-size: var(--fs-2xl); }
  .dash-hero { padding: 22px 20px; }
}

/* ---------- login hero parallax orbs ---------- */
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .ah-orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.auth-hero .ah-orb-1 { width: 460px; height: 460px; right: -140px; bottom: -200px; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.16), transparent 62%); }
.auth-hero .ah-orb-2 { width: 300px; height: 300px; right: 70px; top: -110px; background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.12), transparent 65%); }
.auth-hero .ah-orb-3 { width: 180px; height: 180px; left: -50px; top: 42%; background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.1), transparent 68%); }

/* ============================================================
   Iterasi 7 — menu tebal, focus glow, transisi halaman,
   reveal scroll, pagination, widget dashboard, urgensi stok,
   pemilih produk, modul kesehatan.
   ============================================================ */

/* ---------- 1. menu sidebar: ikon besar, huruf kecil & tebal ---------- */
.sidebar .nav-item { font-size: 12.5px; font-weight: 600; letter-spacing: .01em; padding: 8px 10px; gap: 11px; }
.sidebar .nav-item .nav-tx { font-weight: 600; }
.sidebar .nav-item.active { font-weight: 700; }
.sidebar .nav-label { font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.sidebar .nav-ic { width: 24px; flex: 0 0 24px; font-size: 18px; }
.sidebar .nav-item .nav-ic { font-size: 18px; line-height: 1; }
body.sidebar-collapsed .sidebar .nav-item { font-size: 13px; }
body.sidebar-collapsed .sidebar .nav-ic { font-size: 19px; }

/* ---------- 2. efek glow/neon pada fokus ---------- */
.input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible,
.pg-btn:focus-visible, .pp-input:focus-visible {
  outline: none;
  border-color: var(--em);
  box-shadow: 0 0 0 2px var(--em-ring), 0 0 16px -2px var(--em-glow);
}
.btn-primary:focus-visible { box-shadow: 0 0 0 2px var(--em-ring), 0 0 22px -2px var(--em); }
.nav-item:focus-visible, .check input:focus-visible + span { outline: none; box-shadow: 0 0 0 2px var(--em-ring); }
.tab.active { box-shadow: 0 0 18px -6px var(--em-glow); }
.card:focus-within { border-color: var(--em-ring); }

/* ---------- 3. transisi halaman halus (fade + slide) ---------- */
.page-anim { animation: pageIn 0.38s cubic-bezier(.22,.68,0,1) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px) scale(.995); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}
.swap-in { animation: swapIn .3s cubic-bezier(.22,.68,0,1) both; }
@keyframes swapIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.swap-target { transition: opacity .2s ease, transform .2s ease; }

/* ---------- 4. reveal saat scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .55s cubic-bezier(.22,.68,0,1), transform .55s cubic-bezier(.22,.68,0,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal="left"] { transform: translateX(-24px); }
[data-reveal="right"] { transform: translateX(24px); }
[data-reveal="left"].in, [data-reveal="right"].in { transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ---------- 5. pagination custom ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.pg-info { font-size: var(--fs-xs); color: var(--muted); }
.pg-btns { display: flex; align-items: center; gap: 5px; }
.pg-btn { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .16s ease; }
.pg-btn:hover:not(:disabled) { border-color: var(--em); color: var(--em-dark); transform: translateY(-1px); }
.pg-btn.active { background: linear-gradient(135deg, var(--em), var(--em-dark)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px -4px var(--em-glow); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-dot { color: var(--muted); font-size: 12px; padding: 0 2px; }

/* ---------- 6. widget dashboard tambah/hapus ---------- */
.dw-remove { position: absolute; top: 8px; right: 40px; z-index: 6; width: 24px; height: 24px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer;
  opacity: 0; transition: all .16s ease; }
.dash-widget:hover .dw-remove { opacity: 1; }
.dw-remove:hover { color: var(--red-ink); border-color: var(--red-ink); box-shadow: 0 0 12px -3px var(--red-ink); }
.dw-out { animation: dwOut .22s ease both; }
@keyframes dwOut { to { opacity: 0; transform: scale(.96) translateY(-6px); } }
.widget-pick { padding: 8px 0; border-bottom: 1px dashed var(--line-soft); display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.widget-pick input { width: 15px; height: 15px; accent-color: var(--em); }
.dash-hint { background: var(--em-soft-2); border: 1px dashed var(--em-ring); border-radius: var(--radius-md); padding: 10px 14px; }

/* ---------- 7. status realtime & live number ---------- */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-left: 6px; transition: background .3s; }
.ws-online .live-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.22); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .65; } }
.live-flash { animation: liveFlash .7s ease; }
@keyframes liveFlash { 0% { color: var(--em); text-shadow: 0 0 12px var(--em-glow); } 100% { text-shadow: none; } }
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

/* ---------- 8. urgensi stok ---------- */
.stock-urgent { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.stock-urgent.low { background: rgba(239,68,68,.13); color: #b91c1c; box-shadow: 0 0 0 1px rgba(239,68,68,.28), 0 0 14px -4px rgba(239,68,68,.6); animation: urgentPulse 1.8s infinite; }
.stock-urgent.out { background: rgba(239,68,68,.2); color: #991b1b; box-shadow: 0 0 0 1px rgba(239,68,68,.4); }
.stock-urgent.warn { background: rgba(245,158,11,.14); color: #b45309; }
@keyframes urgentPulse { 0%,100% { box-shadow: 0 0 0 1px rgba(239,68,68,.28), 0 0 10px -4px rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 1px rgba(239,68,68,.5), 0 0 18px -2px rgba(239,68,68,.75); } }
.urgent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.urgent-row:last-of-type { border-bottom: 0; }
.urgent-nm { font-size: 12.5px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stat { background: var(--line-soft); border-radius: 10px; padding: 9px 11px; }
.mini-stat .l { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mini-stat .v { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.health-mini-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.hmb { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-2); padding: 4px 0; border-bottom: 1px dashed var(--line-soft); }
.hmb b { color: var(--ink); }

/* ---------- 9. analisis harga pembelian ---------- */
.aph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 12px 0 10px; flex-wrap: wrap; }
.aph-suppliers { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.aph-sup { flex: 0 0 auto; min-width: 150px; padding: 8px 10px; border-radius: 10px; background: var(--line-soft); border: 1px solid var(--line); }

/* ---------- 10. pemilih produk (type-ahead) ---------- */
.pp-host { position: relative; }
.pp-cell { position: relative; }
.pp-input { min-width: 190px; }
.pp-menu { position: fixed; top: 0; left: 0; min-width: 260px; max-height: 320px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(15,23,42,.45);
  z-index: 1200; padding: 4px; }
.pp-item { padding: 7px 9px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.pp-item:hover, .pp-item.active { background: var(--em-soft-2); }
.pp-name { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.pp-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.pp-hint { padding: 6px 9px; font-size: 10.5px; color: var(--muted); border-top: 1px dashed var(--line-soft); }
.pp-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 11. modul kesehatan ---------- */
.health-result-list { display: flex; flex-direction: column; gap: 7px; }
.hrl { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--line-soft); }
.hrl-k { font-size: 12px; color: var(--ink-2); }
.hrl-v { font-size: 13px; font-weight: 700; color: var(--ink); }
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-legend .lg { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .lg i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
svg.chart text { font-size: 9.5px; fill: var(--muted); }

/* ---------- 12. landing reveal ---------- */
.auth-hero .auth-brand, .auth-hero h1, .auth-hero p, .auth-hero .auth-feats { will-change: transform, opacity; }

/* ---------- 13. kasir: grid 9 kotak, pager, pilihan satuan, kembalian ---------- */
.kasir-prod .prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1180px) { .kasir-prod .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kasir-prod .prod-grid { grid-template-columns: minmax(0, 1fr); } }
.prod-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.pg-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 9px; padding: 7px 13px; font-size: 12px; font-weight: 600; cursor: pointer; transition: .14s; }
.pg-btn:hover:not(:disabled) { border-color: var(--em); color: var(--em-dark); background: var(--em-soft-2); }
.pg-btn:disabled { opacity: .42; cursor: not-allowed; }
.pg-info { font-size: 11.5px; color: var(--muted); }
.pu-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.pu-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 7px; padding: 3px 9px; font-size: 10.5px; font-weight: 650; cursor: pointer; transition: .14s; line-height: 1.5; }
.pu-btn:hover { border-color: var(--em); color: var(--em-dark); }
.pu-btn.on { background: var(--em); border-color: var(--em); color: #fff; box-shadow: 0 2px 8px -3px var(--em); }
.prod-card .pu-per { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.cart-row .unit-chip { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--em-soft-2); color: var(--em-dark); font-size: 10px; font-weight: 650; }
.cart-row .uconv { color: var(--muted); font-size: 10px; }
.change-box.short { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.change-box.short .lbl, .change-box.short .val { color: #b91c1c; }

/* ---------- 14. popover/dropdown harus solid (pencarian nama produk) ---------- */
:root, [data-theme="green"] { --surface: #ffffff; }
[data-theme="modern-pos"] { --surface: #ffffff; }
[data-theme="dark"] { --surface: #17223a; }
[data-theme="indigo"] { --surface: #ffffff; }
[data-theme="ocean"] { --surface: #ffffff; }
[data-theme="sunset"] { --surface: #ffffff; }
[data-theme="minimal"] { --surface: #ffffff; }
[data-theme="glassy"] { --surface: #ffffff; }
.pp-menu { background: var(--surface); background-color: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none;
  border-color: var(--line); box-shadow: 0 18px 40px -14px rgba(15, 23, 42, .38), 0 0 0 1px rgba(15, 23, 42, .04); }
.pp-item { background: transparent; }
.pp-item:hover, .pp-item.active { background: var(--em-soft-2); }
.pp-name { color: var(--ink); }
.pp-hint { background: var(--surface); }

/* ---------- 15. tombol ekspor per bagian laporan ---------- */
.row .export-bar { margin-left: auto; }
@media (max-width: 720px) { .row .export-bar { margin-left: 0; width: 100%; } .row .export-bar .btn { flex: 1; } }

/* ---------- 16. konversi satuan bertingkat (master produk) ---------- */
.uc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.uc-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .02em;
  padding: 8px 10px; background: var(--line-soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.uc-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.uc-table tr:last-child td { border-bottom: 0; }
.uc-table .select, .uc-table .input { height: 32px; font-size: 12.5px; }
.uc-table [data-uc-eq] { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--em-dark); white-space: nowrap; }
.uc-table td[colspan] .empty { padding: 16px; }
.uc-table td.small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
[data-uc-summary] { font-variant-numeric: tabular-nums; }

/* ---------- 17. logo golongan obat (kasir & filter) ---------- */
.drug-logo { display: inline-grid; place-items: center; width: var(--dl-size, 18px); height: var(--dl-size, 18px);
  border-radius: 50%; font-size: calc(var(--dl-size, 18px) * .48); font-weight: 800; line-height: 1;
  color: #fff; letter-spacing: -.02em; flex: 0 0 auto; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.dl-keras { background: #dc2626; }
.dl-bebas { background: #16a34a; }
.dl-terbatas { background: #2563eb; }
.dl-psiko { background: #ea580c; }
.dl-narkotika { background: #991b1b; }
.dl-jamu { background: #15803d; }
.dl-oht { background: #0d9488; }
.dl-fito { background: #0e7490; }
.dl-alkes { background: #475569; }
.dl-umum { background: #7c3aed; }
.dl-none { background: #94a3b8; }
.dl-all { background: var(--ink); }
.prod-card .pc-gol { display: inline-flex; align-items: center; gap: 5px; }
.gol-filter { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px 2px; border-top: 1px solid var(--line-soft); }
.gol-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 11px; font-weight: 650; cursor: pointer; transition: .14s; }
.gol-chip:hover { border-color: var(--em); color: var(--em-dark); }
.gol-chip.on { background: var(--em); border-color: var(--em); color: #fff; box-shadow: 0 2px 10px -4px var(--em); }
.gol-chip.on .drug-logo { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }

/* ---------- 18. baris filter (riwayat penjualan) ---------- */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 12px; padding: 14px 16px; }
.filter-bar .search, .filter-bar .input, .filter-bar .select { width: 100%; max-width: none; }
.filter-bar .btn { justify-self: start; }
@media (max-width: 640px) { .filter-bar { grid-template-columns: 1fr; } .filter-bar .search { grid-column: auto !important; } }

/* ---------- 19. filter segmented (transaksi) ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--line-soft); border-radius: 12px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 650; padding: 6px 12px;
  border-radius: 9px; cursor: pointer; transition: .14s; white-space: nowrap; }
.seg-btn:hover { color: var(--em-dark); }
.seg-btn.on { background: var(--card); color: var(--em-dark); box-shadow: 0 2px 8px -4px rgba(15,23,42,.28); }

/* ---------- 20. harga jual per satuan konversi (tab Harga) ---------- */
.unit-price-list { display: flex; flex-direction: column; gap: 8px; }
.unit-price-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-3); }
.unit-price-row .up-nm { font-size: 12px; font-weight: 650; flex: 1; min-width: 0; }
.unit-price-row .input { width: 130px; height: 32px; text-align: right; }

/* ---------- 21. pemilih template struk (pengaturan) ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 6px; }
.tpl-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; background: var(--card);
  display: flex; flex-direction: column; gap: 6px; transition: .14s; }
.tpl-card:hover { border-color: var(--em); }
.tpl-card.on { border-color: var(--em); box-shadow: 0 0 0 2px var(--em-ring); }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-thumb { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; min-height: 62px; }
.tpl-line { display: block; height: 3px; border-radius: 2px; background: #cbd5e1; }
.tpl-line.w70 { width: 70%; margin: 0 auto; background: #94a3b8; }
.tpl-line.w40 { width: 40%; margin: 0 auto 4px; background: #e2e8f0; }
.tpl-total { display: block; height: 8px; border-radius: 2px; background: #475569; margin-top: 4px; }
.tpl-nm { font-size: 12px; font-weight: 700; color: var(--ink); }
.tpl-desc { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.receipt .r { text-align: right; }
.receipt .small { font-size: 9.5px; }
.rcpt-preview { margin: 0 auto; padding: 10px; box-shadow: 0 8px 24px -14px rgba(15,23,42,.35); }
.change-box.ok { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.4); }
.change-box.ok .lbl, .change-box.ok .val { color: var(--em-dark); }

/* ---------- 22. foto profil karyawan ---------- */
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--line-soft); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.photo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-3); }
.photo-preview { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--em-grad-brand); color: #fff; font-size: 30px; flex: 0 0 auto; box-shadow: 0 6px 18px -10px rgba(15,23,42,.55); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview .ph-ic { opacity: .9; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pht-btn { position: relative; cursor: pointer; }
.emp-cell { display: flex; align-items: center; gap: 10px; }
.emp-cell .avatar { flex: 0 0 auto; }

/* ---------- 23. profil & jam aktif di hero dashboard (Ringkasan Apotek) ---------- */
.dh-user { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; margin: 6px 0 10px; }
.dh-ava { flex: 0 0 auto; }
.dh-ava .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.55), 0 10px 24px -12px rgba(0,0,0,.6); background: rgba(255,255,255,.22); }
.dh-user-main { min-width: 0; flex: 1 1 auto; }
/* nama selalu satu baris (tidak terpisah menjadi dua baris) */
.dh-user-main h2 { font-size: clamp(17px, 2.05vw, 28px); line-height: 1.15; margin-bottom: 6px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dh-user-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-xs); }
.dh-role { font-weight: 650; color: rgba(255,255,255,.85); }
.dh-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 11px; font-weight: 650; }
.dh-pill-on { background: rgba(255,255,255,.26); }
.dh-pill .pulse { width: 6px; height: 6px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110,231,183,.28); animation: pulse-dot 1.8s infinite; }
.dh-user-sub { margin-top: 5px; font-size: 11.5px; color: rgba(255,255,255,.72); }
/* jam aktif + smile: melayang di pojok kanan atas hero, bisa digeser (drag) */
/* latar dibuat sangat transparan agar menyatu dengan hero (tidak seperti kartu putih) */
.dh-clock { position: absolute; top: 18px; right: 22px; z-index: 4; display: flex; align-items: center; gap: 12px;
  padding: 6px 13px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  cursor: grab; touch-action: none; user-select: none; transition: background .18s, border-color .18s, box-shadow .18s; }
.dh-clock:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.26); box-shadow: 0 12px 26px -16px rgba(0,0,0,.45); }
.dh-clock.dragging { cursor: grabbing; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); box-shadow: 0 18px 36px -12px rgba(0,0,0,.55); }
.dh-clock .smile-ic, .dh-clock > div { pointer-events: none; }
.dh-grip { position: absolute; top: 2px; left: 7px; font-size: 10px; line-height: 1; color: rgba(255,255,255,.55); }
.dh-clock-l { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: rgba(255,255,255,.74); }
.dh-clock-v { font-size: 25px; font-weight: 800; letter-spacing: .02em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dh-clock-now { font-size: 10.5px; color: rgba(255,255,255,.72); margin-top: 2px; }
.dh-desc { color: rgba(255,255,255,.82); line-height: 1.65; max-width: 560px; font-size: var(--fs-sm); }
.dh-actions .dh-logout { background: rgba(248,113,113,.22); border-color: rgba(248,113,113,.45); }
.dh-actions .dh-logout:hover { background: rgba(248,113,113,.34); }
.sc-wave { display: inline-block; animation: sc-wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes sc-wave { 0%, 60%, 100% { transform: rotate(0deg); } 10% { transform: rotate(16deg); }
  20% { transform: rotate(-8deg); } 30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); } }
.smile-ic { width: 46px; height: 46px; flex: 0 0 auto; animation: sm-bob 2.6s ease-in-out infinite; }
.smile-ic .sm-face { fill: #fbbf24; stroke: #b45309; stroke-width: 2; }
.smile-ic .sm-eye { fill: #3f2a06; animation: sm-blink 4.2s infinite; transform-origin: center; }
.smile-ic .sm-mouth { stroke: #3f2a06; stroke-width: 3.4; }
.smile-ic .sm-blush { fill: #f97316; opacity: .45; }
@keyframes sm-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes sm-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@media (prefers-reduced-motion: reduce) {
  .smile-ic, .smile-ic .sm-eye, .sc-wave { animation: none; }
}
/* layar sedang/kecil: jam tidak melayang lagi (agar tidak menutupi nama), tetap tampil utuh */
@media (max-width: 1300px) {
  .dh-clock { position: static; margin: 0 0 12px; display: inline-flex; cursor: default; }
  .dh-grip { display: none; }
}
@media (max-width: 760px) {
  .dh-user { gap: 12px; }
  .dh-clock { width: 100%; justify-content: center; }
  .dh-actions .btn { flex: 1 1 auto; }
}

/* ---------- 24. editor satuan jual tambahan (dua arah) ---------- */
.uc-th-hint { font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .75; }
.uc-eq-cell { padding-top: 8px !important; padding-bottom: 8px !important; }
.uc-eq-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uc-eq-row .uc-num { width: 88px; height: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.uc-eq-row .uc-sel { width: 142px; height: 32px; font-size: 11.5px; padding: 4px 8px; text-overflow: ellipsis; }
.uc-eq-row .uc-base-label { font-size: 12px; font-weight: 650; color: var(--em-dark); padding: 0 6px; white-space: nowrap; }
.uc-eq-sign { font-weight: 800; color: var(--muted); }
.uc-recip { margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 14px; }
.uc-row-act { white-space: nowrap; text-align: center; }
.uc-row-act .btn { padding: 3px 8px; }
[data-uc-flip] { font-weight: 700; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }

/* ============================================================
   25. TAMPILAN HANDPHONE / MOBILE — layout menyesuaikan & nyaman disentuh
   ============================================================ */
.sb-scrim { display: none; }
.kasir-mbar { display: none; }

@media (max-width: 900px) {
  html, body { height: auto; min-height: 100%; }
  body { -webkit-text-size-adjust: 100%; font-size: 13.5px; }
  #app-root { display: block; min-height: 100vh; min-height: 100dvh; }
  .main-wrap { min-width: 0; }

  /* sidebar jadi laci geser + latar gelap yang bisa diketuk untuk menutup */
  .sidebar { width: min(86vw, 300px); flex: 0 0 auto; height: 100vh; height: 100dvh; position: fixed; top: 0; left: 0; z-index: 80; }
  body.sb-open { overflow: hidden; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .45);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }

  /* topbar ringkas: judul halaman saja + ikon */
  .topbar { height: 54px; padding: 0 10px; gap: 8px; }
  .crumb { min-width: 0; font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .crumb-grp { display: none; }
  .shift-chip { display: none; }
  .user-btn { padding: 5px 7px; gap: 0; }
  .user-btn > div { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .menu-toggle { display: grid !important; }

  /* konten & kepala halaman */
  .content { padding: 12px 10px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { gap: 10px; margin-bottom: 14px; }
  .page-head h1 { font-size: 19px; }
  .page-head .desc { font-size: 12px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn, .page-head .actions .export-bar { flex: 1 1 auto; }
  .tabs { margin-bottom: 14px; }
  .tab { padding: 9px 11px; font-size: 12.5px; }
  .card-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-pad { padding: 14px; }
  .grid { gap: 12px; }
  .stack { gap: 12px; }
  .mt { margin-top: 12px; }
  .kpi { padding: 13px; gap: 11px; }
  .kpi .val { font-size: 18px; }
  .kpi .ic { width: 34px; height: 34px; flex-basis: 34px; font-size: 15px; }

  /* formulir & filter */
  .toolbar { padding: 10px 12px; gap: 8px; }
  .toolbar .search, .toolbar .select, .toolbar .input { min-width: 0; width: 100%; max-width: none; flex: 1 1 100%; }
  .toolbar .right { width: 100%; margin-left: 0; justify-content: space-between; }
  .toolbar .right .select { flex: 1 1 auto; }
  .filter-bar { padding: 12px; }
  .date-range { width: 100%; }
  .date-range .input { flex: 1 1 0; width: auto; min-width: 0; height: 38px; }
  /* font 16px mencegah iOS memperbesar halaman otomatis saat input disentuh */
  .input, .select, .textarea { font-size: 16px; }
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; }
  .check { font-size: 12.5px; }

  /* tabel: tidak dipepetkan, digeser ke samping bila perlu */
  .table-wrap { -webkit-overflow-scrolling: touch; overflow-x: auto; }
  .table-wrap table { width: max-content; min-width: 100%; }
  thead th { padding: 9px 10px; }
  tbody td { padding: 9px 10px; }
  .summary-strip { flex-wrap: wrap; gap: 10px; }
  .summary-strip .it { min-width: 45%; flex: 1 1 45%; }

  /* modal jadi lembar penuh agar mudah dipakai di layar kecil */
  .modal-backdrop { padding: 0; align-items: flex-start; }
  .modal, .modal.wide, .modal.xwide, .modal.narrow { max-width: 100%; min-height: 100vh; min-height: 100dvh; border-radius: 0; margin: 0;
    display: flex; flex-direction: column; }
  .modal-head { position: sticky; top: 0; z-index: 3; padding: 13px 14px; background: var(--card); }
  .modal-body { max-height: none; padding: 14px; overflow-y: visible; flex: 1 1 auto; }
  .modal-foot { position: sticky; bottom: 0; z-index: 3; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    flex-wrap: wrap; justify-content: stretch; }
  .modal-foot .btn { flex: 1 1 auto; }
  .form-grid { gap: 10px; }
  .split-2 { gap: 12px; }
  .photo-field { gap: 12px; }

  /* dashboard */
  .dash-hero { padding: 18px 14px; }
  .dash-hero .dh-inner { padding: 0; }
  .dh-user { gap: 11px; }
  .dh-user-main h2 { font-size: 17px; }
  .dh-user-sub { font-size: 11px; }
  .dh-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dh-actions .btn { flex: 1 1 45%; }
  .dash-hint { font-size: 11.5px; padding: 12px; }
  .dash-grid { gap: 12px; }
  .dw-handle { opacity: 1; }

  /* kasir: bar total melayang di bawah */
  .kasir { gap: 12px; }
  .kasir-cart .cart-items { max-height: none; }
  .kasir-mbar { display: flex; position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 50; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 16px;
    background: var(--card); border: 1px solid var(--card-border); box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .6); }
  .kasir-mbar .mb-sum { flex: 1 1 auto; min-width: 0; }
  .kasir-mbar .mb-l { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
  .kasir-mbar .mb-v { font-size: 15.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .kasir-mbar .btn { min-height: 36px; white-space: nowrap; }
  .prod-card .pc-manuf, .prod-card .pc-fungsi { font-size: 10px; }
  .receipt, .rcpt-preview { max-width: 100%; }
}

@media (max-width: 760px) {
  .kasir-prod .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dh-clock { width: 100%; justify-content: center; }
  .dh-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 430px) {
  .kasir-prod .prod-grid { grid-template-columns: minmax(0, 1fr); }
  .dh-stats { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 18px; }
  .kpi .val { font-size: 17px; }
  .kasir-mbar .mb-l { display: none; }
  .dash-hero { padding: 16px 12px; }
  .dh-user-main h2 { font-size: 16px; }
}

/* ============================================================
   26. Kasir — biaya tambahan, satuan di keranjang, konsinyasi
   ============================================================ */
.fee-box { padding: 12px 16px 14px; border-top: 1px dashed var(--line); background: var(--totals-bg); }
.fee-box .fee-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fee-box .fee-title { font-size: 11.5px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase; color: var(--ink-2); }
.fee-box .fee-add { display: grid; grid-template-columns: minmax(0, 1fr) 96px 34px; gap: 6px; align-items: center; }
.fee-box .fee-add .select, .fee-box .fee-add .input { height: 32px; font-size: 11.5px; }
.fee-box .fee-add .btn { height: 32px; padding: 0; font-size: 15px; line-height: 1; }
.fee-box .fee-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fee-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 9px; border-radius: 999px;
  background: var(--em-soft-2); color: var(--em-dark); font-size: 10.5px; font-weight: 600; }
.fee-chip b { font-weight: 700; }
.fee-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 11px; line-height: 1; padding: 2px 3px; opacity: .7; }
.fee-chip button:hover { opacity: 1; }
.totals .fee-lines .line { margin-bottom: 5px; font-size: 11.5px; color: var(--ink-2); }
.cart-row .unit-sel { display: inline-block; width: auto; min-width: 74px; max-width: 130px; height: 26px;
  padding: 1px 6px; font-size: 11px; border-radius: 7px; margin-left: 2px; }
.prod-card .pc-kons { font-size: 9.5px; background: var(--amber-soft, #fdf3d7); color: var(--amber-ink, #8a6100);
  border-radius: 5px; padding: 1px 6px; font-weight: 700; }
.kons-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kons-card { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-3); }
.kons-card .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 700; }
.kons-card .v { font-size: 16px; font-weight: 750; margin-top: 4px; }
.kons-card .s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) {
  .fee-box .fee-add { grid-template-columns: minmax(0, 1fr) 84px 32px; }
}

/* Pemindai faktur supplier */
.scan-prev img { display: block; }
.scan-prev .empty { padding: 18px 10px; }
.scan-progress { margin-top: 10px; }
.scan-progress .bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.scan-progress .bar span { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, var(--em), var(--em-dark)); transition: width .2s ease; }
.scan-progress .small { margin-top: 5px; }
.scan-table td { vertical-align: top; }
.scan-table .pp-cell { min-width: 220px; }

/* ============================================================
   27. Pemindai barcode produk (kasir di handphone)
   ============================================================ */
.kasir-scan-fab { display: none; }
.scan-bc-cam { position: relative; border-radius: 14px; overflow: hidden; background: #0b1220;
  aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.scan-bc-cam video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0b1220; }
.scan-bc-frame { position: absolute; inset: 20% 8%; border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 12px; box-shadow: 0 0 0 9999px rgba(2, 6, 23, .32); pointer-events: none; }
.scan-bc-frame::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px;
  background: #5eead4; box-shadow: 0 0 12px 2px rgba(94, 234, 212, .85); animation: bc-scanline 1.9s ease-in-out infinite; }
@keyframes bc-scanline { 0%, 100% { transform: translateY(-34px); } 50% { transform: translateY(34px); } }
.scan-bc-hint { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 8px;
  background: rgba(2, 6, 23, .55); color: #fff; font-size: 11px; text-align: center; line-height: 1.4; }
.scan-bc-tools { flex-wrap: wrap; align-items: center; }
.scan-bc-cam video { cursor: crosshair; }
.scan-bc-zoom { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card-3); }
.scan-bc-zoom .lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.scan-bc-zoom input[type="range"] { flex: 1; min-width: 0; accent-color: var(--em); }
.scan-bc-zoom .val { font-size: 11.5px; font-weight: 700; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .scan-bc-frame::after { animation: none; } }
@media (max-width: 900px) {
  .kasir-scan-fab { display: grid; place-items: center; position: fixed; right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 55; width: 52px; height: 52px;
    border-radius: 50%; border: 0; cursor: pointer; font-size: 22px; line-height: 1;
    color: #fff; background: linear-gradient(135deg, var(--em), var(--em-dark));
    box-shadow: 0 16px 32px -12px rgba(15, 23, 42, .7); }
  .kasir-scan-fab:active { transform: scale(.94); }
}

/* ============================================================
   28. Logo struk — pratinjau 1-bit di Pengaturan Printer POS
   ============================================================ */
.pr-logo-prev { display: grid; place-items: center; gap: 6px; padding: 12px; margin-top: 10px;
  border: 1px dashed var(--line); border-radius: 12px; background: #fff; text-align: center; }
.pr-logo-prev img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.pr-logo-prev .small { color: var(--muted); }

/* ============================================================
   29. Pengadaan → Rencana: info PBF terakhir & detail harga
   ============================================================ */
.plan-chip { cursor: pointer; border: 0; font: inherit; }
.plan-chip:hover { filter: brightness(.96); }
.badge.b-blue.plan-chip { color: var(--blue-ink, #1d4ed8); }
.pi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.pi-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-3); }
.pi-card .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 700; }
.pi-card .v { font-size: 14px; font-weight: 700; margin-top: 4px; line-height: 1.35; }
.pi-card .s { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }
.plan-list { display: grid; gap: 8px; }
.plan-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-3); cursor: pointer; font: inherit; }
.plan-item:hover { border-color: var(--em); }
.plan-item .pi-nm { font-weight: 650; font-size: 12.5px; }
.plan-item .pi-qty { font-weight: 700; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.plan-item .pi-stok { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted); }

/* ============================================================
   30. Ikon apotek (favicon / fallback logo di boot, login, sidebar)
   ============================================================ */
.brand .logo.logo-ic,
.auth-brand .logo.logo-ic { padding: 0; overflow: hidden; background: transparent; }
.brand .logo.logo-ic img,
.auth-brand .logo.logo-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ============================================================
   31. Pengadaan → Pesanan dari Rencana (wizard 3 langkah)
   ============================================================ */
.po-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.po-step { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 650;
  color: var(--muted); padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-3); }
.po-step.on { color: #fff; background: var(--em-grad); border-color: transparent; box-shadow: var(--brand-shadow); }
.po-step.done { color: var(--em-dark); border-color: var(--em-ring); }
.po-step-n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; background: var(--line-soft); color: var(--ink-2); }
.po-step.on .po-step-n { background: rgba(255, 255, 255, .24); color: #fff; }
.po-step-line { flex: 1; min-width: 10px; height: 1px; background: var(--line); }
@media (max-width: 760px) {
  .po-step-line { display: none; }
  .po-step { font-size: 10.5px; padding: 5px 9px; }
}
