:root {
  --bg: #f6f1e8;
  --bg-soft: #efe7da;
  --surface: rgba(255,255,255,.97);
  --surface-soft: rgba(255,255,255,.9);
  --surface-strong: #fffdf9;
  --text: #172131;
  --text-soft: #334256;
  --muted: #566273;
  --border: #d7cbbb;
  --border-strong: #c8b79f;
  --brand: #1f3265;
  --brand-strong: #16264c;
  --brand-light: #e7eefc;
  --red: #9d231b;
  --red-strong: #7e170f;
  --red-light: #fde9e6;
  --gold: #b88b2e;
  --gold-soft: #fff4d9;
  --green: #1f6e47;
  --green-soft: #e7f5ed;
  --blue-soft: #eaf2ff;
  --shadow: 0 18px 48px rgba(18, 28, 44, .10);
  --shadow-sm: 0 10px 24px rgba(18, 28, 44, .07);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(157,35,27,.08), transparent 28%),
    radial-gradient(circle at 100% 0, rgba(31,50,101,.10), transparent 24%),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 58%, #efe8dc 100%);
}
img { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; }
.narrow { width: min(calc(100% - 2rem), 840px); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248,243,236,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31,50,101,.10);
}

.nav-wrap {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .95rem;
  color: var(--text);
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,240,228,.96));
  border: 1px solid rgba(184,139,46,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 20px rgba(18, 28, 44, .12);
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-copy {
  display: grid;
  gap: .12rem;
  min-width: 0;
}
.brand-copy strong {
  font-size: 1.05rem;
  line-height: 1.1;
}
.brand-copy small {
  color: var(--muted);
  font-size: .83rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
}
.nav > a {
  color: var(--text-soft);
  font-weight: 600;
  padding: .6rem .8rem;
  border-radius: 999px;
}
.nav > a:hover {
  text-decoration: none;
  background: rgba(31,50,101,.06);
}
.nav > a.button,
.nav > a.button:visited {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #28427f);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 22px rgba(31,50,101,.18);
}
.nav > a.button:hover,
.nav > a.button:focus-visible {
  background: linear-gradient(135deg, #27417e, #33539d);
}
.nav-link-admin {
  border: 1px solid rgba(31,50,101,.14);
}

.brand-banner-wrap {
  padding: .55rem 0 0;
}
.brand-banner {
  padding: .28rem;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.84));
  border: 1px solid rgba(31,50,101,.10);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.brand-banner-image {
  width: 100%;
  aspect-ratio: 16 / 5.1;
  object-fit: cover;
  object-position: center;
  border-radius: calc(var(--radius-lg) - 6px);
}

main { padding: .2rem 0 3rem; }
.section { padding: 1.35rem 0; }
.section-soft { background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.08)); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}
.section-kicker,
.eyebrow {
  display: inline-block;
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 800;
  color: var(--brand);
}
.page-title,
.section-head h1,
.section-head h2,
.hero h1,
.detail-title {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.hero h1 { font-size: clamp(2rem, 4.8vw, 3.65rem); }
.page-title { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
.lead {
  font-size: 1rem;
  color: var(--text-soft);
}
.muted { color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid rgba(23,33,49,.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero { padding: .7rem 0 1rem; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr .8fr;
  gap: 1rem;
  align-items: stretch;
}
.hero-panel,
.stats-featured,
.spotlight-card,
.mini-feature-card,
.card,
.form-panel,
.detail-card,
.timeline-item,
.notice,
.table-wrap,
.stat {
  padding: 1.1rem;
}
.hero-panel {
  background:
    linear-gradient(135deg, rgba(31,50,101,.97), rgba(157,35,27,.88)),
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.12), transparent 30%);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.2), transparent 70%);
}
.hero-panel .eyebrow,
.hero-panel .lead,
.hero-panel p,
.hero-panel .hero-points span { color: rgba(255,255,255,.92); }
.hero-panel .eyebrow { color: rgba(255,255,255,.86); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.2rem 0;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.hero-points span {
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  font-size: .92rem;
}

.stats-stack {
  display: grid;
  gap: .7rem;
}
.stats-featured {
  background: linear-gradient(180deg, #fffdfb, #faf5ee);
}
.stat-hero strong,
.admin-stats strong,
.stat-grid strong {
  display: block;
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 1;
  margin: .25rem 0 .35rem;
  color: var(--brand-strong);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
  margin-top: 1rem;
}
.stat-grid .stat {
  padding: 1rem;
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: none;
}
.spotlight-card {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,242,231,.95));
}
.spotlight-card h3,
.mini-feature-card h3,
.card h3,
.timeline-item h3,
.detail-card h2 { margin: 0 0 .4rem; }

.mini-feature-grid,
.card-grid {
  display: grid;
  gap: .7rem;
}
.mini-feature-grid { grid-template-columns: repeat(3, 1fr); }
.card-grid { grid-template-columns: repeat(3, 1fr); }
.mini-feature-card {
  position: relative;
  overflow: hidden;
}
.mini-feature-card::before {
  content: "";
  position: absolute;
  left: 1.35rem;
  top: 1.15rem;
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--red));
}
.mini-feature-card h3 { padding-top: .9rem; }

.filter-panel { margin-bottom: .8rem; }
.filter-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.filter-grid .full,
.form-grid .full { grid-column: 1 / -1; }
label {
  display: grid;
  gap: .45rem;
  font-weight: 700;
  color: var(--text-soft);
}
input,
select,
textarea {
  width: 100%;
  padding: .78rem .92rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
textarea {
  min-height: 160px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(31,50,101,.15);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31,50,101,.08);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .2rem 0;
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 42px;
  padding: .72rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #28427f);
  color: #fff;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 10px 22px rgba(31,50,101,.18);
  cursor: pointer;
  text-decoration: none;
}
.button:hover { text-decoration: none; filter: brightness(1.03); }
.button:focus-visible,
.nav > a:focus-visible {
  outline: 3px solid rgba(184,139,46,.35);
  outline-offset: 2px;
}
.button-secondary {
  background: #fff;
  color: var(--brand-strong);
  border-color: rgba(31,50,101,.18);
  box-shadow: none;
}
.button-danger {
  background: linear-gradient(135deg, var(--red), var(--red-strong));
}
.button-sm { min-height: 40px; padding: .65rem .95rem; }
.filter-actions,
.form-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}
.form-note-row {
  justify-content: space-between;
}
.form-note-row p { margin: 0; max-width: 44rem; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: .85rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .34rem .62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.badge-blue { background: var(--blue-soft); color: var(--brand-strong); border-color: rgba(31,50,101,.12); }
.badge-amber { background: var(--gold-soft); color: #6d4d0f; border-color: rgba(184,139,46,.18); }
.badge-green { background: var(--green-soft); color: #165334; border-color: rgba(31,110,71,.16); }
.badge-red { background: var(--red-light); color: #7b1f18; border-color: rgba(157,35,27,.16); }
.badge-slate { background: #edf1f6; color: #4d5f76; border-color: rgba(77,95,118,.14); }

.card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.card p { margin: 0; color: var(--text-soft); }
.kv {
  display: grid;
  gap: .5rem;
  margin: .1rem 0 0;
}
.kv div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .9rem;
  padding-top: .45rem;
  border-top: 1px solid rgba(23,33,49,.08);
}
.kv dt {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}
.kv dd { margin: 0; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
  margin-top: auto;
  padding-top: .35rem;
}
.empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.35rem;
  background: linear-gradient(180deg, #fffdf9, #f8f1e7);
}
.empty-card p { max-width: 42rem; margin: 0 auto; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th,
td {
  text-align: left;
  padding: .72rem .65rem;
  border-bottom: 1px solid rgba(23,33,49,.08);
  vertical-align: top;
}
thead th {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
tbody tr:hover { background: rgba(31,50,101,.03); }

.notice {
  margin: 0 0 1rem;
  border-left: 5px solid transparent;
}
.success-notice {
  background: var(--green-soft);
  border-left-color: var(--green);
}
.error-notice {
  background: var(--red-light);
  border-left-color: var(--red);
}

.detail-hero {
  background: linear-gradient(180deg, #fffdfa, #f8f2e8);
}
.detail-title { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.detail-kv { margin-top: 1rem; }
.timeline {
  display: grid;
  gap: .9rem;
}
.timeline-item {
  position: relative;
  padding-left: 1.35rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.45rem;
  bottom: 1.45rem;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--red));
}
.timeline-date {
  display: inline-block;
  margin-bottom: .45rem;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}

.admin-head,
.two-col,
.admin-stats {
  display: grid;
  gap: .7rem;
}
.admin-head {
  grid-template-columns: 1fr auto;
  align-items: end;
}
.admin-stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 1rem; }
.two-col { grid-template-columns: 1.2fr .95fr; }
.two-col-admin { grid-template-columns: 1.15fr .85fr; }
.login-panel { max-width: 560px; }

.site-footer {
  background: linear-gradient(180deg, #16213f, #10182d);
  color: rgba(255,255,255,.92);
  padding: 2rem 0 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
}
.site-footer h4 { margin: 0 0 .45rem; font-size: 1rem; }
.site-footer p {
  margin: 0;
  color: rgba(255,255,255,.8);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 1.1rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.site-footer .muted { color: rgba(255,255,255,.68); }

@media (max-width: 1080px) {
  .hero-grid,
  .two-col,
  .two-col-admin,
  .mini-feature-grid,
  .card-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-grid { grid-template-columns: 1fr; }
  .stats-stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .container,
  .narrow { width: min(calc(100% - 1.1rem), var(--max)); }
  .nav-wrap,
  .section-head,
  .admin-head,
  .footer-bottom,
  .form-note-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-wrap { align-items: stretch; }
  .nav { justify-content: flex-start; }
  .hero,
  .section { padding: 1.7rem 0; }
  .stats-stack,
  .mini-feature-grid,
  .card-grid,
  .filter-grid,
  .form-grid,
  .two-col,
  .two-col-admin,
  .admin-stats,
  .footer-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .brand-banner-image { aspect-ratio: 16 / 9; }
  .kv div { grid-template-columns: 1fr; gap: .3rem; }
  table { min-width: 640px; }
}

@media (max-width: 720px) {
  .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
  .brand-copy small { font-size: .76rem; }
}


.hero-panel h1{max-width:18ch;}
.hero-panel .lead{max-width:58ch;margin:.55rem 0 0;}
.section-head p{max-width:68ch;margin:.35rem 0 0;color:var(--text-soft);}
.card h3{line-height:1.2;}
.brand-banner{border-radius:22px;}
@media (min-width: 761px) {
  .brand-banner-wrap + main,
  .brand-banner-wrap + main .hero {
    margin-top: 0;
  }
}


/* Compact dashboard-style homepage polish */
main { padding: .1rem 0 2.2rem; }
.brand-banner-wrap { padding: .4rem 0 0; }
.brand-banner-image { aspect-ratio: 16 / 4.2; }
.hero.hero-compact { padding: .45rem 0 .35rem; }
.hero-grid-compact { grid-template-columns: 1.35fr .7fr; gap: .7rem; align-items: start; }
.compact-hero-panel, .compact-stats-card { padding: .85rem 1rem; }
.compact-hero-panel h1 { font-size: clamp(1.55rem, 2.6vw, 2.2rem); max-width: none; }
.compact-hero-panel .lead { font-size: .95rem; max-width: 60ch; margin: .35rem 0 0; }
.compact-actions { margin: .8rem 0 0; gap: .55rem; }
.stats-stack-compact { gap: .55rem; }
.compact-stat-grid { margin-top: 0; gap: .6rem; }
.compact-stat-grid .stat { padding: .85rem; }
.compact-stat-grid strong { font-size: clamp(1.5rem, 2.5vw, 2rem); margin: .2rem 0 0; }
.section { padding: .9rem 0; }
.section-head { margin-bottom: .65rem; }
.section-head h2 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.section-head p { font-size: .94rem; }
.filter-panel { margin-bottom: .65rem; }
.hero + .section { padding-top: .45rem; }
.card, .form-panel, .detail-card, .timeline-item, .notice, .table-wrap, .stat { padding: .95rem; }
.card-grid { gap: .6rem; }
@media (max-width: 1080px) { .hero-grid-compact { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .hero.hero-compact { padding: .35rem 0 .2rem; } .brand-banner-image { aspect-ratio: 16 / 6; } .section { padding: .8rem 0; } }
