:root {
    --navy: #10243f;
    --blue: #173d63;
    --red: #b91c1c;
    --red-dark: #991b1b;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #cbd5e1;
    --soft-line: #e2e8f0;
    --paper: #ffffff;
    --mist: #f4f7fb;
    --subpage: #e5e7eb;
    --success: #166534;
    --success-bg: #f0fdf4;
    --danger-bg: #fef2f2;
    --shadow: 0 16px 38px rgba(15, 23, 42, 0.10);
    --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--mist);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a, input, textarea { outline-color: var(--red); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; }

.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.container.narrow { width: min(900px, calc(100% - 40px)); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--soft-line);
    background: rgba(255, 255, 255, 0.97);
}

.header-inner {
    display: flex;
    min-height: 80px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-lockup, .admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-lockup strong, .admin-brand strong { display: block; color: var(--ink); line-height: 1.2; }
.brand-lockup small, .admin-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.logo-mark, .site-logo, .admin-logo {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    font-size: 21px;
    font-weight: 800;
    box-shadow: inset 0 -4px 0 var(--red);
}

.site-logo { object-fit: contain; padding: 4px; }

.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav a {
    border-radius: 6px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 11px;
}
.primary-nav a:hover, .primary-nav a.active { background: #eef3fa; color: var(--red-dark); }

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 11px 17px;
    cursor: pointer;
    font-weight: 800;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--red); color: #fff; box-shadow: 0 10px 24px rgba(185, 28, 28, 0.22); }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--navy); }
.full-width { width: 100%; }

.hero-band {
    border-bottom: 1px solid var(--soft-line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(244, 247, 251, 1)),
        radial-gradient(circle at top right, rgba(185, 28, 28, .16), transparent 34%),
        radial-gradient(circle at 18% 30%, rgba(23, 61, 99, .14), transparent 30%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 38px; padding-block: 64px; }

.hero-panel {
    display: flex;
    min-height: 520px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #10243f 0%, #173d63 52%, #b91c1c 100%);
    color: #fff;
    padding: 40px;
    box-shadow: var(--shadow);
}

.eyebrow { margin-bottom: 10px; color: var(--red); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.eyebrow.light { color: #fecaca; }
.hero-panel h1 { margin: 20px 0 28px; font-size: 58px; }
.hero-copy { max-width: 560px; color: #dbeafe; font-size: 18px; line-height: 1.75; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.hero-facts div { border-left: 1px solid rgba(255,255,255,.28); padding-left: 16px; }
.hero-facts strong, .hero-facts span { display: block; }
.hero-facts span { margin-top: 4px; color: #bfdbfe; font-size: 13px; }

.hero-side { display: grid; align-content: start; gap: 20px; }
.surface, .admin-section, .metric, .auth-panel, .install-panel {
    border: 1px solid var(--soft-line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 2px 3px rgba(15, 23, 42, .08);
}
.latest-news { padding: 26px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-heading h2 { margin-bottom: 0; font-size: 30px; }
.compact-heading { align-items: center; margin-bottom: 20px; }
.compact-heading h2 { font-size: 24px; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 7px; background: var(--navy); color: #fff; font-size: 22px; }

.compact-news { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; }
.compact-news img, .image-placeholder { width: 104px; height: 88px; border-radius: 6px; object-fit: cover; }
.image-placeholder, .mini-placeholder { display: grid; place-items: center; background: #e2e8f0; color: var(--navy); font-weight: 800; }
.compact-news h3 { margin: 5px 0; font-size: 17px; }
.compact-news p:last-child { display: -webkit-box; overflow: hidden; margin: 0; color: var(--text); font-size: 14px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.date-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.info-tile { min-height: 184px; padding: 22px; }
.info-tile h3 { margin: 18px 0 8px; font-size: 17px; }
.info-tile p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.7; }
.tile-symbol { color: var(--red); font-size: 24px; font-weight: 800; }

.directory-band { border-block: 1px solid var(--line); background: #f1f5f9; padding-block: 50px; }
.directory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.directory-link { display: flex; min-height: 92px; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 20px; color: var(--navy); }
.directory-link:hover { border-color: var(--red); box-shadow: 0 12px 28px rgba(15,23,42,.09); transform: translateY(-2px); }
.directory-number { color: var(--red); font-size: 13px; font-weight: 800; }

.subpage-nav { border-bottom: 1px solid var(--line); background: var(--subpage); }
.nav-pills { display: flex; gap: 9px; overflow-x: auto; padding-block: 16px; }
.nav-pill { flex: 0 0 auto; border: 1px solid #94a3b8; border-radius: 999px; background: #fff; color: #1e293b; padding: 9px 14px; font-size: 14px; font-weight: 700; }
.nav-pill:hover, .nav-pill.active { border-color: var(--red); background: #fff7f7; color: var(--red-dark); }

.content-band { min-height: 62vh; padding-block: 70px; }
.page-intro { max-width: 790px; margin-bottom: 44px; }
.page-intro h1 { margin-bottom: 18px; font-size: 48px; }
.page-intro > p:last-of-type { color: var(--text); font-size: 19px; line-height: 1.7; }
.page-intro .button { margin-top: 12px; }
.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--line); padding-top: 32px; }
.content-block { padding-right: 20px; }
.content-block > span { color: var(--red); font-size: 13px; font-weight: 800; }
.content-block h2 { margin: 18px 0 12px; font-size: 22px; }
.content-block p { margin: 0; color: var(--text); line-height: 1.75; }

.module-container { width: min(1120px, calc(100% - 40px)); }
.module-header { border-bottom: 1px solid var(--soft-line); background: #fff; }
.module-header-inner { display: flex; flex-direction: column; gap: 32px; padding-block: 32px; }
.module-back-link { display: inline-flex; width: fit-content; align-items: center; color: #475569; font-size: 14px; font-weight: 700; }
.module-back-link:hover { color: var(--red-dark); }
.module-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.module-kicker { margin: 0; color: var(--red-dark); font-size: 14px; font-weight: 800; text-transform: uppercase; }
.module-header h1 { margin: 12px 0 0; font-size: 48px; }
.module-intro { max-width: 680px; margin: 20px 0 0; color: #475569; font-size: 18px; line-height: 1.75; }
.module-icon-box { display: grid; width: 80px; height: 80px; place-items: center; border-radius: 8px; background: #020617; }
.module-icon-box img { width: 36px; height: 36px; }
.module-document-wrap { padding-top: 40px; }
.module-document-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; border: 1px solid var(--soft-line); border-radius: 8px; background: #fff; padding: 24px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.module-document-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 8px; background: #fef2f2; color: var(--red-dark); font-size: 12px; font-weight: 900; }
.module-document-type { margin: 0; color: var(--red-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.module-document-card h2 { margin: 4px 0 0; font-size: 20px; }
.module-document-card > div > p:last-child { margin: 4px 0 0; color: #475569; line-height: 1.6; }
.module-document-button { background: var(--navy); color: #fff; }
.module-document-button:hover { background: var(--red-dark); }
.module-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-block: 40px; }
.module-card { border: 1px solid var(--soft-line); border-radius: 8px; background: #fff; padding: 24px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.module-card h2 { margin: 0; font-size: 20px; }
.module-card p { margin: 16px 0 0; color: #475569; line-height: 1.75; }
.module-news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-block: 40px; }
.module-news-card { overflow: hidden; border: 1px solid var(--soft-line); border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.module-news-card > img, .module-news-placeholder { width: 100%; height: 224px; object-fit: cover; }
.module-news-placeholder { display: grid; place-items: center; background: #f1f5f9; }
.module-news-placeholder img { width: 42px; height: 42px; }
.module-news-content { padding: 24px; }
.module-news-content h2 { margin: 8px 0 0; font-size: 24px; }
.module-news-content .news-excerpt { margin: 12px 0 0; }
.module-news-content .news-body { margin-top: 16px; }
.module-news-empty { grid-column: 1 / -1; }

.news-list { display: grid; gap: 28px; }
.news-article { overflow: hidden; border: 1px solid var(--soft-line); border-radius: var(--radius); background: #fff; box-shadow: 0 2px 5px rgba(15,23,42,.07); }
.news-article > img { width: 100%; max-height: 440px; object-fit: cover; }
.news-content { padding: 30px; }
.news-content h2 { margin: 8px 0 16px; font-size: 30px; }
.news-excerpt { color: #334155; font-size: 17px; font-weight: 700; }
.news-body { color: var(--text); line-height: 1.8; white-space: pre-line; }
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius); background: #f8fafc; padding: 20px; }
.empty-state p { margin: 8px 0 0; color: var(--text); }
.empty-state.large { padding: 34px; text-align: center; }

.site-footer { border-top: 1px solid var(--soft-line); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 30px; color: var(--muted); font-size: 14px; }
.footer-inner p { margin: 0; }
.footer-admin-link { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); padding: 7px 11px; font-size: 13px; font-weight: 700; }
.footer-admin-link:hover { border-color: #94a3b8; background: #f8fafc; color: var(--text); }

label { display: grid; gap: 7px; margin-bottom: 16px; color: #334155; font-size: 14px; font-weight: 800; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); padding: 12px 13px; font-weight: 500; }
input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185,28,28,.12); outline: none; }
textarea { resize: vertical; }
fieldset { border: 0; border-top: 1px solid var(--soft-line); margin: 28px 0 0; padding: 24px 0 0; }
legend { padding-right: 12px; color: var(--navy); font-size: 18px; font-weight: 800; }
.form-grid.two-columns { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.field-note { color: var(--muted); font-size: 13px; }

.auth-page, .install-page { background: var(--navy); }
.auth-shell, .install-shell { width: min(480px, calc(100% - 32px)); margin-inline: auto; padding-block: 56px; }
.install-shell { width: min(720px, calc(100% - 32px)); }
.auth-page .brand-lockup strong, .install-page .brand-lockup strong { color: #fff; }
.auth-page .brand-lockup small, .install-page .brand-lockup small { color: #bfdbfe; }
.auth-panel, .install-panel { margin-top: 28px; padding: 32px; }
.auth-panel h1, .install-panel h1 { margin-bottom: 14px; font-size: 34px; }
.lead.compact { color: var(--text); line-height: 1.7; }
.back-link { display: block; margin-top: 22px; color: var(--muted); font-size: 14px; text-align: center; }
.alert { margin-bottom: 22px; border: 1px solid; border-radius: 7px; padding: 14px 16px; font-weight: 700; }
.alert p { margin: 0 0 6px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { border-color: #86efac; background: var(--success-bg); color: var(--success); }
.alert-error { border-color: #fecaca; background: var(--danger-bg); color: var(--red-dark); }

.admin-page { background: #edf2f7; }
.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 260px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; background: var(--navy); color: #fff; padding: 24px 18px; }
.admin-brand { padding: 0 4px 22px; }
.admin-brand strong { color: #fff; }
.admin-brand small { color: #bfdbfe; }
.admin-logo { background: #fff; color: var(--navy); }
.admin-sidebar nav { border-top: 1px solid rgba(255,255,255,.16); padding-top: 22px; }
.sidebar-label { margin: 0 10px 9px; color: #94a3b8; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.admin-sidebar nav a { display: block; border-radius: 6px; color: #dbeafe; padding: 10px 12px; font-weight: 700; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.admin-sidebar nav a.active { background: #fff; color: var(--navy); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.16); padding: 18px 8px 0; color: #cbd5e1; font-size: 13px; }
.sidebar-footer p { margin-bottom: 10px; }
.sidebar-footer button { border: 0; background: none; color: #fff; cursor: pointer; font-weight: 800; padding: 0; }

.admin-main { min-width: 0; padding: 34px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.admin-header h1 { margin: 0; font-size: 34px; }
.admin-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 18px; margin-bottom: 22px; }
.metric { display: grid; gap: 8px; padding: 22px; }
.metric span { color: var(--muted); font-size: 14px; font-weight: 700; }
.metric strong { color: var(--navy); font-size: 38px; }
.metric a { color: var(--red-dark); font-size: 14px; font-weight: 800; }
.admin-section { padding: 26px; }
.admin-section h2 { margin-bottom: 12px; font-size: 25px; }
.admin-section > p:last-child { color: var(--text); line-height: 1.7; }
.admin-section code { border-radius: 4px; background: #e2e8f0; padding: 2px 5px; }
.admin-news-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 22px; align-items: start; }
.editor-actions { display: flex; gap: 12px; border-top: 1px solid var(--soft-line); padding-top: 20px; }
.news-preview { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; }
.news-preview > div:last-child { padding: 22px; }
.preview-image { display: grid; min-height: 190px; place-items: center; background: #e2e8f0; color: var(--muted); }
.preview-image img { width: 100%; max-height: 320px; object-fit: cover; }
.count-badge { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #e2e8f0; color: var(--navy); }
.admin-news-list { display: grid; gap: 14px; }
.admin-news-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 13px; border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 14px; }
.admin-news-item img, .mini-placeholder { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.admin-news-item h3 { margin: 4px 0; font-size: 16px; }
.admin-news-item div > p:last-child { display: -webkit-box; overflow: hidden; margin: 0; color: var(--text); font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.admin-news-item form { grid-column: 1 / -1; border-top: 1px solid var(--soft-line); padding-top: 10px; text-align: right; }
.delete-button { border: 1px solid #fecaca; border-radius: 6px; background: #fff; color: var(--red-dark); cursor: pointer; padding: 8px 11px; font-size: 13px; font-weight: 800; }
.delete-button:hover { background: var(--danger-bg); }

@media (max-width: 1060px) {
    .primary-nav { display: none; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-panel { min-height: 470px; }
    .directory-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-news-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .container, .container.narrow { width: min(100% - 28px, 1180px); }
    .header-inner { min-height: 70px; gap: 10px; }
    .brand-lockup strong { font-size: 14px; }
    .brand-lockup small { display: none; }
    .logo-mark, .site-logo { width: 42px; height: 42px; flex-basis: 42px; }
    .header-action { min-height: 40px; padding: 9px 12px; font-size: 14px; }
    .hero-grid { padding-block: 28px; }
    .hero-panel { min-height: 440px; padding: 27px; }
    .hero-panel h1 { font-size: 42px; }
    .hero-facts { grid-template-columns: 1fr; gap: 14px; }
    .info-grid, .content-grid, .directory-grid { grid-template-columns: 1fr; }
    .module-card-grid, .module-news-grid { grid-template-columns: 1fr; }
    .module-document-card { grid-template-columns: 1fr; align-items: start; }
    .module-document-button { width: 100%; }
    .module-title-row { grid-template-columns: 1fr; align-items: start; }
    .module-header h1 { font-size: 38px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .compact-heading { flex-direction: row; align-items: center; }
    .section-heading h2 { font-size: 25px; }
    .content-band { padding-block: 44px; }
    .page-intro h1 { font-size: 38px; }
    .footer-inner { flex-direction: column; }
    .admin-shell { display: block; }
    .admin-sidebar { position: static; height: auto; }
    .admin-sidebar nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
    .sidebar-label { grid-column: 1 / -1; }
    .sidebar-footer { margin-top: 22px; }
    .admin-main { padding: 22px 14px; }
    .admin-header { align-items: flex-start; }
    .admin-overview { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .hero-panel h1 { font-size: 36px; }
    .compact-news { grid-template-columns: 1fr; }
    .compact-news img, .image-placeholder { width: 100%; height: 180px; }
    .admin-header { flex-direction: column; }
    .admin-overview { grid-template-columns: 1fr; }
    .form-grid.two-columns { grid-template-columns: 1fr; gap: 0; }
    .auth-panel, .install-panel, .admin-section { padding: 22px; }
}
