:root {
  --bg: #0b1f3a;          /* dark blue background */
  --card: #102a4d;        /* slightly lighter blue cards */
  --text: #ffffff;        /* white text */
  --muted: #cbd5f5;       /* soft secondary text */
  --border: #1e3a8a;      /* blue border */
  --primary: #2563eb;     /* button blue */
  --primary-hover: #1d4ed8;
  --max: 560px;
  --pad: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

/* Main layout */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--pad);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* Typography */
h1 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #ffffff;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: #e0e7ff;
}

.small {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Forms */
label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #1e3a8a;
  background: #0f2a52;
  color: #ffffff;
  font-size: 16px; /* prevents iOS zoom */
}

input::placeholder,
textarea::placeholder {
  color: #93c5fd;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Checkbox cards (wizard page) */
.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 8px 0;
  background: #0f2a52;
}

.checkbox input {
  width: auto;
  margin-top: 4px;
}

/* Buttons */
.actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, transform 0.05s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #1e3a8a;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #1d4ed8;
}

/* Error message */
.error {
  background: #7f1d1d;
  border: 1px solid #ef4444;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0 14px;
}

/* Tables (dashboard/admin) */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: #0f2a52;
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  padding: 12px 8px;
  border-bottom: 1px solid #1e3a8a;
  text-align: left;
}

th {
  background: #1e3a8a;
  color: #ffffff;
}

/* Mobile optimization */
@media (max-width: 420px) {
  .card {
    padding: 14px;
  }

  h1 {
    font-size: 1.4rem;
  }

  th:nth-child(3),
  td:nth-child(3) {
    display: none; /* Hide status column on very small screens */
  }
}
/* Dashboard card list */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.request-card .request-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.request-date {
  font-size: 1.15rem;
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Optional: basic status variations (adjust to your actual status values) */
.status-pending { opacity: 0.95; }
.status-reviewed { opacity: 1; }
.status-in-progress { opacity: 1; }
.status-completed { opacity: 1; }

/* ===== Topbar layout ===== */

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Brand defaults (mobile: pushed right) */
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  margin-left: auto;
}

/* Hamburger (mobile default = visible) */
.nav-btn {
  width: 42px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  cursor: pointer;
}

.nav-btn span {
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Desktop nav hidden by default */
.nav-links {
  display: none;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text);
}

/* ===== Desktop layout ===== */
@media (min-width: 860px) {

  /* Hide hamburger + drawer */
  .nav-btn {
    display: none;
  }

  .nav-overlay,
  .nav-drawer {
    display: none !important;
  }

  /* Desktop flex layout */
  .topbar-inner {
    justify-content: space-between;
  }

  /* Title on left */
  .brand {
    margin-left: 0;
  }

  /* Menu on right */
  .nav-links {
    display: flex;
  }
}

/* ===== Slide-out left drawer (mobile) ===== */

/* Overlay sits behind the drawer */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 80;
}

/* Drawer panel */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(82vw, 320px);
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 14px var(--pad);
  z-index: 90;

  display: flex;
  flex-direction: column;
  gap: 10px;

  /* Start hidden off-screen */
  transform: translateX(-105%);
  transition: transform 220ms ease;
  box-shadow: 18px 0 30px rgba(0,0,0,0.35);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.nav-drawer-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.nav-close {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
}

/* Drawer links */
.nav-drawer a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

/* Logout button in drawer */
.drawer-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

/* Toggle open */
.nav-toggle:checked ~ .nav-overlay {
  display: block;
}

.nav-toggle:checked ~ .nav-drawer {
  transform: translateX(0);
}

/* Completely hide nav checkbox toggle */
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Desktop: hide hamburger + drawer/overlay, show inline links */
@media (min-width: 860px) {
  .nav-overlay { display: none !important; }
  .nav-drawer { display: none !important; }
}

/* Logout styled as text link */
.nav-text-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.nav-text-link:hover {
  color: var(--text);
}

/* Settings CSS */
.error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 0, 0, 0.12);
}

.success {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 255, 140, 0.12);
}

/* Dashboard Avatar CSS */
.avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: rgba(255,255,255,0.06);
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text);
}

/* Sticky header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: var(--card);
  border-bottom: 1px solid var(--border);

  padding: 12px 16px;
}

/* layout inside header */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ensure content sits below header properly */
.container {
  margin-top: 10px;
}

/* Header shadowing */
.app-header {
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

/* Section divider for dashboard sections */
.section-divider {
  margin: 26px 0 18px 0;
  border-top: 1px solid var(--border);
  opacity: 0.6;
}

/* Section headers */
.section-title {
  margin-top: 6px;
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 700;
}
/* Notifications badge */
.nav-notif {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notif-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #ef4444; /* red */
  line-height: 1;
}

/* === Header / desktop nav styling === */
.app-header .app-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-header .app-nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.app-header .app-nav a:hover {
  text-decoration: underline;
}

/* Make the logout button look like a normal nav link */
.app-header .nav-text-link {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  font-weight: 600;
}

/* If your logout button is inside app-nav, give it link-like spacing */
.app-header .app-nav form {
  display: inline;
}

/* === Mobile behavior: hide desktop nav and show hamburger === */
@media (max-width: 820px) {
  .app-header .app-nav {
    display: none;
  }

  .app-header .nav-btn {
    display: inline-flex;
  }
}

/* Extra safety: when drawer is open, always hide desktop nav */
.nav-toggle:checked ~ .header-inner .app-nav {
  display: none;
}

.settings-card {
  margin-top: 1rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.setting-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.setting-help {
  font-size: 0.92rem;
  opacity: 0.8;
}

.settings-actions {
  margin-top: 1rem;
}

.settings-stack {
  display: grid;
  gap: 16px;
}

.settings-card {
  margin-top: 0;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}

.switch input:checked + .slider {
  background: rgba(255, 255, 255, 0.38);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.switch input:focus + .slider {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .setting-row {
    align-items: flex-start;
  }
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-card-navigators {
  background: #163766;
}

.dashboard-card-providers {
  background: #1a3f73;
}

.dashboard-inner-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-page-title {
  margin: 4px 0 0 0;
}

.dashboard-entity-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.dashboard-inner-card {
  background: #163766;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.12);
}

@media (min-width: 760px) {
  .dashboard-entity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .dashboard-entity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.dashboard-page-title {
  margin-bottom: 16px;
}

/* grid for main dashboard cards */

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (min-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

/* inner cards stay stacked */

.dashboard-inner-card {
  background: #163766;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.12);
}

.dashboard-container {
  width: min(1400px, calc(100vw - 48px));
  max-width: none;
}
