/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Avenir', 'Avenir Next', 'Nunito Sans', 'Segoe UI', sans-serif;
    font-size: 15px;
    background-color: #ECEAEB;
    color: #08223D;
    min-height: 100dvh;
    padding: 16px 16px 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Optima', 'Optima Nova', 'Palatino', 'Palatino Linotype', serif;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
    max-width: 680px;
    margin: 0 auto;
}

/* ── Header ───────────────────────────────────────────────── */
header {
    display: flex;
    flex-direction: column;        /* mobile: stack */
    gap: 0.75rem;
    margin-bottom: 28px;
}

@media (min-width: 640px) {
    header {
        flex-direction: row;
        align-items: flex-end;     /* buttons sit at bottom of logo */
        justify-content: center;
    }
}

/* Logo wrapper: centered on mobile, left on desktop */
.logo-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

@media (min-width: 640px) {
    .logo-wrap {
        justify-content: flex-start;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.header-logo {
    width: 240px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav {
    display: flex;
    flex-direction: column;        /* stacked on mobile */
    gap: 0.5rem;
    width: 100%;                   /* full width on mobile */
}

@media (min-width: 640px) {
    nav {
        align-items: flex-end;     /* right-aligned on desktop */
        width: auto;
    }
}

.nav-link {
    display: block;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #3A5A40;
    background-color: rgba(58, 90, 64, 0.1);
    transition: background-color 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
    text-align: center;
}

.nav-link:hover {
    background-color: rgba(58, 90, 64, 0.2);
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: #08223D;
    color: #fff;
    box-shadow: 0 4px 14px rgba(8, 34, 61, 0.22);
}

.nav-link.active:hover {
    background-color: #3A5A40;
    box-shadow: 0 6px 18px rgba(58, 90, 64, 0.28);
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 28px 32px;
    box-shadow: 0 4px 24px rgba(8, 34, 61, 0.07);
    margin-bottom: 20px;
}

.card h2 {
    font-family: 'Optima', 'Optima Nova', 'Palatino', 'Palatino Linotype', serif;
    color: #3A5A40;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    display: inline-block;
    padding: 0.3rem 0;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 0.875rem;
    color: #5a6a7a;
    margin-bottom: 24px;
}

/* ── Form ─────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #08223D;
    letter-spacing: 0.01em;
}

input[type="text"] {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 14px;
    background-color: #f0eeec;
    color: #08223D;
    font-size: 16px;
    font-family: inherit;
    transition: box-shadow 0.2s, background-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    background-color: #e8ede8;
    box-shadow: 0 0 0 3px rgba(58, 90, 64, 0.22);
}

/* Inline form (search bar) */
.form-group--inline {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 0;
}

.form-group--inline input[type="text"] {
    flex: 1;
}

/* ── Button ───────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn--primary {
    background-color: #08223D;
    color: #fff;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(8, 34, 61, 0.22);
}

.btn--primary:hover {
    background-color: #3A5A40;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(58, 90, 64, 0.28);
}

.btn--primary:active {
    transform: scale(0.99);
}

.form-group--inline .btn {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
}

/* ── Alert ────────────────────────────────────────────────── */
.alert {
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: none;
}

.alert__message {
    font-weight: 600;
    font-size: 0.95rem;
}

.alert__detail {
    font-size: 0.875rem;
    opacity: 0.85;
}

.alert--success {
    background-color: rgba(58, 90, 64, 0.1);
    color: #3A5A40;
}

.alert--error {
    background-color: rgba(220, 38, 38, 0.08);
    color: #DC2626;
}

.alert--warning {
    background-color: rgba(184, 116, 50, 0.1);
    color: #7a4a10;
}

/* ── Table ────────────────────────────────────────────────── */
.results-heading {
    font-size: 0.9rem;
    font-weight: 500;
    color: #5a6a7a;
    margin-bottom: 16px;
}

.results-heading strong {
    color: #08223D;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    font-size: 0.9rem;
}

thead tr {
    background-color: #3A5A40;
}

thead th {
    text-align: left;
    font-family: 'Optima', 'Optima Nova', 'Palatino', 'Palatino Linotype', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ECEAEB;
    padding: 0.85rem 12px;
}

thead th:first-child { border-radius: 12px 0 0 0; }
thead th:last-child  { border-radius: 0 12px 0 0; }

tbody tr {
    border-bottom: 1px solid rgba(8, 34, 61, 0.06);
    transition: background 0.1s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: rgba(115, 139, 101, 0.1);
}

tbody td {
    padding: 11px 12px;
    color: #08223D;
}

.col-num {
    color: #aaa;
    font-size: 0.8rem;
    width: 36px;
}

.col-date {
    color: #5a6a7a;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    color: #5a6a7a;
    font-size: 0.9rem;
    text-align: center;
    padding: 16px 0 4px;
}

/* ── Avalon footer branding ───────────────────────────────── */
.avalon-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 0 1rem;      /* pt-6 pb-4 */
    gap: 0.75rem;                 /* space-y-3 */
}

.avalon-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
}

.avalon-tagline {
    font-family: 'Optima', 'Optima Nova', 'Palatino', serif;
    font-size: 1rem;
    color: #08223D;
    margin: 0;
}

.avalon-sub {
    font-family: 'Avenir', 'Avenir Next', 'Nunito Sans', 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0;
}

/* ── Support footer ───────────────────────────────────────── */
footer {
    text-align: center;
    padding: 0 1rem 2rem;
    font-size: 0.78rem;
    color: #9aa8b2;
}

footer a {
    color: #738B65;
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .card { padding: 20px 18px 24px; }
    .col-date { font-size: 0.78rem; }
}
