:root {
  --bg: #F5F3EE; --surface: #fff; --surface-2: #FAF9F6; --ink: #1B2320; --ink-2: #3A4541; --muted: #6C7671; --faint: #98A09C;
  --line: #E6E2D9; --line-2: #EFECE5;
  --brand: #7A1F2B; --brand-2: #932A37; --brand-ink: #3D0F16; --brand-soft: #F6E8EA;
  --gold: #B08647; --gold-2: #D4B07A; --gold-soft: #F5EDE0;
  --rose: #B4544E; --rose-soft: #F8E8E6; --amber: #A86B12; --amber-soft: #FBF0DA; --blue: #3B6699; --blue-soft: #E7EEF7; --green: #2F7A4F; --green-soft: #E3F2E8;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 34, 30, .04), 0 2px 10px rgba(23, 34, 30, .04);
  --shadow-md: 0 2px 6px rgba(23, 34, 30, .05), 0 12px 32px rgba(23, 34, 30, .08);
  --shadow-lg: 0 30px 80px rgba(15, 28, 24, .25);
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.num, .kpi-value, td.r { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }

/* ---------- boot */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 80px 0; display: grid; place-items: center; }
.loading span { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }

/* ---------- botões & campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: #D9D4C8; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 2px 6px rgba(122, 31, 43, .25); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-danger { color: var(--rose); }
.btn-danger:hover { background: var(--rose-soft); border-color: #EBCBC7; }
.btn-wa { background: #1F9D55; border-color: #1F9D55; color: #fff; }
.btn-wa:hover { background: #1A8A4A; border-color: #1A8A4A; }
.btn-lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.icon-btn.bordered { border-color: var(--line); background: var(--surface); }

.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 31, 43, .14); }
.input-sm { height: 36px; width: auto; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C7671' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 38px; height: 22px; border-radius: 99px; background: #D7D3CA; position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(122, 31, 43,.2); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-brand { background: var(--brand-soft); color: var(--brand); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-gray { background: #EFEDE8; color: #7A817D; }
.chip-rose { background: var(--rose-soft); color: var(--rose); }
.chip-gold { background: var(--gold-soft); color: var(--gold); }
.chip.plain::before { display: none; }

.avatar { --c: var(--brand); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 650; letter-spacing: .02em;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, white); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.avatar.solid { color: #fff; background: var(--c); box-shadow: none; }
.dot { --c: var(--brand); display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; }

/* ---------- autenticação */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) 1fr; }
.auth-art { position: relative; overflow: hidden; color: #F6EAEC; padding: 44px 56px; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 110% -10%, rgba(212, 176, 122, .28), transparent 60%), radial-gradient(800px 500px at -20% 110%, rgba(147, 42, 55, .55), transparent 60%), linear-gradient(160deg, #4A1520 0%, #2B0A10 100%); }
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(212, 176, 122, .18); pointer-events: none; }
.auth-art::before { width: 620px; height: 620px; right: -260px; bottom: -200px; }
.auth-art::after { width: 420px; height: 420px; right: -160px; bottom: -100px; border-color: rgba(212, 176, 122, .12); }
.auth-copy { margin: auto 0; max-width: 480px; position: relative; z-index: 1; }
.auth-copy h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.4vw, 50px); line-height: 1.08; letter-spacing: -.02em; color: #fff; }
.auth-copy h1 em { font-style: italic; color: var(--gold-2); }
.auth-copy p { margin-top: 20px; font-size: 16px; line-height: 1.6; color: rgba(246, 234, 236, .72); max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; color: rgba(246, 234, 236, .86); font-size: 14.5px; }
.auth-points li .ic { color: var(--gold-2); padding: 7px; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.auth-main { display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 40px 24px 20px; }
.auth-legal { margin-top: 24px; font-size: 12px; color: var(--faint); }
.auth-legal a { color: inherit; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.02em; margin: 8px 0 8px; }
.auth-card > p { margin-bottom: 28px; color: var(--muted); font-size: 14.5px; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.code-input { height: 52px; font-size: 18px; letter-spacing: .14em; text-transform: uppercase; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.auth-alt { margin-top: 22px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-alt button { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0; }
.hint { padding: 12px 14px; border-radius: 10px; background: var(--gold-soft); color: #7A5A2A; font-size: 13px; line-height: 1.5; }

/* ---------- marca */
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -.01em; position: relative; z-index: 1; }
.brand .logo { width: 36px; height: 36px; flex: none; }
.brand small { display: block; font-family: var(--sans); font-size: 11.5px; color: rgba(246, 234, 236,.55); font-weight: 500; letter-spacing: 0; margin-top: 1px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-light { color: #fff; }

/* ---------- layout do app */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 14px; color: #F3E6E8;
  background: radial-gradient(500px 300px at 0% 0%, rgba(212,176,122,.12), transparent 70%), linear-gradient(180deg, #4A1520, #2B0A10); }
.side .brand { padding: 0 8px 22px; color: #fff; line-height: 1.15; }
.side nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .13em; color: rgba(243, 230, 232,.38); padding: 18px 12px 8px; }
.side nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: rgba(243, 230, 232,.72); font-weight: 500; transition: background .15s, color .15s; }
.side nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side nav a.active { background: rgba(255,255,255,.09); color: #fff; }
.side nav a.active::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-2); }
.side nav a.active .ic { color: var(--gold-2); }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--gold-2); color: #1A2E28; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user strong { display: block; font-size: 13px; font-weight: 600; color: #fff; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { font-size: 11.5px; color: rgba(243, 230, 232,.5); }
.side-logout { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: none; color: rgba(243, 230, 232,.8); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.side-logout:hover, .side-logout:focus-visible { background: rgba(255,255,255,.08); color: #fff; }
.side-user .avatar { --c: var(--gold-2); background: rgba(212,176,122,.16); box-shadow: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: 26px 36px 20px; }
.top-titles { flex: 1; min-width: 0; }
.top h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
.top p { color: var(--muted); margin-top: 3px; font-size: 13.5px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; }
.view { padding: 0 36px 48px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.scrim { display: none; }

/* ---------- cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head + .card-body { padding-top: 14px; }
.card-body { padding: 18px 22px 20px; }
.card-tools { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.link { color: var(--brand); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-top: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.grid-2 > *, .grid-3 > *, .grid-2-eq > *, .kpis > * { min-width: 0; }
.section-title { font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi-top .ic { color: var(--brand); padding: 7px; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); }
.kpi-value { font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-top: 8px; line-height: 1.1; }
.kpi-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi.accent { background: linear-gradient(150deg, #5C1A24, #3D0F16); border-color: #3D0F16; color: #fff; }
.kpi.accent .kpi-top, .kpi.accent .kpi-sub { color: rgba(255,255,255,.65); }
.kpi.accent .kpi-top .ic { background: rgba(212,176,122,.18); color: var(--gold-2); }

/* listas */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 22px; border-top: 1px solid var(--line-2); cursor: pointer; transition: background .12s; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; }
.list-item:first-child { border-top: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .t { min-width: 0; flex: 1; }
.list-item strong { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item small { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time-pill { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; width: 50px; flex: none; color: var(--ink-2); }
.empty { padding: 36px 22px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ic { color: var(--faint); }
.empty.small { padding: 22px; font-size: 13px; }

/* tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
th:first-child { border-top-left-radius: var(--r); }
th:last-child { border-top-right-radius: var(--r); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
th.r, td.r { text-align: right; }
tfoot td { font-weight: 650; border-top: 1px solid var(--line); background: var(--surface-2); }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.cell-main strong { display: block; font-weight: 600; }
.cell-main small { color: var(--muted); font-size: 12px; }
.inactive { opacity: .5; }
.actions { display: flex; gap: 4px; justify-content: flex-end; }

/* search & tabs */
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 38px; }
.tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: #ECE9E2; gap: 2px; }
.tabs a, .tabs button { height: 30px; padding: 0 13px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 550; font-size: 13px; color: var(--muted); border: 0; background: none; cursor: pointer; white-space: nowrap; }
.tabs .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs .count { font-size: 11px; background: rgba(0,0,0,.06); padding: 0 6px; border-radius: 99px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 2px; }
.seg .icon-btn { width: 32px; height: 32px; }
.seg .btn { height: 32px; border: 0; }
.legend { display: flex; gap: 14px; margin-left: auto; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- agenda (dia) */
.cal { overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 210px); }
.cal-grid { display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(170px, 1fr)); min-width: calc(62px + var(--cols) * 170px); position: relative; }
.cal-head { position: sticky; top: 0; z-index: 4; display: contents; }
.cal-corner, .cal-pro { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); height: 64px; }
.cal-pro { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-left: 1px solid var(--line-2); }
.cal-pro strong { display: block; font-size: 13.5px; font-weight: 600; }
.cal-pro-txt { flex: 1; min-width: 0; }
.cal-pro strong, .cal-pro small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-pro small { display: block; font-size: 11.5px; color: var(--muted); }
.cal-pro .count { flex: none; margin-left: auto;font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 8px; }
.cal-times { position: relative; }
.cal-times div { height: var(--h); font-size: 11px; color: var(--faint); text-align: right; padding-right: 10px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-times div:first-child { visibility: hidden; }
.cal-col { position: relative; border-left: 1px solid var(--line-2); cursor: copy;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(rgba(0,0,0,.018) 1px, transparent 1px);
  background-size: 100% var(--h), 100% calc(var(--h) / 2); }
.cal-col:hover { background-color: rgba(122, 31, 43,.015); }
.appt { --c: var(--brand); position: absolute; left: 5px; right: 5px; border-radius: 9px; padding: 6px 9px; overflow: hidden; cursor: pointer; z-index: 2;
  background: color-mix(in srgb, var(--c) 12%, white); border-left: 3px solid var(--c); box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: box-shadow .15s, transform .15s; }
.appt:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); z-index: 3; }
.appt strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { display: block; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-time { font-size: 11px; font-weight: 600; color: color-mix(in srgb, var(--c) 75%, black); display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.appt.compact { display: flex; align-items: center; gap: 6px; padding: 0 9px; }
.appt.compact .appt-time { flex: none; }
.appt.st-confirmado { background: color-mix(in srgb, var(--c) 18%, white); }
.appt.st-concluido { background: repeating-linear-gradient(0deg, transparent, transparent), color-mix(in srgb, var(--c) 7%, white); }
.appt.st-concluido strong, .appt.st-concluido span { color: var(--muted); }
.appt.st-cancelado, .appt.st-faltou { background: repeating-linear-gradient(-45deg, #F6F5F2, #F6F5F2 6px, #EFEDE8 6px, #EFEDE8 12px); border-left-color: #C8C4BB; opacity: .8; }
.appt.st-cancelado strong { text-decoration: line-through; color: var(--muted); }
.appt.st-agendado { border-left-style: dashed; }
.now-line { position: absolute; left: 62px; right: 0; height: 2px; background: var(--rose); z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--rose); }

/* agenda (semana) */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 260px; display: flex; flex-direction: column; gap: 6px; }
.week-day.is-today { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 31, 43,.08); }
.week-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.week-head span { text-transform: capitalize; color: var(--muted); font-size: 12px; font-weight: 550; }
.week-head strong { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.week-head a { margin-left: auto; }
.day-count { font-size: 11px; font-weight: 650; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, white); border-radius: 99px; padding: 1px 7px; align-self: center; }
.head-count { color: var(--brand); font-weight: 650; white-space: nowrap; }
.week-item { --c: var(--brand); text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 12.5px; line-height: 1.35; }
.week-item:hover { background: color-mix(in srgb, var(--c) 17%, white); }
.week-item b { font-variant-numeric: tabular-nums; }
.week-item small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-item.st-cancelado, .week-item.st-faltou { opacity: .5; text-decoration: line-through; }
.week-empty { color: var(--faint); font-size: 12px; text-align: center; padding: 18px 0; }
.week-add { margin-top: auto; border: 1px dashed var(--line); background: none; border-radius: 8px; height: 30px; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
.week-add:hover { color: var(--brand); border-color: var(--brand); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-wd { text-align: center; text-transform: capitalize; color: var(--muted); font-size: 12px; font-weight: 550; padding: 2px 0; }
.month-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; min-height: 116px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.month-day.out { opacity: .45; }
.month-day.is-today { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 31, 43,.08); }
.month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.month-num { font-family: var(--serif); font-size: 17px; font-weight: 500; color: inherit; text-decoration: none; padding: 0 5px; border-radius: 6px; }
.month-num:hover { background: var(--line-2); color: var(--brand); }
.month-count { font-size: 11px; font-weight: 600; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, white); border-radius: 99px; padding: 1px 7px; }
.month-item { --c: var(--brand); text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 6px; padding: 2px 6px; cursor: pointer; font-size: 11.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-item:hover { background: color-mix(in srgb, var(--c) 17%, white); }
.month-item b { font-variant-numeric: tabular-nums; }
.month-item.st-cancelado, .month-item.st-faltou { opacity: .5; text-decoration: line-through; }
.month-more { font-size: 11.5px; color: var(--brand); padding: 0 5px; text-decoration: none; }

/* ---------- gráfico */
.chart { position: relative; height: 210px; padding: 6px 0 22px 54px; }
.chart-grid { position: absolute; inset: 6px 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid div { border-top: 1px solid var(--line-2); position: relative; }
.chart-grid div:last-child { border-top-color: var(--line); }
.chart-grid span { position: absolute; left: 0; top: -8px; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chart-bars { position: relative; height: 100%; display: flex; align-items: flex-end; gap: 3px; }
.bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.bar { width: 100%; max-width: 26px; border-radius: 4px 4px 1px 1px; background: var(--brand); min-height: 2px; transition: background .15s; }
.bar.today { background: var(--gold); }
.bar.zero { background: var(--line); }
.bar-wrap:hover .bar { background: var(--brand-2); }
.bar-wrap > span { position: absolute; bottom: -20px; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11.5px; padding: 5px 8px; border-radius: 7px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 5; }
.bar-wrap:hover .bar-tip { opacity: 1; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 8px 22px; }
.hbar-track { grid-column: span 2; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.hbar strong { font-weight: 550; font-size: 13px; }
.hbar span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- modal */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(15, 26, 23, .42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px; animation: fadein .15s ease; overflow-y: auto; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: 100%; max-width: 620px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 48px); animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { max-width: 820px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 6px; }
.modal > header h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -.015em; }
.modal-body { padding: 14px 24px 22px; overflow-y: auto; }
.modal > footer { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modal > footer .spacer { flex: 1; }
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 18px 0 4px; }
.dl dt { font-size: 11.5px; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .06em; }
.dl dd { margin: 3px 0 0; font-weight: 550; }
.note { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }
.detail-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-row { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.profile { display: flex; gap: 18px; align-items: center; }
.profile h4 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.profile p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; margin: 20px 0; }
.stats div { background: var(--surface); padding: 12px 14px; }
.stats small { display: block; color: var(--muted); font-size: 11.5px; }
.stats strong { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.history { border: 1px solid var(--line-2); border-radius: 12px; max-height: 280px; overflow-y: auto; }
.history .list-item { padding: 10px 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; transition: box-shadow .15s; }
.swatches input:checked + i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 220px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }

/* ---------- toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-md); font-size: 13.5px; animation: pop .2s ease; }
.toast .ic { color: #7FD1A6; }
.toast.err { background: #7A2E2A; }
.toast.err .ic { color: #FFB4AC; }

/* ---------- equipe */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.member { padding: 20px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.member:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.member-top { display: flex; gap: 14px; align-items: center; }
.member-top strong { display: block; font-size: 15px; font-weight: 600; }
.member-top small { color: var(--muted); font-size: 12.5px; }
.member-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.member-foot { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.member-foot b { color: var(--ink); font-weight: 600; }

/* mensagens */
.msg { display: flex; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line-2); }
.msg:first-child { border-top: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-head strong { font-weight: 600; }
.msg-head time { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bubble { margin-top: 8px; padding: 10px 13px; border-radius: 4px 14px 14px 14px; background: #F8ECEE; color: #4A1A22; font-size: 13.5px; white-space: pre-wrap; max-width: 620px; line-height: 1.5; }
.msg-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tpl { padding: 18px 22px; border-top: 1px solid var(--line-2); }
.tpl:first-child { border-top: 0; }
.tpl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.tpl-head strong { font-weight: 600; }
.tpl-head small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.vars code { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; color: var(--ink-2); }
.radio-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; align-items: flex-start; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--brand); }
.radio-card strong { display: block; font-weight: 600; }
.radio-card small { color: var(--muted); font-size: 12.5px; }

/* ---------- responsivo */
@media (max-width: 1200px) {
  .kpis, .kpis.k5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px 36px; min-height: auto; }
  .auth-copy { margin: 40px 0 0; }
  .auth-points { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s ease; }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15,26,23,.4); }
  .menu-btn { display: inline-grid; }
  .top { padding: 16px 16px 14px; position: sticky; top: 0; z-index: 20; background: rgba(245,243,238,.92); backdrop-filter: blur(10px); }
  .top h1 { font-size: 22px; }
  .top-actions .btn span.lbl { display: none; }
  .view { padding: 0 16px 40px; }
  .grid-2, .grid-2-eq, .grid-3 { grid-template-columns: 1fr; }
  .legend { display: none; }
  .week { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .month { gap: 3px; }
  .month-day { min-height: 58px; padding: 4px 2px; align-items: center; }
  .month-head { flex-direction: column; gap: 2px; }
  .month-item, .month-more { display: none; }
  .cal-scroll { max-height: calc(100vh - 190px); }
  .cal-pro { gap: 8px; padding: 0 10px; }
}
@media (max-width: 560px) {
  .kpis, .kpis.k5 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-top .ic { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .dl, .checks { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .modal-bg { padding: 0; align-items: end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal > footer { border-radius: 0; }
  .modal > footer .btn { flex: 1; }
  .modal > footer .spacer { display: none; }
  #toasts { left: 16px; right: 16px; }
  .toast { min-width: 0; }
  .hide-sm { display: none; }
}

/* ---------- marca Aura */
.brand span { font-family: 'Cinzel', var(--serif); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 19px; }
.brand .logo { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.auth-logo { position: relative; z-index: 1; }
.auth-logo svg { width: 104px; height: 104px; border-radius: 50%; box-shadow: 0 10px 40px rgba(0,0,0,.35); display: block; }
.auth-card h2, .auth-copy h1 { font-feature-settings: normal; }
