:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --ink: #172033;
    --muted: #6a7387;
    --line: #dde4ef;
    --accent: #f05f40;
    --accent-dark: #d44d31;
    --success: #15a371;
    --warning: #cf8a13;
    --info: #2b7de9;
    --danger: #cf4b4b;
    --shadow: 0 24px 60px rgba(23, 32, 51, 0.08);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "SF Pro Text", "Segoe UI", "Helvetica Neue", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(240, 95, 64, 0.12), transparent 28%),
        radial-gradient(circle at right center, rgba(43, 125, 233, 0.12), transparent 24%),
        var(--bg);
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.demo-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.demo-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 28px 22px;
    background: linear-gradient(180deg, #182133 0%, #101827 100%);
    color: #f7f8fb;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 132px;
    height: auto;
}

.brand-block strong {
    display: block;
    font-size: 1.05rem;
}

.brand-block span {
    display: block;
    margin-top: 4px;
    color: rgba(247, 248, 251, 0.66);
    font-size: 0.9rem;
}

.demo-status-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
}

.demo-status-card p {
    margin: 4px 0 0;
    color: rgba(247, 248, 251, 0.64);
    font-size: 0.88rem;
}

.demo-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-top: 4px;
    background: #36d399;
    box-shadow: 0 0 0 6px rgba(54, 211, 153, 0.16);
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-link {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    color: rgba(247, 248, 251, 0.74);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(240, 95, 64, 0.95), rgba(255, 122, 72, 0.9));
    transform: translateX(3px);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
    font-size: 0.92rem;
}

.sidebar-cta,
.topbar-cta {
    width: 100%;
    text-align: center;
}

.sidebar-footer a {
    color: rgba(247, 248, 251, 0.72);
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #fff;
}

.demo-main {
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.94)),
        linear-gradient(135deg, rgba(240, 95, 64, 0.08), rgba(43, 125, 233, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.topbar h1,
.section-head h2,
.card-head h3 {
    margin: 0;
    line-height: 1.1;
}

.topbar h1 {
    max-width: 780px;
    font-size: clamp(2rem, 3vw, 3.25rem);
}

.topbar-copy {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.topbar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    min-width: 220px;
}

.live-pill,
.ghost-link,
.soft-button,
.primary-button,
.ghost-button {
    border-radius: 999px;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(21, 163, 113, 0.12);
    color: var(--success);
    font-weight: 700;
}

.live-pill::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
}

.live-pill.is-loading {
    color: var(--warning);
    background: rgba(207, 138, 19, 0.12);
}

.live-pill.is-error {
    color: var(--danger);
    background: rgba(207, 75, 75, 0.12);
}

.ghost-link,
.soft-button,
.ghost-button,
.primary-button {
    border: 0;
    text-decoration: none;
    cursor: pointer;
}

.ghost-link,
.ghost-button {
    padding: 12px 18px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.soft-button {
    padding: 12px 18px;
    background: rgba(240, 95, 64, 0.12);
    color: var(--accent-dark);
}

.primary-button {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent), #ff7a48);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 18px 30px rgba(240, 95, 64, 0.24);
}

.primary-button:disabled,
.tiny-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.system-message {
    margin: 22px 0 28px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-weight: 600;
}

.system-message.is-info {
    background: rgba(43, 125, 233, 0.08);
    border-color: rgba(43, 125, 233, 0.18);
    color: var(--info);
}

.system-message.is-success {
    background: rgba(21, 163, 113, 0.08);
    border-color: rgba(21, 163, 113, 0.18);
    color: var(--success);
}

.system-message.is-error {
    background: rgba(207, 75, 75, 0.08);
    border-color: rgba(207, 75, 75, 0.18);
    color: var(--danger);
}

.lead-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1200;
}

.lead-modal.is-open {
    display: flex;
}

.lead-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 14, 24, 0.62);
    backdrop-filter: blur(8px);
}

.lead-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(820px, 100%);
    padding: 28px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(240, 95, 64, 0.14), transparent 28%),
        linear-gradient(180deg, #ffffff, #f7f9fc);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
}

.lead-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
    font-size: 1.5rem;
    cursor: pointer;
}

.lead-modal-copy h2 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.lead-modal-copy p {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.lead-form {
    margin-top: 22px;
}

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

.lead-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
}

.tab-panel {
    display: none;
    animation: panelIn 0.28s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-head,
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
}

.section-head {
    margin-bottom: 20px;
}

.section-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.inline-field,
.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.inline-field select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.room-card textarea,
.room-card select,
.folio-status-select,
.request-status-select {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 14px;
    padding: 12px 14px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

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

.kpi-card,
.surface-card,
.phone-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
}

.kpi-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(240, 95, 64, 0.08), transparent 56%);
    pointer-events: none;
}

.kpi-label {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0 0 10px;
}

.kpi-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.kpi-helper {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.dashboard-grid,
.two-column-layout,
.app-layout,
.reception-layout {
    display: grid;
    gap: 20px;
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

.reception-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
}

.two-column-layout,
.app-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.surface-card {
    padding: 22px;
}

.trend-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 240px;
    margin-top: 18px;
}

.trend-bar {
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 10px;
    min-height: 200px;
}

.trend-bar-visual {
    position: relative;
    min-height: 40px;
    border-radius: 18px 18px 8px 8px;
    background: linear-gradient(180deg, rgba(240, 95, 64, 0.95), rgba(240, 95, 64, 0.3));
}

.trend-bar-value,
.trend-bar-label {
    text-align: center;
}

.trend-bar-value {
    font-weight: 800;
}

.trend-bar-label {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-list,
.stack-list,
.timeline-list {
    display: grid;
    gap: 12px;
}

.status-item,
.list-item,
.timeline-item,
.shift-card,
.alert-item,
.request-item {
    padding: 16px;
    border-radius: 18px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.status-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.status-dot,
.badge-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.status-label,
.list-title {
    font-weight: 700;
}

.status-total,
.list-meta,
.muted-copy {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge.available,
.status-available {
    color: var(--success);
    background: rgba(21, 163, 113, 0.12);
}

.badge.occupied,
.status-occupied {
    color: var(--info);
    background: rgba(43, 125, 233, 0.12);
}

.badge.reserved,
.status-reserved {
    color: var(--warning);
    background: rgba(207, 138, 19, 0.14);
}

.badge.dirty,
.status-dirty {
    color: var(--danger);
    background: rgba(207, 75, 75, 0.12);
}

.badge.blocked,
.status-blocked {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
}

.badge.open,
.status-open,
.badge.pending {
    color: var(--accent-dark);
    background: rgba(240, 95, 64, 0.12);
}

.badge.review,
.status-review,
.badge.in_progress {
    color: var(--warning);
    background: rgba(207, 138, 19, 0.14);
}

.badge.settled,
.status-settled,
.badge.completed,
.badge.attended,
.status-closed {
    color: var(--success);
    background: rgba(21, 163, 113, 0.12);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filter-pill {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    color: var(--muted);
}

.filter-pill.active {
    background: rgba(240, 95, 64, 0.12);
    border-color: rgba(240, 95, 64, 0.3);
    color: var(--accent-dark);
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.room-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.room-card-header,
.item-split,
.shift-metrics,
.request-header,
.alert-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.room-card h4,
.phone-card h3 {
    margin: 0;
}

.room-card p,
.list-item p,
.shift-card p,
.request-item p,
.alert-item p,
.folio-overview p,
.phone-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.room-card textarea {
    min-height: 74px;
    resize: vertical;
}

.room-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.room-card small,
.micro-copy {
    color: var(--muted);
    font-size: 0.84rem;
}

.side-stack {
    display: grid;
    gap: 20px;
}

.shift-card {
    display: grid;
    gap: 10px;
}

.shift-metrics {
    align-items: stretch;
}

.shift-metric {
    flex: 1;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
}

.shift-metric strong,
.metric-chip strong {
    display: block;
    font-size: 1.12rem;
}

.shift-metric span,
.metric-chip span {
    color: var(--muted);
    font-size: 0.82rem;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.form-compact {
    margin-top: 18px;
}

.full-width {
    grid-column: 1 / -1;
}

.table-wrap {
    overflow-x: auto;
}

.table-wrap.narrow {
    max-height: 420px;
    overflow: auto;
}

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

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

.data-table th {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.data-table td select {
    min-width: 130px;
}

.folio-overview {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.overview-tile {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
}

.app-layout {
    align-items: start;
}

.phone-card {
    position: relative;
    max-width: 380px;
    margin-inline: auto;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: linear-gradient(180deg, #111827, #1f2937);
}

.phone-notch {
    width: 38%;
    height: 26px;
    margin: 0 auto 12px;
    border-radius: 0 0 16px 16px;
    background: rgba(255, 255, 255, 0.08);
}

.phone-screen {
    min-height: 640px;
    border-radius: 28px;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(240, 95, 64, 0.16), transparent 34%),
        linear-gradient(180deg, #f7f8fb 0%, #edf2f8 100%);
}

.phone-panel {
    display: grid;
    gap: 14px;
}

.phone-panel-header {
    display: grid;
    gap: 6px;
}

.phone-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.mobile-card {
    padding: 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(23, 32, 51, 0.08);
    box-shadow: 0 20px 40px rgba(23, 32, 51, 0.08);
}

.mobile-card.accent-card {
    color: #fff;
    background: linear-gradient(135deg, #f05f40 0%, #ff8355 100%);
}

.mobile-card.accent-card p,
.mobile-card.accent-card .muted-copy {
    color: rgba(255, 255, 255, 0.86);
}

.metric-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.metric-chip {
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.04);
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.timeline-state {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.timeline-state.done {
    background: var(--success);
}

.timeline-state.pending {
    background: #cbd5e1;
}

.request-actions,
.alert-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.segmented-control {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.segmented-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.segmented-button.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

.empty-state {
    padding: 18px;
    border-radius: 16px;
    background: var(--surface-alt);
    border: 1px dashed var(--line);
    color: var(--muted);
}

.tiny-button {
    border: 0;
    border-radius: 999px;
    padding: 9px 12px;
    background: rgba(240, 95, 64, 0.12);
    color: var(--accent-dark);
    cursor: pointer;
    font-weight: 700;
}

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

    .room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .demo-shell {
        grid-template-columns: 1fr;
    }

    .demo-sidebar {
        position: static;
        height: auto;
    }

    .topbar,
    .dashboard-grid,
    .reception-layout,
    .two-column-layout,
    .app-layout {
        grid-template-columns: 1fr;
    }

    .topbar-actions {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .demo-main {
        padding: 18px;
    }

    .topbar,
    .surface-card,
    .kpi-card,
    .phone-card {
        border-radius: 22px;
    }

    .kpi-grid,
    .compact-grid,
    .room-grid,
    .metric-chip-grid,
    .lead-form-grid {
        grid-template-columns: 1fr;
    }

    .section-head,
    .card-head,
    .room-card-header,
    .room-card-footer,
    .item-split,
    .shift-metrics,
    .request-header,
    .alert-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .phone-screen {
        min-height: auto;
    }

    .lead-modal-dialog {
        padding: 22px;
        border-radius: 22px;
    }

    .lead-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
