/* MANÁ MOVE — design system (tokens extraídos do projeto Lovable) */
:root {
  --background: hsl(222 24% 5%);
  --foreground: hsl(210 40% 98%);
  --card: hsl(222 19% 7%);
  --card-2: hsl(222 17% 9%);
  --popover: hsl(240 10% 6%);
  --primary: #00d6d1;
  --primary-strong: #00aaa6;
  --primary-soft: rgb(0 214 209 / .14);
  --secondary: hsl(220 15% 12%);
  --muted: hsl(220 13% 15%);
  --muted-foreground: hsl(215 16% 61%);
  --border: hsl(220 15% 16%);
  --danger: hsl(0 72% 51%);
  --warning: hsl(38 92% 50%);
  --success: hsl(152 60% 42%);
  --info: hsl(210 90% 58%);
  --radius: 14px;
  --sidebar-w: 250px;
}
[data-theme="light"] {
  --background: hsl(210 25% 97%);
  --foreground: hsl(222 30% 12%);
  --card: hsl(0 0% 100%);
  --card-2: hsl(210 22% 96%);
  --popover: hsl(0 0% 100%);
  --primary: #00aaa6;
  --primary-strong: #007f7c;
  --primary-soft: rgb(0 170 166 / .11);
  --secondary: hsl(210 18% 93%);
  --muted: hsl(210 15% 90%);
  --muted-foreground: hsl(215 14% 42%);
  --border: hsl(214 20% 86%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(circle at 75% -20%, hsl(172 66% 40% / .055), transparent 32%), var(--background);
  color: var(--foreground);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1 { font-size: clamp(23px, 2vw, 28px); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- auth ---------- */
#auth-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 20px;
}
.logo-circle {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--primary) url('data:image/webp;base64,UklGRn4VAABXRUJQVlA4WAoAAAAgAAAA/wAA/wAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZWUDggkBMAAPBUAJ0BKgABAAE+USaRRaOiIZGqxRg4BQSxN3C36G6p3+0/lj4jlkOq/2X9g/7f+0nzo1b+g/0/84/kP1B6APT58O/M/8n/aP3J/uv/////4e/wH+A9hPmBfqJ/sf7V/a/+5/l+4B+5HqA/X79e/dr/r3/O/4XuK/sH+0/0nuDfyz+of9bsGfQE/pP+l//Hrgf+3/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;
  color: transparent; font-size: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-sub { color: var(--muted-foreground); }

/* ---------- shell ---------- */
#app-shell { display: flex; min-height: 100vh; }
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: hsl(222 20% 6% / .96);
  border-right: 1px solid hsl(220 15% 18%); padding: 22px 14px 16px;
  display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.side-brand .logo-circle { width: 40px; height: 40px; box-shadow: 0 0 0 1px hsl(0 0% 100% / .12); }
.side-brand b { font-size: 14px; letter-spacing: .025em; }
.side-brand .muted { color: hsl(215 13% 58%); }
.side-section { margin: 15px 10px 7px; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.3px; color: hsl(215 14% 56%); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 11px;
  border-radius: 9px; color: hsl(215 18% 78%); cursor: pointer;
  font-size: 13px; font-weight: 500; border: none; background: none; width: 100%; text-align: left;
  transition: color .18s ease, background .18s ease;
}
.nav-item:hover { background: hsl(220 16% 12%); color: var(--foreground); filter: none; }
.nav-item.active { background: linear-gradient(90deg, hsl(172 66% 40% / .16), hsl(172 66% 40% / .08)); color: hsl(172 72% 51%); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--primary); }
.nav-item .ico { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 18px; }
.nav-item .ico svg { width: 17px; height: 17px; stroke-width: 1.8; }
.side-account { display: flex; align-items: center; gap: 10px; margin: 12px 4px 8px; padding: 12px 8px; border-top: 1px solid var(--border); }
.account-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.account-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
.account-copy span { color: var(--muted-foreground); font-size: 10.5px; }
.nav-logout { color: hsl(215 13% 58%); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 16px; }
.aviso-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.aviso-item.nova { border-left: 3px solid var(--primary); background: var(--primary-soft); }
.aviso-item:hover { border-color: var(--primary); }
.agenda-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.agenda-toggle input { width: auto; margin: 0; }
#main { flex: 1; width: 100%; padding: 30px 34px 56px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-bar { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; margin: 0; }
.filter-field > span { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-foreground); }
.filter-field select, .filter-field input { height: 38px; min-width: 140px; }
.filter-search { min-width: 220px; }
.filter-search input { width: 220px; }
.filter-clear { height: 38px; }
.filter-summary { min-height: 18px; margin: -14px 0 10px; text-align: right; }
.topbar > div > .small { display: inline-block; margin-top: 5px; line-height: 1.5; max-width: 760px; }
.route-view { min-width: 0; animation: page-in .16s ease-out; }
.page-loading { display: flex; gap: 6px; align-items: center; min-height: 42px; color: var(--muted-foreground); }
.page-loading span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: load-dot .8s ease-in-out infinite alternate; }
.page-loading span:nth-child(2) { animation-delay: .15s; }
.page-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes page-in { from { opacity: 0; transform: translateY(3px); } }
@keyframes load-dot { to { opacity: .25; transform: translateY(-3px); } }

/* ---------- componentes ---------- */
.card {
  background: linear-gradient(145deg, hsl(222 19% 8%), hsl(222 19% 6.5%)); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: 0 12px 30px rgb(0 0 0 / .08);
}
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .val { font-size: 24px; font-weight: 700; }
.kpi .lbl { color: var(--muted-foreground); font-size: 12.5px; }
.kpi.accent .val { color: var(--primary); }

button, .btn {
  font-family: inherit; font-size: 13.5px; cursor: pointer;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--secondary); color: var(--foreground);
  padding: 8px 14px; transition: filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.1); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #04231d; font-weight: 600; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-ghost { background: transparent; }

input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--foreground);
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
label { display: block; font-size: 12.5px; font-weight: 600; margin: 10px 0 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted-foreground); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .75px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: hsl(172 66% 40% / .035); }
.table-wrap { overflow-x: auto; border-radius: calc(var(--radius) - 2px); }
.help-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.help-item:last-of-type { border-bottom: 0; }
.help-item p { line-height: 1.45; }
.help-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.help-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }

[data-theme="light"] body { background: radial-gradient(circle at 75% -20%, hsl(172 66% 40% / .08), transparent 34%), var(--background); }
[data-theme="light"] #sidebar { background: hsl(0 0% 100% / .96); border-right-color: var(--border); }
[data-theme="light"] .side-brand .muted,
[data-theme="light"] .account-copy span,
[data-theme="light"] .nav-logout { color: hsl(215 14% 42%); }
[data-theme="light"] .side-section { color: hsl(215 15% 43%); }
[data-theme="light"] .nav-item { color: hsl(218 20% 27%); }
[data-theme="light"] .nav-item:hover { background: hsl(210 22% 95%); color: hsl(222 30% 12%); }
[data-theme="light"] .nav-item.active { color: var(--primary-strong); }
[data-theme="light"] .card { background: linear-gradient(145deg, #fff, hsl(210 25% 98%)); box-shadow: 0 10px 28px rgb(30 45 55 / .055); }
[data-theme="light"] .btn-primary { color: #002c2b; }

.badge { display: inline-block; padding: 2.5px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.status-quick { padding: 0; border: 0; background: transparent; box-shadow: none; line-height: 1; cursor: pointer; }
.status-quick:hover, .status-quick:focus-visible { background: transparent; box-shadow: 0 0 0 2px var(--primary-soft); outline: none; }
.badge.green { background: hsl(152 60% 42% / .15); color: var(--success); }
.badge.yellow { background: hsl(38 92% 50% / .14); color: var(--warning); }
.badge.red { background: hsl(0 72% 51% / .14); color: var(--danger); }
.badge.blue { background: hsl(210 90% 58% / .14); color: var(--info); }
.badge.gray { background: var(--muted); color: var(--muted-foreground); }
.badge.teal { background: var(--primary-soft); color: var(--primary); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 14px; cursor: pointer; border: none; background: none;
  color: var(--muted-foreground); font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* modal */
#modal-overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 560px; padding: 22px; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted-foreground); }

/* toast */
#toast-area { position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--primary); border-radius: 10px;
  padding: 12px 16px; min-width: 240px; max-width: 380px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .4); animation: slide-in .2s ease; }
.toast.err { border-left-color: var(--danger); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }

/* kanban CRM */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 230px; width: 230px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; transition: border-color .15s ease, background .15s ease; }
.kanban-col h3 { padding: 4px 6px 10px; display: flex; justify-content: space-between; }
.kanban-items { min-height: 82px; }
.kanban-card { background: var(--card-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px; margin-bottom: 8px; cursor: grab;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease; touch-action: pan-y; }
.kanban-card:hover { border-color: var(--primary); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: .35; border-style: dashed; }
.kanban-col.drag-over { border-color: var(--primary); background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary); }
.kanban-empty { min-height: 64px; display: grid; place-items: center; padding: 10px;
  border: 1px dashed var(--border); border-radius: 9px; color: var(--muted-foreground);
  font-size: 11px; text-align: center; }
.kanban-touch-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0;
  opacity: .92; box-shadow: 0 12px 30px rgb(0 0 0 / .28); transform: rotate(1deg); }
.recall-list { display: grid; gap: 8px; margin-top: 12px; }
.recall-row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--border); }
@media (max-width: 700px) { .recall-row { align-items: flex-start; flex-direction: column; } }
/* pacotes do cliente no CRM (modal do lead) */
.crm-packages { display: grid; gap: 8px; margin-top: 6px; }
.crm-package { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 12px; background: var(--card-2); border: 1px solid var(--border); border-radius: 9px; }
.crm-package-saldo { display: grid; justify-items: center; min-width: 72px; text-align: center; line-height: 1.1; }
.crm-package-saldo b { font-size: 20px; color: var(--primary); }
.crm-package-saldo.muted b { color: var(--muted-foreground); }
/* tela Pacotes: destaque do saldo que pede renovação */
.pk-saldo-zero b { color: var(--danger); }
.pk-saldo-um b { color: var(--warning); }

/* agenda */
.view-switch { display: inline-flex; gap: 2px; margin-top: 12px; padding: 3px; border-radius: 9px; background: var(--secondary); }
.view-switch button { padding: 5px 13px; border: 0; background: transparent; color: var(--muted-foreground); }
.view-switch button.active { background: var(--card); color: var(--foreground); box-shadow: 0 1px 4px rgb(0 0 0 / .18); }
.agenda-surface { padding: 0 20px 20px; overflow-x: auto; }
.agenda-error { min-height: 160px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted-foreground); }
.agenda-grid { display: grid; grid-template-columns: 56px 1fr; gap: 0; }
.agenda-hour { color: var(--muted-foreground); font-size: 11px; padding: 6px 6px 0 0;
  text-align: right; border-top: 1px solid var(--border); height: 64px; }
.agenda-slot { border-top: 1px solid var(--border); height: 64px; position: relative;
  cursor: pointer; padding: 0 4px; overflow: visible; }
.agenda-slot:hover { background: var(--card-2); }
.appt-chip { background: var(--primary); color: #fff; border: 0; border-radius: 7px; font-size: 11px;
  padding: 4px 7px; cursor: pointer; max-width: 220px; overflow: hidden; text-align: left; }
.appt-chip b, .appt-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-chip span { margin-top: 2px; font-size: 10px; opacity: .88; }
.appt-chip.compact { display: block; width: 100%; max-width: none; padding: 4px 6px; margin-bottom: 3px; }
.appt-chip.timed { position: absolute; z-index: 2; top: var(--appt-top); left: calc(var(--appt-left) + 3px);
  width: calc(var(--appt-width) - 6px); height: var(--appt-height); max-width: none; min-height: 30px; }
.appt-chip.timed:hover { z-index: 4; filter: brightness(1.06); box-shadow: 0 5px 14px rgb(0 0 0 / .22); }
.appt-chip[draggable="true"] { cursor: grab; touch-action: auto; }
.appt-chip.dragging { opacity: .35; }
.appt-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; touch-action: none; }
.appt-resize::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 28px; height: 3px; margin-left: -14px; border-radius: 2px; background: rgb(255 255 255 / .55); opacity: 0; transition: opacity .15s; }
.appt-chip:hover .appt-resize::after, .appt-chip.resizing .appt-resize::after { opacity: 1; }
.appt-chip.resizing { z-index: 5; box-shadow: 0 5px 14px rgb(0 0 0 / .22); }
@media (pointer: coarse) { .appt-resize { height: 12px; } .appt-resize::after { opacity: 1; } }
.agenda-slot.drag-over, .week-slot.drag-over, .month-day.drag-over { background: var(--primary-soft); outline: 2px solid var(--primary); outline-offset: -2px; }
.touch-drag-ghost { position: fixed !important; z-index: 1000 !important; width: min(230px, 65vw) !important; height: auto !important;
  transform: translate(-50%, -115%); pointer-events: none; opacity: .92; box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
.agenda-week-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(105px, 1fr)); min-width: 820px; }
.week-corner, .week-head { position: sticky; top: 0; z-index: 2; min-height: 58px; border-bottom: 1px solid var(--border); background: var(--card); }
.week-head { border: 0; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 0; color: var(--muted-foreground); }
.week-head span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.week-head b { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-top: 2px; font-size: 14px; }
.week-head.today b { border-radius: 50%; background: var(--primary); color: #fff; }
.week-slot { height: 64px; padding: 0 3px; border-left: 1px solid var(--border); border-top: 1px solid var(--border); cursor: pointer; position: relative; overflow: visible; }
.week-slot:hover { background: var(--card-2); }
/* Semana no celular: a coluna de horários fica presa à esquerda ao arrastar para o lado. */
.agenda-week-grid .agenda-hour { position: sticky; left: 0; z-index: 6; background: var(--card); }
.agenda-week-grid .week-corner { left: 0; z-index: 7; }
.agenda-month-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); min-width: 790px; }
.month-weekday { padding: 13px 10px 9px; color: var(--muted-foreground); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.month-day { min-height: 118px; padding: 7px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); cursor: pointer; }
.month-day:nth-child(7n + 8) { border-left: 0; }
.month-day:hover { background: var(--card-2); }
.month-day.outside { opacity: .42; }
.month-number { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 12px; }
.month-day.today .month-number { background: var(--primary); color: #fff; font-weight: 700; }
.month-items { margin-top: 4px; }
.month-more { border: 0; background: transparent; padding: 2px 4px; color: var(--muted-foreground); font-size: 10px; }
.appt-chip.st-agendado { background: hsl(174 66% 34%); color: #fff; }
.appt-chip.st-realizado { background: hsl(152 55% 38%); color: #fff; }
.appt-chip.st-faltou { background: hsl(0 67% 48%); color: #fff; }
.appt-chip.st-cancelado { background: hsl(215 14% 45%); color: #fff; }

/* Disponibilidade profissional */
.availability-toolbar { display:flex; align-items:end; justify-content:space-between; gap:16px; flex-wrap:wrap; padding:14px 18px; }
.availability-toolbar label { margin:0; min-width:220px; }
.availability-toolbar select { margin-top:4px; }
.availability-legend { display:flex; align-items:center; gap:7px; margin:14px 2px 8px; color:var(--muted-foreground); font-size:13px; }
.availability-legend .blocked { margin-left:12px; }
.availability-dot { display:inline-block; width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.availability-dot.available { background:#16a36a; }
.availability-dot.blocked { background:#d95858; }
.availability-title { font-size:18px; font-weight:800; margin:14px 0 9px; }
/* (grade antiga de cartoes removida: a tela virou grade de horarios) */

@media (max-width: 900px) {
}

/* timeline prontuario */
.timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 18px; }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* processos: etapas conectadas a partir do fluxo cadastrado */
.process-flow { display: grid; gap: 20px; max-width: 620px; }
.process-step { position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-2); }
.process-step:not(:last-child)::after { content: ''; position: absolute; left: 28px; top: 100%;
  width: 1px; height: 21px; background: var(--primary); }
.process-step > span { display: grid; place-items: center; flex: 0 0 24px; height: 24px;
  border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700; }

/* login publico / booking */
/* agenda pública: mesma linguagem visual do app (cartões, seções, chips) */
.booking-wrap { max-width: 680px; margin: 0 auto; padding: 34px 16px 48px; }
.booking-head { text-align: center; margin-bottom: 20px; }
.booking-head h1 { font-size: 26px; margin-top: 12px; }
.booking-head p { max-width: 460px; margin: 6px auto 0; color: var(--muted-foreground); font-size: 14px; }
#bk-card { padding: 0; overflow: hidden; }
.booking-section { padding: 22px 24px; border-top: 1px solid var(--border); }
#bk-card > .booking-section:first-child, #bk-main > .booking-section:first-of-type { border-top: 0; }
.booking-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 4px; }
.booking-titulo b { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted-foreground); }
.booking-section > p.small { margin-bottom: 10px; }
.booking-wrap label { margin-top: 14px; }
.booking-wrap .field-row > div > label:first-child { margin-top: 6px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 6px; }
.slot-btn { padding: 11px 8px; font-size: 13.5px; font-weight: 600; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border); }
.slot-btn:hover { border-color: var(--primary); color: var(--primary); filter: none; }
.slot-btn.sel { background: var(--primary); border-color: var(--primary); color: #04231d; font-weight: 700;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.booking-rodape { text-align: center; margin-top: 18px; color: var(--muted-foreground); font-size: 12px; }
@media (max-width: 560px) { .booking-section { padding: 18px 16px; } }

#menu-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 60;
  width: 42px; height: 42px; border-radius: 10px; padding: 0;
  background: var(--card); border: 1px solid var(--border); }
#menu-toggle svg { width: 18px; height: 18px; }
#sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  #menu-toggle { display: block; }
  #sidebar { position: fixed; left: 0; top: 0; z-index: 50; height: 100vh;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgb(0 0 0 / .5); }
  body.side-open #sidebar { transform: translateX(0); }
  #sidebar-backdrop { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; padding: 0;
    border: 0; border-radius: 0; background: rgb(0 0 0 / .52); opacity: 0; pointer-events: none;
    display: block; transition: opacity .2s ease; }
  body.side-open #sidebar-backdrop { opacity: 1; pointer-events: auto; }
  #main { padding: 16px; padding-top: 62px; }
  .agenda-surface { overflow-x: auto; padding: 0 12px 12px; }
  .filter-bar { width: 100%; justify-content: stretch; }
  .filter-field, .filter-search { flex: 1 1 145px; }
  .filter-field select, .filter-field input, .filter-search input { width: 100%; }
  .filter-clear { flex: 1 1 auto; }
  .filter-summary { text-align: left; }
}

@media print { #menu-toggle { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* impressão: fundo claro e sem navegação */
@media print {
  :root { --background: #fff; --foreground: #111; --card: #fff; --card-2: #fff;
    --border: #ccc; --muted-foreground: #444; --secondary: #eee; --muted: #eee; }
  #sidebar, .topbar button, .topbar select, .topbar input, .topbar .filter-field,
  #toast-area, .tabs, .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  /* DRE: sem isto as colunas de meses somem no PDF em vez de quebrar a página. */
  #dre-print-area .table-wrap { overflow: visible !important; }
  #dre-print-area table { page-break-inside: auto; }
  #dre-print-area tr { page-break-inside: avoid; }
}

/* DRE: cada bloco é uma tabela, então as colunas só se alinham com largura fixa. */
#dre-print-area table { table-layout: fixed; width: 100%; }
#dre-print-area table td:first-child, #dre-print-area table th:first-child { width: 34%; }
#dre-print-area .dre-resultado td { border-top: 2px solid var(--border); }
#dre-print-area .dre-cabecalho h3 { margin: 0 0 2px; }
.booking-appointment{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
.checkin-alert{display:flex;align-items:center;gap:12px;padding:12px 14px;margin-bottom:12px;border:1px solid color-mix(in srgb,var(--primary) 35%,var(--border));background:color-mix(in srgb,var(--primary) 8%,var(--surface));border-radius:var(--radius);color:var(--text)}
.checkin-alert svg{width:20px;color:var(--primary);flex:none}.checkin-alert span{display:block;font-size:12px;color:var(--text-muted);margin-top:2px}
.ranking-row{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--border)}.ranking-row:last-child{border-bottom:0}.ranking-row .grow span{display:block}.ranking-position{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--muted);font-weight:700;color:var(--primary)}
.monthly-chart,.grouped-chart{min-height:195px;display:flex;align-items:end;gap:10px;padding:22px 8px 0;overflow-x:auto}.monthly-column{min-width:42px;flex:1;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:11px}.monthly-column>b{color:var(--foreground)}.monthly-bar{width:min(42px,80%);border-radius:10px 10px 2px 2px;background:linear-gradient(180deg,#00d6d1,#009b98)}
.chart-legend{display:flex;flex-wrap:wrap;gap:10px;font-size:11px}.chart-legend span{display:inline-flex;align-items:center;gap:4px}.chart-legend i{width:9px;height:9px;border-radius:2px}.grouped-month{min-width:60px;flex:1;text-align:center;font-size:11px}.grouped-bars{height:150px;display:flex;align-items:end;justify-content:center;gap:3px}.grouped-bars>div{min-width:10px;max-width:22px;flex:1;border-radius:3px 3px 0 0;position:relative}.grouped-bars b{position:absolute;top:-16px;left:50%;transform:translateX(-50%);font-size:9px;color:var(--foreground)}
.performance-ranking{display:grid;gap:7px}.performance-row{display:grid;grid-template-columns:24px minmax(90px,145px) 1fr 34px;gap:7px;align-items:center;font-size:12px}.performance-row>span{color:var(--muted-foreground);text-align:right}.performance-row>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.performance-row>div{height:13px;background:var(--muted);border-radius:7px;overflow:hidden}.performance-row i{display:block;height:100%;background:linear-gradient(90deg,#00aaa6,#00d6d1)}.performance-row strong{text-align:right}
.ranking-matrix th,.ranking-matrix td{text-align:center}.ranking-matrix th:first-child,.ranking-matrix td:first-child{text-align:left;position:sticky;left:0;background:var(--card)}.ranking-matrix td.best{background:#20d9d2;color:#062825;font-weight:800}
.chart-generator{position:relative;overflow:hidden}.chart-generator::after{content:'';position:absolute;right:-54px;top:-72px;width:180px;height:180px;border:28px solid var(--primary-soft);border-radius:50%;pointer-events:none}.chart-generator>.topbar,.chart-output{position:relative;z-index:1}.chart-generator select{min-width:min(300px,60vw)}.chart-output{min-height:90px;padding-top:4px}
@media(max-width:600px){.booking-appointment{align-items:flex-start;flex-direction:column}}
.field-char-count{text-align:right;margin-top:4px;font-variant-numeric:tabular-nums}
.smart-patient-results{position:absolute;z-index:80;left:0;right:0;top:100%;margin-top:4px;padding:6px;background:var(--popover);border:1px solid var(--border);border-radius:10px;box-shadow:0 10px 30px rgb(0 0 0 / .25);max-height:280px;overflow:auto;min-width:280px}.smart-patient-results button{display:flex;width:100%;justify-content:space-between;align-items:center;gap:10px;padding:10px;border:0;background:transparent;text-align:left}.smart-patient-results button:hover{background:var(--muted)}.smart-patient-results button span{font-size:12px;color:var(--muted-foreground)}.smart-patient-results p{padding:10px}.field-row>div:has(.smart-patient-results){position:relative}

/* demonstrativo de repasse (Meu Financeiro e extrato da Gestao) */
.demonstrativo{display:grid;grid-template-columns:minmax(260px,340px) 1fr;gap:14px;align-items:start}
.demonstrativo-ajustes{grid-column:1/-1}
.demonstrativo-resumo h2{font-size:19px}
.demonstrativo-resumo p{margin:2px 0}
.demonstrativo-resumo table td{padding:5px 0;border-bottom:1px solid var(--border)}
.demonstrativo-resumo table tr:last-child td{border-bottom:0}
.demonstrativo-lista .topbar{margin-bottom:8px}
.dem-check{display:inline-flex;align-items:center;cursor:pointer}
.dem-check input{width:18px;height:18px;accent-color:var(--primary);cursor:pointer}
.dem-check input:disabled{cursor:not-allowed;opacity:.6}
@media(max-width:820px){.demonstrativo{grid-template-columns:1fr}}
.appt-remarcado{font-weight:400;opacity:.85}

/* lista de notas fiscais: linhas compactas, sem quebra feia, acoes sempre visiveis */
.nf-sub { display: block; margin-top: 2px; font-size: 11px; line-height: 1.3; }
.nf-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.nf-nome, .nf-unidade { display: block; max-width: 230px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
.nf-unidade { max-width: 140px; }
.nowrap { white-space: nowrap; }
table td.right.nowrap { position: sticky; right: 0; background: var(--card);
  box-shadow: -8px 0 8px -8px rgb(0 0 0 / .25); }
table td.right.nowrap .btn-sm { margin-left: 4px; }
tbody tr:hover td.right.nowrap { background: color-mix(in srgb, var(--primary) 4%, var(--card)); }
@media (max-width: 900px) { .nf-nome { max-width: 150px; } table td.right.nowrap { position: static; box-shadow: none; } }

/* Minha disponibilidade: grade de horários (estilo Google Agenda) */
.availability-surface { padding: 0; overflow: auto; max-height: 72vh; }
.availability-grid { --av-colunas: 7; --av-linhas: 17; --av-hora: 56px; --av-col: 120px; --av-rotulo: 56px;
  display: grid; grid-template-columns: var(--av-rotulo) repeat(var(--av-colunas), minmax(var(--av-col), 1fr));
  grid-template-rows: auto repeat(var(--av-linhas), var(--av-hora));
  /* Largura vem das proprias colunas: no modo Dia a grade cabe na tela do celular
     em vez do min-width fixo antigo, que forcava rolagem lateral com uma coluna so. */
  min-width: min-content; position: relative; user-select: none; }
.av-corner { left: 0; z-index: 4; }
.av-corner, .av-head { position: sticky; top: 0; z-index: 3; min-height: 54px; padding: 8px 4px;
  text-align: center; background: var(--card); border-bottom: 1px solid var(--border); }
.av-head { border-left: 1px solid var(--border); }
.av-head span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-foreground); }
.av-head b { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-top: 2px; font-size: 14px; }
.av-head.today b { border-radius: 50%; background: var(--primary); color: #fff; }
.av-hour { height: var(--av-hora); padding: 4px 6px 0 0; text-align: right; font-size: 11px;
  color: var(--muted-foreground); border-top: 1px solid var(--border);
  position: sticky; left: 0; z-index: 2; background: var(--card); }
.av-slot { height: var(--av-hora); border-top: 1px solid var(--border); border-left: 1px solid var(--border);
  /* Era pan-y, que travava o arraste lateral da semana no celular. Nao existe
     handler de toque na grade, entao 'auto' e o valor certo. */
  cursor: cell; touch-action: auto; }
.av-slot:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
/* Coluna sobreposta: os blocos ficam posicionados por horário, sem atrapalhar o arraste */
.av-col { grid-row: 2 / -1; position: relative; pointer-events: none; overflow: hidden; }
.av-block { position: absolute; left: 3px; right: 3px; padding: 4px 7px; border: 0; border-left: 4px solid;
  border-radius: 8px; text-align: left; color: var(--foreground); overflow: hidden; pointer-events: auto;
  cursor: pointer; font-size: 11px; }
.av-block b { display: block; }
.av-block span { display: block; font-size: 10px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-block.available { background: color-mix(in srgb, #16a36a 22%, var(--card)); border-color: #16a36a; }
.av-block.blocked { background: color-mix(in srgb, #d95858 20%, var(--card)); border-color: #d95858; }
.av-block:hover { filter: brightness(1.06); box-shadow: 0 4px 12px rgb(0 0 0 / .18); }
.av-selecao { position: absolute; left: 3px; right: 3px; z-index: 2; display: grid; place-items: center;
  border-radius: 8px; font-size: 11px; font-weight: 700; color: #04231d;
  background: color-mix(in srgb, var(--primary) 55%, transparent); border: 1px solid var(--primary); }
.av-repete { display: grid; gap: 6px; margin-top: 4px; }
.av-opcao { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-weight: 400; }
.av-opcao:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 700px) {
  /* --av-hora fica em 56px: o JS posiciona os blocos com ALTURA = 56 em px
     absolutos, entao encolher a linha aqui jogaria os blocos fora do lugar. */
  .availability-grid { --av-col: 88px; --av-rotulo: 44px; }
  .availability-toolbar { gap: 10px; padding: 12px 14px; }
  .availability-toolbar label { min-width: 100%; }
  .availability-legend { flex-wrap: wrap; gap: 5px 7px; font-size: 12px; margin: 10px 2px 6px; }
  .availability-legend .blocked { margin-left: 0; }
  .availability-title { font-size: 16px; margin: 10px 0 6px; }
  .availability-surface { max-height: 62vh; }
  .av-hour { font-size: 10px; padding-right: 4px; }
}

/* area do paciente: resumo de sessoes e pacote contratado */
.booking-resumo { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.booking-resumo > div { flex: 1 1 120px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); }
.booking-resumo b { display: block; font-size: 20px; line-height: 1.1; }
.booking-resumo span { font-size: 11px; color: var(--muted-foreground); }
.booking-pacote { padding: 11px 13px; margin-bottom: 9px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); }
.booking-barra { height: 8px; margin: 8px 0 5px; border-radius: 6px; background: var(--muted); overflow: hidden; }
.booking-barra i { display: block; height: 100%; background: var(--primary); }

/* lista de caixas de selecao (ex.: unidades onde o servico e oferecido) */
.check-list { display: grid; gap: 5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.check-item { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.check-item input { width: 16px; height: 16px; accent-color: var(--primary); }

/* aviso de reavaliacao na penultima/ultima sessao do pacote */
.aviso-reavaliacao { margin: 10px 0; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  color: var(--foreground); border: 1px solid color-mix(in srgb, #e0a83c 45%, var(--border));
  background: color-mix(in srgb, #e0a83c 14%, var(--card)); }

/* --- Tarefas e aniversarios --- */
.kanban-col.hoje { border-color: var(--primary); }
.kanban-col.hoje h3 { color: var(--primary); }
.kanban-col.mural-col { min-width: 260px; width: 260px; }
.tarefa-card b { display: block; margin-bottom: 3px; }
.tarefa-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; }

.aniv-list { display: flex; flex-direction: column; gap: 2px; }
.aniv-day { display: flex; gap: 14px; align-items: flex-start;
  padding: 9px 6px; border-bottom: 1px solid var(--border); }
.aniv-day:last-child { border-bottom: 0; }
.aniv-day.hoje { background: var(--primary-soft); border-radius: 8px; }
.aniv-date { min-width: 46px; text-align: center; line-height: 1.1; }
.aniv-date b { font-size: 18px; }
.aniv-date span { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted-foreground); }
.aniv-people { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-top: 2px; }
.aniv-person { display: inline-flex; align-items: center; gap: 6px; }

.agenda-birthdays { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px; margin-bottom: 10px; border: 1px dashed var(--border);
  border-radius: 9px; background: var(--card-2); }
.agenda-birthdays .aniv-tag { display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 2px 9px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary); }
.agenda-birthdays .aniv-when { color: var(--muted-foreground); font-size: 11px; }

/* Aviso de bloqueio de disponibilidade dentro do formulário da agenda. */
.ag-bloqueio { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border-color: #d9a300; background: color-mix(in srgb, #d9a300 10%, var(--card)); }
.ag-bloqueio span { flex: 1; min-width: 200px; font-size: 12.5px; }

/* Logística: checklist do dia e alerta de estoque no mínimo. */
.lg-lista { display: grid; gap: 2px; }
.lg-item { display: flex; align-items: flex-start; gap: 11px; margin: 0; padding: 11px 4px;
  border-bottom: 1px solid var(--border); font-weight: 400; }
.lg-item:last-child { border-bottom: 0; }
.lg-item input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.lg-item input:disabled, .lg-item button:disabled { opacity: .5; cursor: not-allowed; }
.lg-item .status-quick { flex: none; align-self: center; }
.lg-item span { display: block; }
.lg-item .small { margin-top: 2px; }
.lg-item.feito b { text-decoration: line-through; color: var(--muted-foreground); }
.lg-alerta { color: #d95858; font-weight: 700; }

/* Biblioteca de Exercícios: filtros em blocos de caixas de marcar. */
.ex-grupo { padding: 9px 0; border-bottom: 1px solid var(--border); }
.ex-grupo:last-child { border-bottom: 0; }
.ex-grupo > b { display: block; margin-bottom: 6px; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .5px; font-size: 11px; }
.ex-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 20px; cursor: pointer;
  font-weight: 400; font-size: 12.5px; }
.ex-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.ex-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* Pré-visualização de documento do prontuário (imagem ou PDF) dentro do modal.
   Overlay próprio, empilhado acima do modal do prontuário. */
#preview-overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; z-index: 110; overflow-y: auto; }
.doc-preview { min-height: 240px; }
.doc-preview img { max-width: 100%; max-height: 68vh; display: block; margin: 0 auto;
  border-radius: var(--radius); background: var(--muted); }
.doc-preview iframe { width: 100%; height: 68vh; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; }
@media (max-width: 700px) {
  .doc-preview img, .doc-preview iframe { max-height: 60vh; height: 60vh; }
  .doc-preview img { height: auto; }
}

/* Entradas: campos editáveis direto na linha, sem abrir o formulário. */
.cell-edit { width: 100%; min-width: 110px; max-width: 190px; padding: 5px 7px;
  font-size: 12.5px; border: 1px solid transparent; background: transparent;
  border-radius: 7px; color: var(--foreground); }
.cell-edit:hover, .cell-edit:focus { border-color: var(--border); background: var(--card-2); }
.cell-edit:disabled { opacity: .6; }
.cell-edit.cell-ok { border-color: #16a36a; background: color-mix(in srgb, #16a36a 12%, transparent); }

/* Desmembramento de recebimento: uma linha por paciente. */
.dm-linha { display: grid; grid-template-columns: 1.6fr 1fr 1fr 110px 34px; gap: 7px;
  align-items: center; margin-bottom: 7px; }
.dm-linha select, .dm-linha input { margin: 0; }
@media (max-width: 700px) { .dm-linha { grid-template-columns: 1fr 1fr; } }

/* Prévia da importação OFX: linha que parece duplicada fica destacada. */
.ofx-dup { background: color-mix(in srgb, #d9a300 10%, transparent); }
.check-line{display:flex;align-items:center;gap:8px;margin-top:10px;font-weight:500}.check-line input{width:18px;height:18px;accent-color:var(--primary);margin:0}
