/* GFI ERP — tampilan mengikuti desain UI v0.7 (rail ikon, panel modul, strip tab, pagebar). */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --ground: #F1F5FC; --surface: #FFFFFF; --surface-2: #F8FAFF; --sunken: #EDF2FC;
  --line: #E3EAF7; --line-soft: #EEF3FB;
  --ink: #101A3D; --ink-2: #4A5875; --ink-3: #8492B0;
  --navy: #16225A; --navy-2: #22307A;
  --blue: #3565F0; --blue-2: #5B8BFF; --blue-soft: #E7EDFF;
  --teal: #1FC8C0; --teal-2: #59E0D6; --teal-soft: #DDF7F5;
  --violet: #8257F5; --violet-soft: #EFE8FF;
  --amber: #FFA51F; --amber-soft: #FFF1DC;
  --pink: #FF5C93; --pink-soft: #FFE6EE;
  --good: #11B981; --good-soft: #DCF6EC;
  --warn: #D98411; --warn-soft: #FDF0DA;
  --crit: #EF4B5A; --crit-soft: #FEE6E8;
  --sh-1: 0 1px 2px rgba(23,42,102,.05), 0 6px 18px -10px rgba(23,42,102,.16);
  --sh-2: 0 2px 6px rgba(23,42,102,.07), 0 16px 34px -18px rgba(23,42,102,.32);
  --sh-3: 0 6px 14px rgba(16,26,61,.12), 0 30px 60px -24px rgba(16,26,61,.5);
  --glow-blue: 0 8px 22px -8px rgba(53,101,240,.55);
  --r: 11px; --r-s: 8px; --r-l: 15px;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #080F22; --surface: #101A35; --surface-2: #15213F; --sunken: #0C1630;
    --line: #22304F; --line-soft: #1B2743;
    --ink: #EAF0FF; --ink-2: #A8B7D4; --ink-3: #7C8CAD;
    --navy: #1B2A63; --navy-2: #2B3B86;
    --blue: #5B8BFF; --blue-2: #7EA6FF; --blue-soft: #16264F;
    --teal: #35D8CE; --teal-soft: #0D3A39;
    --violet: #A184FF; --violet-soft: #241A4D;
    --amber: #FFB84D; --amber-soft: #3B2A0D;
    --pink: #FF7FAB; --pink-soft: #3D1626;
    --good: #34D399; --good-soft: #0C3629;
    --warn: #E9A53C; --warn-soft: #3A2A0C;
    --crit: #FF7078; --crit-soft: #3E1519;
    --sh-1: 0 1px 2px rgba(0,0,0,.45); --sh-2: 0 2px 8px rgba(0,0,0,.5), 0 18px 36px -18px rgba(0,0,0,.8);
    --sh-3: 0 6px 16px rgba(0,0,0,.55), 0 30px 60px -22px rgba(0,0,0,.85);
    --glow-blue: 0 8px 22px -8px rgba(91,139,255,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #080F22; --surface: #101A35; --surface-2: #15213F; --sunken: #0C1630;
  --line: #22304F; --line-soft: #1B2743;
  --ink: #EAF0FF; --ink-2: #A8B7D4; --ink-3: #7C8CAD;
  --navy: #1B2A63; --navy-2: #2B3B86;
  --blue: #5B8BFF; --blue-2: #7EA6FF; --blue-soft: #16264F;
  --teal: #35D8CE; --teal-soft: #0D3A39;
  --violet: #A184FF; --violet-soft: #241A4D;
  --amber: #FFB84D; --amber-soft: #3B2A0D;
  --pink: #FF7FAB; --pink-soft: #3D1626;
  --good: #34D399; --good-soft: #0C3629;
  --warn: #E9A53C; --warn-soft: #3A2A0C;
  --crit: #FF7078; --crit-soft: #3E1519;
  --sh-1: 0 1px 2px rgba(0,0,0,.45); --sh-2: 0 2px 8px rgba(0,0,0,.5), 0 18px 36px -18px rgba(0,0,0,.8);
  --sh-3: 0 6px 16px rgba(0,0,0,.55), 0 30px 60px -22px rgba(0,0,0,.85);
  --glow-blue: 0 8px 22px -8px rgba(91,139,255,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 12.2px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; flex: none; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 5px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.boot { padding: 40px; text-align: center; color: var(--ink-3); font-family: var(--sans); }

/* ============ kerangka: rail ikon + panel + konten ============ */
.app { display: grid; grid-template-columns: 64px minmax(0, 1fr); min-height: 100vh; }
.rail { grid-column: 1; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 0 13px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; z-index: 45; }
.rail::-webkit-scrollbar { display: none; }
.logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(140deg, var(--blue), var(--violet)); color: #fff; display: grid; place-items: center; font-family: var(--sans); font-weight: 800; font-size: 12.2px; letter-spacing: -.03em; box-shadow: var(--glow-blue); flex: none; margin-bottom: 6px; text-decoration: none; }
.rail-sep { width: 22px; height: 1px; background: var(--line); margin: 5px 0; flex: none; }
.railbtn { position: relative; width: 42px; height: 38px; border: 0; background: none; border-radius: 11px; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; flex: none; transition: background .16s, color .16s; }
.railbtn:hover { background: var(--sunken); color: var(--ink); }
.railbtn.on { color: #fff; background: linear-gradient(145deg, var(--blue), var(--blue-2)); box-shadow: var(--glow-blue); }
.railbtn .badge-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 0 2px var(--surface); }
.rail .spacer { flex: 1; }
.railbtn[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 50px; top: 50%; transform: translateY(-50%); background: var(--ink); color: var(--surface); font-family: var(--sans); font-weight: 600; font-size: 10.6px; padding: 4px 8px; border-radius: 7px; white-space: nowrap; pointer-events: none; z-index: 80; }

.panel-scrim { position: fixed; inset: 0; z-index: 54; display: none; }
.app.panel-on .panel-scrim { display: block; }
.panel { position: fixed; left: 70px; top: 8px; width: 254px; max-height: calc(100vh - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-3); display: flex; flex-direction: column; overflow: hidden; z-index: 55; opacity: 0; transform: translateX(-10px) scale(.985); pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.app.panel-on .panel { opacity: 1; transform: none; pointer-events: auto; }
.panel-head { padding: 14px 13px 11px; border-bottom: 1px solid var(--line-soft); }
.panel-badge { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: #fff; margin-bottom: 8px; }
.panel-head h2 { font-family: var(--sans); font-size: 13.1px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.panel-head p { font-size: 10.4px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.panel-list { flex: 1; overflow-y: auto; padding: 8px 8px 16px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.panel-kicker { font-family: var(--sans); font-size: 9.6px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 8px 7px 5px; }
.sub { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink-2); padding: 7px 9px; border-radius: 9px; font-size: 11.3px; text-decoration: none; transition: background .15s, color .15s; }
.sub:hover { background: var(--sunken); color: var(--ink); }
.sub .idx { width: 18px; height: 18px; border-radius: 6px; background: var(--sunken); color: var(--ink-3); display: grid; place-items: center; font-family: var(--mono); font-size: 9.6px; flex: none; }
.sub.active { background: var(--blue); color: #fff; font-weight: 500; box-shadow: var(--glow-blue); }
.sub.active .idx { background: rgba(255,255,255,.22); color: #fff; }
.sub-tag { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.panel-foot { border-top: 1px solid var(--line-soft); padding: 9px; }

.main { grid-column: 2; min-width: 0; display: flex; flex-direction: column; }

/* ============ strip tab ala peramban ============ */
.tabstrip { display: flex; align-items: flex-end; gap: 2px; padding: 5px clamp(8px, 1.2vw, 14px) 0; background: var(--ground); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 31; min-height: 39px; }
.tabscroll { display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
.tabscroll::-webkit-scrollbar { display: none; }
.tabx { display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; background: transparent; color: var(--ink-3); cursor: pointer; max-width: 184px; min-width: 0; flex: 0 1 auto; position: relative; margin-bottom: -1px; text-decoration: none; transition: background .14s, color .14s; }
.tabx:hover { background: color-mix(in srgb, var(--surface) 62%, transparent); color: var(--ink-2); }
.tabx.on { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 -2px 8px -4px rgba(23,42,102,.22); }
.tabx .tdot { width: 15px; height: 15px; border-radius: 5px; display: grid; place-items: center; color: #fff; flex: none; }
.tabx .tlab { font-family: var(--sans); font-weight: 600; font-size: 11.4px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tabx .tx { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; flex: none; opacity: 0; color: var(--ink-3); font-size: 13px; line-height: 1; border: 0; background: none; cursor: pointer; padding: 0; }
.tabx:hover .tx, .tabx.on .tx { opacity: 1; }
.tabx .tx:hover { background: var(--sunken); color: var(--crit); }
.tabtools { display: flex; align-items: center; gap: 6px; padding-bottom: 5px; padding-left: 10px; flex: none; margin-left: auto; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-family: var(--sans); font-weight: 600; font-size: 10.8px; color: var(--ink-2); cursor: pointer; box-shadow: var(--sh-1); white-space: nowrap; }
.chipbtn:hover { border-color: var(--blue); color: var(--blue); }
.avatar { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px 3px 3px; box-shadow: var(--sh-1); cursor: pointer; }
.avatar:hover { border-color: var(--blue); }
.avatar .face { width: 23px; height: 23px; border-radius: 50%; background: linear-gradient(140deg, var(--violet), var(--pink)); color: #fff; display: grid; place-items: center; font-family: var(--sans); font-weight: 700; font-size: 10.4px; flex: none; }
.avatar b { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; white-space: nowrap; display: block; text-align: left; }
.avatar small { font-size: 9.6px; color: var(--ink-3); display: block; text-align: left; }
.hamburger { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 5px; cursor: pointer; color: var(--ink-2); box-shadow: var(--sh-1); align-self: center; margin: 0 6px 4px 0; }
.menu-pop { position: fixed; z-index: 70; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; display: flex; flex-direction: column; }
.menu-pop .who { padding: 8px 10px 9px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-pop .who b { font-family: var(--sans); font-size: 12px; display: block; }
.menu-pop .who small { color: var(--ink-3); }

/* ============ pagebar ============ */
.pagebar { position: sticky; top: 39px; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 6px clamp(11px, 1.4vw, 17px); overflow: hidden; min-height: 40px; }
.pb-ic { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.pb-crumb { font-family: var(--sans); font-size: 9.2px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); line-height: 1.2; }
.pb-title { font-family: var(--sans); font-size: 13.6px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; }
.pb-desc { font-size: 11.4px; color: var(--ink-3); border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px; max-width: 48ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.searchbar { display: flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; width: 188px; color: var(--ink-3); position: relative; }
.searchbar:focus-within { border-color: var(--blue); background: var(--surface); }
.searchbar input { border: 0; background: none; outline: none; width: 100%; font-size: 11.3px; min-width: 0; }
.search-pop { position: absolute; top: calc(100% + 6px); right: 0; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; z-index: 70; display: flex; flex-direction: column; gap: 2px; }

/* ============ atom ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 11px; border-radius: 9px; font-family: var(--sans); font-weight: 600; font-size: 11px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary { background: linear-gradient(140deg, var(--blue), var(--blue-2)); border-color: transparent; color: #fff; box-shadow: var(--glow-blue); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); color: #fff; border-color: transparent; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover:not(:disabled) { color: #fff; filter: brightness(1.18); }
.btn-teal { background: linear-gradient(140deg, var(--teal), var(--teal-2)); border-color: transparent; color: #06312F; }
.btn-teal:hover:not(:disabled) { color: #06312F; filter: brightness(1.05); }
.btn-danger { color: var(--crit); }
.btn-danger:hover:not(:disabled) { background: var(--crit-soft); border-color: var(--crit); color: var(--crit); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--sunken); color: var(--ink); border-color: transparent; }
.btn-link { border: 0; background: none; color: var(--blue); padding: 3px 0; font-weight: 600; }
.btn-link:hover:not(:disabled) { text-decoration: underline; }
.btn-sm { padding: 5px 9px; font-size: 10.4px; }
.btn-block { width: 100%; padding: 9px 12px; font-size: 11.6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-family: var(--sans); font-weight: 600; font-size: 9.9px; border: 1px solid transparent; white-space: nowrap; }
.pill-idle { background: var(--sunken); color: var(--ink-2); }
.pill-info { background: var(--blue-soft); color: var(--blue); }
.pill-teal { background: var(--teal-soft); color: var(--teal); }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-crit { background: var(--crit-soft); color: var(--crit); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.eyebrow { font-family: var(--sans); font-size: 9.6px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--blue); }
.mono { font-family: var(--mono); font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); min-width: 0; }
.muted { color: var(--ink-3); }
.good { color: var(--good); }
.crit { color: var(--crit); }
.note { font-size: 10.6px; color: var(--ink-3); line-height: 1.6; }
kbd { font-family: var(--mono); font-size: 9.6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface-2); color: var(--ink-2); }
code { font-family: var(--mono); font-size: 10.8px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 10.7px; color: var(--ink-2); user-select: none; font-family: var(--sans); font-weight: 600; position: relative; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.track { width: 36px; height: 20px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); position: relative; transition: background .16s; flex: none; }
.track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: var(--sh-1); transition: transform .16s; }
.switch input:checked + .track { background: linear-gradient(140deg, var(--teal), var(--teal-2)); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ============ konten ============ */
.page { padding: 12px clamp(11px, 1.4vw, 17px) 44px; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding: 2px 0; }
.page-head h1 { font-family: var(--sans); font-size: clamp(18.3px, 2.09vw, 23.5px); font-weight: 800; letter-spacing: -.032em; }
.page-head p { color: var(--ink-2); font-size: 11.5px; max-width: 70ch; margin-top: 5px; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { border-radius: var(--r-l); padding: 14px 15px; display: flex; align-items: center; gap: 12px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--sh-2); }
.kpi::after { content: ""; position: absolute; right: -34px; top: -42px; width: 124px; height: 124px; border-radius: 50%; background: rgba(255,255,255,.09); }
.kpi-a { background: linear-gradient(135deg, #16225A, #2B3B86); }
.kpi-b { background: linear-gradient(135deg, #3565F0, #6C95FF); }
.kpi-c { background: linear-gradient(135deg, #1FC8C0, #57DED2); color: #06312F; }
.kpi-d { background: linear-gradient(135deg, #8257F5, #B39BFF); }
.kpi-ic { width: 40px; height: 40px; border-radius: 13px; background: rgba(255,255,255,.17); display: grid; place-items: center; flex: none; position: relative; z-index: 1; }
.kpi-c .kpi-ic { background: rgba(6,49,47,.13); }
.kpi-txt { position: relative; z-index: 1; min-width: 0; }
.kpi-val { font-family: var(--sans); font-weight: 800; font-size: clamp(17.4px, 1.83vw, 22.6px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-lab { font-size: 10.6px; opacity: .82; margin-top: 3px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px; align-items: start; }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 9px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--sans); font-size: 12.5px; font-weight: 700; letter-spacing: -.02em; }
.sec-head .right { margin-left: auto; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.sec-body { padding: 0 14px 14px; }
.stat-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.1px; }
.stat-line:last-child { border-bottom: 0; }
.stat-line span { color: var(--ink-3); }
.stat-line b { font-family: var(--sans); font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.toolbar { display: flex; align-items: center; gap: 7px; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line-soft); }
.search { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 12px; flex: 1 1 190px; max-width: 330px; color: var(--ink-3); }
.search input { border: 0; background: none; outline: none; width: 100%; font-size: 11.2px; }
select.sel { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font-family: var(--sans); font-weight: 600; font-size: 10.8px; color: var(--ink-2); cursor: pointer; }

.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-family: var(--sans); font-size: 9.6px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); font-size: 11.2px; color: var(--ink-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .strong { color: var(--ink); font-weight: 500; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .btn + .btn { margin-left: 4px; }
.who-cell { display: flex; align-items: center; gap: 9px; }
.who-face { width: 23px; height: 23px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-family: var(--sans); font-weight: 700; font-size: 9.6px; flex: none; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 30px 20px; text-align: center; }
.empty-ic { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(140deg, var(--blue-soft), var(--violet-soft)); color: var(--blue); display: grid; place-items: center; }
.empty h3 { font-family: var(--sans); font-size: 12.2px; font-weight: 700; letter-spacing: -.015em; }
.empty p { font-size: 11px; color: var(--ink-3); max-width: 50ch; }
.empty .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 3px; }
td.empty-cell { text-align: center; color: var(--ink-3); padding: 22px 12px; }

.flow { display: flex; align-items: center; flex-wrap: wrap; padding: 8px 11px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.step { display: flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.step i { width: 17px; height: 17px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-style: normal; font-size: 9.6px; font-weight: 700; }
.step.on { background: linear-gradient(140deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: var(--glow-blue); }
.step.on i { background: rgba(255,255,255,.25); }
.step.done { color: var(--good); }
.flow .sep { color: var(--ink-3); opacity: .55; padding: 0 1px; }

.tabs { display: flex; gap: 3px; padding: 3px; background: var(--sunken); border-radius: 999px; overflow-x: auto; scrollbar-width: none; align-self: flex-start; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-family: var(--sans); font-weight: 600; font-size: 10.8px; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--surface); color: var(--blue); box-shadow: var(--sh-1); }

.list { display: flex; flex-direction: column; gap: 7px; }
.row-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface-2); }
.row-item .rit { width: 27px; height: 27px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.row-item b { font-family: var(--sans); font-size: 11.2px; font-weight: 700; letter-spacing: -.015em; display: block; }
.row-item p { font-size: 10.6px; color: var(--ink-3); margin-top: 2px; }
.row-item .tail { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 10px; font-size: 10.3px; color: var(--ink-2); cursor: pointer; font-family: var(--sans); font-weight: 500; text-align: left; }
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* ============ form ============ */
.form { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.form-field { display: grid; gap: 5px; min-width: 0; }
.form-field > label { font-family: var(--sans); font-weight: 600; font-size: 10.8px; color: var(--ink-2); }
.form-field .hint { font-size: 10.2px; color: var(--ink-3); }
.input { width: 100%; min-height: 34px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--ink); font-size: 11.8px; outline: none; }
.input:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: 11px; min-height: 280px; }
select.input { cursor: pointer; }
.alert { background: var(--crit-soft); color: var(--crit); padding: 8px 11px; border-radius: 9px; font-size: 11px; }
.alert.info { background: var(--blue-soft); color: var(--blue); }
.check { display: flex; gap: 8px; align-items: center; font-family: var(--sans); font-weight: 600; font-size: 11px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--blue); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ============ halaman login ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { background: linear-gradient(150deg, #16225A 0%, #2B3B86 55%, #3565F0 100%); color: #fff; padding: clamp(24px, 5vw, 56px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.07); }
.auth-hero .logo { width: 44px; height: 44px; font-size: 14px; }
.auth-hero h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.1; max-width: 14ch; }
.auth-hero p { opacity: .8; font-size: 12.5px; max-width: 42ch; margin-top: 12px; }
.auth-hero small { opacity: .6; font-size: 10.6px; position: relative; z-index: 1; }
.auth-side { display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(380px, 100%); padding: 26px; }
.auth-card h2 { font-family: var(--sans); font-size: 19px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 4px; }
.auth-card .lead { color: var(--ink-3); font-size: 11.5px; margin-bottom: 18px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.codes { margin: 0; padding: 12px 12px 12px 34px; background: var(--sunken); border-radius: 10px; columns: 2; column-gap: 22px; }
.codes li { padding: 3px 0; }
.codes code { font-size: 12.5px; font-weight: 500; letter-spacing: .05em; }

/* ============ dialog, toast, drawer ============ */
.dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
.dialog.wide { width: min(880px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(9,18,45,.45); }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog-head h2 { font-family: var(--sans); font-size: 13.5px; font-weight: 800; letter-spacing: -.02em; }
.dialog-head .btn { margin-left: auto; }
.dialog-body { padding: 16px; }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 90; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 9px 15px; border-radius: 11px; background: var(--ink); color: var(--surface); font-family: var(--sans); font-weight: 600; font-size: 11.3px; box-shadow: var(--sh-3); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.drawer-scrim { position: fixed; inset: 0; background: rgba(9,18,45,.45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--sh-3); z-index: 61; display: flex; flex-direction: column; transform: translateX(101%); transition: transform .24s cubic-bezier(.4,0,.2,1), width .2s; }
.drawer.on { transform: none; }
.drawer.wide { width: min(880px, 100vw); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.drawer-head .title b { font-family: var(--sans); font-weight: 800; font-size: 11.8px; letter-spacing: -.02em; display: block; }
.drawer-head .title small { font-size: 9.8px; color: var(--ink-3); }
.agent-mark { width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(140deg, var(--violet), var(--pink)); color: #fff; display: grid; place-items: center; flex: none; }
/* ============ chat Hermes: giliran, aktivitas menyatu, jawaban ter-render ============ */
.chat-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; }
.turn { display: flex; gap: 9px; min-width: 0; }
.turn.user { flex-direction: column; align-items: flex-end; gap: 4px; }
.turn.user .turn-text { background: var(--blue-soft); border-radius: 14px 14px 4px 14px; padding: 9px 12px; font-size: 11.4px; line-height: 1.55; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn-meta { display: flex; gap: 5px; }
.turn .tag { font-size: 9.2px; color: var(--ink-3); background: var(--sunken); border-radius: 6px; padding: 1px 6px; display: inline-flex; align-items: center; gap: 3px; }
.turn .tag.wa { color: var(--good); background: var(--good-soft); }
.turn.system { justify-content: center; font-size: 10.4px; color: var(--warn); background: var(--amber-soft); border-radius: 10px; padding: 7px 11px; }
.turn-mark { width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--violet), var(--pink)); }
.turn-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.turn-answer { font-size: 11.6px; line-height: 1.62; color: var(--ink); min-width: 0; }
.turn-tools { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.turn.agent:hover .turn-tools, .turn-tools:focus-within { opacity: 1; }
.thinking::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); margin-left: 6px; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 9.6px; }
.chat-divider::before, .chat-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.chat-props { display: flex; flex-direction: column; gap: 8px; }

/* aktivitas (langkah tool) — satu baris, dapat dibuka */
.act { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.act-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 6px 9px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: 10.4px; text-align: left; }
.act-head:hover { background: var(--sunken); }
.act-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.act-dot.live { animation: pulse 1s ease-in-out infinite; }
.act-title { font-family: var(--mono); font-size: 10.2px; color: var(--ink); white-space: nowrap; }
.act-sub { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.act-chev { display: grid; place-items: center; color: var(--ink-3); flex: none; }
.act-body { border-top: 1px solid var(--line-soft); max-height: 320px; overflow-y: auto; }
.act-step { display: flex; gap: 9px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.act-step:last-child { border-bottom: 0; }
.act-time { font-family: var(--mono); font-size: 9.4px; color: var(--ink-3); flex: none; padding-top: 2px; }
.act-step-body { min-width: 0; }
.act-step-body b { font-family: var(--mono); font-size: 10.4px; font-weight: 500; }
.act-step-body pre { font-family: var(--mono); font-size: 9.9px; color: var(--ink-2); background: var(--sunken); border-radius: 8px; padding: 7px 9px; margin: 5px 0 0; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

/* markdown jawaban */
.md-p { margin: 0 0 8px; overflow-wrap: anywhere; }
.turn-answer > :last-child { margin-bottom: 0; }
.md-h { font-family: var(--sans); font-weight: 800; letter-spacing: -.02em; margin: 12px 0 6px; font-size: 12.4px; }
.turn-answer > .md-h:first-child { margin-top: 0; }
.md-list { margin: 0 0 8px; padding-left: 18px; }
.md-list li { margin: 2px 0; }
.md-quote { margin: 0 0 8px; padding: 2px 0 2px 10px; border-left: 3px solid var(--line); color: var(--ink-2); }
.md-hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.turn-answer strong { font-weight: 700; color: var(--ink); }
.turn-answer em { font-style: italic; }
.turn-answer del { color: var(--ink-3); }
.turn-answer code { font-family: var(--mono); font-size: 10.4px; background: var(--sunken); border-radius: 5px; padding: 1px 5px; }
.turn-answer a { color: var(--blue); text-decoration: underline; overflow-wrap: anywhere; }
.md-code { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0 0 8px; background: var(--sunken); }
.md-code-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 4px 3px 10px; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 9.6px; color: var(--ink-3); }
.md-code pre { margin: 0; padding: 9px 11px; overflow-x: auto; }
.md-code code { background: none; padding: 0; font-size: 10.2px; line-height: 1.5; }
.md-table { overflow-x: auto; margin: 0 0 8px; }
.md-table table { border-collapse: collapse; font-size: 10.8px; width: 100%; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.md-table th { background: var(--surface-2); font-family: var(--sans); font-weight: 700; }

/* kartu usulan & konfirmasi */
.prop-card { border: 1px solid var(--line); border-left: 3px solid var(--violet); border-radius: 12px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.prop-card.confirm { border-left-color: var(--warn); background: var(--amber-soft); }
.prop-head { display: flex; gap: 9px; align-items: flex-start; }
.prop-head b { font-family: var(--sans); font-size: 11px; font-weight: 700; display: block; }
.prop-head p { font-size: 9.8px; color: var(--ink-3); margin: 2px 0 0; }
.prop-ic { width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--violet), var(--pink)); }
.prop-card.confirm .prop-ic { background: linear-gradient(140deg, var(--amber), var(--pink)); }
.prop-pre { font-family: var(--mono); font-size: 9.8px; background: var(--sunken); border-radius: 8px; padding: 8px 10px; margin: 0; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.prop-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prop-acts .note { margin-right: auto; }
.btn-warn { background: linear-gradient(140deg, var(--amber), var(--pink)); border-color: transparent; color: #fff; }
.btn-warn:hover:not(:disabled) { filter: brightness(1.06); color: #fff; border-color: transparent; }

/* pengetik */
.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 10px 12px; resize: none; outline: none; font-size: 11.4px; min-height: 40px; max-height: 220px; line-height: 1.5; overflow-y: auto; }
.composer textarea:focus { border-color: var(--blue); background: var(--surface); }
.composer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-timer { font-family: var(--mono); font-size: 9.8px; color: var(--ink-3); }

/* ============ khusus ERP ============ */
.qr-card { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 16px; }
.qr-card img { width: min(260px, 100%); height: auto; background: #fff; padding: 8px; border-radius: 12px; }
.steps-list { margin: 0; padding-left: 18px; text-align: left; color: var(--ink-2); font-size: 11px; display: grid; gap: 3px; }
.tree { display: flex; flex-direction: column; gap: 4px; }
.tree-node { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 12px; display: flex; flex-direction: column; gap: 4px; }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-soft); flex-wrap: wrap; }
.tree-row b { font-family: var(--sans); font-size: 11.4px; }
.tree-row .tail { margin-left: auto; display: flex; gap: 5px; }
.pos-list { display: flex; flex-direction: column; gap: 3px; padding-left: 4px; }
.pos-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 11px; flex-wrap: wrap; }
.pos-row:hover { background: var(--surface-2); }
.pos-row .tail { margin-left: auto; display: flex; gap: 4px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.frame-wrap { flex: 1; min-height: calc(100vh - 150px); border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.frame-wrap iframe { width: 100%; height: 100%; min-height: calc(100vh - 150px); border: 0; display: block; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline .ev { display: flex; gap: 9px; font-size: 11px; }
.timeline .ev .t { font-family: var(--mono); font-size: 9.8px; color: var(--ink-3); flex: none; width: 108px; }

@media (max-width: 1180px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } .searchbar { width: 150px; } .avatar b, .avatar small { display: none; } .avatar { padding: 3px; } }
@media (max-width: 980px) { .pb-desc { display: none; } .auth { grid-template-columns: 1fr; } .auth-hero { display: none; } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .rail { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-101%); transition: transform .22s ease; box-shadow: var(--sh-3); z-index: 56; }
  .app.nav-on .rail { transform: none; }
  .hamburger { display: inline-flex; }
}
@media (max-width: 760px) { .searchbar { display: none; } .chipbtn .lbl { display: none; } }
@media (max-width: 640px) {
  .kpi-row { grid-template-columns: 1fr; }
  .panel { left: 8px; right: 8px; width: auto; }
  .page { padding-bottom: 44px; }
  .codes { columns: 1; }
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; }
  .tbl.stack tr { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
  .tbl.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .tbl.stack td::before { content: attr(data-label); color: var(--ink-3); font-size: 10.4px; text-align: left; }
  .tbl.stack td.acts::before, .tbl.stack td.empty-cell::before { content: none; }
}
