/* BeautyUp - estilos */
:root {
  --bg: #fbf7f9;
  --surface: #ffffff;
  --surface-2: #f6eef3;
  --line: #ecdfe7;
  --text: #2e2430;
  --muted: #7a6a78;
  --primary: #b5578a;
  --primary-600: #9c4475;
  --primary-50: #f8e9f1;
  --gold: #c9a46a;
  --ok: #2f9e6e;
  --ok-50: #e6f5ee;
  --warn: #c98a1a;
  --warn-50: #fbf2e1;
  --danger: #c4455a;
  --danger-50: #fbe9ec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(46, 36, 48, .06), 0 6px 20px rgba(46, 36, 48, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
svg.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .stats { gap: .5rem; } .stats .card { padding: .75rem; } .stats .stat .value { font-size: 1.25rem; } .stats .stat .label { font-size: .75rem; } }
.back svg { transform: rotate(180deg); }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.grow { flex: 1; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem .75rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .25rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; color: var(--primary); padding: 0 .5rem .75rem; letter-spacing: -.01em; }
.brand .dot { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--gold)); display: grid; place-items: center; color: #fff; font-size: .95rem; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .65rem .75rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 550; text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-50); color: var(--primary-600); }
.nav svg { width: 20px; height: 20px; flex: none; }
.sidebar .tenant { margin-top: auto; padding: .75rem; border-top: 1px solid var(--line); font-size: .875rem; }
.main { padding: 1.5rem 2rem 3rem; max-width: 1100px; width: 100%; }
.topbar { display: none; }
.bottomnav { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar .brand { padding: 0; font-size: 1.1rem; }
  .main { padding: 1rem 1rem calc(var(--nav-h) + 1.5rem); }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h); background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .7rem; color: var(--muted); text-decoration: none; }
  .bottomnav a.active { color: var(--primary); font-weight: 650; }
  .bottomnav svg { width: 22px; height: 22px; }
}
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: 0; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .75rem; }
.card.flat { box-shadow: none; }
.card h2 { margin-bottom: .75rem; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: .75rem; padding: .8rem .25rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); border-radius: var(--radius-sm); }
.list-item .title { font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; background: var(--primary); font-size: .95rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat .value { font-size: 1.6rem; font-weight: 750; }
.stat .label { color: var(--muted); font-size: .875rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 999px; padding: .62rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; min-height: 44px; transition: background .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--primary-600); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--primary-600); }
.btn.ghost:hover { background: var(--primary-50); }
.btn.danger { background: var(--danger); }
.btn.small { padding: .35rem .8rem; min-height: 34px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn.wa { background: #25d366; }
.btn.wa:hover { background: #1fb457; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: .4rem; border-radius: 8px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); min-height: 44px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-50); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: .9rem; user-select: none; }
.chip input { display: none; }
.chip.on, .chip:has(input:checked) { background: var(--primary-50); border-color: var(--primary); color: var(--primary-600); font-weight: 600; }
.search { position: relative; }
.search input { padding-left: 2.4rem; }
.search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.form-error { background: var(--danger-50); color: var(--danger); padding: .6rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.primary { background: var(--primary-50); color: var(--primary-600); }
.swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: var(--primary-600); border-bottom-color: var(--primary); }

/* ---------- Modal / Toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(46, 36, 48, .38); display: grid; place-items: center; z-index: 100; padding: 1rem; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto; box-shadow: 0 20px 60px rgba(46, 36, 48, .25); }
.modal.wide { width: min(760px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal header h2 { margin: 0; }
.modal .body { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.modal footer { padding: .9rem 1.2rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }
@media (max-width: 640px) {
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; width: 100%; }
}
.toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; width: min(440px, calc(100% - 2rem)); }
.toast { background: var(--text); color: #fff; padding: .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow); animation: slide .2s; font-weight: 500; }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ill { width: 64px; height: 64px; margin: 0 auto .75rem; border-radius: 20px; background: var(--primary-50); display: grid; place-items: center; color: var(--primary); }
.empty .ill svg { width: 30px; height: 30px; }
.empty h3 { color: var(--text); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(1200px 600px at 10% -10%, #f6dbe9 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #f3e6cf 0, transparent 60%), var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: 22px; padding: 2rem 1.75rem; box-shadow: 0 20px 60px rgba(46, 36, 48, .1); }
.auth-card .brand { justify-content: center; font-size: 1.6rem; padding-bottom: .25rem; }
.auth-card .brand .dot { width: 38px; height: 38px; font-size: 1.1rem; }
.auth-card .tag { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }
.choice { border: 2px solid var(--line); border-radius: var(--radius); padding: 1.1rem; cursor: pointer; display: flex; gap: .9rem; align-items: flex-start; background: #fff; text-align: left; font: inherit; color: inherit; width: 100%; }
.choice:hover { border-color: var(--primary); }
.choice.on { border-color: var(--primary); background: var(--primary-50); }
.choice .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
.choice .ico svg { width: 24px; height: 24px; }
.steps { display: flex; gap: .35rem; margin-bottom: 1.25rem; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--primary); }
.onb { width: min(640px, 100%); }
.onb .steps { margin-top: .75rem; }

/* ---------- Week hours editor ---------- */
.hours-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.hours-row .times { display: flex; gap: .4rem; align-items: center; }
.hours-row .times input { min-height: 40px; padding: .45rem .5rem; }
.hours-row.off .times { opacity: .35; pointer-events: none; }
@media (max-width: 640px) { .hours-row { grid-template-columns: 1fr; } }

table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
table.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.loading { padding: 2rem; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--primary-50); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.checklist .list-item .avatar { background: var(--surface-2); color: var(--muted); }
.checklist .list-item.done .avatar { background: var(--ok-50); color: var(--ok); }
.copybox { display: flex; gap: .5rem; }
.copybox input { font-size: .85rem; }
