/* =========================================================================
   UNIT CONDITION MAP — SHARED DESIGN SYSTEM
   =========================================================================
   File ini adalah SUMBER TUNGGAL untuk warna, tipografi, sidebar, header,
   tombol, dan badge yang dipakai di SEMUA halaman (index, detail_stasiun,
   action_plan). login.html sengaja hanya memakai token warna dari sini
   (tidak memakai sidebar/header karena belum ada sesi login).

   ATURAN SINKRONISASI:
   - Jangan duplikasi CSS ini ke dalam <style> masing-masing halaman.
   - Kalau perlu ubah warna/font/ukuran sidebar, ubah HANYA di file ini —
     seluruh halaman otomatis ikut berubah.
   - Cari komentar "EDITABLE" untuk bagian yang aman diubah.
   ========================================================================= */

:root {
  /* ---- Palet warna utama (EDITABLE) ---- */
  --navy: #0A2540;
  --navy-dark: #071A2E;
  --accent: #1A73E8;
  --accent-dark: #1558B0;
  --light-blue: #E8F0FE;
  --bg-body: #F4F7FB;
  --white: #FFFFFF;
  --text-dark: #202124;
  --text-gray: #5F6368;
  --text-muted: #94A3B8;
  --border-color: #DADCE0;

  /* ---- Warna status (dipakai di badge kondisi) ---- */
  --success: #0F9D58;
  --success-bg: #E6F4EA;
  --success-border: #CEEAD6;
  --warning: #E37400;
  --warning-bg: #FEF3E0;
  --warning-border: #FCE1B0;
  --danger: #EA4335;
  --danger-bg: #FDEDEC;
  --danger-border: #F6C6C2;

  /* ---- Tipografi (EDITABLE: ganti ke font brand Anda) ---- */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* ---- Ukuran layout ---- */
  --sidebar-width: 250px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-family); }
body { background: var(--bg-body); color: var(--text-dark); }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font-family); }

/* =========================================================================
   APP SHELL — sidebar + area konten, dipakai di semua halaman ber-login.
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar-brand {
  background: var(--white);
  padding: 16px;
  text-align: center;
  min-height: 70px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand h3 { color: var(--navy); font-size: 12px; font-weight: 800; line-height: 1.3; }
/* EDITABLE: ganti isi .sidebar-brand dengan <img src="logo.png"> untuk logo asli */

.nav-menu { list-style: none; padding: 14px 0; flex: 1; }
.nav-menu li {
  padding: 11px 20px;
  margin-right: 14px;
  font-size: 13px;
  color: #B9C4D0;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: 0.2s;
  border-radius: 0 20px 20px 0;
}
.nav-menu li i { width: 16px; text-align: center; font-size: 14px; }
.nav-menu li:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-menu li.active { background: var(--accent); color: var(--white); }

.sidebar-footer { padding: 16px 20px 20px; }
.sidebar-footer p.footer-title { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.standar-kerja { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.standar-kerja li { font-size: 12px; color: var(--white); display: flex; align-items: center; gap: 10px; }
.standar-kerja li i { background: rgba(255,255,255,0.15); padding: 6px; border-radius: 5px; font-size: 10px; width: 12px; text-align: center; }
/* EDITABLE: daftar NAV_ITEMS & STANDAR_KERJA ada di shared.js, bukan di sini */

/* ---- Top header (dipakai di detail_stasiun & action_plan) ---- */
.top-header {
  background: var(--white);
  padding: 0 24px;
  height: 68px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.header-title h1 { font-size: 17px; color: var(--navy); font-weight: 800; letter-spacing: -0.3px; }
.header-title p { font-size: 11px; color: var(--text-gray); }
.header-right { display: flex; align-items: center; gap: 18px; }
.search-bar { position: relative; }
.search-bar input {
  padding: 8px 14px 8px 34px; border: 1px solid var(--border-color);
  border-radius: 20px; width: 260px; font-size: 12.5px; background: var(--bg-body);
}
.search-bar input:focus { outline: none; border-color: var(--accent); background: var(--white); }
.search-bar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-gray); font-size: 12px; }
.profile-area { display: flex; align-items: center; gap: 16px; }
.bell-wrap { position: relative; color: var(--text-gray); font-size: 17px; }
.bell-wrap .badge {
  position: absolute; top: -6px; right: -7px; background: var(--danger); color: var(--white);
  border-radius: 50%; width: 15px; height: 15px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-info { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.user-info .fa-user-circle { font-size: 26px; color: var(--navy); }
.user-info strong { display: block; color: var(--text-dark); }
.user-info span { color: var(--text-gray); font-size: 11px; }

/* =========================================================================
   KOMPONEN UMUM — badge status, tombol, kartu
   ========================================================================= */
.status-badge {
  font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent;
}
.status-badge i { font-size: 7px; }
.status-badge.cond-good { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.status-badge.cond-warn { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.status-badge.cond-crit { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.status-badge.cond-crit i { animation: badgePulse 1.3s ease-in-out infinite; }
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,67,53,0.5); }
  50% { box-shadow: 0 0 0 4px rgba(234,67,53,0); }
}

.btn {
  padding: 11px 22px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  border: none; transition: 0.2s;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--white); border: 1px solid var(--border-color); color: var(--navy); }
.btn-secondary:hover { background: var(--bg-body); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #0c8046; }

.card {
  background: var(--white); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 20px;
}

/* Utility */
.text-muted { color: var(--text-gray); }
.mt-0 { margin-top: 0; }

/* =========================================================================
   NAVIGASI MOBILE — hamburger + sidebar jadi drawer geser di layar sempit.
   Dipasang otomatis oleh initMobileNav() di shared.js, dipanggil setelah
   renderSidebar() di tiap halaman. Di layar desktop (>860px) semua ini
   tidak aktif sama sekali (tetap seperti sebelumnya).
   ========================================================================= */
.mobile-nav-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 250;
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--navy); color: #fff; border: none;
  align-items: center; justify-content: center; font-size: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25); cursor: pointer;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(8,20,54,0.5); z-index: 150;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 860px) {
  .mobile-nav-toggle { display: flex; }
  .app-shell { flex-direction: column; }
  .app-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 200;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  }
  .app-sidebar.mobile-open { transform: translateX(0); }

  /* Header umum (dipakai detail_stasiun/component_detail/action_plan) —
     beri ruang di kiri supaya tidak tertutup tombol hamburger */
  .top-header { padding-left: 64px; flex-wrap: wrap; height: auto; min-height: 68px; gap: 8px; }
  .header-title p { display: none; }
  .search-bar { display: none; } /* pencarian disembunyikan di mobile, hemat tempat */
  .profile-area { gap: 10px; }
  .user-info div { display: none; } /* sembunyikan nama/role, sisakan ikon saja */
}
