* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --sidebar: #111118;
  --card: #18181f;
  --card-hover: #1f1f2a;
  --border: #2a2a38;
  --text: #e8ecf4;
  --text-muted: #8a8a9c;
  --chrome: #c4cdd8;
  --chrome-bright: #dce3ec;
  --chrome-dim: #3a3a4a;
  --accent: #c4cdd8;
  --accent-hover: #dce3ec;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --in-progress: #a78bfa;
  --sidebar-width: 240px;
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* SCREENS */
.screen { display: none; }
.screen.active { display: flex; }

/* LOGIN */
#login-screen {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 40%, #1a1a2e 0%, #0a0a0f 70%);
}
.login-container {
  background: var(--card);
  border: 1px solid var(--chrome-dim);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 60px rgba(196,205,216,0.04), 0 0 120px rgba(196,205,216,0.02);
}
.login-logo {
  width: 180px;
  margin: 0 auto 36px;
  display: block;
}
.login-container h1 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 32px; font-size: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; }
.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-block { width: 100%; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }
.login-hint { margin-top: 24px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* DASHBOARD SHELL */
#dashboard-shell { display: none; flex-direction: row; min-height: 100vh; }
#dashboard-shell.active { display: flex; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
}
.nav-brand {
  padding: 0 16px 20px;
}
.nav-brand img {
  width: 150px;
  height: auto;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 0 12px 16px;
  background: var(--card);
  border-radius: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.nav-links { list-style: none; flex: 1; }
.nav-link {
  display: block;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--text); border-left-color: var(--accent); background: rgba(59,130,246,0.08); }

.nav-bottom { padding: 16px 12px; border-top: 1px solid var(--border); }
.logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.logout-btn:hover { color: var(--danger); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.page-date { font-size: 12px; color: var(--text-muted); }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; }
.stat-delta { font-size: 12px; margin-top: 8px; color: var(--success); }
.stat-delta.warning { color: var(--warning); }
.stat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  margin-left: 8px;
}

/* SECTION */
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; }

/* RO TABLE */
.ro-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg); }
th { padding: 12px 16px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: left; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--card-hover); cursor: pointer; }

.vehicle-cell { font-weight: 500; }
.vehicle-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.customer-cell { color: var(--text-muted); font-size: 12px; }

/* STATUS BADGES */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.status-in_progress { background: rgba(139,92,246,0.15); color: #a78bfa; }
.status-waiting { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-ready { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-scheduled { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-completed { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.time-cell { color: var(--text-muted); font-size: 12px; }
.charge-cell { font-weight: 600; }

/* ACTION BUTTONS */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; font-weight: 500; }
.btn-sm-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-sm-outline:hover { border-color: var(--text-muted); color: var(--text); }

/* QUICK ACTIONS */
.quick-actions { display: flex; gap: 12px; margin-bottom: 32px; }
.btn-action {
  padding: 10px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-action:hover { background: var(--card-hover); border-color: var(--accent); }

/* ALERT CARD */
.alert-card {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.alert-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.alert-actions { display: flex; gap: 8px; }

/* PLACEHOLDER PAGES */
.placeholder-page { text-align: center; padding: 80px 40px; }
.placeholder-page h2 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.placeholder-page p { color: var(--text-muted); font-size: 15px; }
.placeholder-icon { font-size: 48px; margin-bottom: 24px; display: block; }

/* RO DETAIL */
.ro-detail-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; }
.ro-detail-num { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.ro-detail-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.ro-detail-meta { display: flex; gap: 24px; flex-wrap: wrap; }
.meta-item { font-size: 13px; }
.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 600; margin-left: 6px; }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 32px; }
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.info-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); }
.info-row .value { font-weight: 500; }

.items-table { width: 100%; }
.items-table th { background: var(--bg); padding: 10px 12px; text-align: left; font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.items-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.items-table tr:last-child td { border-bottom: none; }
.item-total { font-weight: 600; text-align: right; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; padding: 12px 0; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 11px; top: 32px; bottom: -12px; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 1;
}
.timeline-dot.done { background: var(--success); border-color: var(--success); color: white; }
.timeline-dot.active { background: var(--accent); border-color: var(--accent); color: white; }
.timeline-label { font-size: 13px; font-weight: 500; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 24px;
  cursor: pointer;
}
.back-btn:hover { color: var(--text); }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--text-muted); font-size: 14px; }

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}