:root {
    --bg: #f5f7fb;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #ffffff;
    --line: rgba(15, 23, 42, 0.08);
    --text: #0f172a;
    --muted: #5b6475;
    --primary: #0a84ff;
    --primary-strong: #0066cc;
    --danger: #b42318;
    --shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
    --radius: 28px;
    --hero-bg: linear-gradient(145deg, rgba(255,255,255,.58), rgba(223,235,255,.75));
    --page-bg:
        radial-gradient(circle at top left, rgba(10, 132, 255, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(255, 159, 10, 0.16), transparent 28%),
        linear-gradient(180deg, #edf4ff 0%, #f8fafc 48%, #eef2ff 100%);
}

:root[data-theme="dark"] {
    --bg: #07111f;
    --surface: rgba(8, 15, 28, 0.78);
    --surface-strong: #0b1527;
    --line: rgba(148, 163, 184, 0.16);
    --text: #e5eefb;
    --muted: #a8b5ca;
    --primary: #4ea1ff;
    --primary-strong: #86bfff;
    --danger: #ff7b7b;
    --shadow: 0 28px 60px rgba(2, 8, 23, 0.45);
    --hero-bg: linear-gradient(145deg, rgba(8,15,28,.88), rgba(18,36,63,.76));
    --page-bg:
        radial-gradient(circle at top left, rgba(78, 161, 255, 0.14), transparent 30%),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 28%),
        linear-gradient(180deg, #06101d 0%, #0b1220 50%, #121a2b 100%);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "SF Pro Display", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page-bg);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar, .panel, .form-card, .hero-panel {
    backdrop-filter: blur(20px);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 999px;
    margin-bottom: 24px;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a84ff, #7dd3fc);
    box-shadow: 0 0 30px rgba(10, 132, 255, 0.5);
}

.nav, .topbar-actions, .action-row, .room-meta { display: flex; align-items: center; gap: 12px; }
.inline-form { margin: 0; }
.nav a, .user-pill { padding: 10px 14px; border-radius: 999px; color: var(--muted); }
.nav a:hover { background: rgba(255,255,255,.12); color: var(--text); }
.user-pill { background: rgba(255,255,255,.12); }

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: .2s ease;
}

.button.primary { background: linear-gradient(135deg, var(--primary), #4dabff); color: white; }
.button.secondary, .button.ghost {
    background: rgba(255,255,255,.08);
    border-color: var(--line);
    color: var(--text);
}
.button.danger { color: var(--danger); }
.button:hover { transform: translateY(-1px); }
.full { width: 100%; }
.theme-toggle {
    min-width: 140px;
    gap: 8px;
}
.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: .95rem;
    background: rgba(255,255,255,.12);
}
.theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: inline-flex; }

.hero-dashboard, .grid-two, .auth-layout, .logout-layout { display: grid; gap: 24px; }
.hero-dashboard { grid-template-columns: 1.5fr 1fr; margin-bottom: 24px; align-items: stretch; }
.hero-dashboard.admin { grid-template-columns: 1.3fr 1fr; }
.hero-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.hero-dashboard.metrics-only { grid-template-columns: 1fr; }
.hero-metrics.full-width { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card, .panel, .form-card, .hero-panel { border-radius: var(--radius); padding: 28px; }
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.metric-card strong { display: block; font-size: 2rem; margin-bottom: 6px; }
.eyebrow { color: var(--primary-strong); text-transform: uppercase; font-size: .8rem; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: 1; margin-bottom: 16px; }
h2 { font-size: 1.5rem; margin-bottom: 12px; }
p, small, span, th, td, label { color: var(--muted); }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.room-grid.large { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.room-card {
    min-height: 220px;
    color: white;
    border-radius: 24px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.3);
}
.room-card * { color: white; }
.room-card.selected { outline: 2px solid rgba(255,255,255,.7); transform: translateY(-2px); }
.room-actions { margin-top: 18px; }

.agenda-list { display: grid; gap: 14px; }
.agenda-item, .room-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.auth-layout { grid-template-columns: 1.2fr .9fr; min-height: calc(100vh - 120px); align-items: center; }
.logout-layout { grid-template-columns: 1.1fr .8fr; min-height: calc(100vh - 180px); align-items: center; }
.hero-panel {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background: var(--hero-bg);
}
.hero-panel.compact { min-height: 360px; display: flex; flex-direction: column; justify-content: center; }
.logout-card { display: grid; gap: 16px; }
.logout-card strong { color: var(--text); }
.form-card.wide { max-width: 740px; width: 100%; }
.glass-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: .8;
}
.orb-one { width: 220px; height: 220px; background: rgba(10,132,255,.22); right: 30px; top: 40px; }
.orb-two { width: 180px; height: 180px; background: rgba(255,159,10,.22); left: 40px; bottom: 30px; }

.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack-form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.input {
    width: 100%;
    border: 1px solid rgba(15,23,42,.1);
    background: rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 14px 16px;
    color: var(--text);
    font: inherit;
}
input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 6px 0 0;
    accent-color: var(--primary);
    justify-self: start;
}
.color-input {
    min-height: 56px;
    padding: 8px;
    cursor: pointer;
}
.textarea { resize: vertical; min-height: 120px; }
.field:has(textarea), .field:last-of-type:nth-child(odd) { grid-column: 1 / -1; }
.form-intro { margin-top: -4px; margin-bottom: 18px; }
.mini-gradient {
    width: 72px;
    height: 10px;
    border-radius: 999px;
    margin-top: 10px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.35);
}
.color-preview {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
}
.preview-swatch {
    height: 88px;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.table-shell { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 16px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.status {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(10,132,255,.12);
    color: var(--primary-strong);
}
.agenda-item .status {
    margin-top: 10px;
}
.status-scheduled {
    background: rgba(10,132,255,.12);
    color: var(--primary-strong);
}
.status-live {
    background: rgba(16,185,129,.14);
    color: #0f9f6e;
}
.status-completed {
    background: rgba(148,163,184,.16);
    color: var(--muted);
}
.status-cancelled {
    background: rgba(180,35,24,.12);
    color: var(--danger);
}
:root[data-theme="dark"] .status-live {
    color: #6ee7b7;
}

.messages { display: grid; gap: 12px; margin-bottom: 20px; }
.message {
    padding: 14px 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.empty { padding: 24px 0; }
.muted { margin-top: 18px; }
.admin-split { align-items: start; }
.hero-blend { background: linear-gradient(135deg, rgba(10,132,255,.16), rgba(255,255,255,.7)); }
.booking-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 24px;
}
.booking-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.booking-steps.compact { margin-top: -6px; }
.booking-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.mode-card {
    display: grid;
    gap: 8px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
}
.mode-card.active {
    border-color: rgba(10,132,255,.4);
    background: rgba(10,132,255,.08);
}
.step-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
}
.step-chip strong {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
    color: var(--muted);
}
.step-chip.active {
    border-color: rgba(10,132,255,.35);
    background: rgba(10,132,255,.08);
}
.step-chip.active strong {
    background: linear-gradient(135deg, var(--primary), #7dd3fc);
    color: white;
}
.step-chip.current {
    box-shadow: inset 0 0 0 1px rgba(10,132,255,.3);
}
.booking-stack {
    display: grid;
    gap: 24px;
}
.wizard-panel {
    max-width: 100%;
}
.wizard-head {
    margin-bottom: 24px;
}
.wizard-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.wizard-form.single-column {
    grid-template-columns: minmax(0, 420px);
}
.wizard-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}
.booking-room-grid { margin-bottom: 24px; }
.booking-layout { align-items: start; }
.day-grid,
.free-window-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.day-card,
.free-window-card {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
}
.day-card.active {
    border-color: rgba(10,132,255,.4);
    background: rgba(10,132,255,.08);
}
.day-card.disabled {
    opacity: .5;
    pointer-events: none;
}
.date-step-form {
    display: flex;
    gap: 16px;
    align-items: end;
}
.date-step-form .field {
    min-width: 260px;
    margin: 0;
}
.availability-form { margin-bottom: 24px; }
.step-locked {
    opacity: .7;
}
.slot-section {
    display: grid;
    gap: 16px;
}
.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
}
.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.slot-card {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.08);
    display: grid;
    gap: 8px;
    transition: .2s ease;
}
.slot-card.active {
    border-color: rgba(10,132,255,.55);
    box-shadow: inset 0 0 0 1px rgba(10,132,255,.28);
}
.slot-card.disabled {
    opacity: .45;
    pointer-events: none;
}
.slot-card:hover { transform: translateY(-2px); }
.booking-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.summary-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(10,132,255,.08);
    color: var(--primary-strong);
}

::placeholder { color: var(--muted); }
.help-text {
    display: block;
    color: var(--muted);
    font-size: .88rem;
}
.field-full {
    grid-column: 1 / -1;
}
.email-composer {
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.08);
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.email-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.email-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(10,132,255,.2);
    background: rgba(10,132,255,.12);
    color: var(--text);
}
.email-chip strong {
    color: var(--primary-strong);
    font-size: 1rem;
    line-height: 1;
}
.email-chip-input {
    flex: 1;
    min-width: 220px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    padding: 8px 4px;
}
.inline-note {
    display: inline-flex;
    margin-right: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(10,132,255,.1);
    color: var(--primary-strong);
    font-size: .85rem;
}

ul.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--danger);
    font-size: .92rem;
}

@media (max-width: 900px) {
    .topbar, .panel-head, .nav, .topbar-actions, .action-row { flex-wrap: wrap; }
    .auth-layout, .logout-layout, .hero-dashboard, .grid-two, .hero-dashboard.admin, .grid-form { grid-template-columns: 1fr; }
    .booking-hero { align-items: start; }
    .booking-steps { grid-template-columns: 1fr 1fr; }
    .booking-modes { grid-template-columns: 1fr; }
    .hero-metrics.full-width { grid-template-columns: 1fr; }
    .date-step-form { flex-direction: column; align-items: stretch; }
    .date-step-form .field { min-width: 100%; }
    .wizard-form, .wizard-form.single-column { grid-template-columns: 1fr; }
    .wizard-actions { justify-content: stretch; flex-direction: column; }
    .page-shell { width: min(100% - 20px, 1180px); }
    h1 { font-size: 2.6rem; }
}
