:root {
    --ink: #241f21;
    --muted: #766d70;
    --line: #e8ddd7;
    --surface: rgba(255, 252, 248, 0.94);
    --rose: #c86b7e;
    --rose-dark: #9f4558;
    --teal: #1f8a8a;
    --gold: #c8923e;
    --sage: #7a9b76;
    --app-bg: #fff7ef;
    --heading-color: #2a2025;
    --button-color: #c86b7e;
    --button-text: #ffffff;
    --header-bg: #fffaf6;
    --footer-bg: #253130;
    --panel-bg: #fffcf8;
    --shadow: 0 24px 70px rgba(60, 38, 33, 0.16);
    --radius: 8px;
    --theme-dark: #253130;
}

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

body {
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(115deg, color-mix(in srgb, var(--app-bg) 94%, white) 0 34%, color-mix(in srgb, var(--rose) 18%, var(--app-bg)) 34% 68%, color-mix(in srgb, var(--teal) 14%, var(--app-bg)) 68% 100%),
        repeating-linear-gradient(90deg, rgba(36, 31, 33, 0.045) 0 1px, transparent 1px 72px),
        repeating-linear-gradient(0deg, rgba(36, 31, 33, 0.035) 0 1px, transparent 1px 72px);
    line-height: 1.5;
}

h1, h2, h3, h4 {
    color: var(--heading-color);
}

.hero h1,
.hero h2,
.sales-hero h1,
.sales-hero h2,
.ultra-band h1,
.ultra-band h2,
.metric.dark h1,
.metric.dark h2 {
    color: white;
}

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

button {
    cursor: pointer;
}

a {
    color: inherit;
}

.shell {
    width: min(1440px, calc(100% - 32px));
    margin: 24px auto;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sidebar,
.panel,
.topbar {
    background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
    border: 1px solid rgba(116, 83, 74, 0.16);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.sidebar {
    background: color-mix(in srgb, var(--header-bg) 94%, transparent);
    min-height: calc(100vh - 48px);
    padding: 18px;
    position: sticky;
    top: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 44px;
    aspect-ratio: 1;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--rose), var(--teal));
}

.brand strong {
    display: block;
    font-size: 20px;
}

.muted,
.brand span {
    color: var(--muted);
    font-size: 13px;
}

.nav-title {
    margin: 22px 0 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav {
    display: grid;
    gap: 7px;
    list-style: none;
}

.nav a {
    min-height: 42px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 800;
}

.nav a:hover,
.nav a.active {
    background: #fff1e8;
    color: var(--rose-dark);
}

.main {
    display: grid;
    gap: 18px;
    min-width: 0;
    align-content: start;
}

.admin-workspace {
    display: grid;
    gap: 18px;
}

.admin-view {
    display: none;
}

.admin-view.is-active-view {
    display: grid;
}

body.panel-dashboard .admin-view[data-view~="dashboard"],
body.panel-appointments .admin-view[data-view~="appointments"],
body.panel-customers .admin-view[data-view~="customers"],
body.panel-services .admin-view[data-view~="services"],
body.panel-payments .admin-view[data-view~="payments"],
body.panel-finance .admin-view[data-view~="finance"],
body.panel-waiting-list .admin-view[data-view~="waiting-list"],
body.panel-reports .admin-view[data-view~="reports"],
body.panel-vip-crm .admin-view[data-view~="vip-crm"],
body.panel-automation .admin-view[data-view~="automation"],
body.panel-integrations .admin-view[data-view~="integrations"],
body.panel-inventory .admin-view[data-view~="inventory"],
body.panel-theme .admin-view[data-view~="theme"] {
    display: grid;
}

.admin-view.panel.is-active-view {
    display: block;
}

body.panel-integrations .admin-view.panel[data-view~="integrations"],
body.panel-payments .admin-view.panel[data-view~="payments"] {
    display: block;
}

.admin-view.hero.is-active-view,
.admin-view.demo-banner.is-active-view,
.admin-view.topbar.is-active-view {
    display: flex;
}

body.panel-dashboard .admin-view.hero[data-view~="dashboard"] {
    display: flex;
}

.admin-split-view.is-active-view {
    grid-template-columns: minmax(0, 1fr);
}

.admin-split-view [data-view-card] {
    display: none;
}

.admin-split-view [data-view-card].is-active-card {
    display: block;
}

body.panel-customers .admin-split-view [data-view-card="customers"],
body.panel-services .admin-split-view [data-view-card="services"],
body.panel-payments .admin-split-view [data-view-card="payments"] {
    display: block;
}

.topbar {
    background: color-mix(in srgb, var(--header-bg) 92%, transparent);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.hero {
    min-height: 280px;
    border-radius: var(--radius);
    overflow: hidden;
    padding: 28px;
    color: white;
    display: flex;
    align-items: flex-end;
    box-shadow: var(--shadow);
    background:
        linear-gradient(90deg, rgba(36, 31, 33, 0.82), rgba(36, 31, 33, 0.32)),
        url("https://images.unsplash.com/photo-1560066984-138dadb4c035?auto=format&fit=crop&w=1500&q=80") center / cover;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1;
}

.hero p {
    max-width: 620px;
    margin-top: 12px;
    color: rgba(255,255,255,.86);
}

.grid-4,
.grid-3,
.grid-2 {
    display: grid;
    gap: 14px;
}

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

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

.grid-2 {
    grid-template-columns: 1.15fr .85fr;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.panel {
    padding: 18px;
    min-width: 0;
}

.metric {
    min-height: 124px;
    display: grid;
    align-content: space-between;
    overflow: hidden;
    position: relative;
}

.metric::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rose), var(--teal), var(--gold));
}

.metric strong {
    font-size: 30px;
}

.metric.dark {
    color: white;
    background: var(--theme-dark);
}

.metric.dark .muted {
    color: rgba(255,255,255,.72);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.btn {
    border: 0;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 900;
    text-decoration: none;
}

.btn-primary {
    color: var(--button-text);
    background: linear-gradient(135deg, color-mix(in srgb, var(--button-color) 82%, var(--ink)), var(--button-color));
}

.btn-soft {
    color: var(--teal);
    background: #e8f7f6;
}

.btn-whatsapp {
    color: white;
    background: linear-gradient(135deg, #1f9d5a, #0f7d62);
    box-shadow: 0 14px 28px rgba(31, 157, 90, .18);
}

.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    width: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 50%;
    color: white;
    background: linear-gradient(135deg, #1f9d5a, #0f7d62);
    box-shadow: 0 14px 30px rgba(15, 125, 98, .24);
    font-size: 0;
    gap: 0;
}

.whatsapp-float i {
    font-size: 20px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: #53484a;
    font-size: 13px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
    color: #5e3b13;
    background: #fff0cf;
}

.tag.confirmed,
.tag.completed,
.tag.paid {
    color: #0e6767;
    background: #def4f2;
}

.tag.cancelled {
    color: #9a4151;
    background: #ffe4e9;
}

.form-grid {
    display: grid;
    gap: 10px;
}

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

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 11px;
    color: var(--ink);
    background: white;
    outline: 0;
}

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

.notice {
    padding: 12px 14px;
    border-radius: 8px;
    background: #e8f7f6;
    color: #0e6767;
    font-weight: 800;
}

.notice.error {
    background: #ffe4e9;
    color: #9a4151;
}

.demo-banner {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--theme-dark);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.demo-banner strong {
    display: block;
}

.demo-banner span {
    color: rgba(255,255,255,.72);
    font-size: 13px;
}

.demo-banner .btn {
    flex-shrink: 0;
}

.chart-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    align-items: end;
    min-height: 180px;
    padding-top: 12px;
}

.chart-bar {
    display: grid;
    gap: 8px;
    align-items: end;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.chart-bar span {
    display: block;
    min-height: 24px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--rose), var(--gold));
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.timeline-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--rose-dark);
    background: #fff1e8;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list li {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.mini-list li:last-child {
    border-bottom: 0;
}

.phone-preview {
    max-width: 330px;
    margin: 0 auto;
    padding: 12px;
    border-radius: 28px;
    background: #1f1c1d;
    box-shadow: 0 22px 46px rgba(36,31,33,.22);
}

.phone-screen {
    min-height: 560px;
    overflow: hidden;
    border-radius: 22px;
    background: #fffaf6;
}

.phone-hero {
    min-height: 175px;
    padding: 18px;
    color: white;
    display: grid;
    align-content: end;
    background:
        linear-gradient(180deg, rgba(36,31,33,.1), rgba(36,31,33,.78)),
        url("https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&w=800&q=80") center / cover;
}

.phone-body {
    padding: 14px;
    display: grid;
    gap: 12px;
}

.phone-tile {
    padding: 12px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--line);
}

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

.ultra-band {
    color: white;
    border-radius: var(--radius);
    padding: 22px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--theme-dark) 94%, transparent), color-mix(in srgb, var(--rose-dark) 88%, transparent)),
        radial-gradient(circle at top right, rgba(200,146,62,.35), transparent 38%);
}

.app-footer {
    color: color-mix(in srgb, white 84%, var(--footer-bg));
    background: var(--footer-bg);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.theme-color-field {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 54px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-bg) 92%, white);
}

.theme-color-field i {
    width: 42px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--rose-dark);
    background: #fff1e8;
}

.theme-color-field strong,
.theme-color-field span {
    display: block;
}

.theme-color-field span {
    color: var(--muted);
    font-size: 12px;
}

.theme-color-field input[type="color"] {
    width: 54px;
    height: 44px;
    min-height: 44px;
    padding: 4px;
}

.theme-preview-screen {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--app-bg);
}

.theme-preview-header {
    min-height: 76px;
    padding: 16px;
    color: var(--heading-color);
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
}

.theme-preview-body {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.theme-preview-card {
    padding: 16px;
    border-radius: 8px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
}

.theme-preview-footer {
    padding: 14px 16px;
    color: color-mix(in srgb, white 84%, var(--footer-bg));
    background: var(--footer-bg);
}

.ultra-band .muted {
    color: rgba(255,255,255,.74);
}

.premium-command {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 14px;
    align-items: stretch;
}

.command-card {
    position: relative;
    overflow: hidden;
}

.command-card-main {
    color: white;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--theme-dark) 92%, transparent), color-mix(in srgb, var(--rose-dark) 82%, transparent)),
        linear-gradient(90deg, rgba(255,255,255,.08), transparent);
}

.command-card-main h2,
.command-card-main .muted {
    color: white;
}

.command-card-main .muted {
    opacity: .74;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.command-kpi {
    min-height: 92px;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    display: grid;
    align-content: space-between;
}

.command-kpi span {
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 900;
}

.command-kpi strong {
    font-size: 30px;
    line-height: 1;
}

.insight-stack {
    display: grid;
    gap: 10px;
}

.insight-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.88);
    font-weight: 800;
}

.insight-row i {
    width: 36px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--theme-dark);
    background: var(--gold);
}

.vip-list,
.staff-score-list {
    display: grid;
    gap: 10px;
}

.vip-card,
.staff-score {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: white;
}

.vip-card span,
.staff-score span {
    display: block;
}

.vip-avatar {
    width: 46px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #5e3b13;
    background: #fff0cf;
}

.staff-score {
    grid-template-columns: minmax(0, 1.15fr) minmax(120px, .85fr) auto;
}

.staff-score .mini-progress {
    min-width: 120px;
}

.mini-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(36,31,33,.1);
    overflow: hidden;
}

.mini-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rose), var(--gold));
}

.report-note {
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    color: var(--rose-dark);
    background: #fff1e8;
    border: 1px solid rgba(200, 107, 126, .18);
}

@media (max-width: 1100px) {
    .shell,
    .grid-2,
    .premium-command {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: 0;
    }

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

@media (max-width: 680px) {
    .shell {
        width: min(100% - 20px, 720px);
        margin: 10px auto;
    }

    .topbar,
    .panel-head,
    .demo-banner,
    .form-grid.two {
        grid-template-columns: 1fr;
        display: grid;
    }

    .grid-4,
    .grid-3,
    .grid-auto {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .command-grid,
    .vip-card,
    .staff-score {
        grid-template-columns: 1fr;
    }

    .whatsapp-float {
        right: 12px;
        bottom: 12px;
        width: 48px;
        min-height: 48px;
    }

    .whatsapp-float i {
        font-size: 21px;
    }
}
