@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }
  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }
  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }

:root {
  --bg: #eef2f4;
  --bg-deep: #e5ebee;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --surface-3: #edf3f5;
  --ink: #0e1a22;
  --ink-2: #425560;
  --ink-3: #5f727d;
  --line: #dde6ea;
  --line-strong: #c8d5db;
  --brand: #0d5c55;
  --brand-700: #0a4a45;
  --brand-600: #0c544e;
  --brand-soft: #e2f0ed;
  --brand-ink: #07332f;
  --info: #1f5f8b;
  --info-soft: #e7f1f8;
  --success: #176b45;
  --success-soft: #e6f3ec;
  --warning: #7a4a00;
  --warning-soft: #fbf0dd;
  --danger: #a82a2a;
  --danger-soft: #fbeaea;
  --sidebar: #0d1a21;
  --sidebar-2: #132730;
  --sidebar-ink: #d8e3e8;
  --sidebar-muted: #93a7b0;
  --sidebar-line: #223640;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 24, 32, .06);
  --shadow-md: 0 8px 24px rgba(10, 24, 32, .09);
  --shadow-lg: 0 28px 70px rgba(8, 20, 28, .22);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --topbar-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-700); }
img, svg { max-width: 100%; }
::selection { background: #b9ded7; color: var(--brand-ink); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.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;
}

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.shell { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 10px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  z-index: 60;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 4px 6px; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: #12453f;
  border: 1px solid #1d5b54;
  border-radius: 9px;
  color: #8fd6c8;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.03em; color: #fff; line-height: 1.1; }
.brand-sub { display: block; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--sidebar-muted); font-weight: 600; margin-top: 1px; }
.sidebar-close { margin-left: auto; display: none; color: var(--sidebar-ink); }

.sidebar-context {
  display: flex; align-items: center; gap: 8px;
  background: var(--sidebar-2);
  border: 1px solid var(--sidebar-line);
  border-radius: 9px;
  padding: 7px 9px;
}
.sidebar-context .od-icon { color: #83c9bb; flex: none; }
.sidebar-context-name { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.25; }
.sidebar-context-meta { font-size: 11px; color: var(--sidebar-muted); line-height: 1.3; }

.sidebar-nav {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px;
  padding-right: 3px; scrollbar-width: thin; scrollbar-color: #2c4650 transparent;
  overscroll-behavior: contain;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #2c4650; border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.nav-group { margin-top: 8px; }
.nav-group:first-child { margin-top: 0; }
.nav-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: #7d939d; font-weight: 700; padding: 0 8px 4px;
}
.nav-label::after { content: ''; flex: 1; height: 1px; background: var(--sidebar-line); opacity: .65; }
.nav-group-toggle {
  width: 100%; display: flex; align-items: center; gap: 7px;
  margin: 0; padding: 5px 8px; border: 0; border-radius: 6px;
  background: transparent; color: #7d939d;
  font-family: inherit; font-size: 9.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; text-align: left;
  cursor: pointer;
}
.nav-group-title { order: 1; white-space: nowrap; }
.nav-group-toggle::after { content: ''; order: 2; flex: 1; height: 1px; background: var(--sidebar-line); opacity: .65; }
.nav-group-alert { order: 3; width: 6px; height: 6px; border-radius: 50%; flex: none; background: #d98a6a; }
.nav-group:not(.is-collapsed) .nav-group-alert { display: none; }
.nav-group-chev { order: 4; display: inline-grid; place-items: center; color: #8fa9b3; transition: transform .18s ease, color .16s ease; }
.nav-group-toggle:hover { color: #b9cdd3; }
.nav-group-toggle:hover .nav-group-chev { color: #cfe4df; }
.nav-group.is-collapsed .nav-group-chev { transform: rotate(-90deg); }
.nav-group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .18s ease; }
.nav-group.is-collapsed .nav-group-body { grid-template-rows: 0fr; }
.nav-group-items { display: flex; flex-direction: column; gap: 1px; overflow: hidden; min-height: 0; padding-top: 1px; visibility: visible; }
.nav-group.is-collapsed .nav-group-items { visibility: hidden; transition: visibility 0s linear .18s; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 5px 8px; min-height: 32px;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--sidebar-ink);
  font-size: 13.5px; font-weight: 500; text-align: left; line-height: 1.3;
  transition: background .16s ease, color .16s ease;
}
.nav-item .od-icon { color: #8fa9b3; flex: none; }
.nav-item > span:not(.nav-badge) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item:hover .od-icon { color: #cfe4df; }
.nav-item[aria-current="page"] {
  background: rgba(52, 166, 148, .18);
  color: #fff;
  box-shadow: inset 2px 0 0 #56c9b7;
  font-weight: 600;
}
.nav-item[aria-current="page"] .od-icon { color: #7edccc; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: #2f7a71; color: #fff;
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav-badge.alert { background: #9a4a32; }
.sidebar-foot { border-top: 1px solid var(--sidebar-line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.nav-label-foot { padding: 2px 8px 5px; margin-top: 0; }
.isolation {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; padding: 6px 8px; border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--sidebar-line);
  color: var(--sidebar-muted);
  font-size: 10.5px; line-height: 1.3; white-space: nowrap; overflow: hidden;
}
.isolation .od-icon { color: #6fbfb0; flex: none; }
.isolation strong { color: #cfe0e5; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.sidebar-scrim { position: fixed; inset: 0; background: rgba(6, 14, 19, .55); z-index: 55; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h);
  padding: 0 26px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.context-btn {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 5px 11px 5px 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; text-align: left;
  transition: border-color .16s ease, background .16s ease;
}
.context-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.context-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-700);
}
.context-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.context-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-3); }
.context-name { font-size: 14px; font-weight: 600; color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-btn .chev { color: var(--ink-3); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.demo-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-3); font-size: 11.5px; font-weight: 600;
}
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 4px 12px; margin-left: 2px;
  border: 0; background: transparent;
  border-left: 1px solid var(--line);
  border-radius: 0 9px 9px 0;
  min-height: 44px;
}
.user-chip:hover { background: var(--surface-2); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta span { font-size: 11.5px; color: var(--ink-3); }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand-700); border-color: #c4e0db; }
.icon-badge {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px;
  display: grid; place-items: center; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border: 2px solid var(--surface);
}

/* ---------- Popovers ---------- */
.popover {
  position: fixed; z-index: 90;
  width: min(370px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
}
.pop-head { padding: 8px 10px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 46px; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent;
  text-align: left; color: var(--ink);
}
.pop-item:hover { background: var(--surface-2); }
.pop-item .od-icon { color: var(--ink-3); }
.pop-item-body { flex: 1; min-width: 0; }
.pop-item-title { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.pop-item-meta { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.35; margin-top: 1px; }
.pop-check { color: var(--brand); }
.pop-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-note { padding: 6px 10px 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.pop-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--ink-3); }
.alert-item .alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
.alert-item .tone-danger { background: var(--danger); }
.alert-item .tone-warning { background: #b7791f; }
.alert-item .tone-info { background: var(--info); }
.alert-item .tone-success { background: var(--success); }

/* ---------- Main ---------- */
#main { flex: 1; padding: 18px 26px 44px; width: 100%; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head-copy { flex: 1 1 420px; min-width: 0; }
.eyebrow {
  font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; margin-bottom: 3px;
}
.page-head h1 { font-size: 25px; line-height: 1.15; color: var(--ink); }
.lede { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; max-width: 76ch; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.btn .od-icon { flex: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-primary:disabled { background: #b7c6c3; border-color: #b7c6c3; color: #36433f; cursor: not-allowed; }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: var(--surface-2); border-color: #adbfc7; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: #e3bcbc; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #d4a3a3; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; color: var(--brand-700); font-weight: 600; padding: 0; min-height: 0; border-radius: 3px; text-decoration: underline; text-underline-offset: 3px; }
.link { border: 0; background: none; color: var(--brand-700); font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip-brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-neutral { background: var(--surface-3); color: var(--ink-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--ink-2);
  font-size: 11px; font-weight: 600;
}

/* ---------- Avatars ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 68px; height: 68px; font-size: 22px; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head-copy { flex: 1; min-width: 0; }
.card-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.card-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.section-gap { margin-top: 16px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 14px 13px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.kpi-meta { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.kpi-meta strong { color: var(--ink-2); font-weight: 600; }
.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }

/* ---------- Funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 134px minmax(0, 1fr) 46px; align-items: center; gap: 10px; }
.funnel-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.funnel-count { font-size: 13px; font-weight: 700; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.funnel-track { height: 11px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 999px; min-width: 4px; transition: width .3s ease; }
.funnel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

/* ---------- Lists ---------- */
.day-list { display: flex; flex-direction: column; }
.day-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.day-row:last-child { border-bottom: 0; padding-bottom: 0; }
.day-row:first-child { padding-top: 0; }
.day-time { font-size: 12.5px; font-weight: 700; color: var(--ink-2); width: 44px; flex: none; font-variant-numeric: tabular-nums; }
.day-main { flex: 1; min-width: 0; }
.day-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.day-meta { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; line-height: 1.35; }

.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; padding-bottom: 0; }
.task-check {
  width: 21px; height: 21px; flex: none; border-radius: 6px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; margin-top: 1px; color: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.task-check:hover { border-color: var(--brand); }
.task-check.done { background: var(--brand); border-color: var(--brand); }
.task-main { flex: 1; min-width: 0; }
.task-title { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.task-row.done .task-title { color: var(--ink-3); text-decoration: line-through; }
.task-meta { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.task-meta .overdue { color: var(--danger); font-weight: 600; }

.avatar-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar-row-text { min-width: 0; }
.avatar-row-title { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.avatar-row-meta { font-size: 11.5px; color: var(--ink-3); display: block; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; }
.rtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rtable th {
  text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.rtable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr:hover { background: var(--surface-2); }
.rtable td strong { color: var(--ink); font-weight: 600; }
.rtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtable .actions { text-align: right; white-space: nowrap; }
.rtable .muted { color: var(--ink-3); }
.table-note { font-size: 12px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
.table-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.search-box { position: relative; flex: 1 1 240px; max-width: 340px; }
.search-box .od-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box input { padding-left: 36px; }
.count-note { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Inputs ---------- */
input, select, textarea {
  width: 100%; min-height: 40px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select { padding-right: 30px; }
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #8697a0; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 92, 85, .14);
}
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); }
input.invalid:focus, select.invalid:focus, textarea.invalid:focus { box-shadow: 0 0 0 3px rgba(168, 42, 42, .14); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.field-error { font-size: 12px; color: var(--danger); font-weight: 500; line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.span-2 { grid-column: span 2; }
.form-errors {
  background: var(--danger-soft);
  border: 1px solid #ecc6c6;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #7e2222;
  margin-bottom: 13px;
}
.form-errors strong { display: block; margin-bottom: 4px; }
.form-errors ul { margin: 0; padding-left: 16px; }
.form-errors li { margin: 2px 0; }
.form-errors .link { color: #7e2222; font-size: 12.5px; }
.check-row { display: flex; flex-direction: row; align-items: flex-start; gap: 9px; }
.check-row input { width: 18px; min-height: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.check-row label { font-size: 13px; line-height: 1.45; color: var(--ink-2); font-weight: 400; }
.check-row .field-error { width: 100%; }

/* ---------- Page furniture ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px; line-height: 1.5;
}
.banner .od-icon { flex: none; margin-top: 1px; }
.banner-body { flex: 1; min-width: 0; }
.banner strong { font-weight: 600; }
.banner-info { background: var(--info-soft); border-color: #c7dfef; color: #174a6b; }
.banner-warning { background: var(--warning-soft); border-color: #ecd5ac; color: #6b4100; }
.banner-danger { background: var(--danger-soft); border-color: #ecc6c6; color: #7e2222; }
.banner-success { background: var(--success-soft); border-color: #bfe0cd; color: #125437; }
.banner-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.access-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 26px;
  background: #133c46; color: #e2f0ee;
  font-size: 13px; line-height: 1.45;
}
.access-banner .od-icon { color: #8fd6c8; }
.access-banner strong { color: #fff; }
.access-banner .btn { margin-left: auto; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.access-banner .btn:hover { background: rgba(255,255,255,.18); }

.empty {
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.empty-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 10px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--brand);
}
.empty strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 3px; }
.empty p { font-size: 13px; max-width: 44ch; margin: 0 auto; line-height: 1.5; }
.empty .btn { margin-top: 12px; }

.callout {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.callout strong { color: var(--ink); }
.callout ul { margin: 6px 0 0; padding-left: 17px; }
.callout li { margin: 3px 0; }
.callout code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--ink); }

.person-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person-name { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.person-meta { color: var(--ink-3); font-size: 12px; }
.person-line .person-name { display: block; }
.person-line .person-meta { display: block; margin-top: 2px; }
.rtable td[data-label="Contato"] { white-space: nowrap; }

.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.summary-cell { background: var(--surface); padding: 11px 14px; }
.summary-cell span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.summary-cell strong { display: block; font-family: var(--font-display); font-size: 19px; margin-top: 2px; font-variant-numeric: tabular-nums; }

.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.progress.warn > span { background: #b7791f; }
.progress.danger > span { background: var(--danger); }

.metric-line { display: flex; align-items: baseline; gap: 8px; }
.metric-line strong { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.metric-line span { font-size: 12px; color: var(--ink-3); }

/* ---------- Inbox ---------- */
.inbox-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.inbox-head-copy { flex: 1 1 420px; min-width: 0; }
.inbox-head-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.inbox-head-title .eyebrow { margin: 0; flex: none; }
.inbox-head-title h1 { font-size: 24px; line-height: 1.15; color: var(--ink); }
.inbox-head .lede { margin-top: 3px; font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.inbox-status {
  display: inline-flex; align-items: center; gap: 5px; align-self: center;
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); border: 1px solid #c4e0db;
  color: var(--brand-ink); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.inbox-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.inbox {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  height: calc(100dvh - 162px);
  min-height: 540px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.inbox-list-head { padding: 9px 10px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.filter-row { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); flex: none;
  border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 600; min-height: 27px;
}
.filter-chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.filter-chip[aria-pressed="true"] { background: var(--brand-soft); border-color: #c4e0db; color: var(--brand-ink); }
.inbox-list-head .count-note { font-size: 11px; }
.inbox-list-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.conv-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.conv-item:hover { background: var(--surface-2); }
.conv-item[aria-current="true"] { background: #eaf5f2; box-shadow: inset 2px 0 0 var(--brand); }
.conv-top { display: flex; align-items: center; gap: 8px; }
.conv-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11px; color: var(--ink-3); flex: none; }
.conv-preview { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.unread {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
}
.inbox-thread { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 9px; padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread-head-main { flex: 1; min-width: 170px; }
.thread-name { font-size: 14.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thread-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.assign-select { width: auto; min-width: 144px; min-height: 32px; font-size: 12px; padding: 5px 26px 5px 8px; }
.thread-scroll { overflow-y: auto; flex: 1; min-height: 0; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 10px; }
.msg-row { display: flex; gap: 8px; }
.msg-row.in { justify-content: flex-start; }
.msg-row.out { justify-content: flex-end; }
.msg-row.note { justify-content: center; }
.bubble {
  max-width: min(78%, 560px);
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(10,24,32,.03);
}
.msg-row.out .bubble { background: var(--brand); border-color: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-row.in .bubble { border-bottom-left-radius: 4px; }
.msg-meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.msg-row.out .msg-meta { color: #cfe6e1; justify-content: flex-end; }
.note-bubble {
  width: 100%;
  background: var(--warning-soft);
  border: 1px solid #ecd5ac;
  color: #5a3a06;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.5;
}
.note-label { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7a4a00; margin-bottom: 3px; }
.day-divider { align-self: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 14px 12px; }
.composer textarea { min-height: 50px; max-height: 150px; border-color: var(--line); background: var(--surface-2); resize: none; font-size: 13.5px; padding: 10px 11px; }
.composer-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.composer-hint { font-size: 11px; color: var(--ink-3); margin-right: auto; }
.quick-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 500; min-height: 26px; }
.quick-chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.note-toggle[aria-pressed="true"] { background: var(--warning-soft); border-color: #ecd5ac; color: #6b4100; }
.send-btn { min-width: 44px; }
.composer-disabled {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.inbox-context { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 13px; background: var(--surface); }
.ctx-block { border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.ctx-block:last-child { border-bottom: 0; padding-bottom: 0; }
.ctx-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.ctx-patient { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.ctx-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; }
.ctx-kv span { color: var(--ink-3); }
.ctx-kv strong { font-weight: 600; color: var(--ink); text-align: right; }
.thread-back { display: none; }

/* ---------- Kanban ---------- */
.crm-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-tools .search-box { max-width: 280px; }
.select-inline { width: auto; min-width: 150px; min-height: 38px; font-size: 13px; padding: 7px 30px 7px 10px; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 9px; min-width: 0; }
.kanban-head { display: flex; align-items: center; gap: 7px; padding: 2px 3px 9px; }
.kanban-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.kanban-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.kanban-count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; min-width: 21px; height: 19px; display: grid; place-items: center; padding: 0 5px; }
.opp-card {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px; margin-bottom: 7px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.opp-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.opp-name { font-size: 13px; font-weight: 600; line-height: 1.35; }
.opp-service { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.opp-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.opp-next { display: flex; align-items: flex-start; gap: 5px; font-size: 11px; color: var(--ink-2); margin-top: 8px; line-height: 1.35; }
.opp-next .od-icon { color: var(--ink-3); margin-top: 1px; }
.opp-next.late { color: var(--danger); }
.opp-next.late .od-icon { color: var(--danger); }
.opp-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.opp-owner { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-3); min-width: 0; }
.kanban-empty { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 14px 6px; border: 1px dashed var(--line-strong); border-radius: 8px; }

/* ---------- Agenda ---------- */
.agenda-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 10px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.agenda-bar-main { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.agenda-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.agenda-bar .view-toggle { margin-left: 0; }
.agenda-bar .select-inline { min-height: 34px; min-width: 176px; font-size: 12px; padding: 6px 28px 6px 9px; }
.agenda-today.is-current { background: var(--brand-soft); border-color: #c4e0db; color: var(--brand-ink); }
.agenda-range { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.25; margin-left: 2px; }
.agenda-range strong { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-range span { font-size: 11px; color: var(--ink-3); }

.agenda-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.agenda-stat {
  position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden;
  padding: 10px 11px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.agenda-stat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.agenda-stat.is-info .agenda-stat-icon { background: #e9f1f8; color: #1f5f8b; }
.agenda-stat.is-success .agenda-stat-icon { background: #eaf4ee; color: #1e6b4a; }
.agenda-stat.is-danger .agenda-stat-icon { background: #fbeeee; color: var(--danger); }
.agenda-stat.is-brand .agenda-stat-icon { background: var(--brand-soft); color: var(--brand-ink); }
.agenda-stat-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.agenda-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); }
.agenda-stat strong { font-size: 20px; line-height: 1.18; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.agenda-stat small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-stat-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-3); }
.agenda-stat-track i { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--brand); }

.date-nav { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.date-nav input { border: 0; min-height: 32px; width: 142px; font-size: 12.5px; padding: 5px 6px; background: transparent; color: var(--ink); }
.date-nav .icon-btn { width: 32px; height: 32px; }
.agenda-row td { vertical-align: top; }
.agenda-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.sync-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.sync-line .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.agenda-card .card-head { align-items: center; }
.agenda-card .table-wrap { overflow: visible; }
.agenda-table { border-collapse: collapse; }
.agenda-table thead th { font-size: 10.5px; letter-spacing: .06em; }
.agenda-table .appt-row td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.agenda-table .appt-row:last-child td { border-bottom: 0; }
.agenda-table .appt-row:hover td { background: #fafcfc; }
.agenda-table .appt-row.is-next td { background: #f3faf8; }
.agenda-table .appt-row.is-next td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.appt-when { width: 82px; }
.appt-time { display: block; font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.appt-flag {
  display: inline-flex; align-items: center; margin-top: 3px; padding: 1px 6px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 9.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.appt-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.appt-person-copy { display: flex; flex-direction: column; min-width: 0; }
.appt-person-copy strong { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-person-copy span { font-size: 11px; color: var(--ink-3); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-note { display: block; margin-top: 3px; font-size: 10.5px; line-height: 1.35; color: var(--ink-3); }
.appt-service { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.appt-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.appt-meta .od-icon { color: var(--ink-3); flex: none; }
.appt-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); margin: 0 2px; }
.appt-link {
  display: inline-block; margin-top: 3px; padding: 0; border: 0; background: transparent;
  color: var(--brand-ink); font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.appt-link:hover { text-decoration: underline; }
.appt-state .chip { white-space: nowrap; }
.agenda-table .agenda-actions { justify-content: flex-end; }
.agenda-table .agenda-actions .btn { min-height: 30px; padding: 0 9px; font-size: 12px; }
.agenda-table .appt-state { width: 132px; }
.agenda-table td.actions { position: relative; }
.row-menu { position: relative; display: inline-flex; flex-wrap: wrap; }
.row-menu summary { list-style: none; cursor: pointer; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-toggle .od-icon { margin-left: 2px; transition: transform .15s ease; }
.row-menu[open] .row-menu-toggle .od-icon { transform: rotate(180deg); }
.row-menu-list {
  position: absolute; right: 0; top: calc(100% + 5px); z-index: 12;
  display: flex; flex-direction: column; gap: 2px; width: max-content; min-width: 150px; max-width: 230px;
  padding: 5px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow-md);
}
.row-menu-list .btn { width: 100%; min-height: 30px; padding: 0 8px; font-size: 11.5px; justify-content: flex-start; }
.row-menu-list .btn:hover { background: var(--surface-2); }
.appt-cancelado .appt-time, .appt-cancelado .appt-person-copy strong { color: var(--ink-3); text-decoration: line-through; }
.appt-faltou .appt-time { color: var(--danger); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin: 16px 0 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.is-scrollable { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); }
.tabs.is-scrollable.is-end { -webkit-mask-image: none; mask-image: none; }
.tab {
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ink-3);
  padding: 9px 11px; font-size: 13px; font-weight: 600;
  white-space: nowrap; margin-bottom: -1px; min-height: 40px;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--brand-700); border-bottom-color: var(--brand); }

/* ---------- Patient ---------- */
.patient-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.patient-head-main { flex: 1; min-width: 240px; }
.patient-head h1 { font-size: 24px; }
.patient-sub { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.patient-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fact { min-width: 0; }
.fact span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.fact strong { display: block; font-size: 13px; color: var(--ink); margin-top: 2px; font-weight: 600; line-height: 1.4; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 11px; padding-bottom: 16px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-rail { width: 20px; flex: none; display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; flex: none; }
.timeline-line { width: 1px; flex: 1; background: var(--line); margin-top: 4px; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-main { flex: 1; min-width: 0; padding-bottom: 2px; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.timeline-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; line-height: 1.4; }
.doc-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11px; color: var(--ink-3); }

/* ---------- Cadences ---------- */
.summary-strip.summary-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cadence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.cadence-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cadence-wide { grid-column: 1 / -1; }
.cadence-top { display: flex; align-items: flex-start; gap: 11px; }
.cadence-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); }
.cadence-top-main { flex: 1; min-width: 0; }
.cadence-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.cadence-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.cad-version { font-size: 10.5px; font-weight: 700; color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; }
.cadence-trigger { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.switch {
  border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--ink-2);
  min-height: 30px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px; flex: none;
}
.switch::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.switch[aria-pressed="true"] { background: var(--success-soft); border-color: #bfe0cd; color: var(--success); }
.switch[aria-pressed="true"]::before { background: var(--success); }

.cadence-stats { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cadence-stat { flex: 1; padding: 7px 10px; background: var(--surface-2); }
.cadence-stat + .cadence-stat { border-left: 1px solid var(--line); }
.cadence-stat span { display: block; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.cadence-stat strong { display: block; font-family: var(--font-display); font-size: 16px; margin-top: 1px; font-variant-numeric: tabular-nums; }

.cad-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.cad-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cad-pill-num { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); font-size: 10px; font-weight: 700; }

.cad-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; padding-top: 11px; border-top: 1px dashed var(--line); }
.cad-step { display: flex; align-items: flex-start; gap: 9px; }
.cad-step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); font-size: 10.5px; font-weight: 700; }
.cad-step strong { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cad-step p { margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--ink-2); }

.cadence-foot { margin-top: auto; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.stop-rule { flex: 1; min-width: 160px; font-size: 11px; line-height: 1.4; color: var(--ink-3); }
.stop-rule strong { margin-right: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.cadence-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 860px) {
  .summary-strip.summary-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cadence-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cad-steps { grid-template-columns: 1fr; }
  .cadence-foot { align-items: flex-start; }
  .cadence-actions { width: 100%; }
  .cadence-actions .btn { flex: 1 1 auto; }
}

/* ---------- Experience ---------- */
.exp-hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.exp-nps-card, .exp-csat-card { display: flex; flex-direction: column; }
.exp-nps-body { display: grid; grid-template-columns: 154px minmax(0, 1fr); gap: 20px; align-items: stretch; flex: 1; margin-top: 12px; }
.exp-score-block { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-right: 18px; border-right: 1px solid var(--line); }
.exp-score-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.exp-score { display: flex; align-items: baseline; gap: 6px; color: var(--ink); }
.exp-score strong { font-family: var(--font-display); font-size: 48px; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.exp-score span { font-size: 12px; color: var(--ink-3); }
.exp-score-meta { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.exp-nps-detail { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.exp-seg-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.exp-seg-bar span { display: block; height: 100%; }
.exp-seg-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.exp-seg-item { min-width: 0; }
.exp-seg-name { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.exp-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.exp-seg-item strong { display: block; margin-top: 3px; font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.exp-seg-item strong small { margin-left: 4px; font-family: var(--font-body); font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.exp-rate-block { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.exp-rate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 11.5px; color: var(--ink-3); }
.exp-rate-head strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.exp-hint { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.exp-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.45; color: var(--ink-3); }
.exp-note .od-icon { flex: none; margin-top: 1px; color: var(--ink-3); }
.exp-note strong { color: var(--ink-2); }

.exp-csat-body { display: flex; flex-direction: column; gap: 10px; flex: 1; margin-top: 12px; }
.exp-csat-top { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.exp-csat-score { display: flex; align-items: baseline; gap: 4px; color: var(--ink); }
.exp-csat-score strong { font-family: var(--font-display); font-size: 48px; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.exp-csat-score span { font-size: 12px; color: var(--ink-3); }
.exp-stars { display: flex; gap: 2px; padding-bottom: 7px; color: var(--line-strong); }
.exp-star .od-icon { fill: currentColor; }
.exp-star.is-on { color: var(--brand); }
.exp-share { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.exp-share strong { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--brand-ink); }
.exp-rate-list { display: flex; flex-direction: column; gap: 5px; }
.exp-rate-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) 18px; align-items: center; gap: 7px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.exp-rate-row strong { text-align: right; color: var(--ink-2); font-weight: 600; }
.exp-rate-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.exp-rate-track i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.exp-empty-soft { display: grid; place-items: center; gap: 6px; padding: 18px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--ink-3); font-size: 11.5px; text-align: center; }
.exp-csat-card .exp-note, .exp-nps-card .exp-note { margin-top: auto; }

.exp-bottom { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.exp-feedback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.exp-feedback { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.exp-feedback:only-child { grid-column: 1 / -1; }
.exp-feedback-head { display: flex; align-items: flex-start; gap: 8px; }
.exp-feedback-who { flex: 1; min-width: 0; }
.exp-feedback-who strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-feedback-who span { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.exp-feedback-who .od-icon { color: var(--ink-3); }
.exp-score-pill { display: inline-flex; align-items: baseline; gap: 1px; flex: none; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.exp-score-pill small { font-size: 9px; font-weight: 600; opacity: .7; }
.is-promoter .exp-score-pill { background: var(--success-soft); color: var(--success); }
.is-passive .exp-score-pill { background: var(--surface-3); color: var(--ink-2); }
.is-detractor .exp-score-pill { background: var(--danger-soft); color: var(--danger); }
.exp-quote { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.exp-quote.is-empty { color: var(--ink-3); font-style: italic; }

.case-list { display: flex; flex-direction: column; gap: 10px; }
.case-item { display: flex; flex-direction: column; gap: 9px; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.case-item.is-open { border-left-color: #d3a3a3; }
.case-item.is-overdue { border-left-color: var(--danger); }
.case-item.is-resolved { background: var(--surface-2); }
.case-item-head { display: flex; align-items: flex-start; gap: 8px; }
.case-item-who { flex: 1; min-width: 0; }
.case-item-who strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-item-who span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.case-reason { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.case-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 10.5px; color: var(--ink-3); }
.case-meta span { display: inline-flex; align-items: center; gap: 5px; }
.case-meta .od-icon { flex: none; }
.case-due-late { color: var(--danger); font-weight: 600; }
.case-actions { margin-top: auto; padding-top: 2px; }
.case-actions .btn { width: 100%; justify-content: center; }
.case-resolution { display: flex; align-items: flex-start; gap: 6px; padding: 8px 9px; border-radius: 7px; background: var(--success-soft); color: #245843; font-size: 11px; line-height: 1.4; }
.case-resolution .od-icon { flex: none; margin-top: 1px; color: var(--success); }

@media (max-width: 1180px) {
  .exp-hero, .exp-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .exp-nps-body { grid-template-columns: 1fr; gap: 14px; }
  .exp-score-block { min-height: 0; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .exp-score strong { font-size: 42px; }
  .exp-feedback-grid { grid-template-columns: 1fr; }
  .exp-seg-legend { gap: 8px; }
  .exp-csat-score strong { font-size: 42px; }
}

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-embed { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.settings-embed-head { padding-top: 18px; border-top: 1px solid var(--line); }
.form-section { display: flex; flex-direction: column; gap: 13px; }
.form-section + .form-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-title { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.section-title span { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.whats-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.whats-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.whats-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex: none; }
.whats-icon.off { background: var(--danger-soft); color: var(--danger); }
.whats-icon.warn { background: var(--warning-soft); color: var(--warning); }
.whats-meta { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.whats-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.sim-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line); }
.sim-item:first-of-type { border-top: 0; padding-top: 2px; }
.sim-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sim-text { font-size: 13px; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.sim-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.sim-actions .btn { padding: 2px 7px; font-size: 11.5px; }
.kv-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.kv-list .ctx-kv { border-bottom: 1px dashed var(--line); padding-bottom: 6px; font-size: 12px; }
.kv-list .ctx-kv:last-child { border-bottom: 0; padding-bottom: 0; }
.permission-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.45; }
.permission-row:last-child { border-bottom: 0; }
.permission-row strong { display: block; font-size: 12.5px; color: var(--ink); }
.permission-row span { color: var(--ink-3); }

/* ---------- DKP ---------- */
.dkp-card { padding: 16px; }
.dkp-head { display: flex; align-items: flex-start; gap: 10px; }
.dkp-progress { margin-top: 9px; }
.dkp-progress-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.dkp-list { display: flex; flex-direction: column; gap: 9px; }
.dkp-list-item { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.45; }
.dkp-list-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 6px; }
.dkp-list-item strong { font-weight: 600; }
.dkp-list-item span { color: var(--ink-3); }
.priority-high { color: var(--danger); font-weight: 600; }
.priority-mid { color: var(--warning); font-weight: 600; }
.priority-low { color: var(--info); font-weight: 600; }

/* ---------- Dialogs ---------- */
.dlg {
  border: 0; padding: 0;
  width: min(600px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.dlg-sm { width: min(440px, calc(100vw - 28px)); }
.dlg-wide { width: min(760px, calc(100vw - 28px)); }
.dlg::backdrop { background: rgba(7, 15, 20, .55); backdrop-filter: blur(2px); }
.dlg[open] { animation: dlgIn .18s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.dlg-head > div:first-child { flex: 1; min-width: 0; }
.dlg-head h2 { font-size: 19px; }
.dlg-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; max-width: 56ch; }
.dlg-body { padding: 4px 20px 20px; overflow-y: auto; max-height: calc(100dvh - 170px); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.confirm-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; padding-top: 2px; }
.dlg .callout { margin-bottom: 13px; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  background: #10242c; color: #eef6f5;
  border: 1px solid #24414b;
  border-radius: 9px; padding: 10px 12px;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px; line-height: 1.45;
  animation: toastIn .2s ease-out;
}
.toast .od-icon { flex: none; margin-top: 1px; color: #8fd6c8; }
.toast-danger { background: #3a1616; border-color: #5c2626; }
.toast-danger .od-icon { color: #f0a3a3; }
.toast-warning { background: #3a2a12; border-color: #5c421f; }
.toast-warning .od-icon { color: #f2c27e; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Login ---------- */
body.logged-out .app,
body.logged-out .skip-link { display: none !important; }
body.logged-out { background: #0d1a21; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  background: var(--bg);
}
.login-brand {
  background:
    radial-gradient(1200px 680px at 12% -10%, rgba(86, 201, 183, .16), transparent 52%),
    linear-gradient(165deg, #0d1a21 0%, #132730 58%, #0d3d38 100%);
  color: #e8f3f1;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.login-brand-top { display: flex; align-items: center; gap: 12px; }
.login-logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: #12453f;
  border: 1px solid #1d5b54;
  border-radius: 12px;
  color: #8fd6c8;
}
.login-logo-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; color: #fff; }
.login-logo-sub { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #93a7b0; font-weight: 600; margin-top: 2px; }
.login-hero { margin-top: 56px; padding: 0 0 28px; max-width: 540px; }
.login-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  color: #fff;
  letter-spacing: -.03em;
}
.login-hero p { margin-top: 16px; font-size: 16px; line-height: 1.6; color: #c5d6d4; max-width: 48ch; }
.login-points { margin-top: 28px; display: grid; gap: 12px; }
.login-point { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: #d5e4e1; }
.login-point .od-icon { color: #7edccc; margin-top: 2px; }
.login-brand-foot { font-size: 12px; color: #7d939d; padding-top: 18px; border-top: 1px solid #223640; }

.login-panel {
  background: var(--surface);
  padding: 40px 42px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}
.login-panel h2 { font-size: 24px; }
.login-panel .lede { margin: 6px 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-accounts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.login-group { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); margin: 12px 0 4px; }
.login-account {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.login-account:hover { border-color: var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.login-account[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(13, 92, 85, .12); }
.login-account-body { flex: 1; min-width: 0; }
.login-account-name { display: block; font-size: 13.5px; font-weight: 600; }
.login-account-meta { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; line-height: 1.35; }
.login-hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.45; }
.login-mfa { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }

.home-queue { display: flex; flex-direction: column; }
.home-queue-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 11px 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit;
}
.home-queue-item:last-child { border-bottom: 0; }
.home-queue-item:hover { color: var(--ink); }
.tenant-status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 28px 24px 32px; }
  .login-hero { margin-top: 28px; padding: 8px 0 0; }
  .login-hero h1 { font-size: 28px; }
  .login-brand-foot { display: none; }
  .login-panel { min-height: auto; padding: 28px 22px 48px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1440px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1360px) {
  .inbox { grid-template-columns: 288px minmax(0, 1fr); }
  .inbox-context { display: none; }
  .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-even { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .patient-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cadence-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); overflow-y: auto; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-grid; }
  .sidebar-nav { flex: none; overflow: visible; padding-right: 0; }
  .sidebar-foot { margin-top: auto; }
  .nav-group-toggle { min-height: 36px; }
  .nav-item { min-height: 38px; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 18px; }
  #main { padding: 16px 18px 44px; }
  .context-name { max-width: 180px; }
  .table-wrap { overflow-x: auto; }
}
@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .demo-chip { display: none; }
  .inbox { grid-template-columns: 1fr; height: calc(100dvh - 174px); }
  .inbox-list { border-right: 0; }
  .inbox.mobile-thread .inbox-list { display: none; }
  .inbox:not(.mobile-thread) .inbox-thread { display: none; }
  .thread-back { display: inline-flex; }
  .user-meta { display: none; }
  .user-chip { padding-left: 10px; }
  .rtable.wide thead { display: none; }
  .rtable.wide tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; padding: 6px 12px; background: var(--surface); }
  .rtable.wide td { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border: 0; padding: 5px 0; text-align: right; }
  .rtable.wide td::before { content: attr(data-label); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; text-align: left; padding-top: 2px; }
  .rtable.wide td:first-child { text-align: left; }
  .rtable.wide td.actions { justify-content: flex-end; padding-top: 8px; }
  .rtable.wide td.actions::before { display: none; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 14px; }
  .context-icon { display: none; }
  .context-btn { padding: 5px 9px; }
  .context-name { max-width: 132px; font-size: 13px; }
  .context-kicker { font-size: 9.5px; }
  #main { padding: 12px 14px 40px; }
  .page-head { margin-bottom: 12px; gap: 10px; }
  .page-head h1 { font-size: 22px; }
  .lede { font-size: 13px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .inbox-head { gap: 8px; margin-bottom: 9px; }
  .inbox-head-title { gap: 8px; }
  .inbox-head-title h1 { font-size: 21px; }
  .inbox-head .lede { font-size: 12.5px; }
  .inbox-status { display: none; }
  .inbox-head .page-actions .btn { min-height: 36px; font-size: 13px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 21px; }
  .kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-facts { grid-template-columns: 1fr; }
  .inbox { height: calc(100dvh - 172px); min-height: 440px; border-radius: 12px; }
  .inbox-list-head { padding: 8px 10px 7px; }
  .inbox-list-head .filter-row { margin: 0 -2px; padding: 0 2px; }
  .thread-head { padding: 8px 11px; }
  .thread-scroll { padding: 14px 12px 6px; }
  .bubble { max-width: 88%; }
  .access-banner { padding: 10px 14px; font-size: 12px; }
  .access-banner .btn { margin-left: 0; }
  .dlg-head { padding: 16px 16px 10px; }
  .dlg-body { padding: 2px 16px 16px; }
  .dlg-foot .btn { flex: 1 1 auto; }
  .toast-stack { right: 12px; bottom: 12px; }
  .tabs { margin: 12px 0 14px; }
  .agenda-actions { justify-content: flex-start; }
  .date-nav input { width: 128px; }
}
@media (max-width: 520px) {
  .top-actions { gap: 4px; }
  .user-chip { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 20px; }
  .kpi-value small { font-size: 10.5px; }
  .kpi-meta { font-size: 11px; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-cell { padding: 8px 10px; }
  .summary-cell:last-child:nth-child(3n + 2) { grid-column: span 2; }
  .summary-cell span { font-size: 9.5px; letter-spacing: .03em; }
  .summary-cell strong { font-size: 16px; }
  .filter-row { gap: 4px; }
  .inbox-head .lede { display: none; }
  .inbox-head { margin-bottom: 8px; }
  .thread-tools .assign-select { min-width: 128px; }
  .page-head h1 { font-size: 21px; }
  .funnel-row { grid-template-columns: 104px minmax(0, 1fr) 38px; gap: 8px; }
  .funnel-label { font-size: 11.5px; }
}

@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Agenda: alternÃ¢ncia lista / semana / mÃªs ---------- */
.view-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); margin-left: auto; }
.view-toggle-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; }
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--line); }
.view-toggle-btn:hover { background: var(--surface-2); }
.view-toggle-btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.view-toggle-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.cal-scroll { overflow-x: auto; margin: 0 -2px; padding-bottom: 4px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 7px; min-width: 860px; }
.cal-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; min-height: 280px; display: flex; flex-direction: column; }
.cal-col.is-weekend { background: #f7f9f9; }
.cal-col.is-today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); background: #f4faf8; }
.cal-day-head { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; cursor: pointer; text-align: left; border-radius: 10px 10px 0 0; }
.cal-day-head:hover { background: var(--surface-3); }
.cal-day-head span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cal-day-head strong { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 16px; color: var(--ink); }
.cal-col.is-today .cal-day-head strong { background: var(--brand); color: #fff; }
.cal-day-head em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 1px 6px; }
.cal-col-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.cal-empty { display: flex; align-items: center; gap: 5px; margin: 3px 2px; padding: 8px 7px; font-size: 11.5px; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: 7px; }
.cal-empty .od-icon { opacity: .7; }
.cal-item { display: grid; gap: 1px; text-align: left; padding: 7px 8px; border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: 7px; background: var(--surface); font: inherit; cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease; }
.cal-item:hover { border-color: var(--line-strong); box-shadow: 0 2px 6px rgba(14, 26, 34, .08); }
.cal-time { font-size: 11.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-name { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-meta { font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-dow { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 0 4px 3px; }
.cal-cell { min-height: 112px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: border-color .15s ease, background .15s ease; }
.cal-cell:hover { border-color: var(--line-strong); }
.cal-cell.is-weekend { background: #f7f9f9; }
.cal-cell.is-out { background: transparent; opacity: .45; }
.cal-cell.is-today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); background: #f4faf8; }
.cal-cell-head { display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; font: inherit; cursor: pointer; padding: 2px 3px; border-radius: 5px; }
.cal-cell-head:hover { background: var(--surface-3); }
.cal-cell-head strong { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; font-size: 12.5px; color: var(--ink); }
.cal-cell.is-today .cal-cell-head strong { background: var(--brand); color: #fff; }
.cal-cell-head em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 1px 6px; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--info); background: var(--surface); border-radius: 4px; padding: 2px 5px; font: inherit; font-size: 10.5px; color: var(--ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { background: var(--surface-3); }
.cal-more { border: 0; background: transparent; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--brand); text-align: left; padding: 1px 5px; cursor: pointer; }

.cal-agendado { border-left-color: var(--info) !important; }
.cal-confirmado { border-left-color: var(--brand) !important; }
.cal-realizado { border-left-color: var(--success) !important; }
.cal-faltou { border-left-color: var(--danger) !important; }
.cal-cancelado { border-left-color: var(--line-strong) !important; color: var(--ink-3); }
.cal-item.cal-confirmado { background: #f2f9f7; }
.cal-item.cal-realizado { background: #f2f8f3; }
.cal-item.cal-faltou { background: #fdf4f4; }
.cal-item.cal-cancelado { background: #f8f9f9; }
.cal-chip.cal-confirmado { background: #f0f8f6; }
.cal-chip.cal-realizado { background: #f1f8f3; }
.cal-chip.cal-faltou { background: #fdf4f4; }
.cal-chip.cal-cancelado { background: #f4f5f5; }
.cal-cancelado .cal-name, .cal-chip.cal-cancelado { text-decoration: line-through; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-swatch { width: 10px; height: 10px; border-radius: 3px; border-left: 3px solid; display: inline-block; background: var(--surface-3); }
.cal-legend-hint { color: var(--ink-3); margin-left: auto; }
.cal-item:focus-visible, .cal-chip:focus-visible, .cal-day-head:focus-visible, .cal-cell-head:focus-visible, .cal-more:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

@media (max-width: 720px) {
  .view-toggle { margin-left: 0; }
  .cal-month { gap: 3px; }
  .cal-cell { min-height: 64px; padding: 3px; }
  .cal-chip, .cal-more { display: none; }
  .cal-dow { font-size: 10px; padding: 0 1px; letter-spacing: 0; }
  .cal-legend-hint { display: none; }
}

/* ---------- Funil: arrastar e soltar ---------- */
#crmBoard .opp-card { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#crmBoard .opp-card.is-pressing { transform: scale(.98); box-shadow: var(--shadow-md); transition: transform .2s; }
.kanban-col { transition: background .15s, border-color .15s, box-shadow .15s; }
.kanban.is-dragging .kanban-col { border-style: dashed; }
.kanban-col.is-over { background: var(--brand-soft); border: 1px solid var(--brand); box-shadow: 0 0 0 3px rgba(13, 92, 85, .12); }
.opp-card.is-drag-source { opacity: .3; box-shadow: none; transform: none; }
.opp-ghost {
  position: fixed; left: 0; top: 0; z-index: 2000; margin: 0; pointer-events: none;
  box-shadow: var(--shadow-lg); border-color: var(--brand); cursor: grabbing; opacity: .96;
  transition: none;
}
.drop-marker {
  display: grid; place-items: center; margin: 0 0 8px; border: 2px dashed var(--brand); border-radius: 9px;
  background: repeating-linear-gradient(45deg, rgba(13, 92, 85, .06) 0 8px, rgba(13, 92, 85, .11) 8px 16px);
  animation: drop-pulse 1.1s ease-in-out infinite;
}
.drop-marker span { font-size: 11.5px; font-weight: 700; color: var(--brand-ink); background: var(--surface); border-radius: 999px; padding: 3px 10px; box-shadow: var(--shadow-sm); }
.drop-marker.needs-step { border-color: #b7791f; background: repeating-linear-gradient(45deg, rgba(183, 121, 31, .07) 0 8px, rgba(183, 121, 31, .13) 8px 16px); }
.drop-marker.needs-step span::after { content: ' Â· abre o agendamento'; font-weight: 500; }
@keyframes drop-pulse { 50% { border-color: rgba(13, 92, 85, .45); } }
.lost-zone {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1990;
  display: flex; align-items: center; gap: 9px; padding: 13px 22px; border-radius: 12px;
  border: 2px dashed var(--danger); background: var(--danger-soft); color: var(--danger);
  font-size: 13px; box-shadow: var(--shadow-md); transition: transform .15s, background .15s;
}
.lost-zone.is-over { background: var(--danger); color: #fff; transform: translateX(-50%) scale(1.05); }
.opp-card.just-dropped { animation: dropped .7s ease-out; }
@keyframes dropped { 0% { box-shadow: 0 0 0 4px rgba(13, 92, 85, .35); } 100% { box-shadow: 0 0 0 0 rgba(13, 92, 85, 0); } }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
@media (prefers-reduced-motion: reduce) {
  .drop-marker, .opp-card.just-dropped { animation: none; }
}
.toast-stack { pointer-events: none; }
#crmBoard .opp-card > .opp-name, #crmBoard .opp-card > .opp-service, #crmBoard .opp-card > .opp-next { display: block; }
#crmBoard .opp-card > .opp-next { display: flex; }
#crmBoard .opp-card > .opp-foot { display: flex; }

/* ---------- ConsultÃ³rio e prontuÃ¡rio ---------- */
.clin-form { display: grid; gap: 6px; }
.clin-h { font-family: var(--font-display); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 14px 0 4px; }
.clin-vitals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.clin-imc { margin: 8px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.clin-systems { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 8px; font-size: 13px; }
.clin-systems label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.clin-record { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); display: grid; gap: 6px; }
.clin-record header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.clin-record header .btn { margin-left: auto; }
.clin-anamnese { border-left: 4px solid var(--brand); }
.clin-evolucao { border-left: 4px solid var(--info, #1f5f8b); }
.clin-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 10px; font-size: 13.5px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.clin-row span { color: var(--ink-3); font-weight: 600; }
.clin-row p { margin: 0; overflow-wrap: anywhere; }
.clin-addendum { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.clin-addendum p { margin: 4px 0 0; }
@media (max-width: 720px) {
  .clin-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clin-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Texto auxiliar dentro de cÃ©lula de tabela fica em linha prÃ³pria. */
td span.card-sub { display: block; }
.clin-record, .grid-2-even > .card { min-width: 0; }

/* Anexos */
.clin-upload { cursor: pointer; }
.clin-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.clin-gallery.compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.clin-thumb { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer; min-width: 0; }
.clin-thumb:hover { border-color: var(--brand); }
.clin-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.clin-doc-icon { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--surface-2); font-weight: 800; color: var(--ink-3); letter-spacing: .08em; }
.clin-file-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Disponibilidade */
.av-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.av-sum-cell { background: var(--surface); padding: 12px 14px; }
.av-sum-cell span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.av-sum-cell strong { display: block; font-family: var(--font-display); font-size: 21px; margin-top: 2px; font-variant-numeric: tabular-nums; }

.av-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.av-identity { min-width: 0; }
.av-name { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.av-meta { margin-top: 3px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.av-card-side { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.av-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.av-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); gap: 20px; }
.av-main { min-width: 0; }
.av-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.av-panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.av-panel-note { font-size: 11.5px; color: var(--ink-3); }
.av-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

.av-week { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; background: var(--surface); }
.av-axis, .av-day-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 132px; gap: 12px; align-items: center; }
.av-axis { margin-bottom: 2px; }
.av-axis-track { display: flex; justify-content: space-between; padding: 0 2px; font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.av-day-row { padding: 7px 0; border-top: 1px dashed var(--line); }
.av-axis + .av-day-row { border-top: 0; }
.av-day-name { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.av-track { position: relative; height: 20px; border-radius: 5px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.av-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--brand); }
.av-day-hours { font-size: 11.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-day-row.off .av-day-name, .av-day-row.off .av-day-hours { color: var(--ink-3); }
.av-day-row.off .av-day-name { font-weight: 600; }

.av-side { display: grid; align-content: start; gap: 14px; }
.av-side-block { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--surface); }
.av-list { display: grid; }
.av-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-top: 1px dashed var(--line); }
.av-item:first-child { border-top: 0; padding-top: 2px; }
.av-item-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--brand-ink); }
.av-item-icon.warn { background: var(--warning-soft); color: var(--warning); }
.av-item-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.av-item-main strong { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.av-item-main span { font-size: 11.5px; line-height: 1.4; color: var(--ink-2); }
.av-item-main em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.av-item-actions { display: flex; flex: none; gap: 8px; }
.av-link { border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--brand-700); cursor: pointer; }
.av-link:hover { text-decoration: underline; }
.av-link-danger { color: var(--danger); }

.av-empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink-3); font-size: 12.5px; }
.av-empty > div { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.av-empty strong { color: var(--ink-2); font-size: 12.5px; }
.av-empty .btn { margin-left: auto; }
.av-empty-sm { padding: 10px; font-size: 11.5px; background: transparent; }
.avail-line { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.avail-line > div { display: grid; gap: 2px; }
.avail-edit-head, .avail-edit-row { display: grid; grid-template-columns: 120px repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; }
.avail-edit-head { font-size: 11.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
.avail-edit-head span:nth-child(2) { grid-column: span 2; }
.avail-edit-head span:nth-child(3) { grid-column: span 2; }
.avail-edit-row { padding: 4px 0; border-bottom: 1px dashed var(--line); }

@media (max-width: 980px) {
  .av-body { grid-template-columns: 1fr; }
  .av-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .av-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .avail-edit-head { display: none; }
  .avail-edit-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avail-edit-row label { grid-column: span 2; }
  .av-card-head { flex-direction: column; }
  .av-card-side { width: 100%; flex-direction: column; align-items: flex-start; }
  .av-actions { width: 100%; justify-content: flex-start; }
  .av-actions .btn { flex: 1 1 auto; }
  .av-axis { display: none; }
  .av-day-row { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .av-day-hours { grid-column: 2; text-align: left; }
  .av-side { grid-template-columns: 1fr; }
  .av-sum-cell { padding: 10px 12px; }
  .av-sum-cell span { font-size: 10px; }
  .av-sum-cell strong { font-size: 18px; }
}

/* ---------- Caixa ---------- */
.cash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cash-toolbar .view-toggle { margin-left: 0; }
.cash-period { min-width: 0; }
.cash-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card.cash-overview { padding: 0; overflow: hidden; }
.cash-overview { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr) minmax(0, 1.3fr); }
.cash-overview > * { min-width: 0; padding: 20px 22px; }
.cash-total-cell { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, var(--brand-soft), #f7fbfa 88%); }
.cash-eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.cash-total { margin-top: 3px; font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cash-total-meta { margin-top: 5px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.cash-refund { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-top: 9px; padding: 3px 8px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 10.5px; font-weight: 600; }

.cash-figures { display: flex; flex-direction: column; justify-content: center; gap: 0; border-right: 1px solid var(--line); }
.cash-figure { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cash-figure:first-child { padding-top: 0; }
.cash-figure:last-child { padding-bottom: 0; border-bottom: 0; }
.cash-figure span { font-size: 11.5px; color: var(--ink-3); }
.cash-figure strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-figure strong.is-danger { color: var(--danger); }

.cash-mix { display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.cash-mix-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.cash-mix-head small { font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.cash-mix-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.cash-mix-bar span { display: block; height: 100%; }
.cash-mix-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
.cash-mix-item { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; color: var(--ink-2); }
.cash-mix-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-mix-item strong { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-mix-empty { font-size: 12px; color: var(--ink-3); }

.cash-ledger { margin-top: 16px; }
.cash-table td { vertical-align: middle; }
.cash-date { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 42px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); line-height: 1.05; }
.cash-date strong { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.cash-date span { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.cash-who { min-width: 0; }
.cash-who strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cash-who span { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.cash-method { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.cash-method i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.cash-amount { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-amount.is-negative { color: var(--danger); }

.cash-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.cash-prof-list { display: flex; flex-direction: column; gap: 12px; }
.cash-prof-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.cash-prof-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-prof-head strong { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-prof-track { height: 7px; margin: 5px 0 3px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.cash-prof-track i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.cash-prof-meta { font-size: 10.5px; color: var(--ink-3); }
.cash-pending-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.cash-pending-row:first-child { padding-top: 0; }
.cash-pending-row:last-child { padding-bottom: 0; border-bottom: 0; }
.cash-pending-main { flex: 1; min-width: 0; }
.cash-pending-main strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.cash-pending-main span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-pending-row .btn { flex: none; }
.cash-pending-service { font-size: 11.5px; color: var(--ink-3); }
.cash-more { margin-top: 9px; font-size: 11px; color: var(--ink-3); }
.cash-clear { display: flex; align-items: center; gap: 8px; padding: 14px 12px; border: 1px dashed #bfe0cd; border-radius: 9px; background: var(--success-soft); color: #245843; font-size: 12.5px; }
.cash-clear .od-icon { color: var(--success); }

@media (max-width: 1120px) {
  .cash-overview { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .cash-figures { border-right: 0; }
  .cash-mix { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .cash-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .cash-period { overflow-x: auto; padding-bottom: 2px; }
  .cash-toolbar .view-toggle { width: max-content; }
  .cash-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .cash-filters .select-inline { width: 100%; min-width: 0; }
  .cash-overview { grid-template-columns: 1fr; }
  .cash-total-cell { border-bottom: 1px solid var(--line); }
  .cash-total { font-size: 32px; }
  .cash-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cash-figure { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; border: 0; }
  .cash-figure strong { font-size: 17px; }
  .cash-mix { grid-column: auto; border-top: 0; }
  .cash-mix-legend { grid-template-columns: 1fr; }
  .cash-bottom { grid-template-columns: 1fr; }
  .cash-ledger .card-head, .cash-bottom .card-head { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .agenda-bar { padding: 8px; gap: 8px; }
  .agenda-bar-main { width: 100%; gap: 6px; }
  .agenda-bar-main .date-nav { flex: 1 1 188px; }
  .agenda-bar-main .date-nav input { flex: 1; width: auto; }
  .agenda-today { flex: 0 0 auto; }
  .agenda-range { order: 5; width: 100%; flex-direction: row; align-items: baseline; gap: 6px; margin: 0 2px; }
  .agenda-range strong { font-size: 12px; }
  .agenda-range span { font-size: 10.5px; }
  .agenda-bar-actions { width: 100%; gap: 6px; margin-left: 0; }
  .agenda-bar .view-toggle { flex: 1 1 210px; }
  .agenda-bar .view-toggle-btn { flex: 1; justify-content: center; padding: 7px 5px; font-size: 12px; }
  .agenda-bar .select-inline { flex: 1 1 140px; min-width: 0; }
  .agenda-stats { display: flex; overflow-x: auto; gap: 7px; margin: 0 -14px 12px; padding: 0 14px 2px; scrollbar-width: none; }
  .agenda-stats::-webkit-scrollbar { display: none; }
  .agenda-stat { flex: 0 0 150px; padding: 9px 10px 10px; }
  .agenda-stat-label { font-size: 9.5px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .agenda-stat strong { font-size: 18px; }
  .agenda-stat-icon { width: 28px; height: 28px; }
  .agenda-card { padding: 14px; }
  .agenda-card .card-head { flex-wrap: wrap; gap: 4px; }
  .agenda-card .card-actions { display: none; }

  .rtable.wide.agenda-table { display: block; border: 0; }
  .rtable.wide.agenda-table thead { display: none; }
  .rtable.wide.agenda-table tbody { display: block; }
  .rtable.wide.agenda-table tr.appt-row {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas: "when who state" "detail detail detail" "actions actions actions";
    gap: 7px 10px; padding: 10px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  }
  .rtable.wide.agenda-table tr.appt-row:last-child { margin-bottom: 0; }
  .rtable.wide.agenda-table tr.appt-row.is-next { background: #f3faf8; box-shadow: inset 3px 0 0 var(--brand); }
  .rtable.wide.agenda-table tr.appt-row.is-next td { background: transparent; box-shadow: none; }
  .rtable.wide.agenda-table tr.appt-row td { display: block; padding: 0; border: 0; text-align: left; background: transparent; }
  .rtable.wide.agenda-table tr.appt-row td::before { display: none; }
  .rtable.wide.agenda-table .appt-when { grid-area: when; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: auto; }
  .rtable.wide.agenda-table .appt-who { grid-area: who; min-width: 0; }
  .rtable.wide.agenda-table .appt-detail { grid-area: detail; padding-top: 7px; border-top: 1px dashed var(--line); }
  .rtable.wide.agenda-table .appt-state { grid-area: state; align-self: start; justify-self: end; width: auto; text-align: right; }
  .rtable.wide.agenda-table .appt-state .appt-note { max-width: 120px; }
  .rtable.wide.agenda-table td.actions { grid-area: actions; display: block; padding-top: 8px; border-top: 1px solid var(--line); }
  .rtable.wide.agenda-table .agenda-actions { justify-content: flex-start; }
  .rtable.wide.agenda-table .agenda-actions > .btn { flex: 1 1 auto; }
  .rtable.wide.agenda-table .agenda-actions .row-menu { flex: 0 0 auto; }
  .rtable.wide.agenda-table .row-menu[open] { flex: 1 0 100%; }
  .rtable.wide.agenda-table .row-menu-list {
    position: static; width: 100%; max-width: none; min-width: 0; margin-top: 2px;
    padding-top: 4px; border: 0; border-top: 1px dashed var(--line); border-radius: 0;
    box-shadow: none; flex-direction: row; flex-wrap: wrap; gap: 4px;
  }
  .rtable.wide.agenda-table .row-menu-list .btn { width: auto; flex: 1 1 auto; }
  .agenda-table .appt-person-copy strong { font-size: 13.5px; }
  .agenda-table .appt-service { font-size: 12.5px; }
}

@media (max-width: 900px) {
  .agenda-stats { display: flex; overflow-x: auto; gap: 7px; scrollbar-width: none; }
  .agenda-stats::-webkit-scrollbar { display: none; }
  .agenda-stat { flex: 0 0 150px; }
  .agenda-stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rtable.wide.agenda-table { display: block; border: 0; }
  .rtable.wide.agenda-table thead { display: none; }
  .rtable.wide.agenda-table tbody { display: block; }
  .rtable.wide.agenda-table tr.appt-row {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas: "when who state" "detail detail detail" "actions actions actions";
    gap: 7px 10px; padding: 10px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  }
  .rtable.wide.agenda-table tr.appt-row:last-child { margin-bottom: 0; }
  .rtable.wide.agenda-table tr.appt-row.is-next { background: #f3faf8; box-shadow: inset 3px 0 0 var(--brand); }
  .rtable.wide.agenda-table tr.appt-row.is-next td { background: transparent; box-shadow: none; }
  .rtable.wide.agenda-table tr.appt-row td { display: block; padding: 0; border: 0; text-align: left; background: transparent; }
  .rtable.wide.agenda-table tr.appt-row td::before { display: none; }
  .rtable.wide.agenda-table .appt-when { grid-area: when; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: auto; }
  .rtable.wide.agenda-table .appt-who { grid-area: who; min-width: 0; }
  .rtable.wide.agenda-table .appt-detail { grid-area: detail; padding-top: 7px; border-top: 1px dashed var(--line); }
  .rtable.wide.agenda-table .appt-state { grid-area: state; align-self: start; justify-self: end; width: auto; text-align: right; }
  .rtable.wide.agenda-table .appt-state .appt-note { max-width: 150px; }
  .rtable.wide.agenda-table td.actions { grid-area: actions; display: block; padding-top: 8px; border-top: 1px solid var(--line); }
  .rtable.wide.agenda-table .agenda-actions { justify-content: flex-start; }
  .rtable.wide.agenda-table .agenda-actions > .btn { flex: 1 1 auto; }
  .rtable.wide.agenda-table .agenda-actions .row-menu { flex: 0 0 auto; }
  .rtable.wide.agenda-table .row-menu[open] { flex: 1 0 100%; }
  .rtable.wide.agenda-table .row-menu-list {
    position: static; width: 100%; max-width: none; min-width: 0; margin-top: 2px;
    padding-top: 4px; border: 0; border-top: 1px dashed var(--line); border-radius: 0;
    box-shadow: none; flex-direction: row; flex-wrap: wrap; gap: 4px;
  }
  .rtable.wide.agenda-table .row-menu-list .btn { width: auto; flex: 1 1 auto; }
}
@media (max-width: 520px) {
  .agenda-table .appt-state .appt-note { max-width: 96px; }
}

/* ---------- Consultoria ---------- */
.consult-hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 18px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(128deg, var(--brand-soft), #fbfdfc 58%, var(--surface));
  box-shadow: var(--shadow-sm);
}
.consult-hero-main { flex: 1 1 320px; min-width: 0; }
.consult-eyebrow { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); }
.consult-hero h2 { margin-top: 3px; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.consult-hero p { margin-top: 5px; max-width: 68ch; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.consult-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.consult-hero-badge {
  display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap;
  padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(255, 255, 255, .74); font-size: 11px; color: var(--ink-2);
}
.consult-hero-badge strong { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.consult-ring {
  --pct: 0;
  position: relative; flex: none; width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--surface-3) 0);
}
.consult-ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.consult-ring-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.consult-ring-copy strong { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.consult-ring-copy small { margin-top: 3px; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

.consult-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.consult-kpi {
  display: flex; align-items: flex-start; gap: 9px; min-width: 0;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.consult-kpi-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); }
.consult-kpi.is-brand .consult-kpi-icon { background: var(--brand-soft); color: var(--brand-700); }
.consult-kpi.is-info .consult-kpi-icon { background: var(--info-soft); color: var(--info); }
.consult-kpi.is-success .consult-kpi-icon { background: var(--success-soft); color: var(--success); }
.consult-kpi.is-warning .consult-kpi-icon { background: var(--warning-soft); color: #b7791f; }
.consult-kpi.is-danger .consult-kpi-icon { background: var(--danger-soft); color: var(--danger); }
.consult-kpi-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.consult-kpi-copy > span { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.consult-kpi-copy strong { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.consult-kpi-copy small { font-size: 10.5px; line-height: 1.35; color: var(--ink-3); }

.consult-goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.consult-goal {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 11px 12px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2);
}
.consult-goal.is-good { border-color: #cbe6d7; background: linear-gradient(180deg, #f2faf5, var(--surface)); }
.consult-goal.is-bad { border-color: #f0d2d2; background: linear-gradient(180deg, #fdf6f6, var(--surface)); }
.consult-goal.is-muted { background: var(--surface); }
.consult-goal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.consult-goal-name { font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.consult-goal-tag { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.consult-goal-tag.is-good { background: var(--success-soft); color: var(--success); }
.consult-goal-tag.is-bad { background: var(--danger-soft); color: var(--danger); }
.consult-goal-tag.is-flat { background: var(--info-soft); color: var(--info); }
.consult-goal-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.consult-goal-value strong { font-family: var(--font-display); font-size: 23px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.consult-goal-value span { font-size: 10.5px; color: var(--ink-3); }
.consult-goal-compare { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--ink-3); }
.consult-delta { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.consult-delta.is-good { color: var(--success); }
.consult-delta.is-bad { color: var(--danger); }
.consult-delta.is-flat { color: var(--info); }
.consult-goal-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.consult-goal-track i { display: block; height: 100%; border-radius: 999px; background: var(--ink-3); }
.consult-goal.is-good .consult-goal-track i { background: var(--success); }
.consult-goal.is-bad .consult-goal-track i { background: var(--danger); }
.consult-goal.is-flat .consult-goal-track i { background: var(--info); }
.consult-goal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--ink-3); }

.consult-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11px; line-height: 1.45; color: var(--ink-3); }
.consult-note .od-icon { flex: none; margin-top: 1px; }

.consult-checklist-progress { height: 8px; margin-bottom: 10px; }
.consult-checklist .task-row { align-items: center; }
.consult-checklist .task-row.is-done .task-title { color: var(--ink-3); text-decoration: line-through; }
.consult-check-state { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.consult-checklist .task-row.is-done .consult-check-state { color: var(--success); }

.consult-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.consult-health-wrap { grid-column: 1 / -1; }
.consult-plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 11px; color: var(--ink-3); }
.consult-plan-head .progress { flex: 1; }
.consult-action-list { display: flex; flex-direction: column; }
.consult-action { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.consult-action:first-child { padding-top: 0; }
.consult-action:last-child { border-bottom: 0; padding-bottom: 0; }
.consult-action-dot { width: 8px; height: 8px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--ink-3); }
.consult-action-dot.is-success { background: var(--success); }
.consult-action-dot.is-info { background: var(--info); }
.consult-action-dot.is-warning { background: #b7791f; }
.consult-action-dot.is-danger { background: var(--danger); }
.consult-action-main { flex: 1; min-width: 0; }
.consult-action-main strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.consult-action-main span { display: block; margin-top: 1px; font-size: 11px; line-height: 1.4; color: var(--ink-3); }
.consult-action.is-late .consult-action-main strong { color: var(--danger); }
.consult-action .btn { flex: none; }

.consult-meeting-list { display: flex; flex-direction: column; }
.consult-meeting { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.consult-meeting:first-child { padding-top: 0; }
.consult-meeting:last-child { border-bottom: 0; padding-bottom: 0; }
.consult-meeting-date { width: 42px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); line-height: 1.05; }
.consult-meeting-date strong { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.consult-meeting-date span { font-size: 9px; font-weight: 700; letter-spacing: .05em; color: var(--ink-3); }
.consult-meeting.is-next .consult-meeting-date { border-color: var(--brand); background: var(--brand-soft); }
.consult-meeting.is-next .consult-meeting-date strong { color: var(--brand-ink); }
.consult-meeting-main { flex: 1; min-width: 0; }
.consult-meeting-main strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.consult-meeting-main span { display: block; margin-top: 1px; font-size: 11px; color: var(--ink-3); }
.consult-meeting .chip { flex: none; }

.consult-health { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; }
.consult-health-row { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.consult-health-dot { width: 7px; height: 7px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--success); }
.consult-health-dot.is-warning { background: #b7791f; }
.consult-health-dot.is-danger { background: var(--danger); }
.consult-health-dot.is-info { background: var(--info); }
.consult-health-main { flex: 1; min-width: 0; }
.consult-health-main strong { display: block; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ink-2); }
.consult-health-main span { display: block; font-size: 10.5px; line-height: 1.35; color: var(--ink-3); }
.consult-health-value { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) {
  .consult-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .consult-hero { padding: 16px; gap: 14px; }
  .consult-hero h2 { font-size: 20px; }
  .consult-ring { width: 88px; height: 88px; }
  .consult-ring-copy strong { font-size: 20px; }
  .consult-ring-copy small { display: none; }
}
@media (max-width: 760px) {
  .consult-hero { flex-wrap: nowrap; align-items: flex-start; }
  .consult-hero-badges { margin-top: 8px; }
  .consult-ring { width: 74px; height: 74px; }
  .consult-ring::after { inset: 7px; }
  .consult-ring-copy strong { font-size: 18px; }
  .consult-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .consult-kpi { padding: 10px; gap: 8px; }
  .consult-kpi-copy strong { font-size: 17px; }
  .consult-goal-grid { grid-template-columns: 1fr; }
  .consult-bottom { grid-template-columns: 1fr; }
  .consult-health { grid-template-columns: 1fr; gap: 8px; }
}

/* Menu lateral recolhível no computador (no celular ele abre por cima, com nav-open). */
@media (min-width: 1025px) {
  .menu-btn { display: inline-grid; }
  .app { transition: grid-template-columns .2s ease; }
  body.nav-collapsed .app { grid-template-columns: 0 minmax(0, 1fr); }
  body.nav-collapsed .sidebar { visibility: hidden; overflow: hidden; padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .app { transition: none; }
}

/* ---------- Cadência comercial (cadence.js) ---------- */
.cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cc-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cc-open { grid-column: 1 / -1; }
.cc-head { display: flex; align-items: flex-start; gap: 11px; }
.cc-head-main { flex: 1; min-width: 0; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 11.5px; color: var(--ink-2); }
.cc-chip.cc-email { background: var(--info-soft); color: var(--info); border-color: transparent; }
.cc-chip.cc-whatsapp { background: var(--success-soft); color: var(--success); border-color: transparent; }
.cc-chip.cc-tarefa { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.cc-legacy { font-size: 11.5px; color: var(--warning); background: var(--warning-soft); border-radius: 6px; padding: 6px 9px; margin-top: 4px; }
.cc-flow { list-style: none; margin: 0; padding: 4px 0 0; display: grid; gap: 0; }
.cc-step { display: flex; gap: 11px; position: relative; padding-bottom: 14px; }
.cc-step:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.cc-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-ink); }
.cc-step.cc-email .cc-dot { background: var(--info-soft); color: var(--info); }
.cc-step.cc-whatsapp .cc-dot { background: var(--success-soft); color: var(--success); }
.cc-step-body { flex: 1; min-width: 0; }
.cc-step-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12.5px; }
.cc-wait { font-size: 11.5px; color: var(--ink-2); }
.cc-day { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.cc-subject { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink); }
.cc-text { margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.cc-hist { margin-top: 4px; font-size: 11.5px; }
.cc-hist summary { cursor: pointer; color: var(--ink-3); }
.cc-hist ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; }
.cc-hist li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cc-window { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 13px; }
.cc-days { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-days label { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; cursor: pointer; }
.cc-window input[type="time"] { width: auto; }
.cc-edit-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.cc-edit-step { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px; display: grid; gap: 8px; background: var(--surface); }
.cc-edit-step.cc-email { border-left-color: var(--info); }
.cc-edit-step.cc-whatsapp { border-left-color: var(--success); }
.cc-edit-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.cc-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); font-size: 11px; font-weight: 700; }
.cc-edit-top select, .cc-edit-top input { width: auto; min-height: 32px; }
.cc-in-wait { width: 72px !important; }
.cc-edit-wait { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cc-edit-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.cc-edit-step textarea, .cc-in-subject { width: 100%; }
.cc-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
@media (max-width: 860px) {
  .cc-grid { grid-template-columns: 1fr; }
}

/* ---------- Inscrever contatos ---------- */
.ce-dlg { width: min(680px, calc(100vw - 28px)); max-height: min(780px, calc(100dvh - 40px)); }
.ce-dlg[open] { display: flex; flex-direction: column; }
.ce-head { padding: 22px 24px 16px; }
.ce-head h2 { font-size: 20px; }
.ce-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.ce-form > .form-errors { margin: 0 24px 12px; }
.ce-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 0 24px 14px; border-bottom: 1px solid var(--line); }
.ce-search { flex: 1 1 260px; max-width: none; }
.ce-search input { min-height: 38px; background: var(--surface-2); }
.ce-filters { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); }
.ce-filter { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.ce-filter span { font-variant-numeric: tabular-nums; font-weight: 500; opacity: .7; }
.ce-filter:hover { color: var(--ink); }
.ce-filter.is-active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.ce-selection { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ce-link { border: 0; background: transparent; color: var(--brand-700); font-size: 12px; font-weight: 600; padding: 0; }
.ce-link:hover { text-decoration: underline; }
.ce-list-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 12px; }
.ce-list { list-style: none; margin: 0; padding: 0; }
.ce-person { border-bottom: 1px solid var(--line); }
.ce-person:last-child { border-bottom: 0; }
.ce-person-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.ce-person:hover { background: var(--surface-2); border-radius: 8px; }
.ce-person.is-picked { background: var(--brand-soft); border-radius: 8px; box-shadow: inset 2px 0 var(--brand); }
.ce-person.is-locked { opacity: .55; }
.ce-person.is-locked .ce-person-row { cursor: default; }
.ce-person input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; flex: none; accent-color: var(--brand); }
.ce-person-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ce-person-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-person-meta { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-person-side { display: grid; justify-items: end; gap: 2px; text-align: right; flex: none; }
.ce-phone { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ce-tag { font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 1px 7px; }
.ce-tag.is-warn { color: var(--warning); background: var(--warning-soft); }
.ce-email { padding: 0 12px 12px 62px; }
.ce-email input { width: 100%; min-height: 34px; font-size: 12.5px; }
.ce-empty { display: grid; justify-items: center; gap: 4px; padding: 36px 20px; color: var(--ink-3); text-align: center; }
.ce-empty strong { font-size: 13px; color: var(--ink-2); }
.ce-empty span { font-size: 12px; }
.ce-empty .od-icon { margin-bottom: 4px; color: var(--ink-3); }
.ce-foot { display: flex; justify-content: flex-end; margin: 0; padding: 14px 24px; background: var(--surface); }
.ce-foot-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 640px) {
  .ce-head { padding: 18px 16px 12px; }
  .ce-form > .form-errors { margin: 0 16px 10px; }
  .ce-toolbar { padding: 0 16px 12px; }
  .ce-selection { width: 100%; justify-content: space-between; margin-left: 0; }
  .ce-list-wrap { padding: 4px 6px; }
  .ce-person-row { padding: 10px 8px; gap: 9px; }
  .ce-email { padding: 0 8px 10px 44px; }
  .ce-foot { flex-wrap: wrap; padding: 12px 16px; }
  .ce-foot-actions { flex: 1 1 100%; }
}

/* ---------- Convênios ---------- */
.ins-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 12px; }
.ins-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ins-filters select, .ins-filters input { min-width: 160px; }
.ins-toolbar { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.ins-card { display: flex; flex-direction: column; gap: 6px; }
.ins-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ins-label { margin: 8px 0 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.ins-prices { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ins-prices li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.ins-prices.compact li { font-size: 12.5px; padding: 1px 0; }
.ins-rows { display: grid; gap: 8px; margin: 6px 0; }
.ins-plan-row { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr auto; gap: 8px; align-items: center; }
.ins-price-row { display: grid; grid-template-columns: 1.6fr 1fr .9fr; gap: 8px; align-items: center; font-size: 13px; }
#insProfPrices .ins-price-row { grid-template-columns: 1.6fr 1fr; }
.ins-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.ins-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.ins-inline { display: flex; gap: 8px; }
.ins-inline select { flex: 1.2; } .ins-inline input { flex: 1; min-width: 0; }
.ins-warn { display: block; color: var(--warning); font-size: 12px; font-weight: 600; }
.ins-err { display: block; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.sched-quote { line-height: 1.6; }
.ins-fact-btn { margin-top: 2px; padding: 2px 6px; font-size: 12px; }
.ins-total td { border-top: 2px solid var(--line-strong); font-weight: 700; }
.ins-list { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 720px) {
  .ins-grid { grid-template-columns: 1fr; }
  .ins-plan-row, .ins-price-row { grid-template-columns: 1fr 1fr; }
  .ins-filters select, .ins-filters input { min-width: 0; width: 100%; }
  .ins-filters label { flex: 1 1 140px; }
}
.ins-table .person-meta { display: block; margin-top: 2px; }
.ins-table td.num { white-space: nowrap; }
@media (max-width: 760px) {
  /* Rótulo em cima e conteúdo embaixo: nome, carteirinha, glosa e preços quebram linha em vez de vazar do cartão. */
  .ins-table td:not(.actions) { display: block; text-align: left; white-space: normal; }
  .ins-table td:not(.actions)::before { display: block; margin-bottom: 3px; }
}

/* ---------- Resumo semanal ---------- */
.wk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 16px; align-items: start; }
.wk-col { display: grid; gap: 16px; min-width: 0; }
.wk-when { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.wk-owners { display: grid; gap: 8px; margin: 6px 0 4px; }
.wk-owner { display: grid; grid-template-columns: 1fr 200px; gap: 10px; align-items: center; }
.wk-owner-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.wk-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.wk-preview img { width: 100%; height: auto; display: block; }
.wk-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.wk-table .person-meta { display: block; margin-top: 2px; }
@media (max-width: 1080px) { .wk-grid { grid-template-columns: 1fr; } .wk-preview { max-width: 480px; } }
@media (max-width: 560px) { .wk-owner { grid-template-columns: 1fr; } .wk-when { grid-template-columns: 1fr; } }

/* ---------- Alertas de consulta ---------- */
.al-grid { display: grid; gap: 16px; }
.al-form { display: grid; gap: 16px; }
.al-rules { display: grid; gap: 10px; margin: 6px 0 10px; }
.al-rule { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.al-when { display: flex; align-items: center; gap: 8px; }
.al-when .al-value { width: 78px; }
.al-auds { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.al-test { margin-top: 4px; font-size: 13px; align-self: flex-start; justify-self: start; text-align: left; }
.al-table .person-meta, .wk-owner-name .person-meta { display: block; margin-top: 2px; }
@media (max-width: 640px) { .al-rule { grid-template-columns: 1fr auto; } .al-rule > .al-when { grid-row: 1; grid-column: 1; } .al-rule > .icon-btn { grid-row: 1; grid-column: 2; } .al-auds { grid-column: 1 / -1; } }

/* ---------- Recebimento pelo Asaas ---------- */
.pay-options { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pay-form { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface-2); min-width: 0; }
.pay-h { font-size: 15px; margin: 0 0 4px; }
.pay-qr { display: flex; justify-content: center; margin: 10px 0; }
.pay-qr img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pay-result-actions { flex-wrap: wrap; gap: 8px; }
.pay-bank { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--success, #1f7a4d); white-space: nowrap; }
.cash-method + .pay-bank { display: flex; }
.pay-table .person-meta { display: block; margin-top: 2px; }
#payPix { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
@media (max-width: 900px) { .pay-options { grid-template-columns: 1fr; } }
