* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); font: 1rem/1.55 var(--body); }
a { color: var(--accent-text); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
p, h1, h2 { margin: 0; }
h1, h2 { font-family: var(--heading); line-height: 1.12; font-weight: var(--heading-weight); }
h1 { font-size: clamp(2.05rem, 5vw, 3.55rem); letter-spacing: -.045em; }
h2 { font-size: 1.55rem; letter-spacing: -.025em; }
.shell { width: min(1190px, calc(100% - 64px)); margin-inline: auto; }
.booking { width: min(630px, calc(100% - 48px)); }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 76px; display: flex; align-items: center; gap: 1.8rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--ink); font: 700 1.45rem/1 var(--body); letter-spacing: -.06em; text-decoration: none; white-space: nowrap; }
.brand span span { color: var(--accent-text); }
.brand-mark { width: 37px; height: 37px; display: grid; grid-template-columns: repeat(2, 6px); grid-template-rows: repeat(2, 6px); gap: 3px; place-content: center; background: var(--accent); transform: rotate(-8deg); border-radius: var(--small-radius); }
.brand-mark i { background: var(--on-accent); border-radius: 50% 50% 1px 50%; }
.brand-mark i:nth-child(2) { transform: rotate(90deg); }
.brand-mark i:nth-child(3) { transform: rotate(270deg); }
.brand-mark i:nth-child(4) { transform: rotate(180deg); }
nav { margin-left: auto; display: flex; gap: 1.4rem; align-items: center; }
nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
nav a:hover { text-decoration: underline; }
main { padding-block: clamp(1.75rem, 5vw, 3.75rem); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.55rem; }
.back { display: inline-block; margin-bottom: 1.1rem; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.establishment { font-size: .87rem; letter-spacing: .045em; font-weight: 700; color: var(--accent-text); margin-bottom: .45rem; overflow-wrap: anywhere; }
.intro { margin: -.4rem 0 1.25rem; color: var(--muted); max-width: 70ch; }
.card, .hero { padding: clamp(1rem, 2vw, 1.75rem); border: 1px solid var(--line); border-radius: var(--radius); }
.card { background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.hero { padding: clamp(1.15rem, 3vw, 2.3rem); display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; margin-bottom: 1rem; background: var(--hero); }
.hero h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.hero h2 + p { margin-top: .65rem; color: var(--muted); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; }
.tile { display: grid; gap: .4rem; color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile strong { display: flex; justify-content: space-between; gap: .65rem; }
.tile strong span { color: var(--accent-text); }
.stack { display: grid; gap: 1rem; align-content: start; }
.stack > .button { justify-self: start; }
.split { display: grid; gap: 1rem; grid-template-columns: minmax(245px, 1fr) minmax(0, 1.35fr); align-items: start; }
.schedule { grid-template-columns: minmax(260px, .85fr) minmax(0, 1.55fr); }
.fields, .theme-grid, .check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.actions, .filter { display: flex; gap: .75rem 1rem; align-items: center; flex-wrap: wrap; }
.filter { align-items: end; }
.filter .actions { padding-block: .6rem; }
label { display: grid; gap: .35rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
.check + .check { margin-top: .3rem; }
.check-grid .check { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--small-radius); padding: .8rem; margin: 0; min-width: 0; }
legend { padding-inline: .3rem; font-weight: 700; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-width: 0; padding: .6rem .75rem; background: var(--surface); color: var(--ink); border: 1px solid var(--input-border); border-radius: var(--small-radius); min-height: 44px; color-scheme: var(--scheme); }
textarea { resize: vertical; }
.customer-note { white-space: pre-wrap; overflow-wrap: anywhere; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--accent); margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem .95rem; font-weight: 700; text-decoration: none; color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); border-radius: var(--small-radius); text-align: center; }
.button:hover { filter: brightness(var(--hover)); }
.button.secondary { color: var(--accent-text); border-color: var(--input-border); background: var(--surface); }
.button:disabled { opacity: .55; cursor: default; }
.text { padding: 0; border: 0; background: none; color: var(--accent-text); text-decoration: underline; text-underline-offset: .2em; }
.text.danger { color: var(--danger); }
.inline { display: inline; }
.muted, small { color: var(--muted); }
small { display: block; font-size: .86rem; }
.list-row, .appointment { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding-block: .7rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.appointment { justify-content: start; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
td, th { padding: .7rem .7rem .7rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-size: .9rem; }
.range { display: grid; align-items: baseline; gap: .2rem .75rem; grid-template-columns: max-content minmax(0, 1fr); }
.range .actions { grid-column: 2; font-size: .9rem; }
.range + .range { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.notice { padding: .75rem 1rem; border-radius: var(--small-radius); background: var(--hero); border: 1px solid var(--line); margin-bottom: 1rem; }
.notice.error { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.status { color: var(--accent-text); font-weight: 700; }
.status.cancelado { color: var(--muted); }
.settings { max-width: 730px; }
.theme-option { border: 1px solid var(--line); border-radius: var(--small-radius); padding: .6rem; }
.theme-option:has(input:checked) { border-color: var(--accent); }
.theme-sample { min-height: 97px; display: grid; align-content: center; justify-items: start; gap: .35rem; border-radius: .35rem; padding: .6rem; }
.theme-sample.elegante { background: #f5e8eb; color: #502838; font-family: Georgia, serif; }
.theme-sample.robusto { background: #242d31; color: #f5f6f4; font-family: system-ui, sans-serif; }
.theme-sample span { width: 58%; height: 3px; background: currentColor; opacity: .55; }
.theme-sample i { width: 40px; height: 10px; border-radius: 3px; }
.theme-sample.elegante i { background: #8a3b58; }
.theme-sample.robusto i { background: #e9b779; }
.booking-hours { display: grid; gap: .65rem; }
.time-period { display: grid; gap: .5rem; padding-top: .65rem; border-top: 1px solid var(--line); min-width: 0; }
.time-period h2 { font: 700 .98rem/1.4 var(--body); }
.time-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(77px, 1fr)); gap: .6rem; }
.time { position: relative; text-align: center; }
.time input, .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.time span { padding: .55rem; border: 1px solid var(--input-border); border-radius: var(--small-radius); cursor: pointer; }
.time input:checked + span { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.time input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
footer { border-top: 1px solid var(--line); padding-block: 1rem; color: var(--muted); font-size: .88rem; }
@media (max-width: 790px) {
    .split, .schedule { grid-template-columns: minmax(0, 1fr); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 525px) {
    .shell, .booking { width: calc(100% - 32px); }
    .top-inner { flex-wrap: wrap; gap: .6rem 1rem; padding-block: .8rem; }
    .top-inner form { margin-left: auto; }
    nav { order: 3; width: 100%; margin: 0; gap: 1.05rem; justify-content: flex-start; font-size: .91rem; }
    .hero, .page-head { align-items: start; flex-direction: column; }
    .grid { grid-template-columns: minmax(0, 1fr); }
    .range { grid-template-columns: minmax(0, 1fr); }
    .range .actions { grid-column: 1; }
}

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
}
.panel-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    max-height: 100vh;
    overflow: auto;
    padding: 1.35rem 1rem;
    border-right: 1px solid var(--line);
    border-bottom: 0;
}
.panel-brand { display: flex; align-items: center; justify-content: space-between; padding-inline: .4rem; }
.panel-menu { display: grid; gap: 1.2rem; margin-top: 1.2rem; }
.panel-menu form { padding-inline: .65rem; }
.panel-nav { display: grid; width: 100%; margin: 0; gap: .2rem; }
.panel-nav a { display: block; min-height: 42px; padding: .5rem .65rem; border-radius: var(--small-radius); }
.panel-nav a[aria-current="page"] { background: var(--hero); color: var(--accent-text); }
.menu-toggle { display: none; }
.appointment-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
.appointment-grid article { overflow-wrap: anywhere; }
.cash-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 1rem; margin: 0; }
.cash-totals dd { margin: 0; font-weight: 700; }
.cash-totals dt { color: var(--muted); }
@media (max-width: 760px) {
    .admin-layout { display: block; }
    .panel-sidebar { position: static; min-height: 0; max-height: none; overflow: visible; padding: .7rem .65rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .panel-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .menu-toggle { display: inline-flex; }
    .panel-menu[data-collapsible]:not([data-open]) { display: none; }
}
@media print {
    body.admin-layout { display: block; background: #fff; color: #000; }
    .panel-sidebar, .no-print, .back { display: none !important; }
    .shell { width: 100%; }
    .card { background: #fff; color: #000; box-shadow: none; }
    .table-wrap { overflow: visible; }
    .report-group h2 { break-after: avoid; }
    .report-group tr { break-inside: avoid; }
}

.account-link { margin-top: 1rem; }
.work-top { justify-content: space-between; }
.work-top .brand { gap: 0; }
