@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,800&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    --font-sans: "Space Grotesk", "Segoe UI", Arial, sans-serif;
    --font-display: "Fraunces", Georgia, serif;
    --bg: #eef2ff;
    --bg-alt: #f8fafc;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --brand: #4f46e5;
    --brand-strong: #1d4ed8;
    --brand-soft: rgba(79, 70, 229, 0.12);
    --border: rgba(148, 163, 184, 0.22);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-lg: 24px;
}

[data-theme="dark"] {
    --bg: #0b1120;
    --bg-alt: #111827;
    --surface: rgba(15, 23, 42, 0.88);
    --surface-strong: #0f172a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --brand: #818cf8;
    --brand-strong: #60a5fa;
    --brand-soft: rgba(129, 140, 248, 0.16);
    --border: rgba(148, 163, 184, 0.2);
    --shadow-lg: 0 24px 60px rgba(2, 6, 23, 0.35);
    --shadow-md: 0 14px 32px rgba(2, 6, 23, 0.26);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.14), transparent 35%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 30%),
        linear-gradient(180deg, var(--bg), var(--bg-alt));
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
}

.navbar {
    background: linear-gradient(90deg, #020617, #0b1220 42%, #111c33 72%, #1b2c4d);
    color: #fff;
    padding: 12px 20px;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-md);
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: blur(16px);
}

[data-theme="dark"] .navbar {
    background: linear-gradient(90deg, #020617, #111827 45%, #172554 75%, #1d4ed8);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-right: 4px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    flex: 0 0 auto;
}

.brand-mark {
    height: 40px;
    width: auto;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
    display: block;
}

.brand-wordmark {
    height: 30px;
    width: auto;
    max-width: 340px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.nav-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 0.96rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-summary:hover,
.nav-summary:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.nav-link--ghost {
    background: transparent;
    border-color: transparent;
}

.nav-link--ghost:hover,
.nav-link--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
}

.nav-group {
    position: relative;
}

.nav-group > summary {
    list-style: none;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-summary {
    user-select: none;
}

.nav-summary .fa-caret-down {
    font-size: 0.8rem;
    opacity: 0.92;
}

.nav-panel {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 12px);
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    border-radius: 20px;
    z-index: 100;
    padding: 16px;
    border: 1px solid var(--border);
    min-width: 260px;
}

.nav-group[open] > .nav-panel {
    display: grid;
}

.mega-menu {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    width: min(900px, calc(100vw - 40px));
}

.nav-panel--stack {
    grid-auto-flow: row;
    gap: 6px;
    min-width: 220px;
}

.nav-panel a {
    color: var(--brand-strong);
    background: rgba(79, 70, 229, 0.04);
    font-weight: 600;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    text-decoration: none;
    display: block;
}

.nav-panel a:hover {
    background: rgba(79, 70, 229, 0.12);
    color: #1e3a8a;
    transform: translateX(2px);
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.nav-section-title {
    font-size: 0.8rem;
    color: var(--brand);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 2px 4px;
}

.schedule-create-link {
    color: #16a34a !important;
    font-weight: 700 !important;
}

.schedule-create-link:hover {
    color: #15803d !important;
    background: rgba(22, 163, 74, 0.08) !important;
}

.public-label {
    padding-left: 0;
    color: rgba(255, 255, 255, 0.9);
}

.inline-form {
    display: inline;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.24);
}

.user-greeting {
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.link-button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.content {
    min-height: 80vh;
    padding: 28px 0 24px;
}

.page-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.surface-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.list-page {
    width: min(1800px, calc(100% - 32px));
    margin: 0 auto;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}

.page-heading h2,
.page-heading h1 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--brand-strong);
    line-height: 1.1;
}

.page-heading h2 {
    font-size: clamp(1.65rem, 2vw, 2.25rem);
}

.page-heading h1 {
    font-size: clamp(1.9rem, 2.5vw, 2.6rem);
}

.page-subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.count-text {
    margin-left: auto;
    color: var(--muted);
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 18px 0;
}

.global-search-container {
    position: relative;
    flex: 1 1 320px;
    max-width: 520px;
}

.global-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md);
}

.search-input:focus {
    outline: 2px solid rgba(79, 70, 229, 0.2);
    outline-offset: 2px;
}

.table-container,
.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    background: var(--surface-strong);
}

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

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

.data-table thead th {
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.data-table a {
    color: var(--brand-strong);
    font-weight: 600;
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.data-table-empty {
    color: var(--muted);
    text-align: center;
    padding: 28px;
}

.component-list {
    font-size: 0.9rem;
    color: #475569;
    max-width: 360px;
    white-space: normal;
}

.message-cell {
    max-width: 420px;
    white-space: normal;
}

.auth-shell {
    min-height: calc(100vh - 170px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px 40px;
}

.auth-card {
    width: min(100%, 1120px);
    margin: 0 auto;
    overflow: hidden;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 0.95fr);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
    color: #e2e8f0;
}

.auth-card .title {
    font-family: var(--font-display);
}

.auth-panel {
    padding: 34px 32px;
}

.auth-panel--intro {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 32%),
        linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.9));
}

.auth-panel--intro::after {
    content: "";
    position: absolute;
    inset: 20px 22px 22px 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    pointer-events: none;
}

.auth-panel--form {
    background: rgba(255, 255, 255, 0.98);
    color: var(--text);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-brand img {
    display: block;
}

.auth-brand .brand-mark {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-brand .brand-wordmark {
    width: min(100%, 260px);
    height: 34px;
    object-fit: contain;
    opacity: 0.98;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-hero-title {
    margin: 18px 0 10px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.05;
    color: #fff;
}

.auth-hero-copy {
    margin: 0;
    max-width: 42ch;
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.6;
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(226, 232, 240, 0.88);
}

.auth-feature-list i {
    color: #7dd3fc;
    margin-top: 3px;
}

.auth-panel--form .title {
    margin-bottom: 8px;
    color: var(--text);
}

.auth-panel--form .subtitle {
    color: var(--muted);
    margin: 0 0 24px;
}

.auth-panel--form .field:not(:last-child) {
    margin-bottom: 1rem;
}

.auth-panel--form .label {
    color: #334155;
    font-weight: 700;
}

.auth-panel--form .input,
.auth-panel--form .select select {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    box-shadow: none;
}

.auth-panel--form .input:focus,
.auth-panel--form .select select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.auth-panel--form .button {
    min-height: 48px;
    border-radius: 14px;
    font-weight: 700;
}

.auth-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.auth-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    font-size: 0.84rem;
    font-weight: 700;
}

.auth-helper {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-helper a {
    color: var(--brand-strong);
    font-weight: 700;
    text-decoration: none;
}

.auth-helper a:hover {
    text-decoration: underline;
}

@media (max-width: 920px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        padding: 28px 22px;
    }
}

.error-shell {
    min-height: calc(100vh - 170px);
    display: grid;
    place-items: center;
    padding: 34px 18px 44px;
}

.error-card {
    width: min(100%, 860px);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.18), transparent 30%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
    color: #e2e8f0;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
}

.error-card__inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
}

.error-card__body {
    padding: 38px 36px;
}

.error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.error-heading {
    margin: 18px 0 12px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1.05;
    color: #fff;
}

.error-message {
    margin: 0;
    max-width: 44ch;
    color: rgba(226, 232, 240, 0.84);
    line-height: 1.65;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.error-actions .button {
    min-height: 46px;
    border-radius: 14px;
    font-weight: 700;
}

.error-card__aside {
    padding: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
}

.error-art {
    width: min(100%, 240px);
    aspect-ratio: 1 / 1;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at 30% 30%, rgba(125, 211, 252, 0.7), transparent 36%),
        radial-gradient(circle at 70% 70%, rgba(167, 139, 250, 0.65), transparent 36%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.2), rgba(255, 255, 255, 0.05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.error-art::before,
.error-art::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
}

.error-art::before {
    width: 110px;
    height: 110px;
    left: 26px;
    top: 30px;
}

.error-art::after {
    width: 180px;
    height: 180px;
    right: -38px;
    bottom: -42px;
}

.error-note {
    margin-top: 18px;
    color: rgba(226, 232, 240, 0.68);
    font-size: 0.92rem;
}

@media (max-width: 860px) {
    .error-card__inner {
        grid-template-columns: 1fr;
    }

    .error-card__aside {
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.detail-page {
    width: min(980px, calc(100% - 32px));
    margin: 40px auto;
    padding: 0;
}

.detail-page.wide {
    width: min(1100px, calc(100% - 32px));
}

.detail-card {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.detail-hero {
    padding: 28px 30px;
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, var(--brand-strong) 100%);
}

.detail-hero.alt {
    background: linear-gradient(135deg, #0f172a 0%, #7c3aed 100%);
}

.detail-hero.green {
    background: linear-gradient(135deg, #0f172a 0%, #059669 100%);
}

.detail-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.4vw, 2.4rem);
}

.detail-hero p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.55;
}

.detail-body {
    padding: 28px 30px 34px;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.kv-field {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid var(--border);
}

.kv-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 7px;
}

.kv-value {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.detail-actions form {
    display: inline;
    margin: 0;
}

.detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.detail-btn.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
}

.detail-btn.secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.detail-btn.success {
    background: #16a34a;
    color: #fff;
}

.detail-btn.danger {
    background: #dc2626;
    color: #fff;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 700;
}

.loading-box,
.error-box {
    margin: 22px 0 0;
    padding: 16px 18px;
    border-radius: 14px;
}

.loading-box {
    background: #eff6ff;
    color: var(--brand-strong);
}

.error-box {
    background: #fef2f2;
    color: #991b1b;
}

.form-shell {
    width: min(820px, calc(100% - 32px));
    margin: 32px auto 0;
}

.form-card {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    padding: 18px;
}

.form-title {
    margin: 0 0 14px;
    font-family: var(--font-display);
    color: var(--brand-strong);
}

.form-grid,
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 700;
    color: var(--text);
}

.text-input,
.select-input,
.textarea-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text);
}

.textarea-input {
    resize: vertical;
    min-height: 88px;
}

.field-help,
.form-note {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.button-row .detail-btn {
    min-width: 120px;
    justify-content: center;
}

.mt-0 {
    margin-top: 0;
}

.span-all {
    grid-column: 1 / -1;
}

.justify-start {
    justify-content: flex-start;
}

.max-720 {
    max-width: 720px;
}

.mt-20 {
    margin-top: 20px;
}

.field-expand {
    flex: 1 1 220px;
    max-width: none;
}

.input-sm {
    width: 100px;
}

.input-md {
    width: 120px;
}

.pre-panel {
    background: var(--bg-alt);
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    overflow: auto;
}

.pre-panel.tall {
    max-height: 320px;
}

.pre-panel.short {
    max-height: 300px;
}

.compact-status {
    margin-left: 0;
    font-size: 12px;
}

.report-shell {
    width: min(100%, 1800px);
    margin: 0 auto;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.metric-card .card-body {
    padding: 18px;
}

.metric-card h6 {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-size: 0.78rem;
}

.metric-card h2 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--brand-strong);
}

.report-filter {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 16px 18px;
}

.report-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.report-toolbar .btn {
    border-radius: 999px;
    font-weight: 700;
}

.report-loading {
    display: none;
    text-align: center;
    padding: 40px 0;
}

.report-loading.is-visible {
    display: block;
}

.report-table-wrap {
    overflow: auto;
    width: 100%;
}

.report-table-wrap .table {
    margin-bottom: 0;
}

.report-column-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.stack-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-col.align-start {
    align-items: flex-start;
}

.chip-inline {
    margin-right: 6px;
    margin-bottom: 6px;
}

@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

.form-panel {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 16px;
}

.section-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.stack {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.stack > * {
    flex: 1 1 360px;
}

.table-card {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

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

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

.table-card th {
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-strong);
}

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

.schedule-table thead th {
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
}

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-table tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.action-link {
    color: var(--brand-strong);
    text-decoration: none;
    font-weight: 700;
}

.action-link:hover {
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(15, 23, 42, 0.5);
    padding: 24px 12px;
}

.modal-content {
    position: relative;
    max-width: 720px;
    margin: 32px auto;
}

.close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.4rem;
    color: var(--brand-strong);
    cursor: pointer;
}

@media (max-width: 720px) {
    .detail-page,
    .detail-page.wide,
    .form-shell {
        width: min(100% - 20px, 1000px);
    }

    .kv-grid,
    .form-grid,
    .form-grid.three,
    .form-row {
        grid-template-columns: 1fr;
    }

    .detail-body,
    .detail-hero {
        padding-left: 18px;
        padding-right: 18px;
    }
}

.page-hero {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(29, 78, 216, 0.88), rgba(56, 189, 248, 0.9));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 30px 32px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.page-hero h1 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.05;
}

.page-hero p {
    margin: 0;
    max-width: 820px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.surface-card,
.toolbar,
.empty-state {
    animation: fade-up 260ms ease both;
}

.empty-state {
    text-align: center;
    padding: 36px 24px;
    color: var(--muted);
}

.footer {
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    text-align: center;
    padding: 22px 16px 24px;
    font-size: 0.98rem;
    border-top: 1px solid var(--border);
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(14px);
}

.footer-brand-image {
    display: block;
    max-width: min(100%, 360px);
    height: auto;
    margin: 0 auto 8px;
    object-fit: contain;
}

[data-theme="dark"] .footer {
    background: rgba(15, 23, 42, 0.84);
}

.footer-note {
    font-size: 0.95em;
}

.footer-heart {
    color: #ef4444;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .navbar {
        padding: 12px 14px;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    .brand {
        margin-right: 0;
    }

    .nav-primary {
        width: 100%;
        order: 3;
    }

    .nav-actions {
        margin-left: auto;
    }

    .nav-panel {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    .mega-menu {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-panel--stack {
        width: 100%;
    }

    .brand-wordmark {
        max-width: 260px;
        height: 26px;
    }
}

@media (max-width: 640px) {
    .nav-primary {
        width: 100%;
    }

    .nav-actions {
        margin-left: 0;
        justify-content: flex-start;
    }

    .theme-toggle {
        margin-left: 0;
    }

    .brand {
        width: 100%;
        justify-content: flex-start;
    }

    .brand-wordmark {
        max-width: 210px;
    }

    .page-shell {
        width: min(100% - 20px, 1000px);
    }

    .mega-menu {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .surface-card {
        border-radius: 18px;
    }
}
