:root {
  --sse-ink: #14213d;
  --sse-primary: #1e3a8a;
  --sse-primary-dark: #14295f;
  --sse-accent: #f59e0b;
  --sse-soft: #f3f5fb;
  --sse-line: #e2e6f0;
  --bs-primary: #1e3a8a;
  --bs-primary-rgb: 30, 58, 138;
  --bs-link-color: #1e3a8a;
  --bs-link-color-rgb: 30, 58, 138;
  --bs-link-hover-color: #14295f;
  --bs-body-color: #1d2433;
  --bs-border-radius: .6rem;
}

body { background: #fff; }
body.dash { background: var(--sse-soft); }

.btn-primary {
  --bs-btn-bg: var(--sse-primary); --bs-btn-border-color: var(--sse-primary);
  --bs-btn-hover-bg: var(--sse-primary-dark); --bs-btn-hover-border-color: var(--sse-primary-dark);
  --bs-btn-active-bg: var(--sse-primary-dark); --bs-btn-active-border-color: var(--sse-primary-dark);
  --bs-btn-disabled-bg: var(--sse-primary); --bs-btn-disabled-border-color: var(--sse-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--sse-primary); --bs-btn-border-color: var(--sse-primary);
  --bs-btn-hover-bg: var(--sse-primary); --bs-btn-hover-border-color: var(--sse-primary);
  --bs-btn-active-bg: var(--sse-primary); --bs-btn-active-border-color: var(--sse-primary);
}
.btn-accent { background: var(--sse-accent); border-color: var(--sse-accent); color: #2b1d00; font-weight: 600; }
.btn-accent:hover { background: #d98a05; border-color: #d98a05; color: #2b1d00; }

.brand-mark {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--sse-primary); color: #fff; font-size: 1.3rem;
}

/* ---------- public site ---------- */
.sse-nav { background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--sse-line); }
.sse-nav .nav-link { font-weight: 500; color: var(--sse-ink); border-radius: .5rem; padding: .45rem .75rem; }
.sse-nav .nav-link:hover { background: var(--sse-soft); }
.sse-nav .nav-link.active { color: var(--sse-primary); background: #e8edfb; }

.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(245,158,11,.35), transparent 60%),
    linear-gradient(135deg, #14295f 0%, #1e3a8a 55%, #2b4fb5 100%);
  background-size: cover; background-position: center;
}
.hero.has-image::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(20,41,95,.92), rgba(30,58,138,.8)); }
.hero > .container { position: relative; }
.hero .eyebrow { letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: #fcd34d; font-weight: 600; }
.hero h1 { font-weight: 800; letter-spacing: -.02em; }
.hero .meta-chip { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: .4rem .8rem; border-radius: 999px; font-size: .95rem; }

.countdown { display: flex; gap: .75rem; flex-wrap: wrap; }
.countdown .cd-box { min-width: 78px; text-align: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: .8rem; padding: .6rem .5rem; }
.countdown .cd-num { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown .cd-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }

.stat-tile { background: #fff; border: 1px solid var(--sse-line); border-radius: .9rem; padding: 1.1rem 1.25rem; height: 100%; }
.stat-tile .num { font-size: 2rem; font-weight: 800; color: var(--sse-primary); line-height: 1; }
.stat-tile .lbl { color: #5b6478; font-size: .9rem; }

.section-title { font-weight: 700; letter-spacing: -.01em; }
.section-title::after { content: ''; display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--sse-accent); margin-top: .5rem; }

.card-soft { background: #fff; border: 1px solid var(--sse-line); border-radius: .9rem; }
.quick-link { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--sse-line); border-radius: .9rem; text-decoration: none; color: inherit; background: #fff; height: 100%; transition: box-shadow .15s, transform .15s; }
.quick-link:hover { box-shadow: 0 8px 24px rgba(20,41,95,.12); transform: translateY(-2px); color: inherit; }
.quick-link .ico { font-size: 1.6rem; color: var(--sse-primary); }

.notice { border-left: 4px solid var(--sse-accent); background: #fffaf0; padding: .7rem 1rem; border-radius: .4rem; }
.notice.pinned { border-color: #dc2626; background: #fff5f5; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--sse-line); }
.timeline li { position: relative; padding: 0 0 1.25rem 1.5rem; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--sse-primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--sse-primary); }
.timeline .time { font-weight: 600; color: var(--sse-primary); font-variant-numeric: tabular-nums; }

.sse-footer { background: var(--sse-ink); color: #fff; }

.page-head { background: var(--sse-soft); border-bottom: 1px solid var(--sse-line); padding: 2rem 0 1.5rem; }

.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------- dashboard ---------- */
.dash-shell { display: flex; min-height: 100vh; }
/* Bootstrap's .offcanvas-lg is transparent on desktop, so the dark colour lives on a wrapper. */
.dash-side-wrap { flex: 0 0 250px; width: 250px; background: var(--sse-ink); }
.dash-side { --bs-offcanvas-bg: var(--sse-ink); --bs-offcanvas-color: #cfd6e6; color: #cfd6e6; }
@media (min-width: 992px) {
  .dash-side-wrap { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
  .dash-side-wrap { flex-basis: 0; width: 0; }
}
.dash-side .offcanvas-header { background: var(--sse-ink); color: #fff; }
.side-brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1.1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand small { color: #9aa6c4; font-size: .75rem; }
.side-nav { padding: .6rem .6rem 2rem; }
.side-nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .8rem; color: #cfd6e6; text-decoration: none; border-radius: .5rem; font-size: .93rem; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--sse-primary); color: #fff; }
.side-heading { text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: #7f8bab; padding: 1rem .8rem .3rem; }
.dash-main { flex: 1; min-width: 0; }
.dash-top { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem; background: #fff; border-bottom: 1px solid var(--sse-line); position: sticky; top: 0; z-index: 20; }
.dash-content { padding: 1.25rem; }
.panel { background: #fff; border: 1px solid var(--sse-line); border-radius: .9rem; }
.panel-head { padding: .85rem 1.1rem; border-bottom: 1px solid var(--sse-line); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel-body { padding: 1.1rem; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #5b6478; background: #f8f9fc; white-space: nowrap; }
.kpi { display: flex; align-items: center; gap: .9rem; }
.kpi .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: #e8edfb; color: var(--sse-primary); }
.kpi .num { font-size: 1.65rem; font-weight: 700; line-height: 1.05; }
.kpi .lbl { color: #5b6478; font-size: .82rem; }
.mini-bar { height: 8px; border-radius: 4px; background: #e9edf6; overflow: hidden; min-width: 70px; }
.mini-bar > span { display: block; height: 100%; background: var(--sse-primary); }
.mini-bar.ok > span { background: #16a34a; }
.mini-bar.warn > span { background: var(--sse-accent); }
.row-flash { animation: rowflash 1.2s ease-out; }
@keyframes rowflash { from { background: #fff4cc; } to { background: transparent; } }
.person { white-space: nowrap; }
.chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; background: #eef1f9; color: #3a4a78; }
.chip.ok { background: #dcfce7; color: #166534; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.bad { background: #fee2e2; color: #991b1b; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--sse-line); padding: .75rem 1rem; margin: 1rem -1.1rem -1.1rem; border-radius: 0 0 .9rem .9rem; }

/* certificate lookup + printing */
.cert-card { border: 1px dashed #b9c3df; border-radius: .8rem; padding: 1rem; background: #fbfcff; }

@media print {
  .dash-side, .dash-top, .sse-nav, .sse-footer, .no-print, #toastHost, .alert { display: none !important; }
  .dash-content { padding: 0; }
  body.dash, body { background: #fff; }
  .panel { border: 0; }
  .print-break { page-break-before: always; }
  a { text-decoration: none; color: inherit; }
}
