:root {
  --navy: #101a2b;
  --navy-light: #16223a;
  --blue: #2f6fed;
  --blue-dark: #244fc0;
  --border: #e6e9ef;
  --text-muted: #6b7280;
  --bg: #f4f6fb;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1f2937;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: var(--navy);
  color: #cbd5e1;
  z-index: 1030;
  transition: transform .25s ease;
  overflow-y: auto;
}
.sidebar .brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand h1 {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: .01em;
  color: #fff;
  margin: 0;
  font-weight: 700;
}
.sidebar .brand small { color: #93a3bd; font-size: 11px; }
.sidebar nav { padding: 10px 0; }
.sidebar .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #5b6b8a;
  padding: 12px 20px 4px;
}
.sidebar a.nav-link {
  color: #cbd5e1;
  padding: 9px 20px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid transparent;
}
.sidebar a.nav-link i { width: 18px; text-align: center; opacity: .85; }
.sidebar a.nav-link:hover { background: var(--navy-light); color: #fff; }
.sidebar a.nav-link.active {
  background: var(--navy-light);
  color: #fff;
  border-left-color: var(--blue);
  font-weight: 600;
}

.main-wrapper { margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------- Topbar ---------------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .hamburger { display: none; background: none; border: none; font-size: 20px; }
.topbar .page-title { font-size: 16px; font-weight: 700; margin: 0; }

.content { padding: 20px 22px 40px; flex: 1; }

/* ---------------- Cards ---------------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,26,43,.04);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
}
.card-body { padding: 16px; }

.stat-card {
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-card .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #fff;
}
.stat-card .value { font-size: 20px; font-weight: 700; line-height: 1.1; }
.stat-card .label { font-size: 12px; color: var(--text-muted); }

/* ---------------- Buttons ---------------- */
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.btn-sm { font-size: 12.5px; }

/* ---------------- Tables ---------------- */
.table { font-size: 13.5px; margin-bottom: 0; }
.table thead th {
  background: #f9fafc;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  white-space: nowrap;
}
.table-responsive { border-radius: var(--radius); }

/* ---------------- Badges ---------------- */
.badge { font-weight: 600; font-size: 11px; padding: 5px 9px; border-radius: 6px; }

/* ---------------- Forms ---------------- */
label.form-label { font-size: 12.5px; font-weight: 600; color: #374151; }
.form-control, .form-select { font-size: 13.5px; }

/* ---------------- Quick actions ---------------- */
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 8px; background: #fff; text-decoration: none; color: #1f2937;
  transition: box-shadow .15s ease, transform .15s ease;
}
.quick-action:hover { box-shadow: 0 4px 12px rgba(16,26,43,.08); transform: translateY(-2px); color: var(--blue-dark); }
.quick-action i { font-size: 20px; color: var(--blue); }
.quick-action span { font-size: 12px; font-weight: 600; text-align: center; }

/* ---------------- Status stepper (job card) ---------------- */
.status-track { display: flex; flex-wrap: wrap; gap: 6px; }
.status-step {
  font-size: 11px; padding: 5px 10px; border-radius: 20px;
  background: #eef1f7; color: var(--text-muted);
}
.status-step.done { background: #dcfce7; color: #166534; }
.status-step.current { background: var(--blue); color: #fff; font-weight: 700; }

/* ---------------- Login page ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #1c2b4a 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 14px; padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .topbar .hamburger { display: inline-block; }
}

/* ---------------- Print ---------------- */
@media print {
  .sidebar, .topbar, .no-print, .btn, footer { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
}
