/* =========================================================
   Template Admin Laundry — responsive (desktop, tablet, HP)
   ========================================================= */
:root {
  --bg: #EEF3F4;
  --surface: #FFFFFF;
  --surface-2: #F5F9F9;
  --ink: #10242B;
  --muted: #5A6D73;
  --line: #D8E3E5;
  --side: #0E2A2F;
  --side-ink: #C9DCDF;
  --side-active: #17424A;
  --accent: #0B7A75;
  --accent-ink: #FFFFFF;
  --accent-soft: #D6EEEC;
  --warn: #9A5A00;   --warn-soft: #FBEACB;
  --ok: #25702B;     --ok-soft: #DDF1DE;
  --bad: #B3261E;    --bad-soft: #F9DEDB;
  --busy: #2558D0;   --busy-soft: #DCE6FB;
  --r: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.ikon { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none !important; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-logo i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; background: radial-gradient(circle at 50% 72%, #8fe0da 0 42%, transparent 44%); }
.brand-text { font-weight: 800; font-size: 15.5px; line-height: 1.2; display: grid; }
.brand-text small { font-weight: 500; font-size: 11.5px; color: var(--side-ink); opacity: .8; }
.nav { display: grid; gap: 2px; padding: 8px 10px; flex: 1; align-content: start; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; opacity: .55; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink);
  font-weight: 600; text-decoration: none !important; border: 0; background: none; width: 100%; font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.aktif { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #3FC1B8; }
.nav-count { margin-left: auto; font-style: normal; font-size: 11px; background: #3FC1B8; color: #062321; border-radius: 99px; padding: 0 7px; font-weight: 700; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 10px; display: grid; gap: 6px; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: #fff; font-weight: 600; }
.user small { display: block; font-weight: 500; color: var(--side-ink); font-size: 11.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--side-active); display: grid; place-items: center; font-weight: 800; }
.btn-keluar { color: #F2A49D; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.hari { color: var(--muted); font-size: 13px; }
.menu-toggle { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.content { padding: 22px 24px 40px; display: grid; gap: 20px; align-content: start; }
.footer { padding: 14px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.backdrop { display: none; }

/* ---------- Komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 18px; display: grid; gap: 14px; }
.card-body.p0 { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 2px; }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.stat b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }

.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pipe { padding: 14px 16px; border-right: 1px solid var(--line); display: grid; color: var(--ink); text-decoration: none !important; }
.pipe:last-child { border-right: 0; }
.pipe:hover { background: var(--surface-2); }
.pipe b { font-size: 26px; font-weight: 800; }
.pipe span { font-size: 12px; color: var(--muted); }

/* Tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--accent); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--bad); border-color: #EBC2BE; }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .ikon { width: 16px; height: 16px; }

/* Form */
label, .lbl { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.help { font-size: 12px; color: var(--muted); font-weight: 500; }

.item-row { display: grid; grid-template-columns: 1fr 100px auto; gap: 8px; }
.pilih-layanan { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.opsi { position: relative; display: block; }
.opsi input { position: absolute; opacity: 0; pointer-events: none; }
.opsi span { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; cursor: pointer; background: var(--surface); height: 100%; }
.opsi span b { font-size: 14px; color: var(--ink); }
.opsi span em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.opsi input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.opsi input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { display: block; color: var(--ink); font-size: 13.5px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 6px; text-align: center; cursor: pointer; font-weight: 600; background: var(--surface); }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }

.ringkas { position: sticky; top: 78px; }
.baris { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.baris.total { font-size: 17px; font-weight: 800; border-top: 1px dashed var(--line); padding-top: 10px; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-lunas, .badge-siap { background: var(--ok-soft); color: var(--ok); }
.badge-dp { background: var(--warn-soft); color: var(--warn); }
.badge-belum { background: var(--bad-soft); color: var(--bad); }
.badge-jalan { background: var(--busy-soft); color: var(--busy); }
.badge-netral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge-abu { background: #ECEFF0; color: #6B7A7E; }

/* Alert */
.alert { padding: 11px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.alert-sukses { background: var(--ok-soft); color: var(--ok); }
.alert-gagal { background: var(--bad-soft); color: var(--bad); }
.alert-info { background: var(--busy-soft); color: var(--busy); }

/* Tabel */
.table-wrap { overflow-x: auto; }
table.tabel { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabel th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tabel td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabel tr:last-child td { border-bottom: 0; }
.tabel tbody tr:hover td { background: var(--surface-2); }
.tabel .r { text-align: right; }
.kode { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.kosong { padding: 22px; text-align: center; color: var(--muted); font-size: 13.5px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.toolbar > * { flex: 1 1 160px; }
.toolbar .btn { flex: 0 0 auto; }
.paging { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 14px; flex-wrap: wrap; }

/* Mesin */
.mesin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mc { border: 1px solid var(--line); border-radius: var(--r); padding: 13px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--surface-2); min-width: 0; }
.mc.jalan { background: var(--busy-soft); border-color: transparent; }
.drum { width: 58px; height: 58px; border-radius: 50%; border: 5px solid #C9D6D9; background: var(--surface); position: relative; overflow: hidden; }
.mc.jalan .drum { border-color: var(--busy); }
.mc.jalan .drum::before { content: ""; position: absolute; inset: -30%; background: conic-gradient(from 0deg, var(--busy) 0 18%, transparent 18% 50%, var(--busy) 50% 68%, transparent 68%); opacity: .35; animation: putar 2.4s linear infinite; }
.mc.jalan .drum::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: var(--busy); opacity: .4; }
.mc.pengering.jalan .drum::before { animation-duration: 3.6s; }
@keyframes putar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mc.jalan .drum::before { animation: none; } }
.mc-info { display: grid; gap: 2px; min-width: 0; }
.mc-info .nm { font-weight: 700; display: flex; justify-content: space-between; gap: 4px 6px; align-items: center; flex-wrap: wrap; }
.mc-info .nm-teks { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mc-info .sub { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-aksi { grid-column: 1 / -1; display: flex; gap: 6px; }
.mc-aksi form { flex: 1; display: flex; }
.mc-aksi .btn { flex: 1; }

/* Papan antrean */
.papan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kolom { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; min-width: 0; }
.kolom-head { display: flex; justify-content: space-between; align-items: center; }
.tiket { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.tiket-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tiket .ket { font-size: 13px; }
.assign { display: flex; gap: 6px; }
.assign select { padding: 6px 8px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* Detail */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { display: grid; gap: 8px; border-left: 2px solid var(--line); padding-left: 14px; font-size: 13px; }
.timeline div { position: relative; }
.timeline div::before { content: ""; position: absolute; left: -19px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline time { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 6px; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); background-image: radial-gradient(circle at 20% 15%, #17424A 0, transparent 40%), radial-gradient(circle at 85% 90%, #0B4F4C 0, transparent 45%); }
.login-box { width: 100%; max-width: 390px; background: var(--surface); border-radius: 16px; padding: 30px; display: grid; gap: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-box .brand { color: var(--ink); padding: 0; }
.login-box .brand-text small { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .papan { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-buka .sidebar { transform: none; }
  body.menu-buka .backdrop { display: block; position: fixed; inset: 0; background: rgba(5,15,18,.5); z-index: 40; }
  .menu-toggle { display: inline-flex; }
  .grid-2, .grid-form, .papan { grid-template-columns: 1fr; }
  .ringkas { position: static; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipe:nth-child(3) { border-right: 0; }
  .pipe:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .topbar, .content, .footer { padding-left: 16px; padding-right: 16px; }
  .hari { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipe { border-bottom: 1px solid var(--line); border-right: 0; }
  .pipe:nth-child(odd) { border-right: 1px solid var(--line); }
  .hide-sm { display: none; }
  .item-row { grid-template-columns: 1fr 70px auto; }
  /* Tabel jadi kartu di HP */
  .tabel.responsif thead { display: none; }
  .tabel.responsif tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tabel.responsif td { padding: 0; border: 0; }
  .tabel.responsif td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 11.5px; }
  .tabel.responsif td.r { text-align: left; }
}

/* Cetak */
@media print {
  .sidebar, .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; }
}
