/* AEA-IRC Collection Intelligence — "archival green" design system */
:root {
  --ink: #1d1c18;          --ink-soft: #5f5b52;
  --paper: #f3efe6;        --surface: #fffdf8;      --line: #e4ddcf;
  --green-900: #11281f;    --green-800: #193629;    --green-600: #1f6b4f;
  --dlsud-green: #016f40;  --dlsud-green-mid: #024f2d; --dlsud-green-deep: #01331e;
  --gold: #d9b45a;         --gold-soft: #e8c46a;
  --sage: #b9c6bb;         --sage-dim: #8fa293;
  --urgent-bg: #f8e1dc;    --urgent-fg: #8f1f17;
  --high-bg: #f6e7cc;      --high-fg: #7a4a06;
  --ok-bg: #e3efe8;        --ok-fg: #17543d;
  --topbar-bg: #0d2e1c;    --banner-green: #15542c;  --bell-bg: #264333;
  --radius: 12px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font-body); color: var(--ink); background: var(--paper); }
a { color: var(--dlsud-green); }
a:hover { color: var(--dlsud-green-deep); }

/* ---------- sign-in page ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; position: relative; overflow: hidden;
}
.auth-page::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(rgba(13,46,28,.55), rgba(13,46,28,.55)), url('../img/library3.jpeg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: blur(8px); transform: scale(1.08);
}

.auth-card {
  position: relative; z-index: 1;
  display: flex; width: 100%; max-width: 960px; min-height: 580px;
  background: var(--surface); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45), 0 12px 24px -12px rgba(0,0,0,.3), 0 0 0 1px rgba(31,107,79,.14);
}

.auth-brand {
  flex: 0 0 280px; background: linear-gradient(165deg, var(--dlsud-green) 0%, var(--dlsud-green-mid) 55%, var(--dlsud-green-deep) 100%);
  color: var(--paper); padding: 0 0 28px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.auth-brand::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(1,111,64,.4) 15%, rgba(1,111,64,.4) 85%, transparent);
}
.brand-photo { width: 100%; height: 160px; object-fit: cover; object-position: top; display: block; }
.brand-kicker {
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  text-align: center; color: #fff; margin: 26px 0 56px;
}
.auth-points { list-style: none; margin: 0; padding: 0 28px; display: flex; flex-direction: column; gap: 20px; }
.auth-points li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.auth-points .glyph {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px -2px rgba(0,0,0,.4);
}
.auth-points .glyph svg { display: block; width: 100%; height: 100%; }
.auth-points b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #fff; }
.auth-points .desc { display: block; color: var(--sage); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.auth-foot { font-size: 11.5px; font-weight: 700; color: #fff; text-align: center; letter-spacing: .05em; text-shadow: 0 1px 2px rgba(0,0,0,.35); margin-top: 32px; padding: 0 20px; }

.auth-panel {
  flex: 1; background-color: var(--surface);
  background-image: linear-gradient(rgba(255,253,248,.93), rgba(255,253,248,.93)), url('../img/library1.jpeg');
  background-repeat: no-repeat; background-position: center; background-size: cover;
  padding: 52px 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.auth-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dlsud-green-deep); margin: 0 auto 12px; max-width: 280px; line-height: 1.4; }
.auth-panel h1 { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.08; margin: 0 0 8px; color: var(--ink); }
.auth-panel .sub { font-size: 14.5px; font-weight: 700; color: var(--ink-soft); margin: 0 0 28px; max-width: 360px; }

.auth-form { width: 100%; max-width: 360px; text-align: left; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%);
  color: var(--ink-soft); opacity: .6; pointer-events: none;
}
.input-wrap:focus-within .icon { opacity: .9; color: var(--dlsud-green); }
.field input {
  width: 100%; height: 48px; padding: 0 16px; border: 1px solid #d8d0c0; border-radius: var(--radius);
  background: var(--surface); font: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
}
.field input::placeholder { font-weight: 400; color: var(--ink-soft); opacity: .7; }
.input-wrap .field input, .input-wrap input { padding-left: 40px; }
.field input:focus { outline: 3px solid rgba(1, 111, 64, .22); border-color: var(--dlsud-green); }
#password { padding-right: 42px; }
.toggle-visibility {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 6px;
  color: var(--ink-soft); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.toggle-visibility svg { width: 17px; height: 17px; }
.toggle-visibility:hover { background: rgba(1,111,64,.08); color: var(--dlsud-green); }
.toggle-visibility:focus-visible { outline: 2px solid var(--dlsud-green); outline-offset: 1px; }
.toggle-visibility.is-visible { color: var(--dlsud-green-deep); }
.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--dlsud-green); }

.btn-primary {
  width: 100%; height: 50px; border: 0; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--dlsud-green), var(--dlsud-green-deep)); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 18px -8px rgba(1,51,30,.5); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(1,51,30,.55); }
.btn-primary .arrow { transition: transform .15s ease; }
.btn-primary:hover .arrow { transform: translateX(3px); }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; margin-top: 20px;
  background: #ece6d8; border-radius: var(--radius); font-size: 13px; font-weight: 700; line-height: 1.5; color: #3d3a33; text-align: left;
}
.auth-copyright { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--ink-soft); margin: 24px 0 0; }
.flash { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 4px; }
.flash-error { background: var(--urgent-bg); color: var(--urgent-fg); }
.flash-info  { background: var(--ok-bg); color: var(--ok-fg); }

@media (max-width: 860px) {
  .auth-card { flex-direction: column; max-width: 460px; min-height: 0; }
  .auth-brand { flex: none; padding-bottom: 24px; }
  .auth-brand::after { display: none; }
  .auth-panel { padding: 40px 28px; }
}

/* ---------- app layout ---------- */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 252px; flex-shrink: 0; background: var(--dlsud-green-deep); color: #e8e3d4;
  display: flex; flex-direction: column; gap: 28px; padding: 24px 16px;
  position: sticky; top: 0; align-self: stretch;
}
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.68); padding: 8px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  border: 1.5px solid transparent; color: rgba(255,255,255,.92); text-decoration: none;
  font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.nav-link:hover { border-color: var(--dlsud-green); color: #fff; }
.nav-link.active { background: var(--dlsud-green); border-color: var(--dlsud-green); color: #fff; font-weight: 700; }
.nav-link.disabled { opacity: .6; cursor: default; }
.nav-link.disabled:hover { border-color: transparent; color: rgba(255,255,255,.92); }
.nav-link em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: rgba(255,255,255,.5); }

.nav-link-quiet { height: 38px; font-size: 15px; font-weight: 600; color: rgba(255,255,255,.75);
  margin: 4px 0 2px; }
.nav-link-quiet:hover { border-color: transparent; background: rgba(255,255,255,.06); color: #fff; }

.status-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: 13px 14px; margin: 6px 0; }
.status-card-head { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 700; color: #fff; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecf7a; flex-shrink: 0; }
.status-card p { margin: 7px 0 0; font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.8); }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.avatar { width: 40px; height: 40px; border-radius: 99px; background: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; }
.user-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.user-text small { color: #c3d0c5; font-size: 13px; font-weight: 500; }
.icon-btn { background: none; border: 0; color: #c9d1c7; cursor: pointer; padding: 8px; border-radius: 8px; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: 28px 32px 40px; display: flex;
  flex-direction: column; gap: 18px; background: var(--surface);
  scrollbar-width: auto; scrollbar-color: var(--sage-dim) transparent; }
.main::-webkit-scrollbar { width: 12px; }
.main::-webkit-scrollbar-thumb { background: var(--sage-dim); border-radius: 8px; border: 3px solid var(--surface); }
.page-head h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin: 0;
  letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.card-flush { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.card h2, .dropzone h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0; }
.small { font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.dropzone { background: var(--surface); border: 2px dashed #b9c9bd; border-radius: 18px; padding: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.dropzone-muted { border-color: #d8cdb4; }
.dz-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--ok-bg); display: flex;
  align-items: center; justify-content: center; }
.dz-icon-gold { background: #f6ead0; }
.btn-inline { display: inline-flex; align-items: center; padding: 0 20px; height: 44px; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.steps li { counter-increment: step; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 99px;
  background: var(--dlsud-green); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; }
.steps span { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }

.table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); background: #f7f2e8; padding: 12px 16px; font-weight: 600; }
.table td { padding: 12px 16px; border-top: 1px solid #efe8da; }
.table .num { text-align: right; font-family: "IBM Plex Mono", monospace; }
.table .empty { text-align: center; color: var(--ink-soft); padding: 28px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-urgent { background: var(--urgent-bg); color: var(--urgent-fg); }
.pill-high { background: var(--high-bg); color: var(--high-fg); }

.field select {
  width: 100%; height: 48px; padding: 0 16px; border: 1px solid #d8d0c0; border-radius: var(--radius);
  background: var(--surface); font: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
}
.field select:focus { outline: 3px solid rgba(1, 111, 64, .22); border-color: var(--dlsud-green); }
.btn-toggle {
  height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-toggle:hover { background: var(--paper); }

.reset-pw-form { display: flex; gap: 6px; align-items: center; }
.input-sm {
  height: 32px; width: 150px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font: inherit; font-size: 13px; color: var(--ink);
}
.input-sm:focus { outline: 2px solid rgba(1,111,64,.22); border-color: var(--dlsud-green); }

/* ---------- reusable show/hide password toggle ---------- */
.pw-wrap { position: relative; display: inline-flex; }
.pw-wrap input { padding-right: 32px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; background: none; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle svg { width: 16px; height: 16px; }
.pw-toggle.is-visible { color: var(--dlsud-green); }

.btn-danger-outline { border-color: var(--urgent-fg); color: var(--urgent-fg); margin-left: 6px; }
.btn-danger-outline:hover { background: var(--urgent-bg); }
.delete-confirm { display: inline-flex; align-items: center; gap: 6px; }
.delete-confirm[hidden] { display: none; }
.delete-confirm span { font-size: 12px; font-weight: 600; color: var(--urgent-fg); }

.privacy { background: var(--dlsud-green-deep); color: var(--paper); border-radius: 18px; padding: 22px; }
.privacy p { margin: 6px 0 0; color: var(--sage); font-size: 13px; line-height: 1.5; }
.privacy .privacy-title { font-family: var(--font-display); font-size: 20px; color: var(--paper); }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #a9b8ab; }

/* ---------- right rail (dashboard) ---------- */
.right-rail { width: 240px; flex-shrink: 0; min-height: 0; overflow-y: auto; padding: 28px 20px 40px;
  display: flex; flex-direction: column; gap: 14px; background: #e5e9e2; border-left: 1px solid #e4e4dc;
  scrollbar-width: auto; scrollbar-color: var(--sage-dim) transparent; }
.right-rail::-webkit-scrollbar { width: 12px; }
.right-rail::-webkit-scrollbar-thumb { background: var(--sage-dim); border-radius: 8px; border: 3px solid #e5e9e2; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.rail-logo-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-logo-card img { width: 96px; height: 96px; object-fit: contain; display: block; }
.rail-logo-caption { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); text-align: center; line-height: 1.3; margin: 0; }

.rail-saint { width: 100%; height: 170px; border-radius: 10px; overflow: hidden; background: var(--paper);
  display: flex; align-items: center; justify-content: center; }
.rail-saint img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rail-caption { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-align: center; margin: 10px 0 0; line-height: 1.4; }

.rail-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rail-card-head h4 { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin: 0;
  color: var(--dlsud-green-deep); font-family: var(--font-display); font-weight: 600; }

.rail-cal-month { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--dlsud-green-deep); margin-bottom: 10px; }
.rail-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.rail-cal-label { font-size: 10px; font-weight: 700; color: var(--ink-soft); padding: 2px 0; }
.rail-cal-label.sun { color: var(--urgent-fg); }
.rail-cal-day { font-size: 12px; font-weight: 600; padding: 6px 0; border-radius: 6px; color: var(--ink); }
.rail-cal-day.sun { color: var(--urgent-fg); font-weight: 700; }
.rail-cal-day.today { background: var(--dlsud-green); color: #fff; font-weight: 700; }

.rail-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0;
  text-decoration: none; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.rail-link svg { color: var(--dlsud-green); flex-shrink: 0; }

.app-footer { background: var(--dlsud-green-deep); color: #fff; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 14px 20px; }

@media (max-width: 1000px) {
  /* Stacked layout: the whole page scrolls as one column instead of each
     pane scrolling independently (that model only works side-by-side). */
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .app { flex-direction: column; flex: none; }
  .app-body { flex: none; min-height: 0; }
  .main { flex: none; overflow-y: visible; min-height: 0; }
  .sidebar { width: auto; height: auto; position: static; }
  .grid-2, .steps { grid-template-columns: 1fr; }
  .right-rail { display: none; }
}
/* ---------- sidebar: card-group design ---------- */
.sidebar {
  height: 100%; overflow: hidden; gap: 0; padding: 0;
  display: flex; flex-direction: column;
}
/* Middle area scrolls; logo and user stay in place */
.sidebar-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 18px 10px 12px 12px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: auto; scrollbar-color: #fff transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 12px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #fff; border-radius: 8px; border: 3px solid var(--dlsud-green-deep); }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }

.sidebar .nav { flex: none; gap: 10px; }

/* Rounded card for each section */
.nav-group {
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.sidebar .nav-title { padding: 6px 10px 4px; margin: 0; }
.sidebar .nav-link { padding: 9px 10px; font-size: 15.5px; }

/* Dashboard on its own */
.nav-solo { padding: 11px 12px; }

/* Red card for Alerts */
.nav-alert { background: rgba(226,75,74,.08); border-color: rgba(226,75,74,.45); }
.nav-alert .nav-link { color: #f4a3a0; }
.nav-alert .nav-link:hover { border-color: rgba(226,75,74,.6); color: #fff; }

/* Status card inside the scroll area */
.sidebar .status-card { margin: 0; border-radius: 12px; }
.status-dot-empty { background: rgba(255,255,255,.35); }

/* User block pinned at the bottom, in a bordered card */
.sidebar-foot { padding: 20px 12px 0; border-top: 1px solid rgba(255,255,255,.3); }
.sidebar-foot .sidebar-user {
  border: 1px solid var(--dlsud-green); border-radius: 12px;
  padding: 8px 8px 8px 10px; background: rgba(255,255,255,.03);
}

/* Narrow screens: sidebar on top at its natural height, nothing scrolls inside */
@media (max-width: 1000px) {
  .sidebar { height: auto; overflow: visible; position: static; }
  .sidebar-scroll { overflow: visible; }
}

/* ---------- top bar (spans the full width, above the sidebar too) ---------- */
.app-body { flex: 1; display: flex; min-width: 0; min-height: 0; }

.topbar {
  position: relative; z-index: 30; height: 72px; flex-shrink: 0;
  display: flex; align-items: center; gap: 14px; padding: 0 64px 0 24px;
  background: var(--topbar-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

.topbar-brand {
  display: flex; align-items: center; gap: 12px; padding-right: 58px; margin-right: 2px;
  margin-left: -24px; padding-left: 24px;
  align-self: stretch;
  border-right: 2px solid rgba(255,255,255,.18);
  border-bottom: 2px solid rgba(255,255,255,.18);
  text-decoration: none; flex-shrink: 0;
}
.topbar-brand-mark {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(232,196,106,.3);
}
.topbar-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-brand-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #fff; }
.topbar-brand-sub { font-size: 11.5px; color: #c3d0c5; }

.topbar-title { min-width: 0; margin-left: 14px; }
.topbar-title h1 {
  margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: #fff;
  line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumbs { font-size: 12px; color: #9dbfaa; white-space: nowrap; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: #d6e4da; }
.topbar-spacer { flex: 1; }

/* User chip and its menu */
.user-menu { position: relative; flex-shrink: 0; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 99px; background: transparent;
  color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: rgba(255,255,255,.1); }
.user-chip:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.user-chip .avatar { width: 32px; height: 32px; overflow: hidden; background: #fff; border: 1.5px solid var(--gold-soft); }
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip svg { color: #9dbfaa; }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 36px -16px rgba(0,0,0,.35); overflow: hidden;
}
.user-dropdown[hidden] { display: none; }
.user-dropdown-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.user-dropdown-head b { font-size: 14px; }
.user-dropdown-head small { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown form { margin: 0; }
.user-dropdown-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink); text-decoration: none; cursor: pointer; text-align: left;
}
.user-dropdown-item:hover { background: var(--paper); color: var(--ink); }
.user-dropdown-item svg { color: var(--ink-soft); flex-shrink: 0; }
.user-dropdown-item.danger, .user-dropdown-item.danger svg { color: var(--urgent-fg); }
.user-dropdown-item[hidden] { display: none; }

.signout-confirm {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--urgent-bg); border-top: 1px solid #f0c9c2;
}
.signout-confirm[hidden] { display: none; }
.signout-confirm span { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--urgent-fg); line-height: 1.3; }
.signout-confirm button {
  border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer;
  height: 30px; padding: 0 12px; font-size: 12.5px; flex-shrink: 0;
}
.signout-cancel { background: var(--surface); color: var(--ink); border: 1px solid var(--line) !important; }
.signout-yes { background: var(--urgent-fg); color: #fff; }

.sidebar-signout-confirm {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 6px;
  background: rgba(143,31,23,.18); border-radius: 10px;
}
.sidebar-signout-confirm[hidden] { display: none; }
.sidebar-signout-confirm span { flex: 1; font-size: 12.5px; font-weight: 600; color: #f4b3ab; }
.sidebar-signout-confirm button {
  border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer;
  height: 28px; padding: 0 10px; font-size: 12px; flex-shrink: 0;
}
.sidebar.collapsed .sidebar-signout-confirm { display: none; }
.sidebar-user[hidden] { display: none; }

/* ---------- audit log: year picker ---------- */
.audit-year-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-top: 18px;
}
.audit-year-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.audit-year-card:hover {
  border-color: var(--dlsud-green); box-shadow: 0 8px 20px -10px rgba(1,111,64,.35);
}
.audit-year-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
}
.audit-year-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--ink); }
.audit-year-count { font-size: 12px; color: var(--ink-soft); }

/* Short description under the top bar, hidden when a page has none */
.page-sub { margin: 0; color: var(--ink-soft); font-size: 14px; }
.page-sub:empty { display: none; }

/* ---------- page header banner (hero card at the top of main) ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--banner-green); border-radius: 16px; padding: 22px 26px; margin-bottom: 20px;
  box-shadow: 0 12px 24px -16px rgba(0,0,0,.4);
}
.page-header-text h2 {
  margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; color: #fff;
}
.crumbs-on-banner { font-size: 12.5px; color: rgba(255,255,255,.72); margin-top: 2px; }
.crumbs-on-banner a { color: rgba(255,255,255,.72); text-decoration: none; }
.crumbs-on-banner a:hover { color: #fff; text-decoration: underline; }
.crumbs-on-banner [aria-current] { color: #fff; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-pill-white {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px;
  border-radius: 999px; border: 0; background: #fff; color: var(--dlsud-green-deep);
  font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.3);
}
.btn-pill-white:hover { background: #f3efe6; color: var(--dlsud-green-deep); }

/* ---------- sidebar toggle ---------- */
.sidebar-toggle {
  flex-shrink: 0; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  margin-left: 10px; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.16); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

/* Collapsed sidebar: icons only, width remembered via localStorage */
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .nav-title { display: none; }
.sidebar.collapsed .nav-link-label { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .status-card { display: none; }
.sidebar.collapsed .user-text { display: none; }
.sidebar.collapsed .sidebar-foot .sidebar-user { justify-content: center; gap: 0; }
.sidebar.collapsed .sidebar-foot form { display: none; }

/* ---------- alerts bell ---------- */
.bell-menu {
  position: relative; flex-shrink: 0; margin-right: 32px; padding-right: 16px;
  border-right: 2px solid rgba(255,255,255,.18);
  align-self: stretch; display: flex; align-items: center;
}
.icon-chip {
  position: relative; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 99px; background: var(--bell-bg); color: #fff; cursor: pointer;
}
.icon-chip:hover, .icon-chip[aria-expanded="true"] { background: #335543; }
.icon-chip:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.bell-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--urgent-fg); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.bell-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 280px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 36px -16px rgba(0,0,0,.35); overflow: hidden;
}
.bell-dropdown[hidden] { display: none; }
.bell-empty { margin: 0; padding: 16px 14px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.bell-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; text-decoration: none;
  color: var(--ink); border-top: 1px solid var(--line);
}
.bell-item:hover { background: var(--paper); }
.bell-item b { font-size: 13.5px; }
.bell-item small { font-size: 12px; color: var(--ink-soft); }

/* ---------- global search ---------- */
.search-box { position: relative; width: 380px; flex-shrink: 0; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dlsud-green); pointer-events: none; }
.search-input {
  width: 100%; min-width: 0; height: 42px; padding: 0 40px 0 36px; border: 1px solid transparent; border-radius: 999px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13.5px;
}
.search-input::placeholder { color: var(--ink-soft); }
.search-input:focus { outline: none; border-color: var(--dlsud-green); box-shadow: 0 0 0 3px rgba(1,111,64,.18); }
.search-input:focus::placeholder { color: var(--ink-soft); }
.search-input:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 1px; }
.search-input:focus + .search-kbd { display: none; }
.search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font: 10px/1 var(--font-body); font-weight: 700; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 5px;
}

.search-results {
  position: absolute; left: 0; top: calc(100% + 8px); width: 100%; max-height: 360px; overflow-y: auto; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 36px -16px rgba(0,0,0,.35);
}
.search-results[hidden] { display: none; }
.search-group-label {
  padding: 10px 14px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.search-result {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px;
  text-decoration: none; color: var(--ink); font-size: 13.5px; cursor: pointer;
}
.search-result:hover, .search-result.active { background: var(--paper); }
.search-result.soon { color: var(--ink-soft); cursor: default; }
.search-result-label mark { background: var(--gold-soft); color: var(--ink); border-radius: 2px; padding: 0 1px; }
.search-result-detail { font-size: 11.5px; color: var(--ink-soft); flex-shrink: 0; }
.search-soon {
  font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--sage-dim); flex-shrink: 0;
}
.search-empty { margin: 0; padding: 16px 14px; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* Narrow screens */
@media (max-width: 1000px) {
  .app-body { flex-direction: column; }
  .topbar { padding: 0 12px; }
}
@media (max-width: 1280px) {
  .search-box { width: 240px; }
}
@media (max-width: 880px) {
  .crumbs, .user-chip-name { display: none; }
  .search-box { width: 38px; }
  .search-box:not(:focus-within) .search-input { width: 38px; padding: 0; font-size: 0; }
  .search-kbd { display: none; }
  .search-box:focus-within { width: 220px; }
  .search-box:focus-within .search-input { padding-left: 36px; }

  /* The brand text, divider and page title don't fit next to the hamburger,
     search, bell and account chip at this width; the page heading is already
     repeated large in the green page-header card below, so it's safe to drop. */
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar-brand { padding-right: 10px; margin-right: 0; margin-left: 0; border-right: 0; }
  .topbar-brand-text { display: none; }
  .sidebar-toggle { margin-left: 0; }
  .topbar-title { display: none; }
  .bell-menu { margin-right: 8px; padding-right: 8px; }
}
/* Bell: severity dot and "View all" link */
.bell-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.bell-dot-critical { background: #A32D2D; }
.bell-dot-warning { background: #BA7517; }
.bell-all { display: block; padding: 10px 14px; font-size: 13px; font-weight: 600; text-align: center;
            border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.bell-all:hover { background: rgba(0, 0, 0, .04); }