:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-alt: #eef2ff;
    --border: #d9e2f1;
    --text: #1f2937;
    --muted: #667085;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --success: #166534;
    --warning: #92400e;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button {
    font: inherit;
}
input[type="radio"],
input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
}
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: #fff;
}
textarea {
    resize: vertical;
    min-height: 7rem;
}
input:not([type="radio"]):not([type="checkbox"]):focus, select:focus, textarea:focus {
    outline: 2px solid rgba(79, 70, 229, 0.18);
    border-color: var(--primary);
}
.site-header, .site-footer {
    color: #fff;
    background: linear-gradient(135deg, #4338ca, #6366f1);
}
.site-header__inner, .site-footer__inner, .page-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.site-header__inner {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}
.site-title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
}
.site-subtitle, .nav-user { color: rgba(255, 255, 255, 0.82); margin: 0.25rem 0 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.site-nav a { color: #fff; font-weight: 600; }
.env-banner {
    padding: 0.65rem 1.25rem;
    background: rgba(15, 23, 42, 0.18);
    text-align: center;
    font-size: 0.95rem;
}
.page-shell {
    flex: 1 0 auto;
    width: 100%;
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.content-card, .hero-card {
    background: var(--surface);
    border: 1px solid rgba(217, 226, 241, 0.8);
    border-radius: 1.25rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
}
.hero-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    margin-top: 2rem;
}
.hero-card h1, .content-card h1, .content-card h2 { margin-top: 0; }
.narrow-card { max-width: 640px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.section-header.compact { margin-bottom: 0.75rem; }
.button-row, .hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.button:hover { text-decoration: none; }
.button--primary { background: var(--primary); color: #fff; }
.button--primary:hover { background: var(--primary-dark); }
.button--secondary { background: var(--surface-alt); color: var(--primary-dark); }
.button--danger { background: var(--danger); color: #fff; }
.button--danger:hover { background: #912018; }
.button--ghost { background: transparent; color: var(--danger); padding: 0.45rem 0.75rem; }
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.inline-form { display: inline-flex; margin: 0; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.flash-stack { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.flash {
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
}
.flash--success { background: #ecfdf3; border-color: #abefc6; color: var(--success); }
.flash--info { background: #eef4ff; border-color: #c7d7fe; color: #1d4ed8; }
.flash--warning { background: #fffaeb; border-color: #fedf89; color: var(--warning); }
.error-summary {
    border: 1px solid #fda29b;
    border-radius: 1rem;
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    background: #fef3f2;
    color: var(--danger);
}
.error-summary h2 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    color: inherit;
}
.error-summary ul {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.35rem;
}
.travel-form { display: grid; gap: 1.5rem; }
.form-section {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    background: #fbfcff;
}
.form-control-group {
    margin: 0;
    padding: 0;
    border: 0;
    min-inline-size: 0;
}
.form-grid {
    display: grid;
    gap: 1rem;
}
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.traveller-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.radio-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: #fff;
    padding: 0.85rem 1rem;
    cursor: pointer;
}
.radio-card input { margin: 0; }
.radio-card__label { flex: 1; line-height: 1.35; font-weight: 600; }
.conditional-block { display: none; margin-top: 1rem; }
.conditional-block.is-active { display: block; }
.traveller-fields { margin-top: 1rem; }
.traveller-fields--locked input[disabled] {
    background: #f2f4f7;
    color: var(--muted);
    border-color: #d0d5dd;
    cursor: not-allowed;
}
.field-error {
    min-height: 1.2rem;
    color: var(--danger);
    font-size: 0.92rem;
    margin: 0.35rem 0 0;
}
.field-help { color: var(--muted); margin: 0.35rem 0 0; font-size: 0.92rem; }
.checkbox-field { display: flex; flex-direction: column; justify-content: center; }
.checkbox-field--top { padding-top: 1.9rem; }
.checkbox-field label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-weight: 600;
}
.checkbox-field label input { margin-top: 0.1rem; }
.warning-box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid #fedf89;
    border-radius: 1rem;
    background: #fffaeb;
}
.warning-box__icon {
    font-size: 1.2rem;
    line-height: 1;
}
.table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
}
.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0.9rem;
    text-align: left;
    vertical-align: top;
}
.data-table thead { background: #eef2ff; }
.table-meta { color: var(--muted); font-size: 0.92rem; }
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.status-pill {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}
.status-pill--draft { background: #eef2ff; color: #3730a3; }
.status-pill--submitted { background: #ecfdf3; color: var(--success); }
.status-pill--admin { background: #fef3c7; color: #92400e; }
.status-pill--user { background: #f3f4f6; color: #6b7280; }
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.summary-card {
    border: 1px solid var(--border);
    background: #fbfcff;
    border-radius: 1rem;
    padding: 1rem;
}
.preformatted-text { white-space: pre-line; }
.admin-section { margin-top: 1.5rem; }
.site-footer {
    margin-top: 2rem;
    width: 100%;
    padding-top: 1rem;
    padding-bottom: 1.25rem;
}
.site-footer__inner {
    text-align: center;
}
@media (max-width: 860px) {
    .hero-card,
    .section-header,
    .site-header__inner,
    .traveller-mode-grid,
    .two-column,
    .three-column,
    .summary-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .site-nav { justify-content: flex-start; }
    .checkbox-field--top { padding-top: 0; }
    .warning-box { grid-template-columns: 1fr; }
}
