/* AATR Events -- modern glassy dark theme (Taskade/Flowninja/Jelly references)
   Font stack uses system sans (no external fetch -- CSP `default-src 'self'` blocks it). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #5db8e6;
    --primary-strong: #2d9fd3;
    --primary-deep: #0b7cac;
    --accent: #a98cf5;
    --accent-deep: #7e6bf0;
    --danger: #ff6b7d;
    --warning: #f0bd5a;
    --success: #4dd66e;

    --bg-base: #0c1119;
    --bg-elev: rgba(28, 38, 56, 0.55);
    --bg-elev-strong: rgba(36, 48, 70, 0.78);
    --bg-input: rgba(20, 28, 42, 0.85);

    --border-soft: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --border-focus: #5db8e6;

    --text: #e8edf5;
    --text-muted: #94a3b8;
    --text-heading: #f5f8fc;

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 0 1px rgba(93, 184, 230, 0.18), 0 12px 40px rgba(45, 159, 211, 0.18);

    --gradient-primary: linear-gradient(135deg, #5db8e6 0%, #7e6bf0 100%);
    --gradient-soft: linear-gradient(135deg, rgba(93,184,230,0.18) 0%, rgba(169,140,245,0.18) 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
    color: var(--text);
    background: var(--bg-base);
    background-image:
        radial-gradient(ellipse 80% 50% at 10% 0%, rgba(93,184,230,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 90% 10%, rgba(169,140,245,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(93,184,230,0.10) 0%, transparent 70%);
    background-attachment: fixed;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
a { color: var(--primary); transition: color 0.15s; }
a:hover { color: var(--accent); }

/* Navbar -- glassy floating bar */
.navbar {
    background: rgba(12, 17, 25, 0.72);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-soft);
}
.nav-brand a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
}
.nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(12, 17, 25, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.nav-links.open { display: flex; }
.nav-links a, .nav-links button {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    transition: color 0.15s;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.nav-links a:hover, .nav-links button:hover { color: white; }
.nav-links a.active { color: white; background: var(--gradient-soft); }
.nav-logout, .nav-links .logout-btn { color: var(--danger) !important; }
.logout-form { display: contents; }

/* Container */
.container { padding: 1.5rem 1.25rem; max-width: 1200px; margin: 0 auto; }

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
.page-header h1 {
    font-size: 1.85rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons -- pill-shape with gradient + lift */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 6px 18px rgba(45, 159, 211, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(126, 107, 240, 0.45); }
.btn-primary:disabled { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: var(--bg-elev-strong); border-color: rgba(255,255,255,0.2); }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-danger { background: var(--danger); color: white; box-shadow: 0 6px 18px rgba(255, 107, 125, 0.3); }
.btn-full { width: 100%; }

/* Cards -- glass panels */
.stat-card, .event-card, .detail-card, .form-card, .shift-card {
    background: var(--bg-elev);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--border-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.stat-card { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-warning .stat-number { color: var(--warning); }
.stat-danger .stat-number { color: var(--danger); }

/* Event List */
.event-list { display: grid; gap: 0.75rem; }
.event-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(93,184,230,0.35); }
.event-card h3 { margin: 0.5rem 0 0.25rem; font-size: 1.1rem; }
.event-card-header { display: flex; justify-content: space-between; align-items: center; }
.event-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-open { background: #1a3a2a; color: #3dbe5a; }
.status-locked { background: #3a3020; color: #e8a838; }
.status-completed { background: #2a3a4a; color: var(--text-muted); }
.status-cancelled, .status-deleted { background: #3a1a20; color: #e74c5a; }
.event-type-badge { font-size: 0.75rem; color: var(--primary); font-weight: 500; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.95rem;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(93,184,230,0.18);
}
.form-group textarea { resize: vertical; min-height: 4.5rem; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.form-error, .form-hint { font-size: 0.85rem; margin-top: 0.35rem; }
.form-error { color: var(--danger); }
.form-hint { color: var(--text-muted); }

/* Tables */
.table-responsive { overflow-x: auto; margin-bottom: 1rem; }
.data-table, .catalog-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-elev);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.92rem;
    border: 1px solid var(--border-soft);
}
.data-table th, .catalog-table th {
    background: rgba(0,0,0,0.25);
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    white-space: nowrap;
}
.data-table td, .catalog-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-soft);
    vertical-align: top;
}
.data-table a, .catalog-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover, .catalog-table a:hover { color: var(--accent); text-decoration: none; }
.total-row td { font-weight: 700; background: rgba(0,0,0,0.25); }
.row-flagged { background: rgba(232,168,56,0.08); }
.catalog-inactive { opacity: 0.55; }

/* Alerts */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.92rem;
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.alert-error { background: rgba(255, 107, 125, 0.12); color: #ffa9b3; border-color: rgba(255, 107, 125, 0.32); }
.alert-warning { background: rgba(240, 189, 90, 0.12); color: #f0bd5a; border-color: rgba(240, 189, 90, 0.32); }
.alert-info { background: rgba(93, 184, 230, 0.12); color: #9fd4ee; border-color: rgba(93, 184, 230, 0.32); }

/* Login Page -- glass card on gradient mesh */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-base);
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(93,184,230,0.32) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 80% 70%, rgba(169,140,245,0.32) 0%, transparent 60%);
    background-attachment: fixed;
}
.login-card {
    background: rgba(28, 38, 56, 0.65);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    padding: 2.5rem 2.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-strong);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}
.login-card h1 {
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.35rem;
    font-size: 1.6rem;
}
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.75rem; font-size: 0.95rem; }

/* Catalog admin */
.variable-chips { margin: 1rem 0; }
.variable-chips h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    margin: 0.2rem;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--primary);
    border-radius: 12px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}
.chip:hover { background: var(--primary-light); }
.preview-panel {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.preview-panel h3 { font-size: 0.9rem; margin: 0 0 0.75rem; color: var(--text-heading); }
#preview-results { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.preview-cell {
    flex: 1 1 120px;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.preview-label { font-size: 0.75rem; color: var(--text-muted); }
.preview-value { font-size: 1.3rem; font-weight: 700; color: var(--primary); word-break: break-word; }
.preview-error { color: var(--danger); font-size: 0.85rem; font-weight: normal; }
.preview-skipped { color: var(--text-muted); font-size: 0.95rem; font-weight: normal; font-style: italic; }

/* Pack list view */
.packlist-page .packlist-header { margin-bottom: 1.5rem; }
.packlist-page .packlist-header h1 { margin: 0 0 0.5rem; font-size: 1.75rem; }
.packlist-page .meta { color: var(--text-muted); margin: 0 0 0.75rem; font-size: 0.95rem; }
.packlist-page .packlist-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.packlist-page .packlist-actions button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}
.packlist-page .packlist-actions button:hover { background: var(--primary); color: white; border-color: var(--primary); }
.packlist-page .contact {
    background: rgba(232,168,56,0.1);
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--warning);
    margin: 0 0 1rem;
    border-radius: 4px;
    color: var(--text);
}
.packlist-page .day-before, .packlist-page .day-of { margin-bottom: 2rem; }
.packlist-page .day-before > h2, .packlist-page .day-of > h2 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--border);
}
.packlist-page .team-block {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    page-break-inside: avoid;
    break-inside: avoid;
}
.packlist-page .team-block > h3 { color: var(--text-heading); margin-bottom: 0.75rem; }
.packlist-page .section-block {
    margin: 0.75rem 0 1.25rem;
    page-break-inside: avoid;
    break-inside: avoid;
}
.packlist-page .section-block h3, .packlist-page .section-block h4 {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.packlist-page .pl-list { list-style: none; padding: 0; margin: 0; }
.packlist-page .pl-item { padding: 0.2rem 0; }
.packlist-page .pl-item label { display: flex; align-items: baseline; gap: 0.5rem; cursor: pointer; }
.packlist-page .pl-item input[type="checkbox"] { flex-shrink: 0; }
.packlist-page .pl-name { white-space: nowrap; color: var(--text); }
.packlist-page .pl-dots { flex: 1; border-bottom: 1px dotted var(--border); margin: 0 6px; min-width: 2rem; }
.packlist-page .pl-qty { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); }
.packlist-page .empty-state { color: var(--text-muted); padding: 2rem; text-align: center; font-style: italic; }
.packlist-page #rule-errors { margin-bottom: 1.5rem; }
.packlist-page #rule-errors ul { margin-left: 1.25rem; margin-top: 0.5rem; }
.packlist-page #rule-errors code {
    background: rgba(231,76,90,0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Event detail page */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}
.detail-header h1 {
    font-size: 2rem;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-section {
    background: var(--bg-elev);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    page-break-inside: avoid;
    break-inside: avoid;
}
.detail-section h2 {
    font-size: 0.85rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 0.85rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border-soft);
}

.detail-section dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
}
.detail-section dt {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-top: 0.1rem;
}
.detail-section dd {
    margin: 0 0 0.35rem;
    color: var(--text);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elev);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}
.detail-actions .btn { margin: 0; }

.btn-dropdown { position: relative; display: inline-block; }
.btn-dropdown > summary { cursor: pointer; list-style: none; user-select: none; }
.btn-dropdown > summary::-webkit-details-marker { display: none; }
.btn-dropdown[open] > summary { background: var(--bg-elev-strong, var(--bg-elev)); }
.btn-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 30;
    min-width: 11rem;
    padding: 0.35rem;
    background: var(--bg-elev);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md, 0.5rem);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.btn-dropdown-menu form { margin: 0; }
.btn-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 0;
    color: inherit;
    border-radius: 0.35rem;
    cursor: pointer;
    font: inherit;
}
.btn-dropdown-item:hover { background: rgba(255,255,255,0.08); }

.btn-small {
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
    line-height: 1.1;
    border-radius: 0.35rem;
}
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}
.row-action-form { display: inline; margin: 0; }

.events-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.events-table th,
.events-table td {
    padding: 0.65rem 1.1rem;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}
.events-table th {
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-soft);
}
.events-table tbody tr + tr td { border-top: 1px solid rgba(255,255,255,0.06); }
.events-table td:nth-child(3) { white-space: normal; min-width: 14rem; }

@media (min-width: 700px) {
    .detail-section dl { grid-template-columns: minmax(11rem, auto) 1fr; gap: 0.5rem 1.25rem; }
    .detail-section dt, .detail-section dd { padding: 0; }
}

/* Rules Review -- glassy panels + pill tabs */
.sweep-review h1 { margin-bottom: 0.5rem; }
.service-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    background: var(--bg-elev);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-soft);
    width: fit-content;
}
.service-tabs .tab {
    padding: 0.5rem 1.1rem;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.88rem;
    transition: color 0.18s ease, background 0.18s ease;
}
.service-tabs .tab:hover { color: var(--text); }
.service-tabs .tab-active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(93,184,230,0.32);
}

.scenario-panel {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--bg-elev);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.scenario-panel label {
    display: flex;
    flex-direction: column;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    gap: 0.35rem;
    font-weight: 600;
}
.scenario-panel label.checkbox-label {
    flex-direction: row;
    align-items: center;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
    align-self: flex-end;
    padding-bottom: 0.6rem;
}
.scenario-panel select,
.scenario-panel input[type="text"] {
    padding: 0.55rem 0.85rem;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    font-size: 0.95rem;
    min-width: 11rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.scenario-panel select:focus,
.scenario-panel input[type="text"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(93,184,230,0.18);
}
.scenario-panel select[name="tables"] { min-width: 13rem; }

.sweep-grid-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.sweep-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}
.sweep-grid thead th {
    background: #0d1117;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.72rem;
    padding: 0.55rem 0.65rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.sweep-grid thead th.sticky:first-child,
.sweep-grid thead th.sticky:nth-child(2) {
    text-align: left;
    position: sticky;
    z-index: 3;
    background: #0d1117;
}
.sweep-grid thead th.sticky:first-child { left: 0; }
.sweep-grid thead th.sticky:nth-child(2) { left: 14rem; }
.sweep-grid tbody td {
    padding: 0.45rem 0.65rem;
    border-top: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}
.sweep-grid tbody td.sticky {
    text-align: left;
    position: sticky;
    background: var(--bg-card);
    z-index: 1;
}
.sweep-grid tbody td.sticky:first-child { left: 0; min-width: 14rem; font-weight: 500; color: var(--text); border-right: 1px solid var(--border); }
.sweep-grid tbody td.sticky:nth-child(2) { left: 14rem; color: var(--text-muted); font-size: 0.8rem; border-right: 1px solid var(--border); }
.sweep-grid tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.sweep-grid tbody tr:nth-child(even) td.sticky { background: #17202c; }
.sweep-grid tbody tr:hover td { background: rgba(45,159,211,0.08); }
.sweep-grid tbody tr:hover td.sticky { background: #1a2332; }
.sweep-cell { font-weight: 500; }
.sweep-blank { color: #3a4a5a; font-weight: 300; }

/* Rules Review single-scenario layout */
.review-head h1 { margin-bottom: 0.25rem; }
.review-head .meta { color: var(--text-muted); margin-bottom: 1rem; }

.scenario-panel .field, .scenario-panel .field-check { display: flex; flex-direction: column; gap: 0.25rem; }
.scenario-panel .field span { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.scenario-panel .field-check { flex-direction: row; align-items: center; gap: 0.4rem; align-self: flex-end; padding-bottom: 0.4rem; }
.scenario-panel .field-check span { font-size: 0.9rem; color: var(--text); text-transform: none; letter-spacing: normal; }

.review-summary { color: var(--text-muted); font-size: 0.9rem; margin: 0.75rem 0 1rem; }
.review-summary strong { color: var(--primary); font-weight: 700; }
.review-summary .muted { color: var(--text-muted); margin-left: 0.5rem; }

.review-list-wrap {
    background: var(--bg-elev);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1.6rem 1.5rem;
    box-shadow: var(--shadow);
}
.review-section {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 1.25rem 0 0.5rem;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 0.4rem;
}
.review-section:first-child { padding-top: 0.5rem; }

.review-list { list-style: none; padding: 0; margin: 0 0 0.4rem; }
.review-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.review-row:hover { background: rgba(93,184,230,0.07); }
.review-name { color: var(--text); font-size: 0.98rem; font-weight: 500; }
.review-dots { flex: 1; border-bottom: 1px dotted var(--border-strong); margin: 0 0.65rem; min-width: 1.5rem; transform: translateY(-4px); }
.review-qty {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 3rem;
    text-align: right;
    letter-spacing: -0.01em;
}

@media print {
    .scenario-panel, .service-tabs, .navbar, .review-head .meta, .review-summary { display: none !important; }
    .review-list-wrap { background: white; border: none; padding: 0; }
    .review-section { color: black; border-bottom-color: #999; }
    .review-name, .review-qty { color: black; }
    .review-dots { border-bottom-color: #999; }
}

/* Utilities */
.hidden { display: none !important; }
.empty-state { text-align: center; color: var(--text-muted); padding: 2rem; }
.empty-note { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

/* Responsive */
@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-links {
        display: flex !important;
        position: static;
        flex-direction: row;
        padding: 0;
        gap: 0.25rem;
        border-bottom: none;
    }
    .nav-links a, .nav-links button { padding: 0.5rem 0.75rem; border-radius: var(--radius); }
    .container { padding: 1.5rem 2rem; }
    .page-header h1 { font-size: 1.75rem; }
    .form-row { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
    .event-list { grid-template-columns: repeat(2, 1fr); }
}

@media print {
    nav, .navbar, .app-header, .no-print, form, button { display: none !important; }
    body { background: white; color: black; font-family: Georgia, "Times New Roman", serif; font-size: 12pt; }
    .packlist-page .section-block, .packlist-page .team-block {
        page-break-inside: avoid;
        break-inside: avoid;
        background: white;
        border: none;
        padding: 0;
    }
    .packlist-page .team-block > h3, .packlist-page .day-before > h2, .packlist-page .day-of > h2 { color: black; }
    .packlist-page .pl-dots { border-bottom-color: black; }
    .packlist-page .pl-name, .packlist-page .pl-qty { color: black; }
    .packlist-page .section-block h3, .packlist-page .section-block h4 { color: black; }
    .alert, .alert-error { border: 1px solid black; background: white; color: black; }
    .detail-header { border-bottom-color: black; }
    .detail-header h1, .detail-section h2 { color: black; }
    .detail-section {
        background: white;
        border: 1px solid #666;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .detail-section h2 { border-bottom-color: #666; }
    .detail-section dt { color: #444; }
    .detail-section dd { color: black; }
    .detail-actions { display: none !important; }
    .status-badge { border: 1px solid #666; color: black !important; background: white !important; }
    @page { margin: 0.75in; }
}
