/* Super Beauty — sistema visual
   Vinho #650D24 · hover #510A1D · rosé #C89599 · blush #EDD6D2 · marfim #FAF6F1 · carvão #302729
   Títulos: Cormorant Garamond · Interface: Inter */

:root {
  --wine: #650D24;
  --wine-hover: #510A1D;
  --wine-deep: #3F0716;
  --rose: #C89599;
  --blush: #EDD6D2;
  --blush-soft: #F6E9E6;
  --ivory: #FAF6F1;
  --ivory-2: #F3ECE4;
  --charcoal: #302729;
  --surface: #FFFFFF;
  --muted: #6F6266;
  --border: #E5D8D6;
  --border-strong: #CDB9B6;

  --ok: #1F6B45;      --ok-bg: #E7F3EC;
  --warn: #8A5A00;    --warn-bg: #FBF1DC;
  --err: #A1242B;     --err-bg: #FBE9E9;
  --info: #2D5B86;    --info-bg: #E8F0F8;
  --neutral: #5D5457; --neutral-bg: #F1ECEA;

  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;

  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(48, 39, 41, .05);
  --shadow: 0 1px 2px rgba(48, 39, 41, .04), 0 6px 20px -8px rgba(48, 39, 41, .12);
  --shadow-lg: 0 24px 60px -20px rgba(63, 7, 22, .35);
  --sidebar-w: 256px;
  --page-pad: 32px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--ivory); color: var(--charcoal);
  font: 400 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
img { max-width: 100%; display: block; }
a { color: var(--wine); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.num, .money, td.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.005em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--blush); color: var(--wine-deep); }

/* ───────── Layout geral ───────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--wine);
  color: #F7ECEA; display: flex; flex-direction: column; padding: 22px 14px 14px;
  background-image: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.08));
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; text-decoration: none; color: inherit; }
.sidebar .brand img { width: 40px; height: 40px; filter: brightness(0) invert(1); opacity: .95; }
.sidebar .brand b { font: 600 25px/1 var(--font-display); letter-spacing: .01em; }
.sidebar .brand small { display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; margin-top: 4px; }
.nav-group { margin: 8px 0 6px; }
.nav-group > span { display: block; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .6; padding: 10px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  color: rgba(255, 245, 243, .86); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s var(--ease), color .15s;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a[aria-current='page'] { background: var(--ivory); color: var(--wine); font-weight: 600; box-shadow: 0 6px 18px -10px rgba(0,0,0,.5); }
.nav a[aria-current='page'] svg { opacity: 1; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--rose); color: var(--wine-deep); border-radius: 99px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.me:hover { background: rgba(255,255,255,.07); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blush); color: var(--wine); font-weight: 700; font-size: 13px; }
.me .who { min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: 13.5px; }
.me .who small { font-size: 11.5px; opacity: .7; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { padding: 28px var(--page-pad) 48px; max-width: 1360px; width: 100%; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .titles { min-width: 0; }
.eyebrow { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.page-title { font: 600 38px/1.08 var(--font-display); color: var(--charcoal); }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ───────── Cartões ───────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .display { font-size: 22px; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* KPIs */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; text-decoration: none; color: inherit; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
a.kpi:hover { border-color: var(--rose); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font: 600 28px/1.1 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--charcoal); }
.kpi .hint { font-size: 12px; color: var(--muted); }
.kpi.hero { background: var(--wine); color: var(--ivory); border-color: var(--wine); }
.kpi.hero .label, .kpi.hero .hint { color: rgba(250, 246, 241, .78); }
.kpi.hero .value { color: #fff; font-size: 32px; }
.kpi .tone { position: absolute; top: 16px; right: 16px; width: 8px; height: 8px; border-radius: 50%; }
.nodata { color: var(--muted); font-size: 18px !important; font-weight: 500 !important; }

/* ───────── Botões ───────── */
.btn {
  --bg: var(--surface); --fg: var(--charcoal); --bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--rose); background: var(--blush-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy='true'] { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn-primary { --bg: var(--wine); --fg: var(--ivory); --bd: var(--wine); box-shadow: 0 6px 16px -8px rgba(101, 13, 36, .55); }
.btn-primary:hover { background: var(--wine-hover); border-color: var(--wine-hover); color: #fff; }
.btn-ghost { --bg: transparent; --bd: transparent; color: var(--wine); }
.btn-ghost:hover { background: var(--blush-soft); border-color: transparent; }
.btn-danger { --bg: var(--surface); --fg: var(--err); --bd: #E6B8BB; }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn-danger-solid { --bg: var(--err); --fg: #fff; --bd: var(--err); }
.btn-danger-solid:hover { background: #861c22; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn-block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Formulários ───────── */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--charcoal); }
.field .req { color: var(--wine); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--err); font-weight: 500; display: none; }
.field.has-error .error { display: block; }
.field.has-error .input { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23650D24' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover { border-color: var(--rose); }
.input:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(101, 13, 36, .12); }
.input[readonly] { background: var(--ivory); }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r) 0 0 var(--r); background: var(--ivory); color: var(--muted); font-size: 14px; }
.input-group .input { border-radius: 0 var(--r) var(--r) 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--wine); flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; max-width: 460px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar select.input { width: auto; min-width: 150px; }
.toolbar .search .input { width: 100%; }

/* Segmentado e abas */
.seg { display: inline-flex; background: var(--ivory-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: transparent; padding: 0 14px; min-height: 36px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--wine); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 12px 14px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; min-height: 44px; }
.tabs [aria-selected='true'] { color: var(--wine); border-bottom-color: var(--wine); }
.tabs .count { font-size: 11px; background: var(--ivory-2); border-radius: 99px; padding: 1px 7px; margin-left: 6px; color: var(--muted); }

/* ───────── Badges (estado sempre com texto + ícone) ───────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; background: var(--neutral-bg); color: var(--neutral); }
.badge svg { width: 13px; height: 13px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.wine { background: var(--blush); color: var(--wine); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ───────── Tabelas (viram cards no celular) ───────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--border); background: #FDFBF9; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--blush-soft); }
.table td.num, .table th.num { text-align: right; }
.table td.actions-cell { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: #FDFBF9; border-top: 1px solid var(--border); }

/* Lista em cards */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--blush-soft); }
button.list-item { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { font-size: 13px; color: var(--muted); }
.time-chip { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--wine); min-width: 52px; font-size: 15px; }

/* ───────── Estados ───────── */
.state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 44px 20px; color: var(--muted); }
.state .ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--blush-soft); color: var(--wine); }
.state .ico svg { width: 24px; height: 24px; }
.state h3 { color: var(--charcoal); font: 600 22px/1.2 var(--font-display); }
.state p { max-width: 420px; font-size: 14px; }
.state.error .ico { background: var(--err-bg); color: var(--err); }
.skeleton { background: linear-gradient(90deg, var(--ivory-2) 25%, #F8F2EC 37%, var(--ivory-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--info-bg); color: var(--info); font-size: 13.5px; border: 1px solid rgba(45, 91, 134, .15); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(138, 90, 0, .18); }
.notice.err { background: var(--err-bg); color: var(--err); border-color: rgba(161, 36, 43, .18); }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(31, 107, 69, .18); }
.notice.wine { background: var(--blush-soft); color: var(--wine); border-color: var(--blush); }

/* ───────── Gaveta / modal ───────── */
.overlay { position: fixed; inset: 0; background: rgba(48, 20, 28, .42); backdrop-filter: blur(2px); z-index: 80; opacity: 0; transition: opacity .18s; }
.overlay.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(560px, 100vw); background: var(--ivory); z-index: 90;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .22s var(--ease);
}
.drawer.wide { width: min(820px, 100vw); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--surface); padding-top: calc(18px + var(--safe-t)); }
.drawer-head h2 { font: 600 24px/1.15 var(--font-display); flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.drawer-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98); opacity: 0; z-index: 95; width: min(460px, calc(100vw - 32px));
  max-height: min(86dvh, 720px); overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); transition: transform .18s var(--ease), opacity .18s;
}
.modal.open { transform: translate(-50%, -50%); opacity: 1; }
.modal .m-body { padding: 24px 24px 8px; }
.modal h2 { font: 600 24px/1.2 var(--font-display); margin-bottom: 8px; }
.modal .m-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px 22px; flex-wrap: wrap; }
body.lock { overflow: hidden; }

/* Toasts */
.toasts { position: fixed; z-index: 120; right: 20px; bottom: calc(20px + var(--safe-b)); display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--charcoal); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .2s var(--ease); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #8BD3A9; } .toast.err { background: #6E1218; } .toast.warn svg { color: #F3C96B; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ───────── Agenda ───────── */
.cal { display: grid; min-width: 0; }
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head .date-title { font: 600 26px/1.1 var(--font-display); min-width: 0; }
.cal-head .date-title::first-letter { text-transform: uppercase; }
.timegrid { display: grid; position: relative; overflow: auto; max-height: calc(100dvh - 250px); min-height: 420px; }
.tg-cols { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr)); min-width: 0; }
.tg-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border); }
.tg-head > div { padding: 10px 8px; font-size: 12.5px; font-weight: 600; text-align: center; border-left: 1px solid var(--border); min-width: 0; }
.tg-head > div:first-child { border-left: 0; }
.tg-head .today { color: var(--wine); }
.tg-body { position: relative; }
.tg-hours { position: relative; }
.tg-hours div { height: var(--hour-h); font-size: 11px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.tg-col { position: relative; border-left: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-h) - 1px), var(--border) calc(var(--hour-h) - 1px), var(--border) var(--hour-h)); }
.tg-col.off { background-color: #FBF7F3; }
.tg-slot { position: absolute; left: 0; right: 0; cursor: pointer; }
.tg-slot:hover { background: rgba(237, 214, 210, .45); }
.ev {
  position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 5px 8px; font-size: 12px; overflow: hidden; cursor: pointer;
  background: var(--blush-soft); border: 1px solid var(--blush); border-left: 3px solid var(--wine); color: var(--charcoal); text-align: left; line-height: 1.3;
  transition: box-shadow .15s, transform .12s;
}
.ev:hover { box-shadow: var(--shadow); z-index: 2; }
.ev b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }
.ev.st-confirmado { background: #fff; }
.ev.st-chegou, .ev.st-em_atendimento { background: var(--info-bg); border-color: #CADBEE; border-left-color: var(--info); }
.ev.st-concluido { background: var(--ok-bg); border-color: #C8E3D3; border-left-color: var(--ok); }
.ev.st-cancelado, .ev.st-faltou { background: #F5F1F0; border-color: var(--border); border-left-color: #A89B9E; color: var(--muted); text-decoration: line-through; opacity: .8; }
.ev.st-aguardando { background: var(--warn-bg); border-color: #F0DDB3; border-left-color: var(--warn); }
.ev.block { background: repeating-linear-gradient(135deg, #F3ECE8, #F3ECE8 6px, #EFE6E1 6px, #EFE6E1 12px); border: 1px dashed var(--border-strong); border-left: 1px dashed var(--border-strong); color: var(--muted); cursor: default; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--err); z-index: 2; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--err); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.month .dow { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; background: #FDFBF9; border-bottom: 1px solid var(--border); }
.month .day { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: none; border-top: 0; border-left: 0; text-align: left; }
.month .day:nth-child(7n) { border-right: 0; }
.month .day:hover { background: var(--blush-soft); }
.month .day.other { background: #FCFAF8; color: #B5A9AC; }
.month .day .n { font-size: 13px; font-weight: 600; }
.month .day.today .n { background: var(--wine); color: #fff; border-radius: 99px; width: 26px; height: 26px; display: grid; place-items: center; }
.month .pill { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--blush-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month .more { font-size: 11px; color: var(--wine); font-weight: 600; }

/* Gráficos */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--font-ui); fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; }
.bar-row .track { grid-column: 1 / -1; height: 8px; background: var(--ivory-2); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--wine); border-radius: 99px; }

/* Etapas (agendamento) */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--border); }
.steps span.done { background: var(--wine); }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; min-height: 64px; }
.choice:hover { border-color: var(--rose); }
.choice[aria-pressed='true'] { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(101, 13, 36, .12); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { min-height: 44px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot:hover { border-color: var(--wine); color: var(--wine); }
.slot[aria-pressed='true'] { background: var(--wine); color: #fff; border-color: var(--wine); }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.dayb { flex: none; width: 64px; min-height: 72px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-content: center; text-align: center; gap: 2px; }
.dayb small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.dayb b { font-size: 20px; }
.dayb[aria-pressed='true'] { background: var(--wine); border-color: var(--wine); color: #fff; }
.dayb[aria-pressed='true'] small { color: rgba(255,255,255,.8); }
.dayb[disabled] { opacity: .4; cursor: not-allowed; }

/* ───────── Autenticação ───────── */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-art { position: relative; background: var(--wine) url('/brand/08-fundo-login.png') center / cover no-repeat; color: var(--ivory); display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; overflow: hidden; }
.auth-art .logo { width: 200px; filter: brightness(0) invert(1); opacity: .95; }
.auth-art .quote { font: 500 34px/1.2 var(--font-display); max-width: 440px; }
.auth-art .foot { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .65; display: flex; justify-content: space-between; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--ivory); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .mobile-logo { display: none; width: 190px; margin: 0 auto 26px; }
.auth-box h1 { font: 600 44px/1.05 var(--font-display); margin-bottom: 8px; }
.auth-box .lead { color: var(--muted); margin-bottom: 24px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 2px; top: 2px; width: 42px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pw-wrap button svg { width: 19px; height: 19px; }

/* Portal da paciente / páginas públicas */
.public { min-height: 100dvh; background: var(--ivory); }
.public-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; padding-top: calc(14px + var(--safe-t)); background: rgba(250, 246, 241, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.public-top img { height: 34px; width: auto; }
.public-wrap { max-width: 760px; margin: 0 auto; padding: 24px 20px calc(48px + var(--safe-b)); }
.hero-banner { border-radius: var(--r-xl); background: var(--ivory-2) url('/brand/09-banner-agendamento.webp') right center / cover no-repeat; border: 1px solid var(--border); padding: 28px; min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.hero-banner h1 { font: 600 36px/1.1 var(--font-display); max-width: 70%; }

/* Impressão de documentos e comprovantes */
.paper { background: #fff; color: #222; font: 14px/1.55 var(--font-ui); }

/* Instalar app */
.install-hint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 12.5px; color: rgba(255,255,255,.9); border: 0; text-align: left; cursor: pointer; width: 100%; }
.install-hint svg { width: 18px; height: 18px; flex: none; }

/* Barra inferior no celular */
.bottom-nav { display: none; }

/* ───────── Responsivo ───────── */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  :root { --page-pad: 18px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 100; top: 0; left: 0; width: min(88vw, 320px); height: 100dvh; transform: translateX(-102%);
    transition: transform .22s var(--ease); padding-top: calc(18px + var(--safe-t)); padding-bottom: calc(14px + var(--safe-b)); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 40; padding: 8px 12px; padding-top: calc(8px + var(--safe-t));
    background: rgba(250, 246, 241, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .topbar .logo { height: 30px; width: auto; margin-right: auto; }
  .page { padding: 18px var(--page-pad) calc(96px + var(--safe-b)); }
  .page-title { font-size: 30px; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn-primary { flex: 1; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding-bottom: var(--safe-b);
  }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 3px; padding: 8px 4px 9px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; background: none; border: 0; min-height: 56px; cursor: pointer; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav [aria-current='page'] { color: var(--wine); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-box .mobile-logo { display: block; }
  .auth-box h1 { font-size: 36px; }
  .toasts { left: 16px; right: 16px; bottom: calc(76px + var(--safe-b)); max-width: none; }
  .timegrid { max-height: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-4.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 22px; }
  .kpi.hero .value { font-size: 26px; }
  .input, select.input, textarea.input { font-size: 16px; } /* evita zoom no iPhone */
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .toolbar > * { flex: 1 1 100%; }
  .toolbar .input, .toolbar select.input { width: 100%; min-width: 0; }
  .search { max-width: none; }
  /* Tabela → cards */
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; max-width: 45%; }
  .table.responsive td[data-label=''], .table.responsive td.primary { display: block; text-align: left; font-weight: 600; font-size: 15px; }
  .table.responsive td[data-label='']::before, .table.responsive td.primary::before { display: none; }
  .table.responsive td.actions-cell { justify-content: flex-end; padding-top: 8px; }
  .table.responsive tfoot { display: block; }
  .drawer, .drawer.wide { width: 100vw; }
  .drawer-foot .btn { flex: 1; }
  .modal .m-foot .btn { flex: 1; }
  .month .day { min-height: 64px; padding: 4px; }
  .month .pill { display: none; }
  .month .day .cnt { display: block; }
  .hero-banner h1 { font-size: 28px; max-width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
}
.month .day .cnt { display: none; font-size: 11px; color: var(--wine); font-weight: 700; }

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

@media print {
  .sidebar, .topbar, .bottom-nav, .page-head .actions, .toolbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Ícones soltos em listas e títulos */
.list-item > svg, .row > svg, .card-head svg, h2 > svg, h3 > svg, .meta svg { width: 18px; height: 18px; flex: none; }
.ico-inline { width: 16px; height: 16px; vertical-align: -3px; }

/* App da cliente */
.bn-dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--err); border: 2px solid #fff; }
.bottom-nav a { position: relative; }
@media (max-width: 960px) {
  .patient .top-tabs { display: none; }
  .patient .public-wrap { padding-bottom: calc(96px + var(--safe-b)); }
  .patient-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .hide-sm { display: none; } }

/* Ícone do "Sair" e de outros itens do rodapé do menu */
.me > svg { width: 20px; height: 20px; flex: none; margin: 0 7px; opacity: .85; }
