/* Booking Mobil Sekolah — gaya A "Bersih & Terang" (mockup v27) */
:root {
  --primary: #2563EB; --primary-soft: #DBE7FF; --primary-tint: #EFF4FF;
  --bg: #F6F8FB; --surface: #FFFFFF; --border: #E3E8EE; --text: #0F172A; --muted: #64748B;
  --sidebar: #FFFFFF; --danger: #DC2626; --danger-soft: #FEE2E2; --warn: #B45309; --warn-soft: #FEF3C7;
  --success: #15803D; --success-soft: #DCFCE7; --neutral-soft: #F1F5F9;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 24px; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
.hp-saja { display: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--sidebar); color: var(--text); border-right: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 20px; }
.brand .logo { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand b { display: block; font-size: 16px; letter-spacing: .5px; }
.brand span { display: block; font-size: 11px; line-height: 1.3; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--neutral-soft); }
.nav a.active { color: var(--primary); background: var(--primary-tint); font-weight: 600; }
.nav .nav-badge { margin-left: auto; font-size: 10px; padding: 2px 6px; }
.sidebar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 12px; padding: 12px 4px 0; border-top: 1px solid var(--border); }
.me b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me form { margin-left: auto; }
.me button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.me button:hover { color: var(--text); background: var(--neutral-soft); }
.main { flex: 1; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.crumbs b { color: var(--text); }
.topbar { display: none; }

/* ---------- Basic UI ---------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; } .icon.xs { width: 14px; height: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.split.wide { grid-template-columns: minmax(0, 1fr) 360px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.hr { height: 1px; background: var(--border); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; background: var(--primary); color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--neutral-soft); filter: none; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.success { background: var(--success); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.icon-only { padding: 0; width: 32px; height: 32px; justify-content: center; }
.btn.block { width: 100%; justify-content: center; }
.inline { display: inline; margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--neutral-soft); color: var(--text); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.diajukan, .badge.terjadwal-soon, .badge.proses, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.disetujui, .badge.tersedia, .badge.success { background: var(--success-soft); color: var(--success); }
.badge.ditolak, .badge.terpakai, .badge.izin, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.batal, .badge.selesai { background: var(--neutral-soft); color: var(--muted); }
.badge.terjadwal, .badge.bertugas, .badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.servis { background: var(--warn-soft); color: var(--warn); }
.vtag { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.vtag i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.icon-box { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; font-size: 13px; }
.alert b { display: block; font-size: 14px; margin-bottom: 2px; }
.alert.danger { background: var(--danger-soft); } .alert.danger b, .alert.danger .icon { color: var(--danger); }
.alert.success { background: var(--success-soft); } .alert.success b, .alert.success .icon { color: var(--success); }
.alert.warn { background: var(--warn-soft); } .alert.warn b, .alert.warn .icon { color: var(--warn); }
.alert.info { background: var(--primary-soft); } .alert.info .icon { color: var(--primary); }

/* ---------- Stats ---------- */
.stat { gap: 12px; }
.stat .value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .label { font-size: 13px; color: var(--muted); }

/* ---------- Timeline ---------- */
.tl-hours, .tl-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.tl-hours .scale { position: relative; height: 16px; font-size: 11px; color: var(--muted); font-weight: 500; }
.tl-hours .scale span { position: absolute; transform: translateX(-50%); }
.tl-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tl-track { position: relative; background: #F8FAFC; border-radius: 8px; min-height: 44px; }
.tl-block { position: absolute; height: 26px; border-radius: 6px; color: #fff; padding: 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.tl-block small { font-weight: 400; opacity: .85; }
.tl-block.diajukan { background-image: repeating-linear-gradient(135deg, transparent 0 6px, #ffffff33 6px 12px); }
.tl-block.servis { background: repeating-linear-gradient(135deg, #B45309 0 6px, #92400E 6px 12px) !important; }
.tl-empty { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 500; color: var(--success); }

/* ---------- Lists ---------- */
.list-item { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.list-item .title { font-weight: 600; font-size: 13px; }
.person { display: flex; gap: 10px; align-items: center; }
.person .body { flex: 1; min-width: 0; }
.person b { display: block; }

/* ---------- Tabs / filters ---------- */
.tabs-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; gap: 24px; overflow-x: auto; }
.tabs a { display: flex; gap: 8px; align-items: center; padding-bottom: 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.tabs a.active .badge { background: var(--primary-soft); color: var(--primary); }
.filters { display: flex; gap: 8px; padding-bottom: 10px; flex-wrap: wrap; }
.filters select, .filters input, .search input { height: 36px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #F8FAFC; padding: 12px 16px; white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.table tr:hover td { background: #FAFBFC; }
.table .kegiatan b { display: block; font-weight: 600; }
.table .kegiatan span { color: var(--muted); font-size: 12px; }
.table .aksi { display: flex; gap: 6px; justify-content: flex-end; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); gap: 12px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 10px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 500; }
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .disabled { color: #CBD5E1; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.section-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=month], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; outline: none;
}
textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #2563EB22; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }

.options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); height: 100%; }
.option .box b { display: flex; justify-content: space-between; align-items: center; }
.option .box .check-icon { color: var(--primary); visibility: hidden; }
.option input:checked + .box { border: 2px solid var(--primary); background: var(--primary-tint); padding: 13px; }
.option input:checked + .box .check-icon { visibility: visible; }
.option.off .box { opacity: .55; }
.option .status-text { font-size: 12px; color: var(--muted); }
.option.off .status-text { color: var(--danger); }

.avail-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.avail-row .ket { font-size: 12px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }

/* ---------- Vehicle cards ---------- */
.vcard .meta { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: 110px repeat(7, minmax(120px, 1fr)); min-width: 980px; }
.cal > div { border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 8px; min-height: 92px; }
.cal .head { min-height: 0; background: #F8FAFC; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal .head.today { color: var(--primary); background: var(--primary-tint); }
.cal .veh { font-weight: 600; display: flex; align-items: flex-start; }
.cal .cell { display: flex; flex-direction: column; gap: 4px; }
.cal .cell.today { background: var(--primary-tint); }
.cal .cell .add { color: #CBD5E1; font-size: 12px; margin-top: auto; }
.cal .cell:hover .add { color: var(--primary); }
.ev { display: block; border-radius: 6px; padding: 4px 6px; font-size: 11px; line-height: 1.3; color: #fff; overflow: hidden; }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.diajukan { background-image: repeating-linear-gradient(135deg, transparent 0 6px, #ffffff33 6px 12px); }
.ev.servis { background: var(--warn); }

/* ---------- Report ---------- */
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 120px; gap: 12px; align-items: center; font-size: 13px; }
.bar-track { height: 10px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 32px; }

/* ---------- Mobile driver ---------- */
.mobile { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.mobile-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 24px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.mobile-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.mobile-head .counters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mobile-head .counters div { background: #ffffff26; border-radius: 10px; padding: 12px; }
.mobile-head .counters b { font-size: 20px; display: block; }
.mobile-head .counters span { font-size: 12px; color: #ffffffcc; }
.mobile-body { flex: 1; padding: 20px 20px 88px; display: flex; flex-direction: column; gap: 12px; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 20; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px; border-radius: 8px; }
.tabbar a.active { color: var(--primary); }
.trip .time { font-size: 20px; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split.wide { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax #0006; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 0; color: var(--text); padding: 4px; }
  .main { padding: 16px; gap: 16px; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .tl-hours, .tl-row { grid-template-columns: 70px minmax(0, 1fr); }
  .page-head .actions { width: 100%; }
  .search { flex: 1; }
}

/* ---------- OCR odometer ---------- */
.ocr { display: flex; flex-direction: column; gap: 10px; }
.ocr-shot { cursor: pointer; }
.ocr-shot input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ocr-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 10px; border: 2px dashed var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.ocr-shot:hover .ocr-btn { background: var(--primary-soft); }
.ocr-preview img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: #000; display: block; }
.ocr-km-besar { height: 56px !important; font-size: 26px !important; font-weight: 700; letter-spacing: 1px; text-align: center; }
.ok-text { color: var(--success); } .warn-text { color: var(--warn); }
.km-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.km-pair div { background: var(--neutral-soft); border-radius: 10px; padding: 10px 12px; }
.km-pair b { display: block; font-size: 16px; }
.km-pair span { font-size: 12px; color: var(--muted); }
.km-pair a { color: var(--primary); font-size: 12px; font-weight: 600; }

/* ---------- Cek kendaraan ---------- */
.foto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foto-slot { position: relative; cursor: pointer; }
.foto-slot input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.foto-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; height: 110px; border-radius: 10px; border: 2px dashed #CBD5E1; background: #F8FAFC center/cover no-repeat; color: var(--muted); font-size: 12px; font-weight: 600; position: relative; overflow: hidden; }
.foto-box small { font-weight: 400; }
.foto-slot.terisi .foto-box { border: 2px solid var(--success); color: transparent; }
.foto-slot.terisi .foto-box .icon { display: none; }
.foto-slot.terisi .foto-box::after { content: attr(data-jumlah); position: absolute; right: 6px; top: 6px; background: var(--success); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.foto-slot.proses .foto-box { opacity: .5; }
.foto-slot.has-error .foto-box { border-color: var(--danger); background-color: var(--danger-soft); }
.cek-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.cek-row:first-of-type { border-top: 0; }
.cek-row.has-error .cek-label { color: var(--danger); }
.cek-label { font-size: 14px; font-weight: 500; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cek-catatan { grid-column: 1 / -1; }
.pills { display: flex; gap: 6px; }
.pills.wrap { flex-wrap: wrap; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pill { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.pills input:checked + .pill { background: var(--primary); border-color: var(--primary); color: #fff; }
.pills input:checked + .pill.ok { background: var(--success); border-color: var(--success); }
.pills input:checked + .pill.bad { background: var(--danger); border-color: var(--danger); }
.danger-btn { background: var(--danger) !important; }
.foto-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.foto-thumbs a { display: block; position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: #F1F5F9; }
.foto-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-thumbs span { position: absolute; left: 0; right: 0; bottom: 0; background: #0009; color: #fff; font-size: 10px; padding: 2px 6px; }
.cek-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.cek-list div { display: flex; gap: 8px; align-items: flex-start; }

/* ---------- Pilih pegawai ---------- */
.pp { position: relative; }
.pp-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: text; }
.pp-tags:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px #2563EB22; }
.pp-tags .pp-input { flex: 1; min-width: 160px; border: 0 !important; box-shadow: none !important; height: 28px; padding: 0 4px; }
.pp-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; font-weight: 600; }
.pp-tag small { font-weight: 400; opacity: .75; }
.pp-tag[data-nip=""] { background: var(--neutral-soft); color: var(--text); }
.pp-tag button { border: 0; background: #0000001a; color: inherit; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1; padding: 0; }
.pp-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px #0f172a1f; max-height: 280px; overflow: auto; }
.pp-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.pp-item span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pp-item.on, .pp-item:hover { background: var(--primary-tint); }
.pp-free { color: var(--primary); border-top: 1px solid var(--border); }
.pp-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ---------- Popup form ---------- */
.popup { width: min(1240px, 96vw); height: 92vh; max-height: 92vh; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--bg); box-shadow: 0 30px 80px #0f172a59; }
.popup::backdrop { background: #0f172a8c; }
.popup iframe { width: 100%; height: 100%; border: 0; display: block; }
.popup-x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
.popup-x:hover { color: var(--text); }
body.in-popup { background: var(--bg); }
body.in-popup .main { min-height: 100vh; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px #0f172a40; }
body.in-popup .page-head { padding-right: 44px; }

/* ---------- Jadwal hari ini / tabel ringkas ---------- */
.table.ringkas td { padding: 10px 16px; }
.table .jam { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.badge.berjalan { background: var(--primary-soft); color: var(--primary); }

/* ---------- Perawatan ---------- */
.mobil-card { gap: 14px; }
.mobil-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tempo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tempo div { border-radius: 10px; padding: 10px 12px; background: var(--neutral-soft); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tempo span { font-size: 11px; color: var(--muted); font-weight: 600; }
.tempo b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tempo .segera { background: var(--warn-soft); } .tempo .segera b { color: var(--warn); }
.tempo .lewat { background: var(--danger-soft); } .tempo .lewat b { color: var(--danger); }
.tempo .ok b { color: var(--success); }
.riwayat { display: flex; flex-direction: column; }
.riwayat > div { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; align-items: start; }
.riwayat > div:first-child { border-top: 0; }
.riwayat .tgl { color: var(--muted); font-size: 12px; }
.riwayat .isi { min-width: 0; }
.riwayat .isi .sub { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.checklist label { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; cursor: pointer; }
.checklist small { color: var(--muted); margin-left: auto; }
.target-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.target-box div { background: var(--primary-tint); border-radius: 10px; padding: 10px 12px; }
.target-box span { font-size: 12px; color: var(--muted); display: block; }
.target-box b { font-size: 16px; color: var(--primary); }
@media (max-width: 640px) { .tempo { grid-template-columns: 1fr; } }
.alert .btn .icon { color: inherit; }

/* ---------- HP: grid tidak boleh melebar karena tabel, tabel jadi kartu ---------- */
@media (max-width: 1200px) {
  .split, .split.wide { grid-template-columns: minmax(0, 1fr); }
}
.stack > *, .split > * { min-width: 0; }
@media (max-width: 860px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.stat { padding: 14px; gap: 8px; }
  .card.stat .value { font-size: 22px; }
  .card.stat .icon-box { width: 32px; height: 32px; border-radius: 8px; }
  .card.stat .icon-box .icon { width: 16px; height: 16px; }
  .page-head h1 { font-size: 22px; }
  .table-wrap .table:not(.kartu) td { white-space: nowrap; }
}
@media (max-width: 640px) {
  .hp-saja { display: inline; }
  .table.kartu thead { display: none; }
  .table.kartu, .table.kartu tbody { display: block; width: 100%; }
  .table.kartu tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
  .table.kartu td { display: block; padding: 0; border: 0; white-space: normal; }
  .table.kartu td:empty { display: none; }
  .table.kartu tr:hover td { background: none; }
  .table.kartu .k-kanan { margin-left: auto; order: 3; }
  .table.kartu .k-utama { flex-basis: 100%; order: 5; }
  .table.kartu .k-bawah { order: 6; font-size: 12px; color: var(--muted); }
  .table.kartu .k-penuh { flex-basis: 100%; order: 7; }
  .table.kartu .k-penuh .aksi { justify-content: flex-start; }
  .table.kartu td.empty { flex-basis: 100%; padding: 24px 0; }
  .tempo div { flex-direction: row; justify-content: space-between; align-items: center; padding: 8px 12px; }
  .riwayat > div { grid-template-columns: 66px minmax(0, 1fr); }
  .riwayat .tgl { white-space: nowrap; }
  .riwayat > div > :last-child:not(.isi) { grid-column: 2; }
  .tabs { gap: 18px; }
  .filters > * { flex: 1 1 140px; }
}
