/* ─── Admin Design System ─────────────────────────────────────────── */
:root {
    --admin-primary: #2563eb;
    --admin-primary-dark: #1d4ed8;
    --admin-primary-light: #dbeafe;
    --admin-accent: #06b6d4;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-hover: rgba(255, 255, 255, 0.06);
    --admin-sidebar-active: rgba(37, 99, 235, 0.18);
    --admin-surface: #ffffff;
    --admin-bg: #f1f5f9;
    --admin-text: #0f172a;
    --admin-text-muted: #64748b;
    --admin-border: #e2e8f0;
    --admin-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --admin-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
    --admin-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.08);
    --admin-radius: 14px;
    --admin-radius-sm: 10px;
    --admin-radius-lg: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Sidebar ─────────────────────────────────────────────────────── */
.admin-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.admin-sidebar-brand h1 {
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--admin-radius-sm);
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.admin-nav-link:hover {
    background: var(--admin-sidebar-hover);
    color: #e2e8f0;
}

.admin-nav-link.active {
    background: var(--admin-sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.admin-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #3b82f6, #06b6d4);
    border-radius: 0 4px 4px 0;
}

.admin-nav-link .material-symbols-outlined {
    font-size: 20px;
    opacity: 0.85;
}

.admin-nav-link.active .material-symbols-outlined {
    opacity: 1;
    color: #60a5fa;
}

.admin-user-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--admin-radius-sm);
    padding: 12px;
    transition: background 0.2s ease;
}

.admin-user-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* ─── Header ──────────────────────────────────────────────────────── */
.admin-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--admin-border);
}

.admin-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--admin-radius-sm);
    color: var(--admin-text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.admin-icon-btn:hover {
    background: var(--admin-bg);
    color: var(--admin-primary);
}

.admin-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--admin-text);
    color: #fff;
    border-radius: var(--admin-radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-btn-logout:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: var(--admin-shadow);
}

/* ─── Main Content ────────────────────────────────────────────────── */
.admin-main {
    background: var(--admin-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.04), transparent);
}

.admin-page-content > * + * { margin-top: 1.75rem; }

/* ─── Page Header ─────────────────────────────────────────────────── */
.admin-page-title {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--admin-text);
    line-height: 1.2;
}

.admin-page-subtitle {
    font-size: 0.9375rem;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

/* ─── Cards ───────────────────────────────────────────────────────── */
.admin-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.admin-card:hover {
    box-shadow: var(--admin-shadow);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.admin-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: -0.01em;
}

.admin-card-subtitle {
    font-size: 0.8125rem;
    color: var(--admin-text-muted);
    margin-top: 2px;
}

/* ─── Stat Cards ──────────────────────────────────────────────────── */
.admin-stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 1.375rem;
    box-shadow: var(--admin-shadow-sm);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.admin-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--admin-radius) var(--admin-radius) 0 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--admin-shadow-lg);
}

.admin-stat-card:hover::after { opacity: 1; }

.admin-stat-card.stat-blue::after { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.admin-stat-card.stat-green::after { background: linear-gradient(90deg, #10b981, #34d399); }
.admin-stat-card.stat-cyan::after { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.admin-stat-card.stat-red::after { background: linear-gradient(90deg, #ef4444, #f87171); }

.admin-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.admin-stat-icon .material-symbols-outlined { font-size: 22px; }

.admin-stat-icon.blue { background: #eff6ff; color: #2563eb; }
.admin-stat-icon.green { background: #ecfdf5; color: #059669; }
.admin-stat-icon.cyan { background: #ecfeff; color: #0891b2; }
.admin-stat-icon.red { background: #fef2f2; color: #dc2626; }

.admin-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--admin-text-muted);
    margin-bottom: 4px;
}

.admin-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--admin-text);
    line-height: 1;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
.admin-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: var(--admin-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.admin-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.admin-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--admin-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.admin-btn-ghost:hover { background: var(--admin-primary-light); }

/* ─── Tables ──────────────────────────────────────────────────────── */
.admin-table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    font-size: 0.875rem;
}

.admin-table thead tr {
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--admin-text-muted);
}

.admin-table td {
    padding: 0.875rem 1rem;
    color: var(--admin-text);
}

.admin-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table tbody tr:last-child { border-bottom: none; }

.admin-page-content table th,
.admin-page-content table td { padding: 0.875rem 1rem; }

/* ─── Badges ──────────────────────────────────────────────────────── */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-badge.confirmed { background: #dcfce7; color: #15803d; }
.admin-badge.pending { background: #fef3c7; color: #b45309; }
.admin-badge.cancelled { background: #fee2e2; color: #b91c1c; }
.admin-badge.completed { background: #dbeafe; color: #1d4ed8; }
.admin-badge.default { background: #f1f5f9; color: #475569; }

/* ─── Activity Timeline ───────────────────────────────────────────── */
.admin-timeline { position: relative; }

.admin-timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 1.5rem;
    position: relative;
}

.admin-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--admin-border), transparent);
}

.admin-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.admin-timeline-icon .material-symbols-outlined { font-size: 18px; }

/* ─── Progress Bars ───────────────────────────────────────────────── */
.admin-progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.admin-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* ─── Welcome Banner ──────────────────────────────────────────────── */
.admin-welcome-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
    border-radius: var(--admin-radius-lg);
    padding: 1.75rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.admin-welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.admin-welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

/* ─── Dark Feature Card ───────────────────────────────────────────── */
.admin-feature-card {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--admin-radius);
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-feature-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25), transparent 70%);
    border-radius: 50%;
}

/* ─── Toast Notifications ─────────────────────────────────────────── */
.admin-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--admin-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--admin-shadow-lg);
    animation: admin-toast-in 0.35s ease;
}

@keyframes admin-toast-in {
    from { opacity: 0; transform: translate(-50%, -12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── Occupancy Row ───────────────────────────────────────────────── */
.admin-occupancy-row {
    padding: 1rem 1.125rem;
    background: #f8fafc;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-sm);
    transition: border-color 0.2s ease;
}

.admin-occupancy-row:hover { border-color: #cbd5e1; }

/* ─── Seat layout manager ─────────────────────────────────────────── */
.layout-option:has(input:checked) {
    border-color: #2563eb;
    background-color: #eff6ff;
}
.seat-preview-grid {
    display: grid;
    gap: 8px;
}
.seat-preview {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
}
.seat-preview.premium-seat { background: #fef3c7; border-color: #d97706; color: #92400e; }
.seat-preview.sleeper-seat { background: #dbeafe; border-color: #2563eb; color: #1e3a8a; }
.seat-preview.standard-seat { background: #ffffff; border-color: #e2e8f0; }
.seat-preview.gap-slot { border: 2px dashed #9ca3af; background: #f3f4f6; color: #9ca3af; }
.seat-preview.door-slot { background: #fce7f3; border-color: #db2777; color: #9d174d; }
.seat-preview.driver-slot { background: #ede9fe; border-color: #7c3aed; color: #5b21b6; }
.seat-preview.aisle-gap { border: none; background: transparent; width: 24px; }
.last-row-option:has(input:checked) { border-color: #2563eb; background-color: #eff6ff; }
.layout-diagram { display: flex; align-items: center; gap: 6px; justify-content: center; }
.layout-diagram .block { width: 28px; height: 28px; background: #dbeafe; border: 1px solid #e2e8f0; border-radius: 6px; }
.layout-diagram .aisle { width: 16px; height: 28px; background: repeating-linear-gradient(90deg, transparent, transparent 3px, #cbd5e1 3px, #cbd5e1 4px); border-radius: 2px; opacity: 0.5; }

/* Canvas seat builder */
.builder-canvas-wrap {
    background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
    overflow: auto;
}
.builder-grid {
    border-collapse: separate;
    border-spacing: 4px;
    user-select: none;
    margin: 0 auto;
}
.builder-grid td { padding: 0; }
.builder-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .08s ease, outline .08s ease;
    border: 1px solid transparent;
}
.builder-cell.empty {
    background: #f3f4f6;
    border-color: #e5e7eb;
    opacity: .6;
}
.builder-cell.seat {
    background: #fff;
    border-color: #e2e8f0;
    color: #475569;
}
.builder-cell.seat.premium {
    background: #fef3c7;
    border-color: #d97706;
    color: #92400e;
}
.builder-cell.seat.sleeper {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1e3a8a;
}
.builder-cell.aisle {
    background: #eff6ff;
    border: 1px dashed #9ca3af;
    color: #6b7280;
}
.builder-cell.door {
    background: #fce7f3;
    border: 1px solid #db2777;
    color: #9d174d;
}
.builder-cell.driver {
    background: #ede9fe;
    border: 1px solid #7c3aed;
    color: #5b21b6;
}
.builder-cell.door .cell-icon,
.builder-cell.driver .cell-icon {
    font-size: 16px;
    line-height: 1;
}
.builder-cell.selecting {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    transform: scale(1.06);
}
.builder-cell.selecting-erase {
    outline: 2px solid #ef4444;
    outline-offset: 1px;
    transform: scale(1.06);
}
.builder-hdr {
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
}
.builder-front {
    text-align: center;
    padding: 10px 16px;
    margin: 0 auto 16px;
    max-width: 280px;
    background: linear-gradient(180deg, #dbeafe, #eff6ff);
    border: 1px solid #e2e8f0;
    border-top: 0;
    border-radius: 0 0 40px 40px / 0 0 20px 20px;
    letter-spacing: .2em;
    font-weight: 700;
    font-size: 11px;
    color: #1d4ed8;
}
.tool-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}
.tool-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}
.palette-item { cursor: grab; }
.palette-item:active { cursor: grabbing; }

/* Reports */
.prose-report h2 { font-size: 1.05rem; font-weight: 700; margin: 1rem 0 .5rem; color: #34d399; }
.prose-report ul { list-style: disc; padding-left: 1.25rem; margin: .25rem 0 .75rem; }
.prose-report li { margin: .2rem 0; }
.prose-report p { margin: .35rem 0; }
.prose-report strong { color: #fff; }
.prose-report code { background: rgba(255,255,255,.12); padding: 1px 5px; border-radius: 4px; }

@media print {
    aside, header, form, #analyzeBtn { display: none !important; }
    main { margin: 0 !important; padding: 0 !important; }
}
