/* ================================================================
   Marches.mr — Design System
   Palette : #0d3b6e (navy) · #1565c0 (blue) · #1976d2 (light blue)
   ================================================================ */

:root {
  --brand-navy:   #0d3b6e;
  --brand-blue:   #1565c0;
  --brand-light:  #1976d2;
  --brand-pale:   #e8f0fe;
  --sidebar-w:    248px;
  --radius-card:  12px;
  --shadow-card:  0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --shadow-hover: 0 4px 12px rgba(21,101,192,.18);
}

/* ── Body / layout ────────────────────────────────────────────── */
body.bg-light { background: #f4f6fb !important; }

#wrapper { min-height: 100vh; }
#page-content-wrapper { min-height: 100vh; background: #f4f6fb; }

/* ── Sidebar ──────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(175deg, var(--brand-navy) 0%, var(--brand-blue) 100%);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, width .25s ease;
  position: relative;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,.12);
}

/* Logo / header */
.sidebar-logo {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text { color: #fff; }
.sidebar-logo .logo-text strong { font-size: .98rem; display: block; line-height: 1.1; }
.sidebar-logo .logo-text span { font-size: .72rem; opacity: .65; }

/* Nav section label */
.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.4);
  padding: 1.1rem 1.5rem .35rem;
}

/* Nav links */
#sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem 1rem;
  margin: 1px .75rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: #fff !important;
  transition: background .15s;
  text-decoration: none;
}
#sidebar .nav-link i { font-size: 1rem; flex-shrink: 0; }
#sidebar .nav-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff !important;
}
#sidebar .nav-link.active {
  background: rgba(255,255,255,.16);
  color: #fff !important;
  font-weight: 600;
}
#sidebar .nav-link.active i { color: #fff; }

/* Admin links */
#sidebar .nav-link.admin-link {
  color: rgba(255,209,102,.9) !important;
}
#sidebar .nav-link.admin-link:hover,
#sidebar .nav-link.admin-link.active {
  background: rgba(255,209,102,.15);
  color: #ffd166 !important;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: auto;
}
.sidebar-user-email {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .35rem;
}
.sidebar-status-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
  display: inline-block;
}
.sidebar-profile-link {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  color: rgba(255,255,255,.55) !important;
  text-decoration: none;
  margin-top: .5rem;
  transition: color .15s;
}
.sidebar-profile-link:hover { color: rgba(255,255,255,.9) !important; }

/* ── Navbar ───────────────────────────────────────────────────── */
.app-navbar {
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  padding: .6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 0 #e8ecf0;
}
.navbar-page-title {
  font-size: .95rem;
  font-weight: 600;
  color: #1e293b;
}
.navbar-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.btn-notif {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #f4f6fb;
  color: #64748b;
  text-decoration: none;
  transition: background .15s;
  font-size: 1.05rem;
}
.btn-notif:hover { background: var(--brand-pale); color: var(--brand-blue); }
.btn-notif .notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}
.btn-upgrade {
  font-size: .78rem;
  font-weight: 600;
  padding: .35rem .85rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-upgrade:hover { opacity: .88; color: #fff; }
.btn-logout {
  font-size: .8rem;
  padding: .35rem .8rem;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex; align-items: center; gap: .35rem;
}
.btn-logout:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius-card);
  border: none;
  box-shadow: var(--shadow-card);
}
.card-header {
  border-radius: var(--radius-card) var(--radius-card) 0 0 !important;
  background: #fff;
  border-bottom: 1px solid #f0f4f8;
  padding: .9rem 1.25rem;
  font-size: .88rem;
  font-weight: 600;
  color: #374151;
}

/* KPI cards */
.kpi-card {
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: box-shadow .2s, transform .2s;
  border-left: 4px solid transparent;
}
.kpi-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.kpi-card.kpi-blue  { border-left-color: var(--brand-blue); }
.kpi-card.kpi-green { border-left-color: #10b981; }
.kpi-card.kpi-cyan  { border-left-color: #06b6d4; }
.kpi-card.kpi-amber { border-left-color: #f59e0b; }
.kpi-card.kpi-indigo { border-left-color: #6366f1; }
.kpi-card.kpi-rose  { border-left-color: #f43f5e; }

.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; flex-shrink: 0;
}
.kpi-icon.bg-blue   { background: #dbeafe; color: var(--brand-blue); }
.kpi-icon.bg-green  { background: #d1fae5; color: #059669; }
.kpi-icon.bg-cyan   { background: #cffafe; color: #0891b2; }
.kpi-icon.bg-amber  { background: #fef3c7; color: #d97706; }
.kpi-icon.bg-indigo { background: #e0e7ff; color: #4f46e5; }
.kpi-icon.bg-rose   { background: #ffe4e6; color: #e11d48; }

.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: #1e293b; }
.kpi-label { font-size: .78rem; color: #94a3b8; margin-top: .2rem; font-weight: 500; }
.kpi-sub   { font-size: .75rem; color: #94a3b8; margin-top: .3rem; }

/* ── Tables ───────────────────────────────────────────────────── */
.table th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 1px solid #f0f4f8;
  background: #f8fafc;
  padding: .75rem 1rem;
}
.table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
  font-size: .875rem;
  color: #374151;
}
.table-hover tbody tr:hover { background: #f8faff; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .3rem .6rem;
  border-radius: 6px;
}
.badge-paa   { background: var(--brand-pale); color: var(--brand-blue); }
.badge-ppm   { background: #d1fae5; color: #065f46; }
.badge-sector { background: #f1f5f9; color: #475569; }

/* ── Misc ─────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.page-title i { color: var(--brand-blue); }

.text-truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-group-item {
  border-color: #f0f4f8;
  padding: .8rem 1.25rem;
  font-size: .875rem;
}

/* ── Responsive sidebar ───────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    transform: translateX(-100%);
  }
  #sidebar.open { transform: translateX(0); }
  #page-content-wrapper { width: 100%; }
}
