/* ============================================================
   GA Tracker — Tema "Biru Minimalis"  v6 · 29 Sep 2026
   Gaya: flat minimalis — slate kebiruan, aksen biru, garis tipis.
   Scope GLOBAL. Token terpusat di bawah: ganti warna = sentuh
   blok token ini saja (komponen lain pakai var).
   ============================================================ */

/* ---------- Token ---------- */
[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-blob-1: transparent; --bg-blob-2: transparent; --bg-blob-3: transparent;
  --glass-bg: #ffffff;
  --glass-border: #e2e8f0;
  --glass-hi: #edf1f7;
  --input-bg: #ffffff;
  --text: #0f172a;
  --text-muted: rgba(15, 23, 42, 0.62);
  --text-soft: rgba(15, 23, 42, 0.84);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --blur: none;
  --accent-1: #2563eb;
  --accent-2: #1d4ed8;
  --accent-3: #2563eb;
  --accent-soft: #e8effd;
  --ok: #0e9f6e;
  --blem: #b45309;
  --danger: #d93025;
  --radius-lg: 14px; --radius-md: 12px; --radius-sm: 10px;
}
[data-theme="dark"] {
  --bg: #0c1220;
  --bg-blob-1: transparent; --bg-blob-2: transparent; --bg-blob-3: transparent;
  --glass-bg: #131b2e;
  --glass-border: #26314d;
  --glass-hi: #1a2440;
  --input-bg: #0e1526;
  --text: #eaf0fb;
  --text-muted: rgba(234, 240, 251, 0.66);
  --text-soft: rgba(234, 240, 251, 0.88);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --blur: none;
  --accent-1: #60a5fa;
  --accent-2: #7db4fc;
  --accent-3: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --ok: #34d399;
  --blem: #fbbf24;
  --danger: #ff6b6b;
  --radius-lg: 14px; --radius-md: 12px; --radius-sm: 10px;
}

/* ---------- Base: background polos, font dasar gede & tebel ---------- */
body::before, body::after { display: none; }              /* blob warna dihapus */
html { font-size: 17px; }                                 /* base font naik (dari 16px) */
body { font-weight: 600; }                                /* base font lebih tebel */
.glass { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- Gradasi / nyala → rata (solid) ---------- */
.brand-dot { background: var(--accent-1); box-shadow: none; }
.pin-dot.filled { background: var(--accent-1); border-color: transparent; box-shadow: none; }
.btn-primary, .btn-submit, .btn-asset-add, .tab-btn.active, .maint-tab.active,
.chat-fab, .chat-panel .msg.user {
  background: var(--accent-1); color: #fff; border: 0; border-color: transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); filter: none; transform: none;
}
.btn-primary:hover, .btn-submit:hover { background: var(--accent-2); filter: none; transform: none; box-shadow: none; }
.btn-asset-add:hover, .maint-tab.active:hover, .chat-fab:hover { filter: brightness(1.06); transform: none; }
.btn-ok { background: var(--ok); }
.btn-blem { background: #d97706; }
.bar-fill { background: var(--accent-1); }
.bar-fill.warn { background: var(--blem); }
.bar-fill.good { background: var(--ok); }
.trend-day.ok { background: var(--ok); }
.trend-day.blem { background: var(--blem); }
.stat-card.accent .stat-num { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--accent-1); -webkit-text-fill-color: currentColor; }

/* ---------- Komponen yang masih bawa literal biru lama ---------- */
.reminder-card { background: var(--accent-soft); border: 1px solid rgba(37, 99, 235, 0.32); }
[data-theme="dark"] .reminder-card { border-color: rgba(96, 165, 250, 0.32); }
.cal-cell.is-selected { background: var(--accent-soft); }
.task-card.is-open .task-card-header { background: var(--glass-hi); }
.dd-item.is-on { background: var(--accent-soft); color: var(--accent-1); }
.dd-panel { background: var(--glass-bg); }
#tab-tasks .calendar-card .cal-nav .btn-icon { background: var(--accent-soft); color: var(--accent-1); border-color: transparent; }
.loading-state, .empty-state { color: var(--text-muted); }

/* ---------- Overlay & chrome (semua halaman) ---------- */
.modal-card, .chat-panel {
  --glass-bg: #ffffff; --glass-border: #e2e8f0; --glass-hi: #edf1f7; --input-bg: #ffffff;
  --blur: none; --shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  --radius-lg: 14px; --radius-md: 12px; --radius-sm: 10px;
}
[data-theme="dark"] .modal-card, [data-theme="dark"] .chat-panel {
  --glass-bg: #131b2e; --glass-border: #26314d; --glass-hi: #1a2440; --input-bg: #0e1526;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
}
.modal-backdrop, .lightbox-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(15, 23, 42, 0.5); }
.toast { background: rgba(24, 24, 27, 0.96); -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 10px; }

/* Dark: elemen aksen berisi teks → teks gelap biar kontras */
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-submit, [data-theme="dark"] .btn-asset-add,
[data-theme="dark"] .tab-btn.active, [data-theme="dark"] .maint-tab.active,
[data-theme="dark"] .chat-fab, [data-theme="dark"] .chat-panel .msg.user { color: #0b1b33; font-weight: 700; }
[data-theme="dark"] .dd-item.is-on { color: var(--accent-1); }

/* ---------- Teks kecil yang kekunci px ikut naik ---------- */
.sub, .spec-item, .tm, .unit-picker-title, .mr-right, .cal-month-title { font-size: 13px; }
.asset-kind, .asset-clean-pill, .asset-log-title, .asset-open-hint, .asset-dl-title { font-size: 12px; }
.btn-primary, .btn-ghost, .btn-mini, .uc-name, .maint-tab, .ifield { font-size: 14px; }
.inline-form-title { font-size: 15px; }
@media (min-width: 1024px) {
  .ifield input, .ifield select, .ifield textarea, .filter-select, .filter-input, #asset-search { font-size: 14px; }
}

/* ============================================================
   Sidebar (desktop & tablet ≥768px; HP tetap drop-down)
   ============================================================ */
@media (min-width: 768px) {
  .tabs-nav {
    display: flex !important; flex-direction: column; align-items: stretch; gap: 2px;
    position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
    margin: 0; padding: 16px 12px 14px; border: 0; border-right: 1px solid var(--glass-border);
    border-radius: 0; background: var(--glass-bg); box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; overflow-y: auto;
  }

  /* Brand */
  .sb-head { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--glass-border); }
  .sb-logo {
    width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center;
    background: var(--accent-1); color: #fff; font-weight: 800; font-size: 0.8rem; letter-spacing: -0.02em;
  }
  [data-theme="dark"] .sb-logo { color: #0b1b33; }
  .sb-brand { display: flex; flex-direction: column; min-width: 0; }
  .sb-name { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; color: var(--text); line-height: 1.2; }
  .sb-sub { font-size: 0.64rem; font-weight: 600; color: var(--text-muted); }

  /* Label section */
  .sb-label { margin: 14px 10px 4px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

  /* Item menu */
  .tabs-nav .tab-btn {
    position: relative; flex: 0 0 auto; width: 100%; justify-content: flex-start; gap: 11px; white-space: normal;
    min-height: 42px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent;
    font-size: 0.93rem; font-weight: 600; color: var(--text-muted); background: transparent; box-shadow: none; text-align: left;
  }
  .tabs-nav .tab-btn svg { flex: 0 0 auto; }
  .tabs-nav .tab-btn:hover { background: var(--glass-hi); color: var(--text); }
  .tabs-nav .tab-btn.active { background: var(--accent-soft); color: var(--accent-1); font-weight: 700; box-shadow: none; }
  .tabs-nav .tab-btn.active svg { color: var(--accent-1); }
  .tabs-nav .tab-btn.active::before {
    content: ""; position: absolute; left: -12px; top: 24%; bottom: 24%; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--accent-1);
  }

  /* Footer */
  .sb-foot {
    margin-top: auto; padding: 12px 10px 2px; display: flex; align-items: center; gap: 7px;
    border-top: 1px solid var(--glass-border); font-size: 0.64rem; font-weight: 700; color: var(--text-muted);
  }
  .sb-foot-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.16); }
  .tabs-nav:not(:has(#tab-manage-btn:not(.hidden))) .sb-label-admin { display: none; }

  .nav-select-wrap { display: none !important; }
  #view-dashboard, #view-analytics { padding-left: 232px; }
  #view-dashboard.view, #view-analytics.view { animation: none; } /* sidebar fixed: jangan ikut animasi fade view */
  .app-shell:has(#view-dashboard:not(.hidden)) { max-width: 990px; }
  .app-shell:has(#view-analytics:not(.hidden)) { max-width: 990px; }
}
@media (min-width: 1024px) { .app-shell:has(#view-dashboard:not(.hidden)) { max-width: 1472px; } }
@media (min-width: 1024px) { .app-shell:has(#view-analytics:not(.hidden)) { max-width: 1472px; } }
@media (min-width: 1440px) { .app-shell:has(#view-dashboard:not(.hidden)) { max-width: 1592px; } }
@media (min-width: 1440px) { .app-shell:has(#view-analytics:not(.hidden)) { max-width: 1592px; } }

/* Tablet (768–1023px): rail ikon; label jadi garis pemisah */
@media (min-width: 768px) and (max-width: 1023px) {
  .tabs-nav { width: 72px; padding: 16px 10px 12px; align-items: center; }
  .tabs-nav .tab-btn { justify-content: center; padding: 12px 0; gap: 0; }
  .tabs-nav .tab-btn > span { display: none; }
  .tabs-nav .tab-btn.active::before { left: -10px; }
  .sb-brand, .sb-sub { display: none; }
  .sb-head { justify-content: center; padding: 0 0 12px; width: 100%; }
  .sb-label { display: block; width: 100%; height: 1px; margin: 10px 8px; padding: 0; background: var(--glass-border); color: transparent; font-size: 0; overflow: hidden; }
  .sb-foot { justify-content: center; width: 100%; }
  .sb-foot span:last-child { display: none; }
  #view-dashboard, #view-analytics { padding-left: 72px; }
}

/* ---------- HP: drop-down tetap, dikasih aksen baru ---------- */
.dd-btn { font-weight: 700; }
.dd-item.is-on .dd-check { color: var(--accent-1); }

/* Konten desktop dijaga proporsional (sidebar makan 232px) */
.skin .section-title-wrap { margin-bottom: 16px; }
.skin .assets-list, .skin .maint-list, .skin .history-list { gap: 14px; }
.skin .asset-card, .skin .history-card, .skin .inline-form { padding: 16px; }
.skin .filter-row { gap: 10px; }
.skin .filter-select { padding: 11px 13px; }
.skin .btn-asset-act { padding: 10px 12px; }
.skin .badge-counter { padding: 6px 13px; }
@media (min-width: 768px) and (max-width: 1023px) { .skin .assets-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .skin .assets-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ============================================================
   Riwayat & Maintenance — kotak tinggi rata + maintenance per tile
   (permintaan Ilham 21 Sep 2026: "height kotak di riwayat samain,
   maintenance bikin per tile kyk di PC aja")
   ============================================================ */
/* Riwayat laporan: grid ≥768px jangan `start` (bikin tinggi kotak beda-beda) */
.history-list { align-items: stretch; }
.history-card { display: flex; flex-direction: column; }
.history-card .admin-card-actions { margin-top: auto; }

/* Maintenance: catatan jadi tile, sejajar kartu PC/aset */
.maint-list { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
@media (min-width: 768px) { .maint-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1024px) { .maint-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.maint-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 15px; border-radius: var(--radius-md); }
.mr-left { font-size: 0.95rem; gap: 2px; }
.mr-left .sub { font-size: 0.78rem; }
.mr-mid { margin-top: 2px; }
.mr-right { justify-content: flex-start; text-align: left; margin-top: auto; font-size: 12.5px; }
.mr-note { text-align: left; }

/* ============================================================
   Form aset (21 Sep 2026): cek/bersihin nempel di form edit,
   storage per drive, tombol Simpan nyala kalau ada perubahan
   ============================================================ */
.btn-asset-act.warn { border-color: rgba(180, 83, 9, 0.45); color: var(--blem); }
.if-section { margin: 16px 0 8px; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); }
.af-drives { display: flex; flex-wrap: wrap; gap: 8px; }
.af-drive { display: flex; align-items: center; gap: 6px; }
.af-drive .af-drive-name { width: 66px; flex: 0 0 auto; text-align: center; font-weight: 700; }
.af-drive .af-drive-gb { width: 118px; flex: 0 0 auto; }
.af-drive-del { width: 34px; height: 34px; flex: 0 0 auto; font-size: 0.78rem; }
.btn-mini.af-drive-add { margin-top: 8px; }
.af-part-open { margin-top: 6px; }
.inline-form-actions .btn-primary.is-on:not(:disabled) { box-shadow: 0 8px 18px -10px var(--accent-1); }
.inline-form-actions .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   Popup aset: form edit + input bersihin DI DALAM popup (21 Sep 2026)
   "kejauhan & kurang taktis kalau di atas halaman" → popup dibesarin
   ============================================================ */
.asset-modal-card { width: min(96vw, 880px); max-height: 90vh; padding: 18px 20px; gap: 12px; }
@media (max-width: 767px) { .asset-modal-card { width: 96vw; max-height: 92vh; padding: 14px; } }
.af-modal-form { display: flex; flex-direction: column; gap: 12px; }
.af-modal-form .ifield input, .af-modal-form .ifield select { min-height: 40px; }
.af-modal-form .iform-grid { gap: 10px 12px; }
#asset-modal .asset-dl-actions { position: sticky; bottom: 0; background: var(--glass-bg); padding-top: 6px; }

/* ============================================================
   Filter riwayat maintenance: unit/genset + tanggal di-service (21 Sep 2026)
   ============================================================ */
.maint-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: -6px 0 14px; }
.maint-filters .maint-filter { flex: 1 1 210px; max-width: none; margin: 0; }
.maint-filters .maint-filter select, .maint-filters .maint-filter input { width: 100%; max-width: none; min-width: 0; }
@media (max-width: 767px) { .maint-filters { flex-direction: column; gap: 8px; } .maint-filters .maint-filter { flex: 0 0 auto; } }

/* Badge "punya siapa" di kartu tugas — admin bisa backup tugas staff (21 Sep 2026) */
.owner-badge { background: var(--accent-soft); border-color: var(--accent-1); color: var(--accent-1); font-weight: 700; }

/* ============================================================
   Kendaraan (mobil & motor) — 21 Sep 2026
   ============================================================ */
.vehicles-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) { .vehicles-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .vehicles-list { grid-template-columns: repeat(3, 1fr); } }
.vehicle-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color 0.12s ease; }
.vehicle-card:hover { border-color: var(--accent-1); }
.vehicle-card.is-off { opacity: 0.55; }
.vc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.vc-title { line-height: 1.3; }
.vc-plate { font-size: 0.82rem; color: var(--text-muted); }
.vc-rows { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; }
.vc-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.vc-row .sub:first-child { min-width: 104px; }
.vc-warn { color: #b91c1c; }
[data-theme="dark"] .vc-warn { color: #ff8f7a; }
.vc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ban-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .ban-grid { grid-template-columns: repeat(2, 1fr); } }
.ban-item { border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px 10px; font-size: 0.85rem; }
.ban-item.bad { border-color: rgba(185, 28, 28, 0.5); background: rgba(185, 28, 28, 0.06); }
.ban-pos { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
/* Redesign kendaraan (28 Sep 2026): seksi perhatian + baris KM supir */
.veh-attn { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-bg); font-size: 0.85rem; }
.veh-attn-row { line-height: 1.4; }
/* Menu Kelola: kartu sebaris tingginya rata (29 Sep 2026) */
#manage-list { align-items: stretch; }
#manage-list .mg-card { display: flex; flex-direction: column; height: 100%; }
#manage-list .mg-card .task-card-meta { display: flex; flex-direction: column; flex: 1; }
#manage-list .mg-card-actions { margin-top: auto; padding-top: 10px; }
/* Aset IT: mode tabel ala Excel + tombol lapor-cepat (29 Sep 2026) */
#assets-list:has(.at-wrap), #vehicles-list:has(.at-wrap) { display: block; } /* mode tabel = full-width, jangan kejepit grid kartu */
.at-wrap { overflow-x: auto; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-bg); width: 100%; }
.at-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 640px; }
.at-table th, .at-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--glass-border); vertical-align: middle; }
.at-table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.at-table tbody tr:last-child td { border-bottom: 0; }
.at-row.is-todo { background: rgba(185, 28, 28, 0.04); }
.at-id { font-weight: 700; white-space: nowrap; }
.at-name { cursor: pointer; }
.at-name b { display: block; line-height: 1.3; }
.at-st .asset-clean-pill { white-space: nowrap; }
.at-st .sub { display: block; margin-top: 2px; }
.at-act { white-space: nowrap; }
.btn-mini { border: 1px solid var(--glass-border); background: transparent; color: var(--text); font: inherit; font-size: 0.78rem; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer; min-height: 36px; }
.btn-mini-on { background: var(--accent-1); border-color: transparent; color: #fff; }
.ban-kond { margin-top: 2px; }

/* Baris tombol di menu Maintenance (Catat + Export) */
.maint-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.maint-actions-row .maint-add-btn { margin: 0; }
.chip-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 0.8em; opacity: 0.7; }
.chip-x:hover { opacity: 1; }
.plan-badge.ok-svc { background: rgba(14, 159, 110, 0.14); border-color: rgba(14, 159, 110, 0.5); color: #0e7a55; }
[data-theme="dark"] .plan-badge.ok-svc { color: #6fe0b0; }

/* ============================================================
   Rework dashboard monitoring Ko Titi (21 Sep 2026)
   Section rapi + rapi di HP: kartu stats 2 kolom, banner, footer status
   ============================================================ */
.ana-content .ana-sec { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.ana-content .ana-sec .ana-card-title { margin: 0 0 10px; font-size: 0.98rem; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ana-content #ana-stats { margin-bottom: 10px; }
.ana-content .stat-card { border-radius: 14px; }
.ana-content #ana-foot { margin: 0 0 12px; }
.ana-content #ana-foot.bad { color: #b45309; }
[data-theme="dark"] .ana-content #ana-foot.bad { color: #ffb27a; }
.ana-content #ana-foot .btn-ghost { margin-left: 4px; }
.week-trend { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-size: 0.9rem; }
.week-trend.up { border-color: rgba(14, 159, 110, 0.45); }
.week-trend.down { border-color: rgba(185, 28, 28, 0.45); }
.week-trend .wt-arrow { margin-right: 4px; }
.ana-task-row { background: transparent; border: 1px solid var(--glass-border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.ana-task-row.empty { opacity: 0.7; }
.ana-task-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ana-task-name { min-width: 0; overflow-wrap: anywhere; }
.ana-task-score { font-weight: 700; font-size: 0.86rem; white-space: nowrap; }
.ana-task-score.good { color: #0e7a55; }
.ana-task-score.warn { color: #b91c1c; }
[data-theme="dark"] .ana-task-score.good { color: #6fe0b0; }
[data-theme="dark"] .ana-task-score.warn { color: #ff9b8a; }
.ana-task-sub { margin-top: 6px; font-size: 0.78rem; color: var(--text-muted); }
.ana-people { margin-top: 10px; }
.ana-people .ana-task-row { padding: 8px 10px; margin-bottom: 6px; }
.ana-ai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ana-ai-actions .btn-primary { width: auto; }
.ana-team-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .ana-team-grid { grid-template-columns: repeat(2, 1fr); } }
.ana-team-grid .team-col { background: transparent; border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px; }
.team-big { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 4px; }
.team-big .tb-num { font-size: 1.5rem; font-weight: 800; }
.team-big .tb-num.warn { color: #b45309; }
.team-big .tb-num.good { color: #0e5f43; }

/* ============================================================
   Sub-menu Maintenance AC — tabel jadwal per bulan / setahun (24 Sep 2026)
   ============================================================ */
.ac-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-bg); }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac-table th, .ac-table td { padding: 9px 8px; border-bottom: 1px solid var(--glass-border); text-align: left; vertical-align: top; }
.ac-table thead th { background: var(--glass-hi); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); white-space: nowrap; }
.ac-table thead th.ac-day, .ac-table thead th.ac-mth { text-align: center; width: 44px; }
.ac-kode { font-weight: 800; white-space: nowrap; position: sticky; left: 0; background: var(--glass-bg); }
.ac-ruang { min-width: 110px; overflow-wrap: anywhere; position: sticky; left: 58px; background: var(--glass-bg); box-shadow: 1px 0 0 var(--glass-border); }
.ac-sub { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.ac-table td.ac-day { text-align: center; white-space: nowrap; }
.ac-mark { color: var(--ok); font-weight: 800; }
.ac-table tr.ac-dim td { opacity: 0.45; }
.ac-empty { text-align: center !important; color: var(--text-muted); padding: 18px 10px !important; }
@media (max-width: 767px) {
  .ac-table { font-size: 12.5px; }
  .ac-table th, .ac-table td { padding: 8px 6px; }
  .ac-table thead th.ac-day, .ac-table thead th.ac-mth { width: 34px; }
  .ac-ruang { min-width: 96px; left: 52px; }
}

/* Warna nama AC = frekuensi service (hijau 1 bln / kuning 2 bln / merah 3 bln) — 24 Sep 2026 */
.ac-kode.ac-g { color: #0b7c46; background: #e6f5ec; }
.ac-kode.ac-y { color: #8a6100; background: #fdf1cf; }
.ac-kode.ac-r { color: #b91c1c; background: #fce9e9; }
[data-theme="dark"] .ac-kode.ac-g { color: #6fe0b0; background: #173226; }
[data-theme="dark"] .ac-kode.ac-y { color: #ffd666; background: #33290f; }
[data-theme="dark"] .ac-kode.ac-r { color: #ff9d9d; background: #351b1b; }

/* Mode Setahun: header 2 baris — bulan nge-span kolom tanggal + garis pemisah antar bulan (24 Sep 2026) */
.ac-table thead th.ac-mth { border-left: 1px solid var(--glass-border); color: var(--text); font-weight: 800; }
.ac-table th.ac-day.mstart, .ac-table td.ac-day.mstart { border-left: 1px solid var(--glass-border); }

/* Edit jadwal AC (superadmin): sel tanggal bisa diklik + tombol edit di baris (24 Sep 2026) */
.ac-table td.ac-day[onclick] { cursor: pointer; }
.ac-table td.ac-day[onclick]:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.ac-edit { display: inline-block; margin-left: 6px; cursor: pointer; opacity: .55; }
.ac-edit:hover, .ac-edit:focus-visible { opacity: 1; }
.ac-admin-btns { display: flex; gap: 6px; }
.ac-admin-btns .btn-ghost { flex: 1; min-height: 40px; }

/* Riwayat: segmen Semua/Foto/Teks + filter tanggal·PIC·jenis (28 Sep 2026) */
.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 10px; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass-bg); }
.seg-btn { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.8rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.seg-btn.is-on { background: var(--accent-1); color: #fff; }
.hist-filters { align-items: end; }
.hist-f { display: flex; flex-direction: column; gap: 4px; flex: 1 1 130px; min-width: 0; }
.hist-f .filter-select { width: 100%; max-width: none; }
.hist-f.hist-q { flex: 2 1 180px; }
#history-list .photos-grid { margin-top: 2px; grid-column: 1 / -1; width: 100%; grid-template-columns: repeat(4, 1fr); }
@media (min-width: 1024px) { #history-list .photos-grid { grid-template-columns: repeat(4, 1fr); } }

/* Analitik rebuild (kx-*) — desain Stitch #11: kartu tim, bar kepatuhan, chip hari ini */
.kx-team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kx-team-col { padding: 13px; border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); }
.kx-team-col b { font-size: 0.9rem; }
.kx-big { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.kx-big span { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.kx-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.kx-line { font-size: 0.84rem; margin: 2px 0; }
.kx-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.kx-chip { padding: 6px 12px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; background: var(--glass-hi); border: 1px solid var(--glass-border); }
.kx-chip.miss { color: var(--danger); border-color: rgba(255,69,58,0.4); }
.kx-bars { display: flex; gap: 3px; align-items: flex-end; min-height: 60px; }
.kx-bar { flex: 1; border-radius: 4px 4px 2px 2px; min-height: 8px; min-width: 4px; }
.kx-bar.ok { background: var(--ok); } .kx-bar.blem { background: var(--blem); } .kx-bar.none { background: var(--glass-hi); }
.kx-trow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.84rem; font-weight: 600; margin-top: 10px; }
.kx-tname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kx-tscore { font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
.kx-tscore.bad { color: var(--danger); } .kx-tscore.warn { color: var(--blem); } .kx-tscore.good { color: var(--ok); }
.kx-bar-track { height: 8px; border-radius: 999px; background: var(--glass-hi); overflow: hidden; margin-top: 4px; }
.kx-bar-fill { height: 100%; border-radius: 999px; }
.kx-bar-fill.good { background: var(--ok); } .kx-bar-fill.bad { background: var(--danger); }
.kx-blem { padding: 11px 13px; border-radius: var(--radius-md); background: rgba(255,159,10,0.08); border: 1px solid rgba(255,159,10,0.25); font-size: 0.8rem; margin-top: 8px; }
.kx-empty { font-size: 0.82rem; color: var(--text-muted); padding: 8px 0; }
@media (max-width: 520px) { .kx-team-grid { grid-template-columns: 1fr; } }

/* ---------- Nav cuma buat halaman yang punya sidebar ----------
   Dulu .tabs-nav display:flex !important di >=768px, jadi ikut nongol di
   halaman PIN (dan mode pantauan). Gate pakai state view yang sudah ada. */
.app-shell:has(#view-login:not(.hidden)) .tabs-nav,
.app-shell:has(#view-readonly:not(.hidden)) .tabs-nav,
.app-shell:has(#view-login:not(.hidden)) .nav-select-wrap,
.app-shell:has(#view-readonly:not(.hidden)) .nav-select-wrap { display: none !important; }
