@font-face { font-family: "Archivo"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("/fonts/archivo-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-soft: #eef0f3;
  --red: #d7141d;
  --red-dark: #b10f17;
  --red-soft: #fdeced;
  --blue: #1d4ed8;
  --blue-soft: #e8eefc;
  --warn: #f0a91c;
  --warn-ink: #2b1d02;
  --warn-soft: #fff3d6;
  --bad: #d7141d;
  --bad-soft: #fde7e8;
  --good: #16803c;
  --good-soft: #dff3e6;
  --side: 240px;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 14.5px; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.rack { background: #fafafb; border-right: 1px solid var(--line); padding: 18px 0 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 18px 18px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; flex: none; }
.brand b, .login .brandrow b { display: block; font-size: 19px; font-weight: 800; letter-spacing: 0.08em; line-height: 1.1; }
.brand-i { color: var(--red); }
.brand small, .login .brandrow small { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); line-height: 1.35; text-transform: uppercase; }
.brand small span, .login .brandrow small span { display: block; white-space: nowrap; }
.nav-group { margin: 16px 18px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.rack a.nav { display: flex; align-items: center; gap: 12px; margin: 1px 12px 1px 5px; padding: 9px 12px 9px 11px; border-radius: 0 9px 9px 0; border-left: 3px solid transparent; color: #1f2937; text-decoration: none; font-weight: 500; }
.rack a.nav:hover { background: #f0f1f4; }
.rack a.nav[aria-current="page"] { background: #ececf0; border-left-color: var(--red); font-weight: 600; }
.rack a.nav .nb { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.rack a.nav { white-space: nowrap; }
.rack a.nav .nb.alert { color: #a16207; }
.rack .spacer { flex: 1; min-height: 16px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 18px 4px; border-top: 1px solid var(--line); margin-top: 8px; }
.me .meta { min-width: 0; flex: 1; font-size: 13px; line-height: 1.25; }
.me .meta span { display: block; color: var(--muted); font-size: 12px; }
.me button { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.me button:hover { background: #f0f1f4; }
main { min-width: 0; }
main:focus { outline: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px 28px; flex-wrap: wrap;
  padding: 28px 32px 84px; color: #fff; background: linear-gradient(100deg, #0d0d0f 0%, #1a1113 40%, #52121a 74%, #8c1a20 100%); }
.hero::before, .hero::after { content: ""; position: absolute; transform: rotate(45deg); pointer-events: none; }
.hero::before { width: 300px; height: 300px; right: 120px; top: -170px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08); }
.hero::after { width: 190px; height: 190px; right: -50px; top: -20px; background: rgba(215, 20, 29, .38); }
.hero > * { position: relative; z-index: 1; }
.hero-main { flex: 1 1 380px; min-width: 0; }
.hero h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hero p { margin-top: 10px; color: rgba(255, 255, 255, .88); max-width: 66ch; }
/* Perangkat (cari, status, bantuan, bel) selalu satu baris di kanan atas; tombol aksi halaman di baris sendiri di bawahnya */
.hero-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hero-util, .hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.hero.skel .skel-line { height: 14px; width: min(420px, 70%); border-radius: 7px; background: rgba(255, 255, 255, .12); }
.hsearch { display: inline-flex; align-items: center; gap: 9px; min-width: 190px; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .88); cursor: pointer; }
.hsearch:hover { background: rgba(255, 255, 255, .14); }
.hsearch span { flex: 1; text-align: left; }
.hsearch kbd { font: inherit; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: rgba(255, 255, 255, .14); }
.live { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); font-weight: 600; font-size: 13px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .28); }
.live.off i { background: #9ca3af; box-shadow: none; }
.ibtn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); color: #fff; cursor: pointer; text-decoration: none; }
.ibtn:hover { background: rgba(255, 255, 255, .16); }
.ibtn .badge { position: absolute; top: -8px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #f59e0b; color: #1f1300; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.hero .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, .18); }
.hero .btn.primary { background: var(--red); border-color: var(--red); box-shadow: 0 6px 18px rgba(215, 20, 29, .5); }
.hero .btn.primary:hover { background: #e3222b; }
.page { position: relative; margin-top: -52px; padding: 0 32px 56px; max-width: 1560px; }

/* Tautan lewati ke konten: tersembunyi sampai difokus dengan Tab */
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar, .scrim, .drawer-close { display: none; }

/* Status memuat saat pindah halaman */
.loading { display: flex; align-items: center; gap: 10px; padding: 48px 32px; color: var(--muted); font-weight: 500; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* Bilah atas dan laci navigasi */
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 12px; background: #fafafb; border-bottom: 1px solid var(--line); }
  .topbar img { width: 26px; height: 26px; }
  .top-title { font-weight: 700; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
  .menu-btn .ico { width: 22px; height: 22px; }
  .rack { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100%; border-right: 1px solid var(--line);
    transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; box-shadow: 0 0 40px rgba(10, 14, 22, .25); }
  .drawer-open .rack { transform: none; visibility: visible; transition: transform .22s ease; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 14, 22, .5); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .drawer-close { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
  .drawer-close:hover { background: #f0f1f4; }
  .rack a.nav { padding: 11px 12px 11px 11px; }
  /* Hero ringkas: pencarian, status, bantuan, bel di satu baris; tombol utama selebar layar */
  .hero { padding: 20px 16px 72px; }
  .hero h1 { font-size: 28px; }
  .hero-tools { align-items: stretch; width: 100%; }
  .hero-util { justify-content: flex-start; flex-wrap: nowrap; }
  .hero-actions { justify-content: stretch; }
  .hero-actions > .btn, .hero-actions > a.btn { flex: 1 1 100%; justify-content: center; }
  .hero-actions > .seg { flex: 1 1 100%; }
  .hero-actions > .seg .btn { flex: 1; justify-content: center; }
  .hsearch { min-width: 0; flex: 1 1 140px; }
  .hsearch kbd { display: none; }
  .live { padding: 0; width: 38px; height: 38px; justify-content: center; }
  .live .live-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero-tools > .btn { flex: 1 1 100%; justify-content: center; }
  .hero-tools > .seg { flex: 1 1 100%; }
  .hero-tools > .seg .btn { flex: 1; justify-content: center; }
  .page { padding: 0 14px 48px; }
}

/* Ring fokus putih di atas latar gelap */
.hero :focus-visible, .login :focus-visible { outline-color: #fff; }
.login .box :focus-visible { outline-color: var(--blue); }

/* Layar sentuh: target minimal 40 px */
@media (pointer: coarse) {
  .btn, .btn.small { min-height: 40px; }
  .btn.small { padding: 6px 12px; }
  .ibtn { width: 42px; height: 42px; }
  input[type="text"], input[type="number"], input[type="date"], input[type="password"], select { min-height: 42px; }
  .check input { width: 20px; height: 20px; }
  .me button { min-height: 40px; }
}

/* ---------- Kontrol ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid #d5d9df; background: var(--panel); cursor: pointer; font-weight: 600; line-height: 1.3; }
.btn:hover { background: #f4f5f7; border-color: #bcc2cb; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.danger { color: var(--red-dark); border-color: #efbcbf; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
a.btn { color: var(--ink); text-decoration: none; }
a.btn.primary { color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 9px 9px 0; }
.seg .btn.primary { position: relative; z-index: 1; }
.check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--red); }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d5d9df; border-radius: 9px; background: #fff; }
input:hover, select:hover, textarea:hover { border-color: #aeb5bf; }
textarea { resize: vertical; min-height: 64px; }
select.inline, input.inline { width: auto; }

/* ---------- Panel & tabel ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.panel + .panel, .kpis + .panel, .panel + .cols2, .cols2 + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head a, .linkbtn { font-size: 14px; background: none; border: 0; padding: 0; color: var(--red); text-decoration: underline; cursor: pointer; font-weight: 500; }
.panel-head .sub { color: var(--muted); font-size: 12.5px; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); align-items: start; }
.cols2 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.cols > .panel + .panel, .cols2 > .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .cols, .cols2 { grid-template-columns: 1fr; } }
.scroll, .board-wrap { overflow-x: auto; }
/* Bayangan tipis di tepi kalau tabel masih bisa digeser ke samping (hanya terlihat saat ada isi tersembunyi) */
.scroll, .board-wrap {
  background: linear-gradient(to right, var(--panel) 30%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--panel) 30%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(17, 24, 39, .16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(17, 24, 39, .16), transparent) right / 12px 100% no-repeat scroll; }
.oncall-tbl select { min-width: 150px; }
.cap-body .form { max-width: 780px; }
.settings-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); align-items: start; }
.settings-grid > .panel { margin-top: 0; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.off td { color: var(--muted); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.tbl tr.now td { background: #f5f7fb; }
.tbl td.nw, .tbl th.nw { white-space: nowrap; }

.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f3; color: #374151; white-space: nowrap; }
.chip.good { background: var(--good-soft); color: #11632f; }
.chip.warn { background: var(--warn-soft); color: #7a5206; }
.chip.bad { background: var(--bad-soft); color: #9b0f16; }
.link-btn { background: none; border: 0; padding: 0 2px; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.map-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.map-box summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.map-box select { min-width: 200px; max-width: 100%; }
.map-box .tbl + .scroll, .map-box .scroll + .scroll { margin-top: 12px; }
.map-sub { margin: 10px 0; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.map-sub summary { font-weight: 600; cursor: pointer; }
.tcell { min-width: 200px; max-width: 260px; white-space: normal; }
.tcell .chip { white-space: normal; }
p > .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.chip.info { background: var(--blue-soft); color: #1e40af; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.notice { padding: 11px 14px; border-radius: 9px; background: var(--blue-soft); color: #1e3a8a; margin-bottom: 14px; }
.notice.warn { background: var(--warn-soft); color: #6b4605; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 15px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.kpi .l { font-weight: 600; font-size: 13.5px; }
.kpi .v { font-size: 40px; font-weight: 700; line-height: 1.1; margin: 8px 0 6px; letter-spacing: -0.02em; }
.kpi .v.text { font-size: 28px; margin: 14px 0 8px; overflow-wrap: anywhere; }
.kpi .v.bad { color: var(--red); }
.kpi .s { color: var(--muted); font-size: 13px; }
.kpi .s.bad { color: var(--red); }

/* ---------- Heatmap ---------- */
.board-wrap { overflow-x: auto; padding-bottom: 4px; }
table.board { border-collapse: separate; border-spacing: 3px; }
.board th { font-weight: 600; font-size: 12.5px; color: var(--muted); text-align: center; padding: 4px 0 6px; min-width: 72px; }
.board th.corner, .board th.rowhead { text-align: left; min-width: 150px; position: sticky; left: 0; background: var(--panel); z-index: 2; padding-right: 10px; }
.board th.rowhead { color: var(--ink); font-size: 14.5px; padding: 0 10px 0 0; }
.board th.rowhead .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.board th.wk.now { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.board th.wk.newmonth { box-shadow: inset 3px 0 0 var(--line); }
.board td { padding: 0; }
.cell { position: relative; display: block; width: 74px; height: 56px; border: 0; border-radius: 5px; cursor: pointer; text-align: center; padding: 0; line-height: 1.2; }
.cell:hover { box-shadow: 0 0 0 2px var(--ink); }
/* Baris lencana kecil di atas (D, P, hari tersedia), angka persen di bawahnya supaya tidak pernah tertutup */
.cell .pct { display: block; font-size: 15px; font-weight: 700; margin-top: 16px; }
.cell .hrs { display: block; font-size: 11.5px; }
.cell .flag { position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; font-size: 10px; font-weight: 700; line-height: 14px; border-radius: 4px; background: var(--ink); color: #fff; }
.cell .flag.b { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cell .days { position: absolute; right: 4px; top: 3px; font-size: 10px; font-weight: 700; line-height: 14px; }
.cell .pre { position: absolute; left: 20px; top: 3px; width: 14px; height: 14px; font-size: 10px; font-weight: 700; line-height: 12px; border-radius: 4px; background: #fff; color: var(--ink); border: 1px dashed var(--ink); }
.cell:not(:has(.flag)) .pre { left: 3px; }
.cell.leave { background: repeating-linear-gradient(135deg, #dadee3 0 6px, #eef0f2 6px 12px); color: #374151; }
.cell.leave .pct { font-size: 12.5px; font-weight: 600; margin-top: 19px; }
.cell.over { background: var(--bad); color: #fff; }
.cell.warn { background: var(--warn); color: var(--warn-ink); }
.board tr.sum td .cell { height: 44px; cursor: default; background: #f3f4f6; color: var(--ink); }
.board tr.sum td .cell:hover { box-shadow: none; }
.board tr.sum .cell .pct { font-size: 13px; margin-top: 5px; font-weight: 600; }
.board tr.sum .cell.over { background: var(--bad); color: #fff; }
.board tr.sum .cell.warn { background: var(--warn-soft); }
.board tr.sum .bar { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 4px; border-radius: 2px; background: #dde1e6; overflow: hidden; }
.board tr.sum .bar i { display: block; height: 100%; background: var(--blue); }
.board tr.sum .over .bar i { background: #fff; }
.pm { display: block; width: 72px; text-align: center; font-size: 12px; color: var(--muted); padding: 3px 0; border-radius: 5px; }
.num-in { width: 88px; text-align: right; }
.pm.has { background: var(--blue-soft); color: #1e40af; font-weight: 600; cursor: help; }
button.pm { border: 0; font: inherit; font-size: 12px; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 5px; }
.ramp { display: inline-block; width: 90px; height: 10px; border-radius: 3px; vertical-align: 0; margin: 0 5px; background: linear-gradient(90deg, #e8eef8, #1f4fa8); }

/* ---------- Daftar bergaya dashboard ---------- */
.lrows { list-style: none; margin: 0; padding: 0; }
.lrows li { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.lrows li:last-child { border-bottom: 0; }
.lrows .sev { font-weight: 700; font-size: 13.5px; }
.lrows .sev.high { color: var(--red); }
.lrows .sev.mid { color: #a16207; }
.lrows .sev.low { color: var(--muted); }
.lrows .tx { font-weight: 600; }
.lrows .go { font-size: 13px; color: var(--red); white-space: nowrap; }
.erows .erow { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.erows .erow:last-child { border-bottom: 0; }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.erow .nm { font-weight: 600; }
.erow .sb { color: var(--muted); font-size: 12.5px; }
.erow .ev { text-align: right; line-height: 1.1; }
.erow .ev b { font-size: 24px; font-weight: 700; }
.erow .ev b.over { color: var(--red); }
.erow .ev b.warn { color: #a16207; }
.erow .ev small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Rincian ---------- */
.kv { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.kv td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.kv td:last-child { text-align: right; font-weight: 600; }
.kv tr.total td { border-bottom: 0; border-top: 1px solid var(--line); font-weight: 700; padding-top: 9px; }
.kv .minus { color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin: 4px 0 12px; }
.meter i { display: block; height: 100%; background: var(--blue); }
.meter i.warn { background: var(--warn); }
.meter i.over { background: var(--bad); }

/* Ringkasan satu minggu (klik judul minggu di heatmap atau tombol Minggu ini) */
.board th.wk .wk-btn { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.board th.wk .wk-btn:hover, .board th.wk .wk-btn:focus-visible { background: var(--blue-soft); color: var(--blue); }
.wk-team { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.wk-big { font-size: 34px; font-weight: 700; line-height: 1; }
.wk-big.warn { color: #a16207; }
.wk-big.over { color: var(--red); }
.wk-meter { margin: 6px 0; position: relative; overflow: visible; }
.wk-meter.big { height: 12px; border-radius: 6px; }
.wk-meter.big i { border-radius: 6px; }
.wk-meter .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
.wk-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wk-list { list-style: none; margin: 0; padding: 0; }
.wk-list li { border-bottom: 1px solid var(--line-soft); }
.wk-list li:last-child { border-bottom: 0; }
.wk-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 92px; gap: 12px; align-items: center; width: 100%; padding: 10px 4px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 8px; }
.wk-row:hover, .wk-row:focus-visible { background: #f6f7f9; }
.wk-row.off { opacity: .6; }
.wk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wk-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-val { text-align: right; line-height: 1.15; }
.wk-val b { font-size: 20px; font-weight: 700; display: block; }
.wk-val small { color: var(--muted); font-size: 12px; }
.wk-val.warn b { color: #a16207; }
.wk-val.over b { color: var(--red); }
.wk-extra { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #f6f7f9; }
.wk-extra p { margin: 3px 0; }

/* Kelengkapan data */
.cl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cl-card .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cl-card .v { font-size: 18px; font-weight: 700; margin: 4px 0 2px; }
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.cl-row:last-child { border-bottom: 0; }
.cl-row.off { opacity: .65; }
.cl-row .chip { justify-self: start; }
.cl-act { display: flex; gap: 6px; }
@media (max-width: 600px) { .cl-row { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- On duty & kapasitas ---------- */
.pts-row { display: grid; grid-template-columns: 90px 1fr 46px; gap: 8px; align-items: center; padding: 5px 0; }
.pts-row .bar { height: 10px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.pts-row .bar i { display: block; height: 100%; background: var(--blue); }
.pts-row .n { text-align: right; font-weight: 600; }
.pts-row .sub { grid-column: 1 / -1; margin-top: -4px; }
.flagline { color: #9b0f16; font-size: 12.5px; display: block; }
.flagline.soft { color: #7a5206; }
.mini { display: inline-block; min-width: 46px; text-align: center; padding: 3px 0; border-radius: 5px; font-size: 12px; margin-right: 2px; background: var(--blue-soft); }
.mini.low { background: var(--warn-soft); }
.mini.neg { background: var(--bad-soft); color: #9b0f16; }

/* ---------- Matriks skill ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix select { width: 62px; padding: 4px 4px; text-align: center; }
.matrix select.l0 { color: #9aa3ad; }
.matrix select.l3, .matrix select.l4 { background: var(--blue-soft); font-weight: 700; }
.matrix th .count { display: block; font-weight: 400; }

/* ---------- Panduan: satu artikel dengan daftar isi ---------- */
.formula { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6;
  background: #f3f4f6; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; margin: 8px 0 16px; white-space: pre-wrap; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; max-width: 1120px; }
.help-layout .toc { order: 2; position: sticky; top: 20px; }
.toc details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 10px 0 0; padding-left: 20px; }
.toc li { margin: 7px 0; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--red); text-decoration: underline; }
.article-wrap { padding: 36px 44px; }
.article { max-width: 68ch; font-size: 15.5px; line-height: 1.7; }
.article section + section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.article h2 { font-size: 23px; margin-bottom: 12px; scroll-margin-top: 72px; }
.article h2:focus { outline: none; }
.article h3 { font-size: 16.5px; margin: 26px 0 8px; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { margin: 0 0 8px; padding-left: 4px; }
.callout { margin: 18px 0; padding: 14px 18px; border-radius: 10px; border-left: 4px solid; }
.callout p:last-child { margin-bottom: 0; }
.callout-t { display: block; margin-bottom: 6px; }
.callout.tip { background: var(--good-soft); border-color: var(--good); }
.callout.info { background: var(--blue-soft); border-color: var(--blue); }
.callout.warn { background: var(--warn-soft); border-color: var(--warn); }
.keys { display: flex; flex-direction: column; gap: 8px; }
.key { display: flex; align-items: center; gap: 10px; }
.key .sw { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.key .k-ok { background: #5b7fc4; }
.key .k-warn { background: var(--warn); }
.key .k-over { background: var(--bad); }
.key .k-leave { background: repeating-linear-gradient(135deg, #dadee3 0 4px, #eef0f2 4px 8px); box-shadow: inset 0 0 0 1px #cfd4da; }
@media (max-width: 1100px) { .help-layout { grid-template-columns: 1fr; } .help-layout .toc { order: 0; position: static; } }
@media (max-width: 600px) { .article-wrap { padding: 22px 18px; } .article { font-size: 15px; } .article h2 { font-size: 21px; } }

/* ---------- Form & dialog ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form .f.full { grid-column: 1 / -1; }
.form label.lbl { font-weight: 600; }
.form .hint { color: var(--muted); font-size: 12.5px; }
.form .checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 18px 50px rgba(10, 14, 22, .4); color: var(--ink); }
dialog.dlg.wide { width: min(780px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(10, 14, 22, .55); }
.dlg .dh { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.dlg .db { padding: 14px 22px; overflow-y: auto; max-height: calc(100vh - 170px); }
.dlg .df { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 22px 20px; flex-wrap: wrap; }
.dlg .df:empty { display: none; }
.dlg .df .left { margin-right: auto; }
.dlg .err { color: #9b0f16; background: var(--bad-soft); padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }

.pal-input { margin-bottom: 8px; }
.pal-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.pal-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pal-item.on { background: #f0f1f4; }
.pal-kind { flex: none; width: 82px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pal-label { font-weight: 600; }
.pal-empty { padding: 14px 10px; color: var(--muted); }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 24px rgba(10, 14, 22, .3); max-width: 360px; }
.toast.bad { background: #9b0f16; }

/* ---------- Login ---------- */
.login { position: relative; overflow: hidden; min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(100deg, #0d0d0f 0%, #1a1113 40%, #52121a 74%, #8c1a20 100%); }
.login::before, .login::after { content: ""; position: absolute; transform: rotate(45deg); pointer-events: none; }
.login::before { width: 520px; height: 520px; right: 6%; top: -300px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08); }
.login::after { width: 320px; height: 320px; right: -90px; bottom: -150px; background: rgba(215, 20, 29, .4); }
.login .box { position: relative; z-index: 1; width: min(400px, 100%); background: #fff; border-radius: 16px; padding: 30px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.login .brandrow { display: flex; align-items: center; gap: 12px; }
.login .brandrow img { width: 40px; height: 40px; }
.login .f { display: flex; flex-direction: column; gap: 4px; }
.login label.lbl { font-weight: 600; }
.login .err { color: #9b0f16; min-height: 1.2em; }
.login .btn.primary { justify-content: center; padding: 10px; box-shadow: 0 6px 18px rgba(215, 20, 29, .35); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Editor tim di dialog alokasi ---------- */
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 600px) { .team-row { grid-template-columns: minmax(0, 1fr) 80px auto; } .team-row > span { display: none; } }

/* Jarak seragam antar blok halaman */
.page > * + * { margin-top: 18px; }

/* KPI ringkas di layar kecil: 2 × 2, supaya heatmap cepat terlihat */
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .l { font-size: 12.5px; }
  .kpi .v { font-size: 28px; margin: 6px 0 4px; }
  .kpi .v.text { font-size: 17px; margin: 8px 0 6px; }
  .kpi .s { font-size: 12px; }
}

/* Heatmap di layar kecil: kolom nama lebih sempit supaya lebih banyak minggu terlihat */
@media (max-width: 600px) {
  .board th.corner, .board th.rowhead { min-width: 96px; max-width: 120px; }
  .board th.rowhead { font-size: 13.5px; }
  .board th.rowhead .sub { display: none; }
  .panel { padding: 16px 14px; }
}
@media (max-width: 600px) {
  .toolbar .seg { flex: 1 1 100%; }
  .toolbar .seg .btn { flex: 1; justify-content: center; padding: 8px 6px; white-space: nowrap; }
  .toolbar select.inline { flex: 1 1 auto; }
}

/* Cek bentrok di form alokasi */
.impact { margin-top: 14px; }
.impact:empty { display: none; }
.impact > div { padding: 12px 14px; border-radius: 10px; background: #f6f7f9; border: 1px solid var(--line); }
.impact-list { list-style: none; margin: 8px 0 0; padding: 0; }
.impact-list li { padding: 3px 0; }

/* ---------- Skenario dan proyeksi 12 bulan ---------- */
.fc { display: grid; gap: 6px; margin: 14px 0 4px; }
.fc-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 96px; gap: 10px; align-items: center; }
.fc-m { font-weight: 600; font-size: 13px; }
.fc-bars { display: grid; gap: 3px; }
.fc-bar { position: relative; height: 18px; }
.fc-bar.two { height: 14px; }
.fc-track { position: absolute; left: 0; top: 0; bottom: 0; background: #e7eaee; border-radius: 4px; }
.fc-fill { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 3px; background: var(--blue); }
.fc-fill.warn { background: var(--warn); }
.fc-fill.over { background: var(--bad); }
.fc-plan { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink); }
.fc-tag { position: absolute; right: 100%; margin-right: 6px; font-size: 11px; color: var(--muted); display: none; }
.fc-n { display: grid; gap: 3px; font-size: 12.5px; }
.fc-n > div { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.legend .sw.fc-sw-track { background: #e7eaee; }
.legend .sw.fc-sw-plan { width: 3px; background: var(--ink); border-radius: 0; }
.sc-list, .sc-changes { list-style: none; margin: 0; padding: 0; }
.sc-list li, .sc-changes li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sc-list li { justify-content: flex-start; }
.sc-list li:last-child, .sc-changes li:last-child { border-bottom: 0; }
@media (max-width: 600px) {
  .fc-row { grid-template-columns: 50px minmax(0, 1fr) 84px; gap: 6px; }
  .fc-m { font-size: 12px; }
  .fc-n { font-size: 12px; }
  .fc-n > div { flex-wrap: wrap; gap: 2px 4px; }
  .fc-n .chip { font-size: 11px; padding: 0 6px; }
}

/* Rincian sel: jam dan tombol aksi per baris beban */
.kv td.hrs-td { text-align: right; font-weight: 600; white-space: nowrap; }
.kv td.act { width: 1%; white-space: nowrap; text-align: right; font-weight: 400; padding-left: 10px; }

/* Sorotan sesaat untuk hal yang dibuka dari peringatan */
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(215, 20, 29, 0); } 25%, 75% { box-shadow: 0 0 0 4px rgba(215, 20, 29, .55); } }
.flash { animation: flash 1.2s ease 2; border-radius: 6px; }
tr.flash > td, tr.flash > th { background: var(--red-soft) !important; transition: background .3s; }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; box-shadow: 0 0 0 3px rgba(215, 20, 29, .55); } }

/* Penjelasan generator on duty: engineer yang tidak dipilih */
.skipped { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f6f7f9; border: 1px solid var(--line); }
.skipped ul { margin: 6px 0 8px; padding-left: 20px; }
.skipped li { margin: 3px 0; }

@media (max-width: 600px) {
  .wk-team { grid-template-columns: 1fr; gap: 6px; }
  .wk-row { grid-template-columns: 30px minmax(0, 1fr) 70px; gap: 8px; }
  .wk-sub { white-space: normal; }
}
.cl-tips { margin-top: 8px; }
.cl-tips summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }

/* Akun engineer: beranda, pendaftaran */
.wk-list.mine .wk-row { grid-template-columns: 74px minmax(0, 1fr) 92px; }
.wk-date { line-height: 1.15; }
.wk-date b { display: block; font-size: 15px; }
.wk-date small { color: var(--muted); font-size: 12px; }
.note-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--warn-soft); border-color: #f3d68a; }
.note-panel p { margin: 0; flex: 1 1 260px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 4px 0; }
.ok-note { background: var(--good-soft); color: #14532d; border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 8px; }
.signup-link { margin: 14px 0 0; text-align: center; }
.login .box h2 { margin: 0 0 6px; }
.tbl tr.off td { color: var(--muted); }
@media (max-width: 600px) { .wk-list.mine .wk-row { grid-template-columns: 58px minmax(0, 1fr) 64px; } }
.big-code { font-family: ui-monospace, Consolas, monospace; font-size: 16px; font-weight: 700; letter-spacing: 1px; background: #f3f4f6; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.login .box .f { margin-bottom: 12px; }
.login .box .f .hint { display: block; margin-top: 3px; }

/* On duty: panel keadilan pindah ke bawah sebelum tabel jadwal terpotong; di HP tiap minggu jadi kartu */
@media (max-width: 1450px) { .od-cols { grid-template-columns: 1fr; } }
.oncall-tbl td.od-week { min-width: 150px; }
.oncall-tbl td.od-note { min-width: 120px; }
@media (max-width: 760px) {
  .oncall-tbl thead { display: none; }
  .oncall-tbl, .oncall-tbl tbody { display: block; }
  .oncall-tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .oncall-tbl tr.now { border-color: var(--blue); }
  .oncall-tbl tr.now td { background: none; }
  .oncall-tbl td { display: block; padding: 0; border: 0; min-width: 0 !important; }
  .oncall-tbl td.od-week { grid-column: 1 / -1; font-weight: 600; }
  .oncall-tbl td.od-note, .oncall-tbl td.od-act { grid-column: 1 / -1; }
  .oncall-tbl td.od-note:empty, .oncall-tbl td.od-act:empty { display: none; }
  .oncall-tbl td.num { text-align: left; }
  .oncall-tbl td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .oncall-tbl select { min-width: 0; width: 100%; }
  .oncall-tbl .od-act .btn { width: 100%; justify-content: center; }
}

/* Toolbar heatmap: pilihan tambahan selalu terlihat di desktop, di HP di balik tombol Opsi */
.tb-opts { display: contents; }
.tb-more { display: none; }
@media (max-width: 700px) {
  .tb-more { display: inline-flex; }
  .toolbar .tb-opts { display: none; }
  .toolbar.open .tb-opts { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .toolbar.open .tb-opts > * { flex: 1 1 100%; }
}
.mode-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 18px; }
.mode-panel p { margin: 0; flex: 1 1 260px; }
.mode-panel + .cap-body > .panel:first-child { margin-top: 18px; }
.mode-seg .btn.primary { box-shadow: none; }
.calib-empty { max-width: 760px; }
.calib-prog { display: flex; align-items: baseline; gap: 8px; }
.calib-prog b { font-size: 22px; }
.calib-empty h2 { margin: 14px 0 8px; }
.calib-empty .btn { margin-top: 12px; }

/* Navigasi bagian di Pengaturan */
.set-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--blue); color: var(--blue); }
[id^="set-"], #akses-engineer { scroll-margin-top: 16px; }

/* Tombol per baris: netral. "Isi" sedikit lebih tegas, "Hapus" berwarna peringatan tanpa blok merah */
.btn.strong { font-weight: 700; border-color: var(--ink); }
.btn.subtle-danger { color: #9b0f16; border-color: var(--line); background: var(--panel); }
.btn.subtle-danger:hover { background: var(--bad-soft); border-color: #efbcbf; }
/* Tabel: cari cepat dan urutkan */
.tbl-search { flex: 0 1 300px; min-width: 180px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover, .tbl th.sortable:focus-visible { color: var(--ink); }
.tbl th.sortable::after { content: " ↕"; opacity: .35; font-size: 11px; }
.tbl th[aria-sort="ascending"]::after { content: " ↑"; opacity: .9; }
.tbl th[aria-sort="descending"]::after { content: " ↓"; opacity: .9; }
