/* nav.css — shared mobile-responsive sidebar navigation, used by every page.
   Linked via <link rel="stylesheet" href="/nav.css"> and populated by nav.js. */

/* Single source of truth for the colour system — every page links this file
   instead of redefining its own :root, so the palette only ever changes here. */
:root {
  --primary: #3D6B24;       /* deep leaf-green, closer to NEA's logo green */
  --primary-dark: #2F5319;  /* hover / pressed state for primary actions */
  --primary-light: #6B9950; /* borders / focus rings — a lighter step of primary */
  --accent: #EAF4E2;        /* pale tint for selected/active surfaces */
  --bg: #F7F8F9;
  --surface: #ffffff;
  --border: #D9DEE3;
  --text: #1F2937;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;

  /* Status colours — success reuses the primary green per the NEA palette */
  --green: #3D6B24;
  --green-bg: #EAF4E2;
  --green-border: #9CC17E;
  --amber-bg: #FDF3E0;
  --amber-text: #8A5A00;
  --amber-border: #F3CD80;
  --error-text: #C0392B;
  --error-bg: #FBEAEA;
  --error-border: #E8B4AC;
  /* Aliases for pages that reference the red/error family by this name */
  --red: var(--error-text);
  --red-bg: var(--error-bg);
  --red-border: var(--error-border);
}

/* ── Sidebar ── */
.app-nav {
  width: 230px; flex-shrink: 0; background: var(--primary-dark);
  display: flex; flex-direction: column; padding: 20px 0;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
  transition: transform .2s ease;
}
.app-nav-brand {
  display: flex; align-items: center; gap: 10px; padding: 0 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px;
}
.app-nav-logo {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff; letter-spacing: -.5px; flex-shrink: 0;
}
.app-nav-title { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.app-nav-sub { font-size: 10.5px; color: #A9C99A; }

.app-nav-items { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; overflow-y: auto; }
.app-nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: #cbd5e1; text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.app-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav-item.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.app-nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.app-nav-footer {
  padding: 14px 20px 0; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; gap: 10px;
}
.app-nav-username { font-size: 12px; color: #C7DFB8; font-weight: 500; }
.app-nav-logout {
  padding: 7px 12px; border-radius: 7px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; font-size: 12px; font-weight: 500;
  cursor: pointer; align-self: flex-start; transition: background .15s;
}
.app-nav-logout:hover { background: rgba(255,255,255,.18); }

/* ── Mobile top bar + backdrop (hidden on desktop) ── */
.app-topbar {
  display: none; align-items: center; gap: 12px; height: 56px; padding: 0 16px;
  background: var(--primary-dark); position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); flex-shrink: 0;
  align-self: stretch; width: 100%;
}
.app-topbar-burger {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.1); color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.app-topbar-title { color: #fff; font-size: 14px; font-weight: 700; }
.app-nav-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 25;
}
.app-nav-backdrop.open { display: block; }

/* ── Main content area ── */
.app-main { margin-left: 230px; min-height: 100vh; min-height: 100dvh; }

@media (max-width: 860px) {
  .app-nav { transform: translateX(-100%); }
  .app-nav.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  .app-main { margin-left: 0; }
  .app-topbar { display: flex; }
}
