:root {
  --brand: #e11d2e;
  --brand-dark: #b01524;
  --ink: #14202b;
  --muted: #5b6b7a;
  --bg: #f5f7f9;
  --card: #ffffff;
  --line: #e9e9ee;
  --side: #14202b;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: #d33; font-size: 14px; margin-top: 10px; text-align: center; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700;
  font-size: 14.5px; cursor: pointer; background: #e8edf1; color: var(--ink);
  transition: .15s filter;
}
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.danger { background: #ffe3e3; color: #c0392b; }
.btn.ghost { background: transparent; color: #b7c4cf; border: 1px solid #33434f; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.block { width: 100%; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  background: var(--card); padding: 34px 30px; border-radius: 18px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(16,32,43,.12);
}
.brand { font-weight: 850; font-size: 20px; margin-bottom: 4px; }
.brand small { color: var(--brand); font-weight: 800; font-size: 13px; }
.brand .dot {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--brand), #fca5a5); color: #fff;
  border-radius: 9px; font-size: 15px;
}
.login-card .muted { margin-bottom: 20px; }
.login-card .btn { margin-top: 4px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: #b7c4cf; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; margin-bottom: 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a {
  color: #b7c4cf; text-decoration: none; padding: 11px 14px;
  border-radius: 10px; font-size: 15px; font-weight: 600;
}
.sidebar nav a:hover { background: #1e2d3b; color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }

.content { padding: 0 30px 50px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px;
}
.topbar h1 { font-size: 24px; letter-spacing: -.4px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}

/* ---------- cards / stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .num { font-size: 28px; font-weight: 850; }
.stat .lbl { color: var(--muted); font-size: 13.5px; }
.stat.accent .num { color: var(--brand-dark); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 17px; margin-bottom: 16px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; border-bottom: 2px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafafa; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: #eef2f5; color: var(--muted);
}
.badge.searching { background: #fff3cd; color: #8a6d00; }
.badge.matched, .badge.in_progress { background: #dbeafe; color: #1d4ed8; }
.badge.completed, .badge.rated, .badge.online { background: #d1fae5; color: #047857; }
.badge.cancelled, .badge.no_driver, .badge.offline { background: #fee2e2; color: #b91c1c; }
.badge.verified { background: #d1fae5; color: #047857; }
.badge.unverified { background: #fef3c7; color: #92400e; }
.badge.gender-male { background: #dbeafe; color: #1d4ed8; }
/* ---------- kartu kategori ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cat-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cat-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cat-form { gap: 10px 14px; }
.cat-form .cat-submit { grid-column: 1 / -1; }

/* form vertikal di dalam tabel (atur mitra) */
.stack { display: grid; gap: 6px; min-width: 170px; }
.stack select, .stack button { width: 100%; }
.badge.gender-female { background: #fce7f3; color: #9d174d; }

/* ---------- forms grid ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row label { flex: 1; min-width: 160px; margin-bottom: 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff;
  padding: 13px 20px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.25); z-index: 99; max-width: 340px;
}
.toast.err { background: #c0392b; }

.empty { color: var(--muted); text-align: center; padding: 30px; }

/* --- tambahan --- */
.brand-logo { height: 30px; width: 30px; object-fit: contain; border-radius: 8px; vertical-align: middle; }
.brand img.brand-logo { margin-right: 6px; }
.row-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-inline input[type="number"] { width: 110px; }
.row-inline select { width: 110px; }
.right { text-align: right; }
.field-note { display: flex; align-items: end; }
/* checkbox sejajar teks di form pengaturan verifikasi */
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: auto; min-width: 0; }
code { background: #eef2f5; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.flash { background: #d1fae5; border: 1px solid #6ee7b7; color: #047857; font-weight: 700; padding: 12px 18px; }
form button { cursor: pointer; }
.sidebar form { margin-top: 8px; }

/* --- halaman user --- */
a.btn { text-decoration: none; display: inline-block; }
.pager {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-top: 16px;
}
.pager .row-inline { gap: 8px; }

/* --- foto identitas mitra --- */
.id-photos { min-width: 110px; }
.id-photo {
  width: 96px; height: 64px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 8px; display: block;
}
.id-photo:hover { border-color: var(--brand); }
