:root {
    --navy-950: #071633;
    --navy-900: #0a1f44;
    --navy-800: #12294f;
    --navy-700: #1c3763;
    --gold-500: #c9a227;
    --gold-400: #d4b43a;
    --gold-100: #f3e6bc;
    --ink: #14213d;
    --paper: #fbfaf7;
    --paper-dim: #f1efe8;
    --line: #d9d3c1;
    --text-muted: #5b6472;
    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 22px;
    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

:focus-visible {
    outline: 2px solid var(--gold-400);
    outline-offset: 2px;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--navy-900);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.4rem; }

a { color: var(--navy-800); }

.site-header {
    background: var(--navy-950);
    border-bottom: 3px solid var(--gold-500);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--paper);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.03em;
}

.site-header .brand img { height: 40px; width: 40px; }

.site-nav { display: flex; gap: 1.75rem; align-items: center; }
.site-nav a {
    color: var(--gold-100);
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--gold-400); }

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover, .btn-gold:focus-visible { background: var(--gold-400); }

.btn-outline { background: transparent; border-color: var(--navy-700); color: var(--navy-800); }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--navy-900); border-color: var(--navy-900); color: var(--paper); }

.btn-danger { background: transparent; border-color: #a3302f; color: #a3302f; }
.btn-danger:hover, .btn-danger:focus-visible { background: #a3302f; color: var(--paper); }

.btn:disabled, .btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

main { max-width: 1120px; margin: 0 auto; padding: 3rem 2rem; }

.hero {
    background: linear-gradient(180deg, var(--navy-950), var(--navy-800));
    color: var(--paper);
    padding: 4.5rem 2rem;
    text-align: center;
}
.hero h1 { color: var(--paper); }
.hero p { color: var(--gold-100); max-width: 40rem; margin: 0 auto 1.75rem; }

.banner-suspended {
    background: var(--gold-100);
    border-bottom: 1px solid var(--gold-500);
    color: var(--navy-900);
    padding: 0.65rem 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.75rem;
    margin: 2.5rem 0;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.6rem;
}

.site-footer {
    background: var(--navy-950);
    color: var(--gold-100);
    padding: 2.5rem 2rem 1.5rem;
    margin-top: 3rem;
}
.site-footer a { color: var(--gold-100); text-decoration: none; }
.site-footer a:hover { color: var(--gold-400); }
.footer-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}
.footer-grid h4 { color: var(--gold-500); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.85rem; }
.footer-bottom {
    max-width: 1120px;
    margin: 2rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--navy-700);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-field { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.form-field label { font-weight: 600; font-size: 0.88rem; }
.form-field input, .form-field select, .form-field textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--navy-900); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; }
tbody tr { transition: background-color 0.1s ease; }
tbody tr:hover { background: var(--paper-dim); }

.portal-shell { display: flex; flex: 1; }
.portal-sidebar {
    width: 252px;
    background: var(--navy-950);
    color: var(--paper);
    padding: 1.5rem 0.85rem;
    flex-shrink: 0;
    overflow-y: auto;
}
.portal-main {
    flex: 1;
    padding: 2rem 2.5rem 3rem;
    min-width: 0;
}
.portal-main h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.portal-main h2 { font-size: 1.25rem; margin-top: 2rem; }
.portal-main h3 { font-size: 1.05rem; }
.portal-main > p:first-of-type { color: var(--text-muted); margin-top: 0; }

.sidebar-nav { display: flex; flex-direction: column; gap: 1.4rem; }
.nav-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(243, 230, 188, 0.5);
}
.nav-group-icon { width: 14px; height: 14px; flex-shrink: 0; }
.nav-group a {
    display: block;
    color: var(--gold-100);
    text-decoration: none;
    padding: 0.48rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.89rem;
    margin-bottom: 0.05rem;
    opacity: 0.82;
    transition: background-color 0.12s ease, opacity 0.12s ease;
}
.nav-group a:hover { background: rgba(255, 255, 255, 0.07); opacity: 1; }
.nav-group a.active {
    background: var(--gold-500);
    color: var(--navy-950);
    font-weight: 600;
    opacity: 1;
}

.calendar-scroll { overflow-x: auto; }
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 700px;
}
.calendar-weekday {
    background: var(--navy-950);
    color: var(--gold-100);
    padding: 0.5rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
}
.calendar-day {
    background: #fff;
    min-height: 108px;
    padding: 0.4rem 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.calendar-day.is-outside { background: var(--paper-dim); }
.calendar-day.is-outside .calendar-day-number { color: var(--text-muted); }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--gold-500); }
.calendar-day-number { font-weight: 700; font-size: 0.85rem; color: var(--navy-900); }
.calendar-pill {
    display: block;
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-pill-event { background: var(--gold-100); color: #8a6a10; }
.calendar-pill-patrol { background: #eceef2; color: var(--text-muted); }
.calendar-pill:hover { filter: brightness(0.95); }

.empty-state {
    padding: 2.25rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
}

.tag { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.tag-ready { background: #dff3e3; color: #1f6b3b; }
.tag-progressing { background: var(--gold-100); color: #8a6a10; }
.tag-coaching { background: #fbe1e1; color: #a3302f; }
.tag-not-started { background: #eceef2; color: var(--text-muted); }

.alert { padding: 1rem 1.2rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-size: 0.92rem; }
.alert-error { background: #fbe1e1; color: #7a2422; border: 1px solid #e6a5a3; }
.alert-success { background: #dff3e3; color: #1f6b3b; border: 1px solid #a7d9b4; }
.alert-warning { background: var(--gold-100); color: #7a5c0a; border: 1px solid var(--gold-500); }
