:root {
    --bg: #f3efe7;
    --surface: #fffdf9;
    --ink: #1d1a16;
    --muted: #6f675e;
    --line: #e4dcd0;
    --accent: #1f6b4a;
    --accent-ink: #f4faf6;
    --brass: #9c7844;
    --danger: #8d3232;
    --warn: #8a5a16;
    --info: #24556f;
    --sidebar: #171512;
    --sidebar-text: #efe8dc;
    --shadow: 0 16px 40px rgba(48, 36, 20, 0.06);
    --radius: 16px;
    --font: "Outfit", "Segoe UI", sans-serif;
    --display: "Fraunces", Georgia, serif;
    --tap: 48px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--ink);
    color: white;
    padding: 8px 12px;
    z-index: 20;
}
.skip:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 18px; text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); font-family: var(--display);
}
.brand strong { display: block; font-size: 14px; letter-spacing: .01em; }
.brand small { color: #b7ad9f; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #d9d0c3;
    padding: 10px 12px; border-radius: 12px; margin-bottom: 2px;
}
.nav-link.active, .nav-link:hover { background: rgba(255,255,255,.06); color: white; }
.nav-link.active { box-shadow: inset 3px 0 0 var(--brass); }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; }
.main { min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 22px; position: sticky; top: 0; z-index: 5;
    background: rgba(243, 239, 231, .92); backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.menu-toggle, .icon-btn {
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface);
    display: grid; place-items: center;
}
.menu-toggle { display: none; }
.top-spacer { flex: 1; }
.bell { position: relative; }
.bell-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--accent); color: var(--accent-ink);
    border-radius: 99px; font-size: 11px; min-width: 18px; text-align: center;
}
.dropdown { position: relative; }
.dropdown-panel {
    display: none; position: absolute; right: 0; top: 48px; width: min(320px, 80vw);
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow); padding: 8px;
}
.dropdown.open .dropdown-panel { display: block; }
.dropdown-panel a, .dropdown-panel p { display: block; padding: 8px 10px; text-decoration: none; }
.who { text-align: right; }
.who strong { display: block; font-size: 14px; }
.who span, .muted { color: var(--muted); }
.content { padding: 8px 22px 40px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin: 8px 0 18px; }
.page-head h1, .display { font-family: var(--display); font-weight: 520; letter-spacing: -.03em; margin: 0; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-family: var(--display); font-size: 32px; margin: 6px 0 0; }
.card h2 { font-size: 18px; margin: 0 0 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 14px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface); text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-danger { background: #f8ecec; color: var(--danger); border-color: #efd0d0; }
.btn-whatsapp { background: #1f6b4a; color: white; border-color: transparent; }
.btn-small { min-height: 34px; padding: 0 10px; font-size: 14px; }
.btn[disabled] { opacity: .7; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-span { grid-column: 1 / -1; }
.field span { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"], input[type="url"], input[type="color"],
select, textarea {
    width: 100%; min-height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: #fff; padding: 10px 12px;
}
input[type="color"] { height: 44px; padding: 6px; }
input[type="file"] { width: 100%; font-size: 14px; }
.brand-preview { width: 100%; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.brand-preview.is-logo { width: 72px; height: 72px; }
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { color: var(--danger); }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; }
.alert-success { background: #e8f5ee; color: #14573a; }
.alert-error { background: #fbeeee; color: #7d2828; }
.alert-info { background: #e8f1f6; color: #1d455c; }
.badge {
    display: inline-flex; align-items: center; border-radius: 999px;
    padding: 3px 8px; font-size: 12px; background: #efeae2;
}
.badge-pending { background: #f8efd8; color: #7a5410; }
.badge-confirmed, .badge-active { background: #e3f3ea; color: #14613d; }
.badge-declined, .badge-cancelled, .badge-suspended { background: #f8e4e4; color: #8a2e2e; }
.badge-completed { background: #e6eef5; color: #1d4e6c; }
.badge-no_show { background: #eee9e2; color: #5c5348; }
.badge-demo { background: #f3ead7; color: #6d5424; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { min-height: 40px; }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 6px; margin-top: 14px; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; border: 1px solid var(--line); }
.pager a.is-current { background: var(--ink); color: white; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bar { flex: 1; background: color-mix(in srgb, var(--accent) 80%, white); border-radius: 8px 8px 2px 2px; min-height: 4px; position: relative; }
.bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }

.cal-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; }
.day-cell {
    min-height: 92px; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
    background: #fff; text-decoration: none; display: block;
}
.day-cell.is-out { opacity: .45; }
.day-cell.is-today { border-color: var(--accent); }
.event {
    display: block; font-size: 12px; margin-top: 4px; padding: 3px 5px; border-radius: 7px;
    background: color-mix(in srgb, var(--accent) 12%, white); text-decoration: none;
}
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-col { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-height: 220px; }
.timeline { display: grid; gap: 8px; }
.timeline article { display: grid; grid-template-columns: 72px 1fr; gap: 10px; }

.guest-body, .market-body { min-height: 100vh; }
.guest-wrap { max-width: 440px; margin: 8vh auto; padding: 20px; }
.market-hero { padding: 48px 8vw 32px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: end; }
.market-hero h1 { font-family: var(--display); font-size: clamp(42px, 6vw, 72px); line-height: .95; margin: 0 0 12px; }
.market-band { margin: 0 8vw 40px; }

.public-body { background: var(--paper, #f6f1ea); }
.profile { max-width: 980px; margin: 20px auto 0; padding: 0 16px; }
.profile-cover {
    height: 220px; border-radius: 22px 22px 0 0; overflow: hidden;
    background: linear-gradient(145deg, var(--accent), #241910 70%);
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-card {
    background: #fff; border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 22px 22px; padding: 0 22px 22px; box-shadow: var(--shadow);
}
.profile-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.profile-avatar {
    width: 112px; height: 112px; margin-top: -56px; border-radius: 50%;
    border: 4px solid #fff; background: #fff; object-fit: contain; padding: 10px; flex: none;
    box-shadow: 0 8px 24px rgba(29, 26, 22, .12);
}
.profile-fallback {
    display: grid; place-items: center; font-family: var(--display); font-size: 40px; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, white);
}
.profile-cat { margin: 12px 0 0; color: var(--muted); font-weight: 650; }
.profile-card h1 { font-family: var(--display); font-size: clamp(32px, 4vw, 48px); line-height: 1.05; margin: 2px 0 0; }
.profile-bio { max-width: 68ch; margin: 8px 0 0; color: #3d3832; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.profile-actions .btn { border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 650; }
.profile-actions .btn-whatsapp { background: #128c7e; color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(18, 140, 126, .22); }
.profile-actions .btn-instagram { background: #fff; color: #1d1a16; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; margin: 14px 0 0; padding: 0; color: var(--muted); }
.profile-meta li { display: flex; align-items: center; gap: 6px; }
.profile-meta a { color: var(--accent); font-weight: 650; text-decoration: none; }
.profile-meta svg { width: 16px; height: 16px; }
.book-sheet { max-width: 980px; margin: 16px auto 32px; padding: 0 16px 24px; }
.book-sheet .field input,
.book-sheet .field textarea {
    width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line);
    background: #fff; padding: 12px 14px;
}
.book-sheet .field input:focus,
.book-sheet .field textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.book-sheet input[data-phone] { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.book-sheet .check { align-items: flex-start; line-height: 1.45; }
.book-sheet .check input { margin-top: 3px; }
.stack { margin-top: 14px; }
.stack-sm { margin-top: 12px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.steps span { font-size: 13px; color: var(--muted); background: #f6f1ea; border-radius: 999px; padding: 6px 10px; }
.steps .is-on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.choice {
    display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 16px;
    padding: 14px; background: #fff; min-height: var(--tap);
}
.choice strong { display: block; }
.choice:hover, .slot:hover { border-color: var(--accent); }
.day-row, .slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot, .day-chip {
    min-height: var(--tap); min-width: 84px; padding: 10px 12px; border-radius: 14px;
    border: 1px solid var(--line); background: #fff; text-decoration: none; display: inline-grid; place-items: center;
}
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gallery img { height: 120px; width: 100%; object-fit: cover; border-radius: 12px; }
.summary { background: color-mix(in srgb, var(--accent) 8%, white); border-radius: 16px; padding: 12px; }

.backdrop { position: fixed; inset: 0; background: rgba(20,16,12,.45); z-index: 8; display: none; }
body.nav-open .backdrop { display: block; }

@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 9; transform: translateX(-105%); transition: transform .2s ease; width: min(300px, 88vw); }
    body.nav-open .sidebar { transform: none; }
    .menu-toggle { display: grid; }
    .grid-4, .grid-3, .week-grid { grid-template-columns: 1fr 1fr; }
    .market-hero { grid-template-columns: 1fr; padding-top: 28px; }
    .form-grid, .grid-2 { grid-template-columns: 1fr; }
    .who { display: none; }
}
@media (max-width: 720px) {
    .content { padding: 8px 14px 32px; }
    .grid-4, .grid-3, .week-grid, .gallery { grid-template-columns: 1fr; }
    .book-sheet .gallery { grid-template-columns: 1fr 1fr; }
    .profile-cover { height: 160px; }
    .profile-avatar { width: 88px; height: 88px; margin-top: -44px; }
    .month-grid { gap: 4px; }
    .day-cell { min-height: 64px; }
    table.responsive thead { display: none; }
    table.responsive tr { display: block; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: #fff; }
    table.responsive td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 0; }
    table.responsive td::before { content: attr(data-label); color: var(--muted); }
    .page-head { flex-direction: column; align-items: stretch; }
}
