/* =========================================================
   Painel administrativo do salão
   ========================================================= */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 1rem .75rem; overflow-y: auto; z-index: 40;
}
.side-brand { display: flex; align-items: center; gap: .65rem; padding: .35rem .55rem 1rem; color: #fff; }
.side-brand .logo-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); display: grid; place-items: center; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.side-brand .logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.side-brand strong { display: block; font-size: .98rem; line-height: 1.2; }
.side-brand small { color: #b5a7ba; font-size: .76rem; }
.side-nav { display: grid; gap: 2px; }
.side-group { font-size: .72rem; color: #9b8ca0; padding: .9rem .7rem .3rem; font-weight: 600; }
.side-link {
  display: flex; align-items: center; gap: .7rem; padding: .58rem .7rem; border-radius: 9px;
  color: var(--side-ink); font-weight: 500; font-size: .93rem; text-decoration: none !important; border: 0; background: transparent; width: 100%; cursor: pointer; text-align: left;
}
.side-link:hover { background: var(--side-2); color: #fff; }
.side-link.active { background: #fff; color: var(--side); font-weight: 700; }
.side-link.active svg { color: var(--brand); }
.side-link .lock { margin-left: auto; opacity: .6; }
.side-link .count { margin-left: auto; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: 0 .45rem; border-radius: 99px; line-height: 1.5; }
.side-foot { margin-top: auto; padding-top: 1rem; }
.plan-chip { display: flex; align-items: center; gap: .55rem; padding: .7rem; border-radius: 12px; background: var(--side-2); font-size: .82rem; margin-bottom: .5rem; color: #fff; text-decoration: none !important; }
.plan-chip small { display: block; color: #b5a7ba; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; background: rgba(243, 242, 245, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.topbar-title { font-weight: 700; font-size: 1rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: .5rem; padding: .25rem .3rem .25rem .25rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .86rem; font-weight: 600; }
.view { padding: 1.5rem; max-width: 1320px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .15rem; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.side-overlay { display: none; }

/* ---------- Dashboard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.mini-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.mini-stat strong { color: var(--ink); font-size: 1.05rem; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; }
.upcoming { display: grid; gap: .1rem; }
.up-item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .75rem .4rem; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.up-item:hover { background: var(--surface-2); }
.up-item:last-child { border-bottom: 0; }
.up-time { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.up-time small { display: block; font-weight: 500; font-size: .74rem; color: var(--muted); }
.up-body strong { display: block; }
.up-body span { color: var(--muted); font-size: .87rem; }
.up-price { text-align: right; font-weight: 700; display: grid; gap: .25rem; justify-items: end; }
.pro-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.lm-banner { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; border-radius: var(--r-lg); background: var(--side); color: #fff; margin-bottom: 1rem; flex-wrap: wrap; }
.lm-banner .lm-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.lm-banner p { margin: 0; color: var(--side-ink); font-size: .9rem; }
.lm-banner strong { font-size: 1rem; }
.lm-banner .btn { margin-left: auto; }

/* ---------- Cartões de entidades ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.entity-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; cursor: pointer; position: relative; transition: border-color .15s; }
.entity-card:hover { border-color: var(--line-strong); }
.entity-card.is-off { opacity: .62; }
.entity-card h3 { margin: 0; font-size: 1.02rem; }
.entity-actions { display: flex; justify-content: flex-end; gap: .15rem; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--line); }
.entity-media { height: 150px; margin: -1.1rem -1.1rem .2rem; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.entity-media img { width: 100%; height: 100%; object-fit: cover; }
.price-line { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price-line strong { font-size: 1.15rem; }
.pro-card-head { display: flex; gap: .8rem; align-items: center; }
.pro-card-head small { color: var(--muted); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 99px; background: var(--gray-soft); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.meta-line { display: flex; gap: .9rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.meta-line span { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.agenda-nav { display: flex; align-items: center; gap: .25rem; }
.agenda-date { font-weight: 700; font-size: 1.05rem; min-width: 0; }
.agenda-bar .grow { flex: 1; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; max-height: calc(100vh - 220px); position: relative; }
.cal-day { display: grid; min-width: max-content; }
.cal-head { position: sticky; top: 0; z-index: 5; display: contents; }
.cal-corner, .cal-colhead { position: sticky; top: 0; z-index: 6; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: .6rem .7rem; }
.cal-corner { left: 0; z-index: 7; }
.cal-colhead { display: flex; align-items: center; gap: .5rem; border-left: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.cal-colhead small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.cal-times { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.cal-time { font-size: .72rem; color: var(--muted); text-align: right; padding-right: .5rem; transform: translateY(-.5em); }
.cal-col { position: relative; border-left: 1px solid var(--line); min-width: 190px; }
.cal-slot { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); cursor: pointer; }
.cal-slot.half { border-top-style: dashed; border-top-color: #efedf2; }
.cal-slot:hover { background: var(--brand-soft); }
.cal-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f4f2f6 0 6px, #ebe8ef 6px 12px); pointer-events: none; }
.cal-off span { position: absolute; top: 4px; left: 6px; font-size: .72rem; color: var(--muted); font-weight: 600; }
.cal-appt {
  --c: var(--brand); position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: .3rem .5rem; overflow: hidden; cursor: pointer; z-index: 2;
  background: color-mix(in srgb, var(--c) 14%, white); border-left: 4px solid var(--c); font-size: .8rem; line-height: 1.25; color: var(--ink);
}
.cal-appt:hover { box-shadow: var(--shadow-2); z-index: 3; }
.cal-appt strong { display: block; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cal-appt.st-cancelled { opacity: .45; text-decoration: line-through; }
.cal-appt.st-no_show { background: var(--red-soft); border-left-color: var(--red); }
.cal-appt.st-completed { background: #f1f0f3; border-left-color: var(--gray); }
.cal-appt.st-pending { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.6) 8px 12px); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 1050px; }
.wk-col { border-left: 1px solid var(--line); min-height: 420px; }
.wk-col:first-child { border-left: 0; }
.wk-head { position: sticky; top: 0; background: var(--surface-2); padding: .6rem .7rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.wk-head.today { background: var(--brand-soft); }
.wk-head strong { display: block; }
.wk-head small { color: var(--muted); }
.wk-list { padding: .5rem; display: grid; gap: .4rem; align-content: start; }
.wk-item { --c: var(--brand); padding: .45rem .55rem; border-radius: 9px; background: color-mix(in srgb, var(--c) 12%, white); border-left: 3px solid var(--c); font-size: .8rem; cursor: pointer; }
.wk-item b { display: block; }
.wk-item.st-cancelled { opacity: .45; text-decoration: line-through; }
.wk-closed { font-size: .78rem; color: var(--muted); padding: .6rem; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head { padding: .55rem; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: center; }
.mo-cell { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .4rem; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; }
.mo-cell:nth-child(7n) { border-right: 0; }
.mo-cell:hover { background: var(--surface-2); }
.mo-cell.out { background: #fbfafc; color: var(--faint); }
.mo-cell.today .mo-num { background: var(--brand); color: #fff; }
.mo-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.mo-item { --c: var(--brand); font-size: .72rem; padding: .1rem .35rem; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-more { font-size: .72rem; color: var(--muted); font-weight: 600; }
.legend-pros { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: .75rem; }

/* ---------- Detalhe do agendamento ---------- */
.appt-detail { display: grid; gap: 1rem; }
.appt-hero { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-radius: var(--r-lg); background: var(--surface-2); }
.appt-hero .big-time { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.appt-hero .big-time small { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-top: .3rem; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; margin: 0; }
.dl div { min-width: 0; }
.dl dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.action-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .35rem; max-height: 180px; overflow-y: auto; padding: 2px; }
.slot-picker button { min-height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .86rem; cursor: pointer; }
.slot-picker button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot-empty { padding: .8rem; background: var(--amber-soft); color: var(--amber); border-radius: 9px; font-size: .88rem; }
.inline-alert { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: .9rem; font-weight: 500; }
.inline-alert.info { background: var(--blue-soft); color: var(--blue); }
.inline-alert.ok { background: var(--green-soft); color: var(--green); }
.new-client-box { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: .9rem; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); }

/* ---------- Configurações ---------- */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.settings-nav { position: sticky; top: 76px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .5rem; }
.settings-nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .92rem; text-decoration: none; }
.settings-nav a:hover { background: var(--surface-2); }
.settings-nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td, .hours-table th { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
.hours-table th { font-size: .78rem; color: var(--muted); }
.hours-table input[type=time] { min-width: 108px; }
.hours-table tr.closed input[type=time] { opacity: .4; }
.theme-presets { display: flex; gap: .5rem; flex-wrap: wrap; }
.theme-preset { width: 44px; height: 44px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; overflow: hidden; display: grid; grid-template-rows: 1fr 1fr; padding: 0; }
.theme-preset:hover, .theme-preset:focus-visible { border-color: var(--ink); }
.preview-phone { border-radius: 28px; border: 8px solid #1d1620; overflow: hidden; max-width: 300px; background: #fff; box-shadow: var(--shadow-3); margin: 0 auto; }
.qr-poster { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.75rem; text-align: center; max-width: 340px; margin: 0 auto; }
.qr-poster h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: .2rem; }
.qr-box { display: grid; place-items: center; margin: 1rem auto; width: 220px; height: 220px; }
.qr-box img, .qr-box canvas { width: 220px !important; height: 220px !important; }
.link-box { display: flex; gap: .5rem; align-items: center; padding: .6rem .6rem .6rem .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; overflow-wrap: anywhere; }
.link-box span { flex: 1; min-width: 0; }
.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.2rem; display: flex; flex-direction: column; gap: .6rem; background: var(--surface); }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; font-size: .88rem; }
.plan-card li { display: flex; gap: .45rem; align-items: center; }
.plan-card li.off { color: var(--faint); text-decoration: line-through; }
.plan-card li svg { color: var(--green); }
.plan-card li.off svg { color: var(--faint); }
.plan-price { font-size: 1.6rem; font-weight: 800; }
.plan-price small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.usage { display: grid; gap: .3rem; font-size: .88rem; }
.usage-bar { height: 8px; border-radius: 99px; background: var(--gray-soft); overflow: hidden; }
.usage-bar div { height: 100%; background: var(--brand); }
.notif-list { display: grid; gap: .5rem; }
.notif { display: flex; gap: .75rem; padding: .75rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.notif .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gray-soft); flex-shrink: 0; }
.notif p { margin: .15rem 0 0; font-size: .88rem; color: var(--ink-2); }
.notif small { color: var(--muted); }

/* ---------- Clientes (detalhe) ---------- */
.client-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat-row div { background: var(--surface-2); border-radius: 12px; padding: .7rem; }
.stat-row small { color: var(--muted); display: block; font-size: .76rem; font-weight: 600; }
.stat-row strong { font-size: 1.05rem; }
.loyalty-bar { display: flex; gap: .3rem; margin: .4rem 0; }
.loyalty-bar span { flex: 1; height: 10px; border-radius: 99px; background: var(--gray-soft); }
.loyalty-bar span.on { background: var(--brand); }
.review-item { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
