:root {
    --black: #050505;
    --coal: #100a07;
    --panel: #1f120b;
    --panel-2: #2b1a11;
    --line: #5b3421;
    --gold: #d7aa76;
    --gold-strong: #f0c891;
    --copper: #9b6140;
    --text: #fff3df;
    --muted: #c3a58e;
    --danger: #c46352;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--black);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(18px, 4vw, 56px);
    background: #000;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: var(--gold-strong);
    font-size: 17px;
    text-transform: uppercase;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

.brand.centered {
    justify-content: center;
    margin-bottom: 20px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

nav a:hover,
nav a[aria-current="page"] {
    color: var(--gold-strong);
    border-color: var(--line);
    background: #11110e;
}

main {
    min-height: calc(100vh - 170px);
}

.hero {
    min-height: 78vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
    padding: clamp(48px, 8vw, 96px) clamp(18px, 6vw, 88px);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(120deg, rgba(16, 10, 7, .94), rgba(43, 26, 17, .74)),
        repeating-linear-gradient(135deg, rgba(215, 170, 118, .08), rgba(215, 170, 118, .08) 1px, transparent 1px, transparent 18px);
}

.hero h1,
.section-heading h1,
.section-heading h2 {
    margin: 0;
    color: var(--gold-strong);
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.02;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(48px, 8vw, 104px);
}

.hero p {
    max-width: 700px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.55;
}

.hero-mark {
    display: flex;
    justify-content: center;
}

.hero-mark img {
    width: min(100%, 430px);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 28px 32px rgba(0, 0, 0, .45));
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12px;
}

.hero-actions,
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--gold-strong);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    background: var(--gold);
    color: #111;
}

.button.ghost:hover,
.button.primary:hover {
    transform: translateY(-1px);
}

.section-band,
.content-layout,
.photo-band,
.page-shell,
.admin-page,
.admin-layout {
    padding: clamp(34px, 6vw, 76px) clamp(18px, 6vw, 88px);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.status-grid article {
    padding: 28px;
    background: var(--panel);
}

.status-grid span,
.ops-card span,
.admin-list span,
.update-card time {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.status-grid strong {
    display: block;
    margin: 8px 0;
    color: var(--gold-strong);
    font-size: 28px;
}

.status-grid p,
.event-row p,
.ops-card p,
.update-card p,
footer span {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
    gap: clamp(28px, 5vw, 64px);
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h1,
.section-heading h2 {
    font-size: clamp(32px, 5vw, 58px);
}

.section-heading.compact h2 {
    font-size: 32px;
}

.stack {
    display: grid;
    gap: 18px;
}

.update-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.update-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--panel);
}

.update-card h3,
.event-row h3 {
    margin: 6px 0 8px;
    color: var(--text);
    font-size: 24px;
}

.side-panel {
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    align-self: start;
}

.event-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.event-row time {
    display: grid;
    place-items: center;
    height: 58px;
    border: 1px solid var(--line);
    color: var(--gold);
}

.event-row time strong {
    font-size: 24px;
}

.photo-band {
    background: var(--coal);
    border-top: 1px solid var(--line);
}

.photo-grid,
.ops-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

figure {
    margin: 0;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #000;
    border: 1px solid var(--line);
}

.empty-photo img {
    object-fit: contain;
    padding: 40px;
}

figcaption {
    padding-top: 10px;
    color: var(--muted);
}

.ops-card,
.editor-card,
.auth-card {
    display: block;
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    text-decoration: none;
}

.ops-card:hover {
    border-color: var(--gold);
    background: var(--panel-2);
}

.ops-card strong {
    display: block;
    margin: 8px 0;
    color: var(--gold-strong);
    font-size: 28px;
}

.admin-layout {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
    gap: 28px;
}

.admin-page {
    display: grid;
    gap: 34px;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    scrollbar-width: thin;
}

.tabs a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 16px;
    border: 1px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.tabs a[aria-current="page"],
.tabs a:hover {
    color: #111;
    background: var(--gold);
    border-color: var(--gold);
}

.report-grid,
.mobile-card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.finance-list {
    display: grid;
    gap: 10px;
}

.finance-list a,
.finance-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 14px;
    padding: 12px;
    color: var(--text);
    text-decoration: none;
    background: #0b0907;
    border: 1px solid var(--line);
}

.finance-list a:hover {
    border-color: var(--gold);
}

.finance-list span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.finance-list strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.finance-list em {
    color: var(--gold-strong);
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.compact-status {
    grid-template-columns: 1fr;
    background: transparent;
    gap: 10px;
}

.compact-status article {
    border: 1px solid var(--line);
}

.mobile-record h2 {
    margin: 8px 0;
    color: var(--gold-strong);
}

.record-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.record-date,
.record-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.record-date {
    color: var(--gold-strong);
    background: #0f0906;
}

.record-status.logged {
    color: #dff7d7;
    border-color: #4d7a3d;
    background: #1e3518;
}

.record-status.not-logged {
    color: #ffd0cc;
    border-color: var(--danger);
    background: #3b1715;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.on-pace {
    color: #dff7d7;
    border-color: #4d7a3d;
    background: #1e3518;
}

.status-pill.at-risk {
    color: #fff0b5;
    border-color: #8a742d;
    background: #3a3215;
}

.status-pill.behind {
    color: #ffd0cc;
    border-color: var(--danger);
    background: #3b1715;
}

td.expired input {
    border-color: var(--danger);
    background: #351410;
}

td.expiring input {
    border-color: #b89136;
    background: #332711;
}

.legal-card-list {
    display: none;
}

.legal-table input {
    min-width: 150px;
}

.legal-table .check-label input {
    min-width: 0;
}

.legal-field.expired input {
    border-color: var(--danger);
    background: #351410;
}

.legal-field.expiring input {
    border-color: #b89136;
    background: #332711;
}

fieldset {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid var(--line);
}

legend {
    padding: 0 8px;
    color: var(--gold-strong);
    font-weight: 700;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    background: #0f0906;
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

.form-grid label {
    flex: 1 1 190px;
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.admin-list strong {
    display: block;
    margin-top: 5px;
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--gold);
    font-size: 12px;
    text-transform: uppercase;
}

.text-right {
    text-align: right;
}

.muted {
    color: var(--muted);
}

.compact-form {
    max-width: 420px;
}

.check-label,
.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-weight: 400;
}

.check-label input,
.checkbox-grid input {
    width: auto;
    min-height: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 14px;
    margin: 12px 0 16px;
}

.attendance-member-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    margin: 8px 0 14px;
}

.attendance-member-row {
    display: grid;
    grid-template-columns: minmax(58px, 1fr) 118px;
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
    border: 1px solid var(--line);
    background: #0f0906;
}

.attendance-member-row .check-label {
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.attendance-member-row select {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 12px;
}

.inline-editor {
    display: grid;
    gap: 10px;
    min-width: 360px;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-weight: 700;
}

.visibility-form {
    display: grid;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 14px 0;
}

.delete-form {
    margin: 0 0 14px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    width: min(100%, 440px);
    min-height: auto;
}

.auth-card h1 {
    margin: 0 0 22px;
    color: var(--gold-strong);
}

.flash {
    width: min(100% - 36px, 980px);
    margin: 18px auto;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--gold-strong);
}

.flash.error {
    color: #ffd0cc;
    border-color: var(--danger);
}

.flash.success {
    color: var(--gold-strong);
}

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 28px clamp(18px, 6vw, 88px);
    border-top: 1px solid var(--line);
    color: var(--gold);
}

@media (max-width: 820px) {
    .site-header,
    .hero,
    .content-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .site-header {
        position: static;
        align-items: flex-start;
    }

    nav {
        justify-content: flex-start;
    }

    .status-grid,
    .photo-grid,
    .ops-grid,
    .report-grid,
    .mobile-card-list {
        grid-template-columns: 1fr;
    }

    .update-card {
        grid-template-columns: 1fr;
    }

    .record-status-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .admin-page,
    .page-shell,
    .section-band,
    .content-layout,
    .photo-band {
        padding-left: 14px;
        padding-right: 14px;
    }

    .site-header {
        flex-direction: column;
    }

    .hero {
        min-height: auto;
    }

    .hero p {
        font-size: 17px;
    }

    .tabs {
        margin-left: -4px;
        margin-right: -4px;
    }

    .tabs a {
        min-width: 44%;
    }

    .editor-card,
    .auth-card,
    .ops-card {
        padding: 18px;
    }

    .inline-editor {
        min-width: 0;
    }

    .attendance-member-row {
        grid-template-columns: minmax(58px, 1fr) 118px;
    }

    th,
    td {
        padding: 10px 8px;
    }
}

@media (max-width: 680px) {
    .responsive-table-card,
    .legal-section {
        overflow-x: visible;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        padding: 16px 0;
        border-top: 1px solid var(--line);
    }

    .responsive-table tr:first-child {
        border-top: 0;
        padding-top: 0;
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: minmax(92px, 32%) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 0;
        text-align: left;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--gold);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .responsive-table td[colspan] {
        display: block;
    }

    .responsive-table td[colspan]::before {
        display: none;
    }

    .responsive-table .text-right {
        text-align: left;
    }

    .responsive-table input,
    .responsive-table select,
    .responsive-table .button {
        width: 100%;
    }

    .responsive-table .check-label input {
        width: auto;
    }

    .responsive-table .status-pill {
        justify-self: start;
    }

    .admin-list article {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-list .text-button {
        min-height: 38px;
        padding: 0;
    }

    .legal-table {
        display: none;
    }

    .legal-card-list {
        display: grid;
        gap: 16px;
    }

    .legal-card {
        display: grid;
        gap: 12px;
        padding: 16px 0;
        border-top: 1px solid var(--line);
    }

    .legal-card:first-child {
        border-top: 0;
        padding-top: 0;
    }

    .legal-field {
        margin: 0;
    }

    .legal-field span {
        color: var(--gold);
        font-size: 12px;
        text-transform: uppercase;
    }

    .legal-field-name input {
        font-weight: 700;
    }

    .legal-card-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 2px;
    }

    .legal-card-actions .check-label {
        margin: 0;
    }

    .legal-card-actions .button {
        width: auto;
        min-width: 112px;
    }
}
