:root {
  color-scheme: light;
  --ink: #211e18;
  --muted: #716b61;
  --line: #e7e0d4;
  --paper: #ffffff;
  --wash: #f7f5f0;
  --green: #1b1a17;
  --green-dark: #3b3020;
  --lime: #dfbd70;
  --danger: #a43d32;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--wash); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-page, .setup-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 15% 0%, #443820, #111111 56%); }
.auth-card, .setup-card { width: min(100%, 460px); padding: 34px; border: 1px solid rgba(255,255,255,.45); border-radius: 24px; background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.brand-mark { display: block; width: 88px; height: 88px; margin-bottom: 20px; border-radius: 19px; box-shadow: 0 8px 22px rgba(23,33,29,.2); }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(1.7rem, 5vw, 2.3rem); letter-spacing: -.045em; line-height: 1.1; }
h2 { margin-bottom: 17px; font-size: 1.1rem; letter-spacing: -.02em; }
.muted, small { color: var(--muted); }
.auth-card .muted { margin-bottom: 28px; }
.auth-card section h2 { margin-top: 28px; }
.form-stack { display: grid; gap: 10px; }
label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 700; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd8d1; border-radius: 10px; outline: none; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(173,130,48,.16); }
.form-stack input + label { margin-top: 5px; }
.button { min-height: 46px; padding: 10px 16px; border: 0; border-radius: 11px; font-weight: 750; transition: transform .12s ease, background .12s ease; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { background: var(--green); color: #f2d68d; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button-whatsapp { background: #dff1e4; color: #205b34; }
.switch-auth { margin: 19px 0 0; text-align: center; font-size: .9rem; }
.text-button { padding: 0; border: 0; background: none; color: var(--green); font-weight: 800; }
.language-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f8faf8; }
.language-switch button { min-width: 34px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 800; }
.language-switch button.is-active { background: var(--green); color: #fff; }
.auth-card > .language-switch { display: flex; width: max-content; margin: 22px auto 0; }
.setup-card .muted { line-height: 1.5; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.form-actions .button { flex: 1; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 70px; padding: 10px clamp(16px, 4vw, 48px); background: #111111; color: #fff; box-shadow: 0 4px 18px rgba(13,25,17,.12); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.05rem; font-weight: 850; letter-spacing: -.02em; }
.brand-symbol { display: block; width: 38px; height: 38px; border-radius: 11px; object-fit: cover; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar select { width: min(230px, 30vw); min-height: 38px; padding: 7px 10px; border-color: #65563e; background: #26221a; color: #fff; }
.icon-button { min-height: 38px; padding: 7px 11px; border: 1px solid #65563e; border-radius: 9px; background: transparent; color: #fff; font-size: .82rem; font-weight: 700; }
.icon-button:hover { background: #3b3020; }
.language-switch-dark { border-color: #65563e; background: #26221a; }
.language-switch-dark button { color: #dce6df; }
.language-switch-dark button.is-active { background: var(--lime); color: #211e18; }
.app-content { width: min(100% - 32px, 1040px); min-height: calc(100vh - 145px); margin: 0 auto; padding: 34px 0 105px; }
.app-panel { display: grid; gap: 20px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.page-heading h1 { margin-bottom: 0; }
.page-heading .muted { margin-bottom: 4px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.metric-card { display: flex; align-items: center; gap: 14px; min-height: 112px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.metric-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; background: #f3ecdd; color: var(--green); font-size: 25px; font-weight: 850; }
.metric-icon-green { background: #e5f2e2; color: #397a3e; font-size: 15px; }
.metric-card p { margin-bottom: 7px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.metric-card strong { font-size: 1.5rem; letter-spacing: -.04em; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.content-card { padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; }
.section-heading .eyebrow { margin-bottom: 5px; }
.agenda-filter { display: flex; align-items: center; gap: 8px; }
.agenda-filter input { width: auto; min-height: 38px; padding: 6px 9px; font-size: .82rem; }
.form-card h2 { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label { margin-bottom: 7px; }
.form-full { grid-column: 1 / -1; }
.appointment-list, .barber-list, .commission-list { display: grid; gap: 10px; }
.appointment-card, .barber-card, .commission-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.appointment-main { min-width: 0; }
.appointment-title { margin: 0 0 4px; font-weight: 800; }
.appointment-meta { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.appointment-side { display: grid; justify-items: end; gap: 8px; flex: 0 0 auto; }
.appointment-price { font-weight: 850; white-space: nowrap; }
.appointment-actions { display: flex; gap: 6px; }
.small-button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf8; color: var(--ink); font-size: .76rem; font-weight: 750; }
.small-button:hover { border-color: var(--green); }
.small-button-danger { color: var(--danger); }
.status-pill { padding: 4px 8px; border-radius: 999px; background: #edf2ee; color: #546459; font-size: .7rem; font-weight: 800; }
.status-confirmed, .status-completed { background: #e1f0e4; color: #27663c; }
.status-cancelled { background: #f9e7e4; color: #973b32; }
.empty-state { padding: 24px 12px; color: var(--muted); text-align: center; }
.commission-card strong { display: block; margin-top: 4px; }
.commission-card .commission-total { text-align: right; }
.toast { position: fixed; right: 18px; bottom: 92px; z-index: 30; max-width: min(440px, calc(100vw - 36px)); padding: 13px 16px; border-radius: 12px; background: #1d2a22; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.toast-error { background: #8a332d; }
.toast-success { background: #285c43; }
.bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 15; display: flex; justify-content: center; gap: clamp(16px, 8vw, 84px); padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(16px); }
.nav-button { display: grid; justify-items: center; gap: 2px; min-width: 68px; padding: 4px; border: 0; background: transparent; color: #87948b; font-size: .68rem; font-weight: 750; }
.nav-button span:first-child { font-size: 1.35rem; line-height: 1.2; }
.nav-button.is-active { color: var(--green); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.license-banner { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 17px; border:1px solid #cddfce; background:#edf4e8; border-radius:14px; margin-bottom:22px; }
.license-banner p { margin:0; font-size:.85rem; }
.license-banner .is-expired { color:var(--danger); }
.plans-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:20px 0; }
.plan-card { display:grid; align-content:start; gap:12px; padding:22px; border:1px solid var(--line); border-radius:14px; background:#faf7ef; }
.plan-card p { margin:0; }
.plan-card strong { font-size:1.5rem; }
.check-label { display:flex; align-items:flex-start; gap:10px; margin:18px 0; font-weight:500; line-height:1.5; }
.check-label input { width:20px; min-height:20px; margin-top:2px; flex-shrink:0; }
.backup-status { padding:12px; border-radius:10px; background:#edf2ee; font-size:.9rem; }
.purchase-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:16px 0; border-bottom:1px solid var(--line); }
.purchase-row p { margin:0; width:100%; }
.purchase-row small { overflow-wrap:anywhere; }
#backup-form, #restore-file-form { margin:18px 0; }
#clients-list { margin-top:18px; }
#clients-list .barber-card { display:block; }
#clients-list p { margin:8px 0; }
#settings-view p { line-height:1.55; }
dialog { max-width:min(460px,calc(100vw - 32px)); border:1px solid var(--line); border-radius:20px; padding:26px; box-shadow:0 20px 80px #0005; }
dialog::backdrop { background:#142219aa; }
dialog code { display:block; padding:15px; background:#edf4e8; overflow-wrap:anywhere; user-select:all; }
hr { border:0; border-top:1px solid var(--line); margin:24px 0; }
.bottom-nav { gap:clamp(0px,3vw,36px); }
.nav-button { min-width:0; width:72px; }
button:disabled { opacity:.5; cursor:not-allowed; }
.admin-content { max-width:850px; margin:30px auto; padding:20px; }
.admin-content .content-card { margin:20px 0; }
.admin-content input { margin-bottom:12px; }
.booking-controls { display:grid; gap:20px; }
.booking-controls .content-card > .action-row { margin-bottom:18px; }
.shop-logo-preview { width:90px; height:90px; object-fit:contain; border-radius:16px; border:1px solid var(--line); background:#fff; margin-bottom:16px; }
.brand-symbol { object-fit:contain; background:#fff; }
.brand span { max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar { flex-wrap:wrap; }
.topbar-actions { flex-wrap:wrap; min-width:0; }
.brand { max-width:100%; min-width:0; }
.service-editor { display:grid; grid-template-columns:minmax(130px,2fr) minmax(80px,1fr) minmax(90px,1fr) auto; gap:10px; align-items:end; padding:12px 0; border-bottom:1px solid var(--line); }
.hours-editor { display:grid; grid-template-columns:130px repeat(4,minmax(90px,1fr)); gap:10px; align-items:center; border-bottom:1px solid var(--line); padding:12px 0; }
.hours-editor .check-label { margin:0; }
.hours-editor label { font-size:.75rem; }
textarea { width:100%; padding:12px; font:inherit; border:1px solid var(--line); border-radius:10px; resize:vertical; }
#booking-link-section input { margin:10px 0; }
.public-booking-page { background:linear-gradient(180deg,#e9efdf,#f6f7f2 430px); }
.public-booking-header { max-width:850px; margin:auto; display:flex; align-items:center; gap:24px; padding:45px 24px 20px; }
.public-booking-header img { width:90px; height:90px; border-radius:22px; object-fit:contain; background:#fff; border:1px solid var(--line); padding:5px; }
.public-booking-header h1 { font-size:2.2rem; overflow-wrap:anywhere; }
.public-booking-header p { margin-bottom:6px; }
.public-booking-main { max-width:850px; margin:auto; padding:0 24px 35px; }
.public-booking-main .content-card { margin:20px 0; padding:26px; }
.public-booking-main h3 { margin-top:24px; }
.public-booking-main .form-grid { margin-bottom:20px; }
.booking-message { line-height:1.6; color:var(--green-dark); }
.booking-error { background:#fae9e5; padding:16px; border-radius:12px; color:var(--danger); }
.slots-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(85px,1fr)); gap:10px; }
.slot-button { min-height:44px; border:1px solid #b6cbb8; color:var(--green-dark); border-radius:10px; background:#f5f9ee; font-weight:700; }
.slot-button[aria-pressed=true] { background:var(--green-dark); color:#fff; }
.selected-slot, .service-summary { padding:14px; background:#edf4e5; border-radius:12px; line-height:1.5; }
.receipt-code { padding:16px; background:#edf4e5; border-radius:10px; overflow-wrap:anywhere; font-weight:700; }
.public-footer { color:var(--muted); text-align:center; padding-top:25px; line-height:1.6; }
.booking-honeypot { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(100%); }
.customer-auth-form { margin-top:20px; }
.customer-booking-item { padding:18px 0; border-bottom:1px solid var(--line); }
.customer-booking-item p { margin:8px 0; line-height:1.5; }
.customer-booking-item small { overflow-wrap:anywhere; }
.customer-recovery-note { background:#edf4e5; border-radius:12px; padding:16px; margin-top:18px; line-height:1.5; }
.customer-recovery-note code { display:block; overflow-wrap:anywhere; user-select:all; margin:12px 0; }
.legal-document { max-width:880px; margin:auto; padding:28px 22px; font-size:16px; line-height:1.65; }
.legal-document h1 { margin-top:28px; }
.legal-document h2 { margin-top:30px; margin-bottom:12px; font-size:1.25rem; }
.legal-document li { margin:10px 0; }
.legal-document code { overflow-wrap:anywhere; font-size:.8rem; }
.legal-document footer { margin-top:35px; border-top:1px solid var(--line); padding-top:20px; }
.legal-footer { padding:20px 16px 110px; text-align:center; }
.check-label a, .legal-footer a, .legal-document a, .public-footer a { color:var(--green-dark); text-decoration:underline; }
@media print { .legal-document { max-width:none; padding:0; font-size:12pt; } .legal-document nav { display:none; } }

@media (max-width: 680px) {
  .service-editor { grid-template-columns:1fr 1fr; }
  .service-editor label:first-child { grid-column:1 / -1; }
  .hours-editor { grid-template-columns:1fr 1fr; }
  .hours-editor > .check-label { grid-column:1 / -1; }
  .public-booking-header { padding:28px 16px 10px; gap:14px; }
  .public-booking-header img { width:64px; height:64px; border-radius:16px; }
  .public-booking-header h1 { font-size:1.7rem; }
  .public-booking-main { padding:0 16px 25px; }
  .public-booking-main .content-card { padding:20px 16px; }
  .plans-grid { grid-template-columns:1fr; }
  .license-banner { align-items:flex-start; flex-direction:column; }
  .auth-card, .setup-card { padding: 26px 21px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; }
  .topbar select { width: min(100%, 240px); flex: 1 1 170px; }
  .app-content { padding-top: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-card { min-height: 100px; padding: 14px 12px; gap: 10px; }
  .metric-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 21px; }
  .metric-card strong { font-size: 1.22rem; }
  .metric-card p { font-size: .72rem; }
  .action-row > .button { flex: 1 1 160px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: auto; }
  .content-card { padding: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .agenda-filter { width: 100%; }
  .agenda-filter input { flex: 1; }
  .appointment-card { align-items: flex-start; flex-direction: column; }
  .appointment-side { width: 100%; justify-items: start; grid-template-columns: 1fr auto; align-items: center; }
  .appointment-actions { grid-column: 1 / -1; }
}
/* A Pix code is private account content, never part of the offline shell. */
.pix-qr { display: block; width: min(260px,100%); height: auto; padding: 12px; background: white; border-radius: 12px; margin: 12px 0; }
.pix-code { display: block; width: 100%; min-height: 80px; overflow-wrap: anywhere; font: 12px monospace; margin: 12px 0; }
.purchase-row { overflow-wrap: anywhere; }
.purchase-row > button, .purchase-row > a { margin: 6px 6px 6px 0; }
