/* =====================================================
   TravelKu — gaya antarmuka
   Mobile-first; sidebar muncul di layar >= 900px
   Palet: petrol (jalan malam) + amber (lampu kendaraan)
   ===================================================== */
:root {
  --bg: #F2F5F4;
  --card: #FFFFFF;
  --ink: #17262B;
  --muted: #64777D;
  --line: #E1E8E7;
  --brand: #0E4F51;
  --brand-2: #0A3B3D;
  --accent: #F0A81C;
  --accent-ink: #7A5200;
  --ok: #1E8E5A;
  --danger: #C4402F;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(17, 38, 43, .08);
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-bottom: 76px; /* ruang bottom nav */
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.25; }

/* ---------- Brand ---------- */
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #d98f0a);
  color: #2B1D00; font-weight: 800; font-size: .8rem; letter-spacing: .5px;
}
.brand-mark.big { width: 56px; height: 56px; font-size: 1.2rem; border-radius: 14px; }

/* ---------- Topbar (mobile) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff;
  padding: 12px 16px calc(12px);
  padding-top: max(12px, env(safe-area-inset-top));
}
.topbar strong { font-size: 1.05rem; flex: 1; }
.top-out { color: #fff; font-size: 1.2rem; opacity: .85; }

/* ---------- Sidebar (desktop) ---------- */
.sidebar { display: none; }

/* ---------- Konten ---------- */
.content { padding: 16px; max-width: 960px; margin: 0 auto; }
.sec-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 22px 0 10px; }

/* ---------- Hero dashboard ---------- */
.hero {
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff; border-radius: var(--radius); padding: 18px;
  margin-bottom: 14px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -30px; top: 0; bottom: 0; width: 140px;
  background: repeating-linear-gradient(115deg, transparent 0 26px, rgba(240,168,28,.16) 26px 34px);
}
.hero-greet { font-weight: 700; font-size: 1.1rem; }
.hero-date { opacity: .8; font-size: .9rem; }

/* ---------- Kartu statistik ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.stat-label { display: block; color: var(--muted); font-size: .78rem; }
.stat-val { font-size: 1.5rem; font-weight: 800; }
.stat-val.small { font-size: 1.05rem; }

/* ---------- Kartu trip ---------- */
.trip-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 10px; color: var(--ink);
}
.trip-time {
  font-weight: 800; font-size: 1.05rem; color: var(--brand);
  background: #E4EFEE; border-radius: 10px; padding: 8px 10px; min-width: 62px; text-align: center;
}
.trip-body { flex: 1; min-width: 0; }
.trip-route { font-weight: 700; }
.trip-route .arrow { color: var(--accent-ink); }
.trip-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-seats { text-align: center; font-weight: 800; color: var(--ok); }
.trip-seats small { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
.trip-seats.full { color: var(--danger); }

/* ---------- Aksi cepat ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick {
  background: var(--card); border: 1px dashed var(--line); border-radius: 12px;
  text-align: center; padding: 14px 4px; font-weight: 600; font-size: .85rem; color: var(--brand);
}

/* ---------- Formulir ---------- */
form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .88rem; }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  padding: 11px 18px; font: inherit; font-weight: 700;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-accent { background: var(--accent); color: #2B1D00; }
.btn-danger { background: #FBE9E6; color: var(--danger); }
.btn-light { background: #E4EFEE; color: var(--brand); }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Kartu & tabel ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* ---------- Badge ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.b-open, .b-aktif, .b-booking, .b-diterima { background: #E4EFEE; color: var(--brand); }
.b-berangkat, .b-jalan, .b-dikirim { background: #FCF1D8; color: var(--accent-ink); }
.b-selesai, .b-sampai, .b-diambil, .b-lunas { background: #E2F3EA; color: var(--ok); }
.b-batal { background: #FBE9E6; color: var(--danger); }
.b-dp { background: #FCF1D8; color: var(--accent-ink); }

/* ---------- Flash ---------- */
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-weight: 600; font-size: .9rem; }
.flash-ok { background: #E2F3EA; color: var(--ok); }
.flash-danger { background: #FBE9E6; color: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 34px 16px; background: var(--card); border-radius: var(--radius); }

/* ---------- SEAT MAP (elemen khas) ---------- */
.cabin {
  background: var(--card); border: 2px solid var(--line); border-radius: 22px 22px 16px 16px;
  padding: 14px; max-width: 340px; margin: 0 auto 14px;
}
.cabin-head { display: flex; justify-content: flex-end; padding: 0 6px 10px; border-bottom: 2px dashed var(--line); margin-bottom: 12px; }
.wheel {
  width: 34px; height: 34px; border: 4px solid var(--muted); border-radius: 50%;
  position: relative; opacity: .55;
}
.wheel::after { content: ""; position: absolute; inset: 10px; background: var(--muted); border-radius: 50%; }
.seat-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.seat, .aisle { width: 52px; height: 48px; }
.seat {
  border: 1.5px solid var(--line); border-radius: 10px 10px 6px 6px;
  background: #F7FAF9; font: inherit; font-weight: 700; color: var(--brand);
  cursor: pointer; position: relative;
}
.seat::before { content: ""; position: absolute; left: 6px; right: 6px; bottom: 4px; height: 5px; border-radius: 3px; background: var(--line); }
.seat.taken { background: #EDEDED; color: #A9B4B2; cursor: not-allowed; text-decoration: line-through; }
.seat.picked { background: var(--accent); border-color: #d98f0a; color: #2B1D00; }
.seat.picked::before { background: #d98f0a; }
.seat-legend { display: flex; gap: 16px; justify-content: center; font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.seat-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.lg-free { background: #F7FAF9; border: 1.5px solid var(--line); }
.lg-taken { background: #EDEDED; }
.lg-picked { background: var(--accent); }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a { flex: 1; text-align: center; padding: 13px 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.bottomnav a.on { color: var(--brand); border-top: 3px solid var(--accent); padding-top: 10px; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px 16px 80px;
  background: linear-gradient(160deg, var(--brand-2), var(--brand) 55%, #14666a);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: 18px; padding: 28px 24px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-brand { text-align: center; margin-bottom: 8px; }
.login-card h1 { text-align: center; margin: 4px 0 2px; font-size: 1.4rem; }
.login-sub { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: .9rem; }

/* ---------- Print manifest ---------- */
@media print {
  .sidebar, .topbar, .bottomnav, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  .content { max-width: none; padding: 0; }
  .card, .table-wrap { box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 232px; }
  .topbar, .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; width: 232px;
    background: var(--brand-2); color: #fff; padding: 18px 14px;
  }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; margin-bottom: 22px; padding: 0 6px; }
  .sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 10px; color: #CFE0DF;
    padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  }
  .sidebar nav a .ic {
    width: 24px; height: 24px; display: grid; place-items: center;
    background: rgba(255,255,255,.08); border-radius: 6px; font-size: .72rem; font-weight: 800;
  }
  .sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
  .sidebar nav a.on { background: var(--accent); color: #2B1D00; }
  .sidebar nav a.on .ic { background: rgba(43,29,0,.15); }
  .side-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .side-user { font-weight: 700; font-size: .9rem; }
  .side-user small { display: block; font-weight: 400; opacity: .65; }
  .btn-out { color: #F6C766; font-weight: 700; font-size: .85rem; }
  .content { padding: 28px 32px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

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