/* ==========================================================
   SAGA Work Order — stylesheet
   Tema: kartu kerja bengkel. Barlow, slate ink, kuning safety.
   ========================================================== */
:root {
  --ink: #1d2a33;
  --ink-2: #33434f;
  --muted: #66737d;
  --line: #d6dde2;
  --line-soft: #e6ebee;
  --paper: #eceff1;
  --surface: #ffffff;
  --signal: #f2b705;
  --signal-deep: #d9a200;
  --signal-ink: #2b2100;

  --st-baru: #1f62b0;       --st-baru-bg: #e3edf9;
  --st-diterima: #0e7470;   --st-diterima-bg: #dff1f0;
  --st-dikerjakan: #9a5b00; --st-dikerjakan-bg: #fbefd9;
  --st-menunggu: #74489c;   --st-menunggu-bg: #efe6f6;
  --st-selesai: #2b7a2f;    --st-selesai-bg: #e2f2e2;
  --st-ditutup: #4c5a64;    --st-ditutup-bg: #e6eaed;
  --st-dibatalkan: #7d878e; --st-dibatalkan-bg: #f0f2f3;

  --p-darurat: #c62828;
  --p-tinggi: #dd6b1f;
  --p-normal: #9fb0bc;
  --p-rendah: transparent;

  --danger: #b3261e;
  --radius: 6px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", "Arial Narrow", system-ui, sans-serif;
  --tabbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
.stat .num, td.num, .tl-time, .metrics b { font-variant-numeric: tabular-nums; }
a { color: var(--st-baru); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-cond); line-height: 1.15; margin: 0; font-weight: 700; }
h1 { font-size: 1.8rem; letter-spacing: -0.005em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
.ic { flex: none; vertical-align: -0.2em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 40;
}
.topbar-in {
  max-width: 1160px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 24px; height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-cond); font-weight: 700; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 4px; background: var(--signal); color: var(--signal-ink);
  display: grid; place-items: center; font-size: .95rem; line-height: 1;
}
.brand small { font-family: var(--font); font-weight: 500; font-size: .8rem; color: #a9b6bf; margin-left: 2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: #c9d3da; padding: 8px 12px; border-radius: 4px; font-weight: 500; position: relative;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.on { color: #fff; box-shadow: inset 0 -3px 0 var(--signal); border-radius: 0; }
.top-right { display: flex; align-items: center; gap: 12px; }
.who { text-align: right; line-height: 1.2; font-size: .875rem; }
.who b { display: block; font-weight: 600; color: #fff; }
.who span { color: #a9b6bf; font-size: .8rem; }
.iconbtn {
  background: none; border: 0; color: #c9d3da; padding: 8px; border-radius: 4px; cursor: pointer; display: inline-flex;
}
.iconbtn:hover { color: #fff; background: rgba(255,255,255,.08); }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--signal); color: var(--signal-ink); font-size: .75rem; font-weight: 700; margin-left: 6px;
}
.badge[data-n="0"] { display: none; }

/* ---------- Page ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 24px 16px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }

/* ---------- Flash ---------- */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--st-baru);
  padding: 10px 14px; border-radius: 4px; font-weight: 500;
}
.flash.ok { border-left-color: var(--st-selesai); }
.flash.warn { border-left-color: var(--signal-deep); }
.flash.error { border-left-color: var(--danger); color: #7a1b15; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius);
  font: 600 .95rem/1 var(--font); border: 1px solid transparent; cursor: pointer;
  background: var(--ink); color: #fff; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--ink-2); }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.btn-signal { background: var(--signal); color: var(--signal-ink); }
.btn-signal:hover { background: var(--signal-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f5f7f8; border-color: #c3ccd2; }
.btn-ok { background: var(--st-selesai); }
.btn-ok:hover { background: #22652a; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #e3b9b6; }
.btn-danger:hover { background: #fdf1f0; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 600; font-size: .925rem; }
.field .opt { font-weight: 400; color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=search],
input[type=number], select, textarea {
  width: 100%; font: 400 1rem/1.4 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid #c4cdd3; border-radius: var(--radius);
  padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2366737d' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(242,183,5,.45); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* choice tiles (tujuan IT / Teknisi) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile span {
  display: block; height: 100%; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.tile b { display: flex; align-items: center; gap: 8px; font-family: var(--font-cond); font-size: 1.3rem; }
.tile small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; line-height: 1.35; }
.tile input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f7f9fa; }
.tile input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }

/* priority segmented */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #c4cdd3; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg label { position: relative; text-align: center; cursor: pointer; border-left: 1px solid var(--line); }
.seg label:first-child { border-left: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 10px 4px; font-weight: 600; font-size: .925rem; }
.seg input:checked + span { color: #fff; background: var(--ink); }
.seg .p-darurat input:checked + span { background: var(--p-darurat); }
.seg .p-tinggi input:checked + span { background: var(--p-tinggi); }
.seg input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: -3px; }

/* photo input */
.photo-input { display: grid; gap: 10px; }
.photo-add {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; border: 2px dashed #b6c1c8; border-radius: var(--radius); background: #f7f9fa;
  color: var(--ink-2); font-weight: 600; cursor: pointer; padding: 10px;
}
.photo-add:hover { border-color: var(--ink); background: #fff; }
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-previews:empty { display: none; }
.pv { position: relative; width: 84px; height: 84px; border-radius: 4px; overflow: hidden; background: var(--line-soft); }
.pv img { width: 100%; height: 100%; object-fit: cover; }
.pv button {
  position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 12px; border: 0;
  background: rgba(29,42,51,.85); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.photo-input.is-invalid .photo-add { border-color: var(--danger); background: #fdf1f0; }
.photo-error { color: var(--danger); font-size: .875rem; font-weight: 500; display: none; }
.photo-input.is-invalid .photo-error { display: block; }

/* stars */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { cursor: pointer; font-size: 2rem; line-height: 1; color: #c9d1d6; padding: 0 2px; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--signal); }
.stars input:focus-visible + label { outline: 3px solid var(--signal); outline-offset: 1px; }
.rating-show { color: var(--signal-deep); letter-spacing: 2px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 18px 20px; }
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head a { font-weight: 600; font-size: .925rem; }
.count { color: var(--muted); font-weight: 500; font-family: var(--font); font-size: .95rem; margin-left: 6px; }

/* ---------- Status & priority ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 4px;
  font-weight: 600; font-size: .825rem; line-height: 1.4; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-baru { color: var(--st-baru); background: var(--st-baru-bg); }
.st-diterima { color: var(--st-diterima); background: var(--st-diterima-bg); }
.st-dikerjakan { color: var(--st-dikerjakan); background: var(--st-dikerjakan-bg); }
.st-menunggu { color: var(--st-menunggu); background: var(--st-menunggu-bg); }
.st-selesai { color: var(--st-selesai); background: var(--st-selesai-bg); }
.st-ditutup { color: var(--st-ditutup); background: var(--st-ditutup-bg); }
.st-dibatalkan { color: var(--st-dibatalkan); background: var(--st-dibatalkan-bg); text-decoration: line-through; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .78rem; padding: 2px 7px; border-radius: 3px; color: #fff; }
.prio-tag-darurat { background: var(--p-darurat); }
.prio-tag-tinggi { background: var(--p-tinggi); }
.prio-tag-normal { background: var(--st-ditutup-bg); color: var(--ink-2); }
.prio-tag-rendah { background: var(--st-dibatalkan-bg); color: var(--muted); }
.dept-tag { font-weight: 600; font-size: .78rem; color: var(--ink-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 3px; background: #f7f9fa; }
.late-flag { color: var(--danger); font-weight: 600; font-size: .8rem; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- WO rows ---------- */
.wo-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wo-row {
  display: grid; grid-template-columns: 5px 1fr auto; gap: 0 14px; color: inherit;
  border-top: 1px solid var(--line-soft); padding: 12px 16px 12px 0;
}
.wo-row:first-child { border-top: 0; }
.wo-row:hover { background: #f7f9fa; text-decoration: none; }
.wo-stripe { background: var(--p-rendah); }
.prio-darurat .wo-stripe { background: var(--p-darurat); }
.prio-tinggi .wo-stripe { background: var(--p-tinggi); }
.prio-normal .wo-stripe { background: var(--p-normal); }
.wo-main { min-width: 0; display: grid; gap: 2px; }
.wo-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wo-no { font-family: var(--font-cond); font-weight: 700; color: var(--ink-2); font-size: .95rem; letter-spacing: .01em; }
.wo-title { font-weight: 600; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: .85rem; }
.wo-meta span { display: inline-flex; align-items: center; gap: 5px; }
.wo-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }
.wo-row.is-overdue .wo-no { color: var(--danger); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 2px; }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.stat { padding: 16px 18px; border-left: 1px solid var(--line-soft); color: inherit; display: block; }
.stat:first-child { border-left: 0; }
a.stat:hover { background: #f7f9fa; text-decoration: none; }
.stat .num { font-family: var(--font-cond); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.stat .lbl { color: var(--muted); font-weight: 500; font-size: .9rem; margin-top: 6px; }
.stat.alert .num { color: var(--danger); }
.stat.zero .num { color: #a7b3bb; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px 28px; color: var(--ink-2); font-size: .925rem; margin: 0 2px 28px; }
.metrics b { font-weight: 700; }
.dept-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.dept-switch a { padding: 7px 14px; color: var(--ink-2); font-weight: 600; font-size: .9rem; border-left: 1px solid var(--line); }
.dept-switch a:first-child { border-left: 0; }
.dept-switch a.on { background: var(--ink); color: #fff; }
.dept-switch a:hover { text-decoration: none; }
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 24px; }

/* reporter hero */
.report-cta {
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; flex-wrap: wrap;
  border-left: 8px solid var(--signal);
}
.report-cta h1 { font-size: 1.7rem; }
.report-cta p { margin: 4px 0 0; color: #c2cdd4; }

/* ---------- Tabs & filters ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: flex-start; }
.search { position: relative; flex: 1; min-width: 220px; }
.search .ic { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.search input { padding-left: 38px; }
.filters { width: 100%; }
.filters > summary { list-style: none; }
.filters > summary::-webkit-details-marker { display: none; }
.filter-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; padding: 16px 16px 4px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-box .field { margin-bottom: 12px; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; padding-bottom: 12px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: .9rem; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "ticket side" "log side"; gap: 20px 24px; align-items: start; }
.detail .a-ticket { grid-area: ticket; }
.detail .a-side { grid-area: side; position: sticky; top: 76px; }
.detail .a-log { grid-area: log; }

.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.ticket-head { padding: 20px 22px 18px; }
.ticket-no {
  font-family: var(--font-cond); font-weight: 700; font-size: 2.5rem; line-height: 1; letter-spacing: .01em;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ticket-no .wo-dept { font-family: var(--font); font-size: .85rem; font-weight: 700; background: var(--ink); color: #fff; padding: 4px 9px; border-radius: 3px; letter-spacing: 0; }
.ticket-title { font-family: var(--font); font-weight: 600; font-size: 1.3rem; line-height: 1.3; margin-top: 10px; }
.ticket-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.ticket.prio-darurat { border-top: 6px solid var(--p-darurat); }
.ticket.prio-tinggi { border-top: 6px solid var(--p-tinggi); }
/* garis sobekan tiket */
.perf { position: relative; height: 0; border-top: 2px dashed #c8d1d7; margin: 0 14px; }
.perf::before, .perf::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.perf::before { left: -26px; clip-path: inset(0 0 0 50%); }
.perf::after { right: -26px; clip-path: inset(0 50% 0 0); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 16px 22px 4px; gap: 0 18px; }
.facts div { padding: 6px 0 12px; min-width: 0; }
.facts dt { color: var(--muted); font-size: .825rem; font-weight: 500; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dd small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.facts dd.bad { color: var(--danger); }
.t-block { padding: 16px 22px; border-top: 1px solid var(--line-soft); }
.t-block h2 { font-size: 1.05rem; margin-bottom: 8px; }
.t-block .desc { white-space: normal; overflow-wrap: anywhere; }
.resolution { background: #f4faf4; }
.resolution dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 12px; }
.resolution dt { color: var(--muted); font-size: .9rem; }
.resolution dd { margin: 0; overflow-wrap: anywhere; }

.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos a { width: 108px; height: 108px; border-radius: 4px; overflow: hidden; background: var(--line-soft); display: block; border: 1px solid var(--line); }
.photos a img { width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.photos a:hover img { transform: scale(1.04); }
.photos.sm a { width: 76px; height: 76px; }

/* action side */
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.side-box + .side-box { margin-top: 12px; }
.side-head { padding: 14px 16px 10px; }
.side-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.side-body { padding: 4px 16px 16px; display: grid; gap: 8px; }
.act { border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfb; }
.act > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; font-weight: 600;
}
.act > summary::-webkit-details-marker { display: none; }
.act > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.act[open] > summary::after { transform: rotate(-135deg); }
.act[open] { background: var(--surface); border-color: #b9c4cb; }
.act-body { padding: 4px 14px 14px; }
.act-body .field { margin-bottom: 12px; }
.act.primary > summary { background: var(--ink); color: #fff; border-radius: 5px; }
.act.primary[open] > summary { border-radius: 5px 5px 0 0; }
.act.primary > summary::after { border-color: #fff; }
.act.ok > summary { background: var(--st-selesai); color: #fff; border-radius: 5px; }
.act.ok[open] > summary { border-radius: 5px 5px 0 0; }
.act.ok > summary::after { border-color: #fff; }
.side-links { display: flex; gap: 8px; padding: 0 16px 16px; flex-wrap: wrap; }
.status-note { padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: .925rem; color: var(--ink-2); display: flex; gap: 10px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 18px 44px; }
.tl-dot {
  position: absolute; left: 6px; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted);
}
.tl-dot .ic { width: 11px; height: 11px; }
.tl.to-baru .tl-dot { border-color: var(--st-baru); color: var(--st-baru); }
.tl.to-diterima .tl-dot { border-color: var(--st-diterima); color: var(--st-diterima); }
.tl.to-dikerjakan .tl-dot { border-color: var(--st-dikerjakan); color: var(--st-dikerjakan); }
.tl.to-menunggu .tl-dot { border-color: var(--st-menunggu); color: var(--st-menunggu); }
.tl.to-selesai .tl-dot { border-color: var(--st-selesai); color: #fff; background: var(--st-selesai); }
.tl.to-ditutup .tl-dot { border-color: var(--st-ditutup); color: #fff; background: var(--st-ditutup); }
.tl.to-dibatalkan .tl-dot { border-color: var(--st-dibatalkan); }
.tl.quiet { padding-bottom: 10px; }
.tl.quiet .tl-line { color: var(--muted); font-size: .875rem; }
.tl-line { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.tl-line b { font-weight: 600; }
.tl-time { color: var(--muted); font-size: .825rem; margin-left: auto; white-space: nowrap; }
.tl-info { font-size: .9rem; color: var(--ink-2); margin-top: 2px; }
.tl-note { margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; overflow-wrap: anywhere; }
.tl .photos { margin-top: 8px; }
.comment-box { margin-top: 6px; padding: 14px 16px; }
.comment-box textarea { min-height: 80px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .925rem; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
thead th { border-top: 0; background: #f5f7f8; color: var(--ink-2); font-weight: 600; font-size: .85rem; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.inactive td { color: var(--muted); }
.bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input[type=text] { min-height: 36px; padding: 6px 10px; }
.inline-form select { min-height: 36px; padding: 6px 30px 6px 10px; }

.report-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.report-form .field { margin: 0; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius); overflow: visible; }
.login-card .ticket-head { padding: 26px 26px 20px; }
.login-card .brand-mark { width: 40px; height: 40px; font-size: 1.4rem; margin-bottom: 14px; }
.login-card h1 { font-size: 2rem; }
.login-card .perf::before, .login-card .perf::after { background: var(--ink); border-color: var(--ink); }
.login-body { padding: 22px 26px 26px; }
.login-foot { color: #9fb0bc; text-align: center; font-size: .85rem; margin-top: 16px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15,22,27,.92); display: none; place-items: center; padding: 16px; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 4px; }
.lightbox .iconbtn { position: absolute; top: 12px; right: 12px; color: #fff; background: rgba(255,255,255,.1); }
.lightbox a.dl { position: absolute; bottom: 16px; color: #dfe6ea; font-size: .9rem; }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }
.fab-label { display: inline; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; grid-template-areas: "ticket" "side" "log"; }
  .detail .a-side { position: static; }
  .dash-grid, .rep-grid { grid-template-columns: 1fr; }
  .filter-box { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .page { padding: 16px 12px calc(var(--tabbar-h) + 28px); }
  .nav, .top-right .who, .top-new { display: none; }
  .topbar-in { height: 52px; justify-content: space-between; }
  h1 { font-size: 1.55rem; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: var(--ink); border-radius: 0 0 3px 3px; }
  .tabbar a.tb-new.on::before { display: none; }
  .tabbar .tb-new span.fab { width: 48px; height: 48px; margin-top: -18px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); display: grid; place-items: center; box-shadow: 0 2px 0 var(--signal-deep); }
  .tabbar .badge { position: absolute; top: 6px; left: 54%; margin: 0; min-width: 18px; height: 18px; font-size: .68rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .stat .num { font-size: 2rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile span { padding: 12px; }
  .wo-row { grid-template-columns: 5px 1fr; padding-right: 12px; }
  .wo-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; margin-top: 6px; }
  .wo-title { white-space: normal; }
  .ticket-head { padding: 16px 16px 14px; }
  .ticket-no { font-size: 2rem; }
  .ticket-title { font-size: 1.15rem; }
  .facts { grid-template-columns: 1fr 1fr; padding: 14px 16px 2px; }
  .t-block { padding: 14px 16px; }
  .resolution dl { grid-template-columns: 1fr; gap: 0; }
  .resolution dd { margin-bottom: 8px; }
  .photos a { width: calc((100% - 16px) / 3); height: auto; aspect-ratio: 1; }
  .photos.sm a { width: 72px; height: 72px; }
  .filter-box { grid-template-columns: 1fr; }
  .report-cta { padding: 18px; }
  .report-cta .btn { width: 100%; }
  .page-head .btn-row { width: 100%; }
}

/* ---------- Print helpers ---------- */
@media print {
  .topbar, .tabbar, .no-print { display: none !important; }
  body { background: #fff; }
}

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

/* ==========================================================
   Audit cabang
   ========================================================== */
:root {
  --sev-kritis: #c62828;
  --sev-sedang: #dd6b1f;
  --sev-ringan: #8a99a4;
  --ok: #2b7a2f; --ok-bg: #e2f2e2;
  --bad: #b3261e; --bad-bg: #fbe9e7;
}
.bad { color: var(--danger) !important; }
.sub-h { font-size: 1rem; margin: 18px 0 8px; }
.sev { display: inline-flex; align-items: center; font-weight: 700; font-size: .75rem; padding: 2px 7px; border-radius: 3px; color: #fff; text-transform: uppercase; letter-spacing: .03em; }
.sev-kritis { background: var(--sev-kritis); }
.sev-sedang { background: var(--sev-sedang); }
.sev-ringan { background: #e6eaed; color: var(--ink-2); }
.sevrow-kritis .wo-stripe { background: var(--sev-kritis); }
.sevrow-sedang .wo-stripe { background: var(--sev-sedang); }
.sevrow-ringan .wo-stripe { background: var(--sev-ringan); }
.audit-row .wo-stripe { background: var(--ink-2); }
.evi { font-size: .75rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

.fs-terbuka { color: var(--st-baru); background: var(--st-baru-bg); }
.fs-diperbaiki { color: var(--st-menunggu); background: var(--st-menunggu-bg); }
.fs-terverifikasi { color: var(--st-selesai); background: var(--st-selesai-bg); }
.fs-ditolak { color: var(--st-dikerjakan); background: var(--st-dikerjakan-bg); }
.as-berlangsung { color: var(--st-dikerjakan); background: var(--st-dikerjakan-bg); }
.as-selesai { color: var(--st-selesai); background: var(--st-selesai-bg); }
.as-dibatalkan { color: var(--st-dibatalkan); background: var(--st-dibatalkan-bg); }

.grade { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 8px; border-radius: 4px; line-height: 1.05; }
.grade b { font-family: var(--font-cond); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.grade small { font-size: .7rem; font-weight: 600; white-space: nowrap; }
.gr-baik { background: var(--ok-bg); color: var(--ok); }
.gr-cukup { background: #fbefd9; color: #8a5200; }
.gr-perlu-perhatian { background: var(--bad-bg); color: var(--bad); }
.gr-na { background: var(--line-soft); color: var(--muted); }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-bottom: 14px; }
.callout .ic { margin-top: 2px; }
.callout.info { border-left: 4px solid var(--st-baru); }
.callout.warn { border-left: 4px solid var(--signal-deep); background: #fffaf0; }
.callout.danger { border-left: 4px solid var(--danger); background: #fdf3f2; }
.callout.ok { border-left: 4px solid var(--st-selesai); background: #f4faf4; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.from-audit { display: flex; gap: 10px; align-items: flex-start; background: #f4f7fb; }

/* beranda kepala toko */
.check-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.check-chip { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; }
.check-chip:hover { text-decoration: none; border-color: #b9c4cb; }
.check-chip b { display: block; font-weight: 600; line-height: 1.25; }
.check-chip small { color: var(--muted); font-size: .8rem; }
.cc-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--signal); color: var(--signal-ink); flex: none; }
.check-chip.done .cc-ic { background: var(--ok-bg); color: var(--ok); }
.check-chip.done small { color: var(--ok); }
.check-chip.run .cc-ic { background: #fbefd9; color: #8a5200; }

/* beranda audit */
.audit-cta { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; border-left: 8px solid var(--signal); }
.audit-cta h1 { font-size: 1.6rem; }
.audit-cta p { margin: 4px 0 0; color: #c2cdd4; }
.sched-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sched { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.sched:first-child { border-top: 0; }
.sched-time { font-family: var(--font-cond); font-weight: 700; font-size: 1.15rem; color: var(--ink-2); line-height: 1.1; }
.sched-time small { display: block; font-family: var(--font); font-weight: 500; font-size: .75rem; color: var(--muted); }
.sched-main b { display: block; font-weight: 600; }
.sched-main span { color: var(--muted); font-size: .875rem; }
.sched.is-done { background: #fafcfa; }
.sched.is-done .sched-time { color: var(--ok); }
.day-head { font-family: var(--font-cond); font-size: 1.05rem; margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.day-head small { font-family: var(--font); color: var(--muted); font-weight: 500; font-size: .85rem; }

/* pilih checklist */
.pick-group { margin-bottom: 16px; }
.pick-group h3 { font-size: .95rem; color: var(--muted); margin: 0 0 6px; font-family: var(--font); font-weight: 600; }
.pick-list { display: grid; gap: 6px; }
.pick { position: relative; display: block; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }
.pick span { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pick b { font-weight: 600; }
.pick small { color: var(--muted); font-size: .825rem; grid-column: 1; }
.pick em { font-style: normal; grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--muted); font-size: .8rem; text-align: right; white-space: nowrap; }
.pick input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f7f9fa; }
.pick input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.pick.is-hidden, .pick-group.is-hidden { display: none; }

/* isi checklist */
.afill-head { position: sticky; top: 58px; z-index: 30; background: var(--paper); padding: 10px 0 10px; margin: -10px 0 10px; border-bottom: 1px solid var(--line); }
.afill-head h1 { font-size: 1.35rem; }
.afill-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: .875rem; margin-top: 2px; }
.afill-meta span { display: inline-flex; gap: 5px; align-items: center; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.progress .bar { flex: 1; height: 8px; }
.progress .bar i { background: var(--st-selesai); transition: width .2s; }
.save-state { font-size: .8rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.save-state.is-err { color: var(--danger); font-weight: 600; }
.ai-list { display: grid; gap: 10px; }
.ai { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; scroll-margin-top: 150px; }
.ai.is-sesuai { border-left-color: var(--st-selesai); }
.ai.is-tidak { border-left-color: var(--danger); }
.ai.is-na { border-left-color: #aab5bc; }
.ai.is-missing { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(179,38,30,.15); }
.ai.is-inactive { opacity: .65; }
.ai-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.ai-code { font-family: var(--font-cond); font-weight: 700; color: var(--muted); font-size: .9rem; }
.ai-text { font-weight: 600; font-size: 1.02rem; line-height: 1.35; margin-bottom: 10px; }
.ans { display: grid; grid-template-columns: 1fr 1fr .6fr; gap: 6px; }
.ans label { position: relative; cursor: pointer; }
.ans input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ans span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid #c4cdd3; border-radius: var(--radius); font-weight: 600; background: #fff; }
.ans .a-sesuai input:checked + span { background: var(--st-selesai); border-color: var(--st-selesai); color: #fff; }
.ans .a-tidak input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.ans .a-na input:checked + span { background: #66737d; border-color: #66737d; color: #fff; }
.ans input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.ai-detail { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ai.is-tidak .ai-detail { display: block; }
.ai-detail .field { margin-bottom: 12px; }
.ai-detail textarea { min-height: 70px; }
.mini-seg { display: inline-grid; grid-auto-flow: column; border: 1px solid #c4cdd3; border-radius: var(--radius); overflow: hidden; background: #fff; }
.mini-seg label { position: relative; cursor: pointer; border-left: 1px solid var(--line); }
.mini-seg label:first-child { border-left: 0; }
.mini-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mini-seg span { display: block; padding: 8px 12px; font-weight: 600; font-size: .875rem; }
.mini-seg .s-kritis input:checked + span { background: var(--sev-kritis); color: #fff; }
.mini-seg .s-sedang input:checked + span { background: var(--sev-sedang); color: #fff; }
.mini-seg .s-ringan input:checked + span { background: var(--ink-2); color: #fff; }
.mini-seg input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: -3px; }
.ai-row2 { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: end; }
.ai-photo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-photo .photo-add { min-height: 76px; width: 76px; padding: 4px; flex-direction: column; gap: 2px; font-size: .75rem; text-align: center; }
.ai-photo .pv { width: 76px; height: 76px; }
.ai-photo .pv a { display: block; width: 100%; height: 100%; }
.pv.is-up { opacity: .55; }
.pv.is-up::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); }
.pv.is-err { outline: 2px solid var(--danger); }
.need-photo { color: var(--danger); font-size: .8rem; font-weight: 600; }
.afill-bar { position: sticky; bottom: 0; z-index: 30; margin: 18px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(236,239,241,.96); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.afill-bar .btn-row { flex: 1; justify-content: flex-end; }

/* ringkasan & hasil */
.score-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px 20px; }
.score-big { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; text-align: center; border: 8px solid var(--line-soft); }
.score-big b { font-family: var(--font-cond); font-size: 2.3rem; line-height: 1; display: block; }
.score-big small { font-size: .75rem; color: var(--muted); }
.score-big.gr-baik { border-color: #bfe0c0; }
.score-big.gr-cukup { border-color: #f1d49b; }
.score-big.gr-perlu-perhatian { border-color: #efbab5; }
.counts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: .925rem; }
.counts b { font-variant-numeric: tabular-nums; }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-na { color: var(--muted); }
.sig-wrap { border: 1px solid #c4cdd3; border-radius: var(--radius); background: #fff; position: relative; }
.sig-wrap canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sig-wrap .sig-line { position: absolute; left: 16px; right: 16px; bottom: 40px; border-bottom: 1px dashed #c4cdd3; pointer-events: none; }
.sig-wrap .sig-ph { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #a3afb7; font-size: .85rem; pointer-events: none; }
.sig-wrap.is-signed .sig-ph { display: none; }
.sig-wrap.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(179,38,30,.15); }
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sig-img { max-width: 280px; height: auto; border-bottom: 1px solid var(--line); background: #fff; }
.res-items { list-style: none; margin: 0; padding: 0; }
.res-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.res-item:first-child { border-top: 0; }
.res-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .75rem; }
.res-mark.m-sesuai { background: var(--st-selesai); }
.res-mark.m-tidak { background: var(--danger); }
.res-mark.m-na { background: #9aa6ae; }
.res-mark.m-none { background: var(--line); }
.res-item p { margin: 4px 0 0; font-size: .9rem; color: var(--ink-2); }
.res-item .photos { margin-top: 6px; }

/* temuan */
.f-callout-reject { border-left-color: var(--st-dikerjakan); }
.fix-box { background: #f8f6fc; }
.dept-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }

/* rekap */
.report-switch { margin-bottom: 18px; }
.top-items td:first-child { font-family: var(--font-cond); font-weight: 700; color: var(--muted); white-space: nowrap; }

/* admin checklist */
.cl-table td { vertical-align: top; }
.cl-table .inline-form { flex-wrap: wrap; }
.item-edit { display: grid; grid-template-columns: 1fr 120px 130px auto; gap: 6px; align-items: center; }
.item-edit input[type=text], .item-edit select { min-height: 36px; padding: 6px 10px; }
.item-edit select { padding-right: 30px; }
.div-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.master-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* tentang */
.about { max-width: 640px; }
.about-head { display: flex; gap: 16px; align-items: center; }
.about-mark { width: 52px; height: 52px; border-radius: 6px; flex: none; }
.about-for { margin: 6px 0 0; color: var(--ink-2); }
.about-facts { grid-template-columns: repeat(2, 1fr); }
.about-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.about-foot { color: var(--muted); font-size: .9rem; }
.about-link a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.login-foot a { color: #dfe6ea; text-decoration: underline; }

@media (max-width: 760px) {
  .afill-head { top: 52px; }
  .afill-bar { margin: 18px -12px 0; padding-left: 12px; padding-right: 12px; }
  .afill-bar .btn-row .btn { flex: 1; }
  .sched { grid-template-columns: 54px 1fr; }
  .sched > .btn, .sched > form, .sched > .sched-act { grid-column: 1 / -1; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .counts { justify-content: center; }
  .ai-row2 { grid-template-columns: 1fr; gap: 10px; }
  .item-edit { grid-template-columns: 1fr 1fr; }
  .item-edit input[type=text] { grid-column: 1 / -1; }
  .about-facts { grid-template-columns: 1fr 1fr; }
  .grade { min-width: 48px; }
}
@media (min-width: 901px) { .sched-form { position: sticky; top: 76px; } }

/* ---------- v1.0 penyesuaian tata letak ---------- */
.brand { white-space: nowrap; }
.nav a { white-space: nowrap; padding: 8px 10px; }
.top-right .btn { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 761px) {
  .top-right .who { display: none; }
  .topbar-in { gap: 16px; }
}
.afill-head .save-state { margin-top: 2px; min-height: 1.2em; }
.afill-bar { background: var(--paper); box-shadow: 0 -4px 12px rgba(29,42,51,.06); }
.cl-list { table-layout: fixed; }
.cl-list th:nth-child(1) { width: 64px; }
.cl-list th:nth-child(3) { width: 96px; }
.cl-list th:nth-child(4) { width: 170px; }
.cl-list th:nth-child(5) { width: 190px; }
.cl-list th:nth-child(6) { width: 64px; }
.cl-list th:nth-child(7) { width: 78px; }
.cl-list th:nth-child(8) { width: 216px; }
.cl-list .inline-form { flex-wrap: nowrap; }
@media (max-width: 900px) {
  .cl-list { table-layout: auto; min-width: 820px; }
}
@media (max-width: 760px) {
  .afill-bar [data-save-state-2] { display: none; }
  .afill-bar .btn-row { flex-wrap: nowrap; }
  .afill-bar .btn-ghost { flex: 0 0 auto; }
  .check-strip { grid-template-columns: 1fr 1fr; gap: 6px; }
  .check-chip { padding: 9px 10px; gap: 8px; align-items: flex-start; }
  .check-chip b { font-size: .9rem; }
  .cc-ic { width: 26px; height: 26px; }
}

/* ---------- v1.0.1: impor pengguna, database, kunci login ---------- */
.lock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: #8a5200; background: #fbefd9; padding: 1px 7px; border-radius: 3px; vertical-align: 1px; }
.imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.step-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); display: grid; place-items: center; font-size: .95rem; flex: none; }
.imp-rules { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.imp-table td { vertical-align: top; }
.imp-tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.imp-baru .imp-tag { background: var(--ok-bg); color: var(--ok); }
.imp-perbarui .imp-tag { background: var(--st-baru-bg); color: var(--st-baru); }
.imp-lewati .imp-tag { background: var(--line-soft); color: var(--muted); }
.imp-lewati td { color: var(--muted); }
.imp-error .imp-tag { background: var(--bad-bg); color: var(--bad); }
.imp-error { background: #fffafa; }
code, .pw { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; background: #f2f4f5; padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
.pw { font-size: .95em; font-weight: 600; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 14px 0 0; font-size: .925rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.cmd { background: var(--ink); color: #e6edf1; padding: 12px 14px; border-radius: var(--radius); font-size: .82rem; line-height: 1.55; overflow-x: auto; margin: 0 0 10px; }
.disk-bar { position: relative; height: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.disk-bar i { position: absolute; inset: 0 auto 0 0; background: #cfe3d0; }
.disk-bar i.is-high { background: #f3c1bc; }
.disk-bar span { position: relative; padding: 0 10px; line-height: 24px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
@media (max-width: 900px) { .imp-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .page-head > .btn { width: 100%; }
}
@media print { .admin-tabs, .back, .callout { display: none !important; } }
.dash-grid > *, .imp-grid > *, .rep-grid > * { min-width: 0; }
.admin-tabs { display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { white-space: nowrap; flex: none; }
.file-pick input[type=file] { width: 100%; padding: 14px; border: 2px dashed #b6c1c8; border-radius: var(--radius); background: #f7f9fa; font: 500 .95rem var(--font); color: var(--ink-2); cursor: pointer; }
.file-pick input[type=file]:hover { border-color: var(--ink); background: #fff; }
.file-pick input[type=file]::file-selector-button { font: 600 .9rem var(--font); margin-right: 12px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
