.code{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:26px;padding:0 5px;border-radius:6px;font-size:13px;font-weight:500;white-space:nowrap;line-height:1}
:root{
  --bg:#0C0A08; --surface:#181512; --surface-2:#221D18; --surface-3:#2C251E;
  --ink:#fff; --muted:#8F8A84; --accent:#C9A45A; --accent-ink:#0C0A08;
  --flag:#D8624A; --ok:#6E8F6A;
  --s:#E0B25C; --m:#6E8CA8; --off:#6B655E; --fb:#8C6A46; --ct:#6E8F6A; --dns:#7E93A1;
  --r:10px;
  --s13:13px; --s16:16px; --s24:24px; --s40:40px; --s80:80px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink); overflow-x:hidden;
  font-family:Inter,"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  font-size:16px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
h1,h2,h3,p{margin:0}
img{max-width:100%}
::selection{background:var(--accent);color:var(--accent-ink)}

.topbar{position:sticky;top:0;z-index:20;background:var(--bg)}
.topbar-in{
  max-width:1440px;margin:0 auto;padding:10px 24px;min-height:64px;
  display:flex;align-items:center;gap:20px;flex-wrap:wrap;
}
.brand{font-size:24px;font-weight:500;letter-spacing:-.02em}
.pit{font-size:13px;color:var(--muted)}
.nav{display:flex;gap:32px;margin-left:48px;flex:1;flex-wrap:wrap;min-width:0}
.nav a{font-size:16px;color:var(--muted);padding:6px 0}
.nav a:hover{color:var(--ink)}
.nav a.on{color:var(--ink)}
.topbar-end{display:flex;align-items:center;gap:16px}
.who{font-size:13px;color:var(--muted)}

.wrap{max-width:1440px;margin:0 auto;padding:16px 24px 40px}
.foot{
  max-width:1440px;margin:0 auto;padding:20px 24px 40px;
  display:flex;justify-content:space-between;gap:16px;color:var(--muted);font-size:13px;
}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  height:48px;padding:0 20px;border:0;border-radius:var(--r);
  background:var(--accent);color:var(--accent-ink);
  font:500 16px/1 Inter,"Segoe UI",system-ui,sans-serif;cursor:pointer;
}
.btn:hover{filter:brightness(1.05)}
.btn:disabled{background:var(--surface-3);color:var(--muted);cursor:not-allowed}
.btn.small{height:40px;padding:0 16px;font-size:13px}
.btn.ghost{background:var(--surface-2);color:var(--ink)}
.btn.ghost:hover{background:var(--surface-3)}
.btn.wide{width:100%}

.flash{background:var(--surface-2);border-left:4px solid var(--ok);padding:12px 16px;border-radius:8px;margin-bottom:12px;font-size:14px}
.flash.err{border-left-color:var(--flag)}
.flash.warn{border-left-color:var(--accent)}

.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:8px}
.grid>*{min-width:0}
.tile{background:var(--surface);border-radius:var(--r);padding:20px 22px}
.tile.alt{background:var(--surface-2)}
.tile.accent{background:var(--accent);color:var(--accent-ink)}
.tile-title{font-size:24px;font-weight:500;letter-spacing:-.02em;line-height:1.3}
.tile-sub{font-size:13px;color:var(--muted);margin-top:4px}
.tile.accent .tile-sub{color:#4A3B1C}
.muted{color:var(--muted)}
.s13{font-size:13px}
.strong{font-weight:500}

.kpi{font-size:80px;line-height:1;font-weight:500;letter-spacing:-.02em}
.kpi.sm{font-size:40px;letter-spacing:-.01em}
.num{font-variant-numeric:tabular-nums}

.split{display:flex;gap:2px;height:12px;vertical-align:middle;width:100%}
.split i{display:block;height:100%;border-radius:3px}

.flag{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;background:var(--flag);color:#fff;font-weight:500;font-size:14px}
.flagtext{color:var(--flag);font-size:13px}

/* chips & fields */
.chips{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end}
.chip{display:block;min-width:140px;background:var(--surface-2);border-radius:var(--r);padding:8px 14px}
.chip .lab{display:block;font-size:13px;color:var(--muted)}
.chip .val{display:block;font-size:16px;color:var(--ink);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search{min-width:240px;flex:1}
.field{display:flex;flex-direction:column;gap:6px;min-width:140px}
.field label{font-size:13px;color:var(--muted)}
.input,select.input{
  height:48px;background:var(--surface-2);border:0;border-radius:var(--r);
  color:var(--ink);font:16px Inter,"Segoe UI",system-ui,sans-serif;padding:0 14px;width:100%;
}
.input:focus,select.input:focus{outline:2px solid var(--accent);outline-offset:0}
select.input{appearance:none;padding-right:32px;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 18px) 22px,calc(100% - 13px) 22px;background-size:5px 5px;background-repeat:no-repeat}
.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end;margin-bottom:12px}
.filters .grow{flex:1}
.hint{font-size:13px;color:var(--muted)}

/* rekap table */
table{border-collapse:collapse}
.rekap{width:100%}
.rekap th,.rekap td{padding:10px 8px;text-align:left;font-size:14px}
.rekap th{font-size:13px;color:var(--muted);font-weight:400}
.rekap td.num{text-align:right;font-variant-numeric:tabular-nums}
.rekap tr.on{background:var(--surface-2)}

/* matrix */
.mx-wrap{overflow:auto;background:var(--surface);border-radius:var(--r);max-height:calc(100vh - 260px)}
table.mx{border-collapse:separate;border-spacing:0;table-layout:fixed}
.mx th,.mx td{padding:0 6px;height:36px;font-size:13px;white-space:nowrap;text-align:left}
.mx thead th{position:sticky;top:0;background:var(--surface);z-index:3;height:54px;vertical-align:top;padding-top:8px}
.mx th.d{width:54px;text-align:center;font-variant-numeric:tabular-nums}
.mx th .dw{display:block;font-size:13px;color:var(--muted);font-weight:400}
.mx th .dd{display:block;font-size:16px;color:var(--ink);font-weight:500}
.mx th.today,.mx td.today{background:var(--surface-3)}
.mx .sticky{position:sticky;background:var(--surface);z-index:2}
.mx thead .sticky{z-index:5}
.mx .c1{left:0;min-width:84px}
.mx .c2{left:84px;min-width:186px}
.mx .c3{left:270px;min-width:96px}
.mx .c4{left:366px;min-width:170px}
.mx tbody tr:nth-child(even) td:not(.today){background:var(--surface-2)}
.mx tbody tr:nth-child(even) .sticky{background:var(--surface-2)}
.mx tbody tr:hover td:not(.today){background:var(--surface-3)}
.mx .code{display:inline-flex;align-items:center;justify-content:center;width:42px;height:26px;border-radius:6px;font-size:13px;font-weight:500}
.mx .sec{color:var(--accent)}
.mx .recap td{background:var(--surface-2);font-weight:500;font-variant-numeric:tabular-nums}
.mx .recap .lbl{color:var(--muted);font-weight:400;font-size:13px}
.mx .recap .dot{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:8px;vertical-align:middle}
.mx .recap td.d{text-align:center}
.mx tbody .recap .sticky{background:var(--surface-2)}
.mx td.c1,.mx td.c2,.mx td.c3,.mx td.c4{padding-right:10px}
.mx .c1{font-variant-numeric:tabular-nums;color:var(--muted)}
.mx .c2{color:var(--ink)}
.mx .c4{color:var(--muted)}
.legend{display:flex;gap:22px;flex-wrap:wrap;align-items:center;margin-top:12px;font-size:13px;color:var(--muted)}
.legend .code{width:30px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;font-size:13px;font-weight:500;margin-right:8px}
.legend span.item{display:flex;align-items:center;white-space:nowrap}

/* dashboard */
.hero{grid-column:span 6;grid-row:span 2;background:var(--accent);color:var(--accent-ink);padding:24px;border-radius:var(--r);display:flex;flex-direction:column;min-height:560px}
.hero .date{font-size:13px;color:#4A3B1C;font-weight:500}
.hero .big{font-size:120px;line-height:.95;font-weight:500;letter-spacing:-.03em;margin-top:8px}
.hero .sub{font-size:16px;color:#4A3B1C;margin-top:6px}
.hero .splitrow{display:flex;gap:24px;margin-top:auto;padding-top:24px}
.hero .splitrow .cell{flex:1}
.hero .splitrow .lab{font-size:13px;color:#4A3B1C}
.hero .splitrow .v{font-size:40px;font-weight:500;line-height:1.1}
.hero .splitrow .t{font-size:13px;color:#4A3B1C;margin-top:2px}
.hero .bar{margin-top:16px}
.hero .pct{display:flex;justify-content:space-between;font-size:16px;font-weight:500;margin-top:12px}
.hero .note{font-size:13px;color:#4A3B1C;margin-top:auto;padding-top:24px}

.balance{grid-column:span 6;min-height:280px}
.absence{grid-column:span 3}
.empty-tile{grid-column:span 3}
.days{grid-column:span 12;margin-top:8px}
.balance .row{display:flex;align-items:center;gap:16px;padding:8px 0;flex-wrap:wrap;min-width:0}
.balance .row .name{width:110px;font-weight:500;font-size:16px}
.balance .row .pair{width:64px;font-variant-numeric:tabular-nums;font-size:16px}
.balance .row .state{margin-left:auto;text-align:right;min-width:80px}
.balance .row .split{flex:0 1 240px;min-width:80px}
.absence .arow{display:flex;align-items:center;gap:12px;padding:7px 0}
.absence .arow .dot{width:10px;height:10px;border-radius:2px}
.absence .arow .v{font-size:24px;font-weight:500;font-variant-numeric:tabular-nums;margin-left:auto}
.bigzero{font-size:80px;line-height:1;font-weight:500;margin:24px 0 8px}
.daystrip{display:flex;gap:8px;overflow-x:auto;padding-top:16px;min-width:0;max-width:100%}
.daystrip .d{min-width:78px;flex:0 0 78px}
.daystrip .dw{font-size:13px;color:var(--muted)}
.daystrip .dd{font-size:16px;font-weight:500;margin-bottom:8px}
.daystrip .bar{display:flex;flex-direction:column;gap:2px;height:72px}
.daystrip .bar i{display:block;border-radius:4px}
.daystrip .d.today{background:var(--surface-3);border-radius:8px;padding:8px 6px;margin:-8px 0 0}
.daystrip .d.today .dd{color:var(--accent)}

/* upload */
.stages{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}
.stage{background:var(--surface);border-radius:var(--r);padding:16px 20px;min-height:96px}
.stage .t{font-size:24px;font-weight:500;letter-spacing:-.02em}
.stage .s{font-size:13px;color:var(--muted);margin-top:6px}
.stage.done{border-left:6px solid var(--accent)}
.stage.now{background:var(--accent);color:var(--accent-ink)}
.stage.now .s{color:#4A3B1C}
.up-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.kv{display:flex;gap:36px;flex-wrap:wrap;margin-top:16px}
.kv .k{font-size:13px;color:var(--muted)}
.kv .v{font-size:40px;font-weight:500;line-height:1.1}
.problem{display:flex;gap:10px;padding:10px 0}
.problem .dot{width:10px;height:10px;border-radius:2px;background:var(--flag);margin-top:6px;flex:none}
.problem .msg{font-size:16px;font-weight:500}
.problem .loc{font-size:13px;color:var(--muted)}
.list-scroll{max-height:280px;overflow:auto}
.actionbar{display:flex;align-items:center;gap:12px;background:var(--surface-2);border-radius:var(--r);padding:12px 16px;margin-top:8px}
.actionbar .info{flex:1;font-size:14px;color:var(--muted)}
.file-meta{font-size:13px;color:var(--muted);margin-top:4px;word-break:break-all}

/* master */
.srow{display:flex;align-items:center;gap:12px;background:var(--surface-2);border-radius:var(--r);padding:14px 16px;margin-top:8px}
.srow .n{font-size:16px;font-weight:500}
.srow .c{font-size:13px;color:var(--muted);margin-left:auto}
.srow .st{font-size:13px;color:var(--ok);width:52px;text-align:right}
.srow form{margin:0}
.mini{background:none;border:0;color:var(--muted);font-size:13px;cursor:pointer;padding:4px}
.mini:hover{color:var(--ink)}
.krow{display:flex;align-items:center;gap:12px;padding:7px 0}
.krow .code{width:56px;height:30px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;font-size:13px;font-weight:500}
.krow .lab{font-size:16px}
.krow .cat{font-size:13px;color:var(--muted);margin-left:auto}
.threshold{display:flex;gap:40px;flex-wrap:wrap;margin-top:8px}
.threshold .v{font-size:80px;font-weight:500;line-height:1;letter-spacing:-.02em;color:var(--accent)}
.threshold .u{font-size:16px;margin-top:6px}
.track{height:12px;background:var(--surface-3);border-radius:6px;margin-top:16px;width:280px;max-width:100%}
.track i{display:block;height:100%;background:var(--accent);border-radius:6px}
.syncrow{display:flex;gap:36px;margin-top:12px}

/* login */
.login{display:grid;grid-template-columns:1fr 492px;gap:48px;align-items:center;min-height:calc(100vh - 160px)}
.login h1{font-size:96px;line-height:1;font-weight:500;letter-spacing:-.04em}
.login h1 .muted{color:var(--muted)}
.login .sub{font-size:16px;color:var(--muted);max-width:560px;margin-top:32px}
.panel{background:var(--surface);border-radius:var(--r);padding:32px 28px}
.panel h2{font-size:24px;font-weight:500;letter-spacing:-.02em}
.panel .sub{font-size:13px;color:var(--muted);margin:6px 0 24px}
.panel .field{margin-bottom:16px}
.focus-left{position:relative}
.focus-left:focus-within::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--accent);border-radius:2px}
.panel .foot{font-size:13px;color:var(--muted);margin-top:32px;padding:0}

/* states */
.empty{padding:40px 24px;text-align:center;color:var(--muted);font-size:16px}
.empty .btn{margin-top:16px}
.err-list{max-height:320px;overflow:auto}
.badge{display:inline-block;padding:3px 8px;border-radius:6px;background:var(--surface-3);font-size:13px;color:var(--muted)}
.close{font-size:13px;color:var(--muted)}
.right{text-align:right}
.nowrap{white-space:nowrap}

@media (max-width:1000px){
  .hero,.balance,.absence,.empty-tile,.days{grid-column:span 12}
  .hero{min-height:0}
  .login{grid-template-columns:1fr}
  .login h1{font-size:56px}
  .up-grid{grid-template-columns:1fr}
  .stages{grid-template-columns:1fr 1fr}
  .kpi{font-size:64px}
  .hero .big{font-size:80px}
}
@media (max-width:640px){
  .topbar-in{padding:8px 16px;gap:12px}
  .pit{display:none}
  .topbar-end .btn{padding:0 12px}
  .nav{margin-left:0;gap:18px;order:3;width:100%;flex:1 0 100%}
  .topbar-end{margin-left:auto}
  .wrap{padding:12px 16px 32px}
  .tile{padding:16px}
  .filters .field{min-width:0;width:100%}
  .search{width:100%}
  .kpi{font-size:56px}
  .grid{gap:6px}
  .stages{grid-template-columns:1fr}
  .login h1{font-size:44px}
  .mx-wrap{max-height:none}
  .mx th.d,.mx .code{width:44px}
  .mx .code{width:36px}
}
/* rekap label di matriks */
.mx .recap .rlbl{position:sticky;left:0;z-index:2;background:var(--surface-2);padding:0 10px 0 0}
.mx .recap .rlbl .rl{float:left;color:var(--muted);font-weight:400}
.mx .recap .rlbl .cat{float:right;display:flex;align-items:center;font-weight:400}
.mx .recap .rlbl .cat .dot{margin-right:8px}
.mx .recap .rlbl::after{content:"";display:block;clear:both}

/* form baris kode */
.krow .input{min-width:0}
.krow input[type=color]{appearance:none;border:0;background:none;padding:0;cursor:pointer}
.srow form{margin-left:0}
.srow .st{white-space:nowrap}

input[type=file]{padding:10px;font-size:14px;color:var(--muted)}
input[type=file]::file-selector-button{background:var(--surface-3);color:var(--ink);border:0;border-radius:6px;padding:8px 12px;margin-right:12px;font:500 14px Inter,"Segoe UI",system-ui,sans-serif;cursor:pointer}
input[type=file]::file-selector-button:hover{background:#3A3128}

.daygrid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:8px}
.daygrid .d{min-width:0}
.daygrid .code{width:auto;min-width:44px;max-width:100%;white-space:nowrap;margin-top:4px}
.daygrid .dd{font-size:16px;font-weight:500;margin-bottom:6px}
.daygrid .dw{font-size:13px;color:var(--muted)}
@media (max-width:900px){.daygrid{grid-template-columns:repeat(6,minmax(0,1fr))}}

/* multi-pilih dengan pencarian */
.ms{position:relative;width:100%}
.ms details{position:relative}
.ms summary{list-style:none;height:48px;background:var(--surface-2);border-radius:var(--r);padding:0 14px;display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;font-size:16px}
.ms summary::-webkit-details-marker{display:none}
.ms[open] summary,.ms summary:focus-visible{outline:2px solid var(--accent);outline-offset:0}
.ms .ms-val{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ms .caret{flex:none;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(--muted)}
.ms[open] .caret{transform:rotate(180deg)}
.ms-panel{position:absolute;z-index:40;top:calc(100% + 6px);left:0;width:max(100%,260px);max-width:340px;background:var(--surface-3);border-radius:var(--r);padding:10px;box-shadow:0 16px 40px rgba(0,0,0,.5)}
.ms-search{width:100%;height:38px;background:var(--surface-2);border:0;border-radius:8px;color:var(--ink);font:14px Inter,"Segoe UI",system-ui,sans-serif;padding:0 10px}
.ms-search:focus{outline:2px solid var(--accent)}
.ms-list{max-height:240px;overflow:auto;margin-top:8px}
.ms-opt{display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:6px;font-size:15px;cursor:pointer}
.ms-opt:hover{background:var(--surface-2)}
.ms-opt input{accent-color:var(--accent);width:16px;height:16px;flex:none}
.ms-empty{display:none;padding:10px 6px;color:var(--muted);font-size:13px}

.ms-clear{display:block;margin-top:6px;background:none;border:0;color:var(--accent);font:13px Inter,"Segoe UI",system-ui,sans-serif;cursor:pointer;padding:4px 6px;text-align:left}
.ms-clear:hover{text-decoration:underline}

/* legenda roster melayang */
.legend-float{
  position:fixed;left:16px;right:16px;bottom:16px;z-index:40;
  background:var(--surface-2);border-radius:var(--r);
  padding:10px 14px;display:flex;align-items:center;gap:22px;
  flex-wrap:nowrap;overflow-x:auto;max-width:calc(100vw - 32px);
}
.legend-float .item{flex:none}
.legend-float .info{margin-left:auto;flex:none;white-space:nowrap}
@media (max-width:640px){
  .legend-float{left:8px;right:8px;bottom:8px;max-width:calc(100vw - 16px);gap:16px}
  .legend-float .info{display:none}
}

/* header tanggal + rekap harian ikut menempel saat tabel di-scroll */
.mx tbody tr.recap td{position:sticky;z-index:3;background:var(--surface-2)}
.mx tbody tr.recap:nth-of-type(1) td{top:54px}
.mx tbody tr.recap:nth-of-type(2) td{top:90px}
.mx tbody tr.recap:nth-of-type(3) td{top:126px}
.mx tbody tr.recap:nth-of-type(4) td{top:162px}
.mx tbody tr.recap:nth-of-type(5) td{top:198px}
.mx tbody tr.recap td.rlbl{left:0;z-index:4}

.ms-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px;flex-wrap:wrap}
.ms-selectall{background:none;border:0;color:var(--accent);font:500 13px Inter,"Segoe UI",system-ui,sans-serif;cursor:pointer;padding:4px 6px;text-align:left}
.ms-selectall:hover{text-decoration:underline}
