:root {
  --sidebar-width: 17rem;
  --topbar-height: 4.5rem;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe2ea;
  --panel: #f6f8fa;
  --surface: #ffffff;
  --accent: #007d8a;
  --nav-bg: #0b2545;
  --nav-ink: #cbd5e1;
  --nav-active: #ffffff;
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--panel);
}

.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--nav-bg);
  color: var(--nav-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1.25rem 1.25rem 1rem;
  color: var(--nav-active);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-size: 0.95rem; }
.brand-copy span { font-size: 0.75rem; color: var(--nav-ink); }

.sidebar-nav { flex: 1; padding: 0.75rem 0.75rem 1rem; }

.nav-heading {
  margin: 1.1rem 0.6rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7c8ba1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  color: var(--nav-ink);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-item:hover { color: var(--nav-active); background: rgba(255, 255, 255, 0.06); }
.nav-item i { font-size: 1rem; opacity: 0.85; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  font-size: 0.72rem;
  color: #7c8ba1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

/* ── Workspace ───────────────────────────────────────────────────────── */

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-heading { display: flex; flex-direction: column; }
.topbar-group { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.topbar-title { font-size: 1.15rem; margin: 0; font-weight: 650; }

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.role-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.topbar-user { font-size: 0.85rem; color: var(--muted); }

.page { padding: 1.5rem; max-width: 72rem; width: 100%; }

.page-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.page-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.page-card .card-header h2 { font-size: 1rem; margin: 0; font-weight: 650; }
.page-card .card-header p { margin: 0.15rem 0 0; font-size: 0.82rem; color: var(--muted); }

.card-body { padding: 1.25rem; }

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table td { vertical-align: middle; font-size: 0.9rem; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.filter-bar .form-control { max-width: 18rem; }

.form-label { font-weight: 600; font-size: 0.85rem; }

.step-tracker { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; }
.step-tracker .step {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: #eef1f5;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.step-tracker .step.active { background: var(--accent); color: #fff; }
.step-tracker .step.done { background: #d6edee; color: #0b6b74; }

.kpi { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.kpi .kpi-card {
  flex: 1 1 12rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}
.kpi .kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.kpi .kpi-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.form-hint { font-size: 0.78rem; color: var(--muted); }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: linear-gradient(160deg, #0b2545 0%, #12365f 100%);
}

.login-panel { width: 100%; max-width: 26rem; }

.login-panel .brand-copy { color: #fff; margin-bottom: 1.25rem; }

.account-button {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 125, 138, 0.12);
}

.account-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft, #e6f5f6);
  color: var(--accent);
  font-weight: 700;
  flex: 0 0 auto;
}

.progress { background: #e8ecf1; }
