/* =========================================================================
   app.css — casca (menu, cabeçalho, abas), telas e balões-linha (componentes genéricos; vindo do protótipo do Aluguel telas-v0.9.5).
   ========================================================================= */

body.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
body.app.nav-collapsed { --sidebar-w: 92px; }

/* ---- Menu lateral --------------------------------------------------- */
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 16px; z-index: 30; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 22px; flex: none; }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; flex: none; background: linear-gradient(145deg, var(--blue-500), var(--blue-800)); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(31, 95, 168, .3); }
.brand-mark .ic { width: 26px; height: 26px; }
.brand-mark .logo { width: 40px; height: 40px; }
.brand-txt { min-width: 0; line-height: 1.2; flex: 1; }
.brand-name { font-weight: 700; font-size: 18px; color: var(--blue-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sys { font-size: 14px; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.nav-sep { display: flex; align-items: center; gap: 8px; margin: 18px 14px 6px; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 14px; min-height: var(--nav-h); padding: 8px 14px; border-radius: 14px; color: var(--ink-600); font-weight: 560; white-space: nowrap; text-decoration: none; }
.nav a .ic { width: 22px; height: 22px; }
.nav a:hover { background: var(--blue-50); color: var(--blue-700); }
.nav a.active { background: var(--blue-100); color: var(--blue-800); }
.nav a.active .ic { color: var(--blue-600); }
.nav a .count { margin-left: auto; min-width: 26px; height: 24px; font-size: 13px; background: var(--surface-2); color: var(--ink-700); }
.nav a.active .count { background: #fff; color: var(--blue-700); }
.nav a .nav-label small { display: block; font-size: 13px; font-weight: 400; color: var(--text-3); line-height: 1.2; }
.nav-locked { margin: 18px 4px 0; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--text-3); font-size: 14px; }
.nav-locked strong { display: flex; align-items: center; gap: 8px; color: var(--ink-600); }
.nav-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; }
.nav-foot a, .nav-foot button { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 14px; border-radius: 14px; color: var(--text-2); font-weight: 560; background: none; border: 0; cursor: pointer; white-space: nowrap; width: 100%; text-align: left; text-decoration: none; }
.nav-foot a:hover, .nav-foot button:hover { background: var(--blue-50); color: var(--blue-700); }
body.nav-collapsed .brand-txt, body.nav-collapsed .nav-label, body.nav-collapsed .nav a .count,
body.nav-collapsed .nav-sep span, body.nav-collapsed .nav-locked span, body.nav-collapsed .nav-locked .lb { display: none; }
body.nav-collapsed .brand { justify-content: center; }
body.nav-collapsed .nav-sep { justify-content: center; margin: 18px 0 6px; }
body.nav-collapsed .nav a, body.nav-collapsed .nav-foot a, body.nav-collapsed .nav-foot button { justify-content: center; padding: 0; }
body.nav-collapsed .nav-locked { display: flex; justify-content: center; padding: 10px; }
body.nav-collapsed .collapse-ic { transform: scaleX(-1); }

/* ---- Coluna principal ---------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 32px; position: sticky; top: 0; z-index: 20; background: rgba(243, 246, 251, .92); backdrop-filter: blur(8px); }
.menu-btn { display: none !important; }
.search { position: relative; flex: 1; max-width: 560px; }
.search > .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { height: 48px; padding-left: 48px; padding-right: 48px; border-radius: var(--pill); border-color: var(--border); box-shadow: var(--sh-1); }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.search-pop { position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-2); max-height: 70vh; overflow-y: auto; padding: 10px; z-index: 50; }
.sp-group { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 12px 4px; }
.sp-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; color: var(--text); min-height: 48px; }
.sp-item:hover, .sp-item.kb { background: var(--blue-50); text-decoration: none; }
.sp-item .sp-sub { color: var(--text-3); font-size: 14px; margin-left: auto; white-space: nowrap; }
.sp-item mark { background: var(--blue-100); color: inherit; border-radius: 3px; }
.sp-foot { border-top: 1px solid var(--line-100); margin-top: 8px; padding: 10px 12px 4px; font-size: 13.5px; color: var(--text-3); display: flex; gap: 14px; flex-wrap: wrap; }
.topbar-spacer { flex: 1; }
/* Data e hora de Brasília em todas as telas (DP §10): longa no computador, compacta no celular; atualiza sozinha. */
.relogio-topo { flex: none; font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.relogio-topo .rt-curto { display: none; }
.bell { position: relative; }
.bell .dot-n { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--err-700); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.anchor { position: relative; }
.pop { position: absolute; top: calc(100% + 10px); right: 0; width: 400px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-2); z-index: 50; padding: 8px; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
.pop-f { padding: 10px 12px 6px; text-align: center; border-top: 1px solid var(--line-100); margin-top: 4px; }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text); align-items: flex-start; }
.notif:hover { background: var(--blue-50); text-decoration: none; }
.notif .n-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.n-ic.err { background: var(--err-50); color: var(--err-700); }
.n-ic.warn { background: var(--warn-50); color: var(--warn-700); }
.n-ic.info { background: var(--blue-100); color: var(--blue-600); }
.n-ic.ok { background: var(--ok-50); color: var(--ok-700); }
.notif .n-t { font-weight: 650; }
.notif .n-s { font-size: 14px; color: var(--text-2); }
.user-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 14px 4px 4px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--panel); cursor: pointer; box-shadow: var(--sh-1); text-align: left; }
.user-btn:hover { border-color: var(--border-strong); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; background: var(--blue-100); color: var(--blue-700); flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }
.avatar.admin { background: var(--blue-700); color: #fff; }
.user-btn .u-name { font-weight: 650; font-size: 15px; line-height: 1.2; }
.user-btn .u-role { font-size: 13px; color: var(--text-3); line-height: 1.2; }
.menu-list { padding: 4px; }
.menu-list button, .menu-list a { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; background: none; border: 0; border-radius: 12px; cursor: pointer; color: var(--text); text-align: left; text-decoration: none; }
.menu-list button:hover, .menu-list a:hover { background: var(--blue-50); }
.menu-list .check-mark { margin-left: auto; color: var(--blue-600); }
.menu-list hr { border: 0; border-top: 1px solid var(--line-100); margin: 6px 4px; }

/* ---- Barra de abas (pílulas) ---------------------------------------- */
.tabbar { display: flex; align-items: center; gap: 10px; padding: 0 32px; position: sticky; top: var(--header-h); z-index: 15; background: rgba(243, 246, 251, .92); backdrop-filter: blur(8px); }
.tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; padding: 4px 2px 12px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.tab { display: flex; align-items: center; flex: none; max-width: 240px; min-width: 0; border-radius: 12px; color: var(--ink-600); border: 1px solid transparent; }
.tab:hover { background: var(--panel); }
.tab.active { background: var(--panel); color: var(--blue-700); border-color: var(--border); box-shadow: var(--sh-1); }
.tab .t-link { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 14px; min-height: var(--tab-h); color: inherit; font-weight: 560; font-size: 15px; min-width: 0; text-decoration: none; }
.tab .t-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .ic.t-ic { width: 18px; height: 18px; }
.tab .t-close { width: 30px; height: 30px; margin-right: 5px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; flex: none; }
.tab .t-close:hover { background: var(--blue-100); color: var(--err-700); }
.tab .t-close .ic { width: 16px; height: 16px; }
.tab-count { font-size: 13px; color: var(--text-3); padding-bottom: 12px; white-space: nowrap; }
.tabs-mobile { display: none; }

/* ---- Conteúdo ------------------------------------------------------ */
.views { flex: 1; min-width: 0; }
.view { padding: 24px 32px 64px; display: flex; flex-direction: column; gap: var(--section-gap); max-width: 1400px; margin: 0 auto; animation: surge .18s ease-out; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-h .ph-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-h .crumbs { font-size: 15px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-h .crumbs a { color: var(--text-2); }
.page-h h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-h h1 .count { font-size: 15px; height: 32px; min-width: 32px; }
.page-h .muted { font-size: 16px; color: var(--text-3); }
.hello h1 { font-size: 34px; }
.toolbar { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .field { min-width: 160px; }
.toolbar .field.grow { flex: 1; min-width: 220px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--panel); color: var(--ink-700); cursor: pointer; box-shadow: var(--sh-1); }
.chip:hover { border-color: var(--blue-300); }
.chip .count { height: 24px; min-width: 24px; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,.22); color: #fff; }
.sum-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sum-pills .badge { font-size: 15px; padding: 6px 14px 6px 11px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.grid-main-wide { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.grid-wide-left { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; gap: var(--gap-sm); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--gap-sm); flex-wrap: wrap; }

/* =====================================================================
   BALÃO-LINHA — um balão por item, com CONJUNTOS de informação lado a lado.
   ===================================================================== */
.band { display: flex; flex-direction: column; gap: 14px; }
.band-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.band-h h2 { display: flex; align-items: center; gap: 12px; font-size: 21px; }
.band-h h2 .b-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-600); }
.band-h .band-sub { color: var(--text-3); font-size: 15px; }
.band-h .band-act { margin-left: auto; }
.band.b-late .band-h h2 { color: var(--err-700); }
.band.b-late .band-h h2 .b-ic { background: var(--err-50); color: var(--err-700); }

.baloes { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.balao {
  --cols: minmax(0, 1fr);
  display: grid; grid-template-columns: var(--cols); align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--sh-1);
  padding: 16px 6px; position: relative; color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.balao[data-href] { cursor: pointer; }
.balao[data-href]:hover { box-shadow: var(--sh-2); border-color: var(--blue-200); transform: translateY(-1px); }
.balao.is-late { border-color: var(--err-200); box-shadow: inset 5px 0 0 var(--err-700), var(--sh-1); }
.balao.is-warn { box-shadow: inset 5px 0 0 var(--warn-700), var(--sh-1); }
.balao.is-done { background: var(--surface-1); }
.balao.is-done .bl-t { color: var(--text-2); }
.bl { padding: 4px 18px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bl + .bl { border-left: 1px solid var(--line-100); }
.bl-k { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.bl-t { font-weight: 650; font-size: 16.5px; line-height: 1.3; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.bl-t:hover { color: var(--blue-700); }
.bl-s { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-s .ic { width: 15px; height: 15px; color: var(--text-3); margin-right: 2px; }
.bl-v { font-size: 19px; font-weight: 750; color: var(--blue-800); font-variant-numeric: tabular-nums; line-height: 1.25; }
.bl-v.neg { color: var(--err-700); }
.bl-v.ok { color: var(--ok-700); }
.bl-act { flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bl-who { flex-direction: row; align-items: center; gap: 14px; }
.bl-who > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bl-time { align-items: flex-start; }
.bl-time .hora { font-size: 26px; font-weight: 750; color: var(--blue-800); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.01em; }
.bl-time .hora.late { color: var(--err-700); }
.bl-time .hora-s { font-size: 13px; color: var(--text-3); font-weight: 600; }
.bl-date { align-items: center; }
.date-chip { width: 60px; height: 64px; border-radius: 16px; background: var(--blue-50); border: 1px solid var(--blue-200); display: grid; place-items: center; align-content: center; line-height: 1.1; flex: none; }
.date-chip b { font-size: 22px; color: var(--blue-800); }
.date-chip small { font-size: 12.5px; color: var(--blue-700); text-transform: uppercase; font-weight: 650; }
.date-chip.late { background: var(--err-50); border-color: var(--err-200); }
.date-chip.late b, .date-chip.late small { color: var(--err-700); }
.contact { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--ink-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact .ic { width: 16px; height: 16px; color: var(--text-3); }
.chev { color: var(--text-3); justify-self: end; padding-right: 14px; }
.balao[data-href]:hover .chev { color: var(--blue-600); }
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-list .ml { display: flex; align-items: center; gap: 10px; font-size: 14.5px; min-width: 0; }
.mini-list .ml .ml-d { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .ml .ml-v { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.mini-list .ml .ml-v.neg { color: var(--err-700); }

/* colunas por tipo de balão */
.b-agenda { --cols: 108px minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(170px, auto); }   /* L3-022: o nome de três palavras cabe em menos linhas */
.b-cli    { --cols: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, 1fr) 40px; }
.b-res    { --cols: 92px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .9fr) 40px; }
.b-fin    { --cols: 92px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(150px, auto); }
.b-cau    { --cols: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(150px, auto); }
.b-lan    { --cols: 92px minmax(0, 3fr) minmax(0, 1fr); }
.b-avi    { --cols: 72px minmax(0, 2fr) minmax(0, 1fr) auto; }
.b-pec    { --cols: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.bl-icon { align-items: center; }
.bl-icon .n-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }

@container (max-width: 900px) {
  .balao { display: flex; flex-wrap: wrap; row-gap: 12px; padding: 16px 8px; }
  .bl { flex: 1 1 210px; }
  .bl + .bl { border-left: 0; }
  .bl-time, .bl-date, .bl-icon { flex: 0 0 auto; }
  .bl-act { flex: 1 1 100%; justify-content: flex-start; border-top: 1px solid var(--line-100); padding-top: 12px; }
  .chev { display: none; }
}
@container (max-width: 520px) {
  .bl { flex-basis: 100%; }
  .bl-time, .bl-date, .bl-icon { flex-basis: auto; }
  .bl-t, .bl-s { white-space: normal; }
}

/* Próximos dias */
.days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.day { padding: 18px; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; color: var(--text); min-height: 150px; }
a.day:hover { border-color: var(--blue-400); background: var(--blue-50); text-decoration: none; }
.day .d-name { font-size: 14px; color: var(--text-3); text-transform: capitalize; font-weight: 600; }
.day .d-num { font-size: 26px; font-weight: 750; color: var(--blue-800); line-height: 1; margin-bottom: 4px; }
.day .d-line { font-size: 14px; color: var(--ink-600); display: flex; align-items: center; gap: 7px; }
.day .d-line .ic { width: 16px; height: 16px; color: var(--blue-600); }
.day .d-line.zero { color: var(--text-3); }
.day .d-line.zero .ic { color: var(--line-300); }

/* Calendário mensal */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 0 var(--card-p) var(--card-p); }
.cal .cal-dow { font-size: 13px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 4px 0; }
.cal .cal-day { min-height: 116px; padding: 8px; border-radius: 14px; background: var(--surface-1); border: 1px solid transparent; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal .cal-day.out { background: transparent; }
.cal .cal-day.today { border-color: var(--blue-600); background: var(--blue-50); }
.cal .cal-day.today .cd-num { background: var(--blue-600); color: #fff; }
.cd-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cd-num { font-weight: 650; font-variant-numeric: tabular-nums; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14.5px; color: var(--ink-700); }
.cd-occ { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.occ-bar { height: 6px; border-radius: 3px; background: var(--line-200); overflow: hidden; }
.occ-bar span { display: block; height: 100%; background: var(--blue-500); border-radius: 3px; }
.cd-ev { font-size: 12.5px; line-height: 1.3; padding: 3px 8px; border-radius: 8px; background: var(--blue-600); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cd-ev:hover { background: var(--blue-800); text-decoration: none; }
.cd-ev.late { background: var(--err-700); }
.cd-more { font-size: 12.5px; color: var(--text-2); }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mini-cal .mc-dow { font-size: 12.5px; color: var(--text-3); font-weight: 700; padding: 4px 0; }
.mini-cal button { font-size: 14.5px; border: 0; background: var(--surface-1); height: 44px; border-radius: 12px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.mini-cal button:hover { background: var(--blue-100); }
.mini-cal button.has { font-weight: 750; color: var(--blue-800); background: var(--blue-50); }
.mini-cal button.has::after { content: attr(data-n); font-size: 11px; font-weight: 700; color: var(--blue-600); }
.mini-cal button.today { box-shadow: inset 0 0 0 2px var(--blue-600); }
.mini-cal button[aria-pressed="true"] { background: var(--blue-600); color: #fff; }
.mini-cal button[aria-pressed="true"]::after { color: #fff; }
.mini-cal .mc-empty { height: 44px; }

/* Resumo lateral */
.summary { position: sticky; top: calc(var(--header-h) + var(--tab-h) + 40px); }
.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line-100); align-items: center; }
.sum-line:last-child { border-bottom: 0; }
.sum-line.total { font-weight: 750; font-size: 19px; color: var(--blue-800); }
.sum-line.neg { color: var(--err-700); }
.forma-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--blue-50); border: 1px solid var(--blue-200); margin-bottom: 8px; }
.forma-box strong { display: block; }
.forma-box small { color: var(--text-2); font-size: 14px; }
.parcela { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-1); margin-top: 8px; }
.parcela .p-d { display: flex; flex-direction: column; min-width: 0; }
.parcela .p-d span { font-size: 13.5px; color: var(--text-3); }
.parcela .p-v { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Escolha (radio em cartões) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.choice { position: relative; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--panel); }
.choice:hover { border-color: var(--blue-400); }
.choice input { position: absolute; opacity: 0; }
.choice .c-t { font-weight: 650; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.choice .c-t .radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-500); flex: none; }
.choice .c-s { font-size: 14px; color: var(--text-2); }
.choice:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.choice:has(input:checked) .radio-dot { border-color: var(--blue-600); background: radial-gradient(circle, var(--blue-600) 45%, transparent 50%); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }


/* Checklist de devolução */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist .check { padding: 10px 14px; border-radius: 12px; background: var(--surface-1); min-height: 48px; }
.checklist .check:has(input:checked) { background: var(--ok-50); color: var(--ok-700); }
.check-progress { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); }
.progress { flex: 1; height: 8px; background: var(--blue-100); border-radius: 4px; overflow: hidden; min-width: 100px; }
.dano-fields { display: flex; flex-direction: column; gap: 10px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--border); border-radius: var(--pill); cursor: pointer; font-weight: 600; }
.radio-row label:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); }
.radio-row input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }

/* Gráficos (relatórios) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 14.5px; }
.hbar .hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); display: flex; align-items: center; gap: 10px; }
.hbar .hb-track { height: 14px; background: var(--blue-50); border-radius: 7px; }
.hbar .hb-fill { height: 100%; background: var(--blue-500); border-radius: 7px; }
.hbar:hover .hb-fill { background: var(--blue-700); }
.hbar .hb-v { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.vbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 220px; padding-top: 22px; padding-left: 36px; border-bottom: 1px solid var(--border-strong); position: relative; }
.vbars .vb { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vbars .vb-fill { width: 70%; max-width: 40px; background: var(--blue-500); border-radius: 8px 8px 0 0; position: relative; }
.vbars .vb:hover .vb-fill { background: var(--blue-700); }
.vbars .vb-fill.fc { background: repeating-linear-gradient(135deg, var(--blue-200) 0 4px, var(--blue-100) 4px 8px); border: 1px dashed var(--blue-400); border-bottom: 0; }
.vbars .vb-v { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 12.5px; font-weight: 700; color: var(--ink-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vbars .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-200); font-size: 11.5px; color: var(--text-3); }
.vlabels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: 13px; color: var(--text-2); padding-top: 8px; padding-left: 36px; }
.legend { display: flex; gap: 16px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--blue-500); }
.legend i.fc { background: repeating-linear-gradient(135deg, var(--blue-200) 0 3px, var(--blue-100) 3px 6px); border: 1px dashed var(--blue-400); }

/* Usuários (balões) */
.usr { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) 150px 160px auto; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--panel); }
.usr + .usr { margin-top: 10px; }
.usr strong { display: block; }
.usr small { color: var(--text-3); font-size: 14px; display: block; }
.perm td:not(:first-child), .perm th:not(:first-child) { text-align: center; }

.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; align-items: center; }
.blocked { max-width: 600px; margin: 40px auto; width: 100%; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-100); font-size: 15px; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.occ { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-100); align-items: flex-start; }
.occ:last-child { border-bottom: 0; }
.occ .o-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-600); }
.occ .o-ic.dano { background: var(--err-50); color: var(--err-700); }
.occ .o-ic.ajuste { background: var(--warn-50); color: var(--warn-700); }
.diff-ok { color: var(--ok-700); font-weight: 600; } .diff-warn { color: var(--warn-700); font-weight: 600; } .diff-err { color: var(--err-700); font-weight: 600; }
.client-mini { display: flex; gap: 14px; align-items: center; }
.client-mini .cm-name { font-weight: 650; font-size: 18px; color: var(--text); }
.ellip { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

/* ---- Responsivo ---------------------------------------------------- */
.scrim { display: none; }
@media (max-width: 1240px) {
  .grid-main, .grid-main-wide, .grid-wide-left { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .piece-hero { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
  .usr { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .usr > :nth-child(3), .usr > :nth-child(5) { display: none; }
}
@media (max-width: 900px) {
  body.app, body.app.nav-collapsed { grid-template-columns: minmax(0, 1fr); --sidebar-w: 272px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: transform .22s; box-shadow: var(--sh-2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 36, 67, .4); z-index: 25; }
  body.nav-collapsed .brand-txt, body.nav-collapsed .nav-label, body.nav-collapsed .nav a .count, body.nav-collapsed .nav-sep span { display: revert; }
  .collapse-btn { display: none !important; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 0 16px; gap: 8px; height: 68px; }
  .relogio-topo { font-size: 12px; line-height: 1.2; }
  .relogio-topo .rt-longo { display: none; }
  .relogio-topo .rt-curto { display: inline-flex; flex-direction: row; gap: 5px; white-space: nowrap; }   /* celular: "20/10 10:40" numa linha só */
  .user-btn .u-txt, .user-btn > .ic, .search kbd, .topbar .new-label { display: none; }
  .user-btn { padding: 3px; }
  .search .input { height: 44px; }
  .tabbar { top: 68px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
  .tabs, .tab-count { display: none; }
  .tabs-mobile { display: flex; align-items: center; gap: 8px; width: 100%; }
  .tabs-mobile .select { flex: 1; min-height: 44px; }
  .view { padding: 20px 16px 48px; }
  h1 { font-size: 26px; } .hello h1 { font-size: 28px; }
  .grid-2, .grid-3, .piece-hero, .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .gal { max-width: 440px; }
  .measures { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
  .steps li:nth-child(3)::before { right: 50%; } .steps li:nth-child(4)::before { left: 50%; }
  .cal { gap: 4px; padding: 0 10px 12px; }
  .cal .cal-day { min-height: 64px; padding: 4px; }
  .cal .cd-ev, .cal .cd-more { display: none; }
  .hbar { grid-template-columns: 120px minmax(0, 1fr) 36px; }
  .form-grid .span-2 { grid-column: auto; }
  .vbars .vb-v { font-size: 10px; }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-h .btn-group { width: 100%; }
  .card-h { padding-left: 18px; padding-right: 18px; }
  .card-b { padding-left: 18px; padding-right: 18px; }
  .card-flush .card-b { padding-left: 0; padding-right: 0; }
}
@media (max-width: 560px) {
  .usr { grid-template-columns: auto minmax(0, 1fr); }
  .usr > :nth-child(n+4) { grid-column: 2; }
  .kpi .k-value { font-size: 26px; }
  .topbar .btn-primary { padding: 0 12px; }
  .search { min-width: 0; }
}

/* ---- Perfil: só o administrador vê Gestão ------------------------------- */
body:not(.perfil-administrador) .gestao { display: none !important; }
body.perfil-administrador .so-restrito { display: none !important; }

/* ---- Complementos ------------------------------------------------- */
.band-empty { display: flex; align-items: center; gap: 12px; padding: 22px 24px; border-radius: 22px; border: 1.5px dashed var(--border-strong); background: var(--surface-1); color: var(--text-3); }
.band-empty .ic { color: var(--ok-700); }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-600); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none; }
.grid-res { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.res-aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + var(--tab-h) + 40px); }
@media (max-width: 1500px) {
  .grid-res { grid-template-columns: minmax(0, 1fr); }
  .res-aside { order: -1; position: static; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 900px) { .res-aside { grid-template-columns: minmax(0, 1fr); } }
.res-aside .mini-cal button { height: 40px; }
.bl-date .hora-s { display: block; margin-top: 4px; width: 60px; }
.b-lan .bl-date { flex-direction: column; align-items: center; }

/* ---- Novidades (histórico das versões) ---- */
.nov-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.nov-list li { list-style: disc; }
.nov-sec { display: grid; gap: 8px; }
.nov-sec h3 { margin: 0; }
.nav-foot a.versao { color: var(--text-3); font-size: 14px; }
.nov-sec h3 { font-weight: 700; }
.nov-list strong { font-weight: 700; }

/* Subabas: quebram em linha (nenhuma fica escondida no celular) */
.subtabs { display: flex; flex-wrap: wrap; border-radius: 24px; }
.subtabs button { flex: 0 1 auto; }
.b-func, .b-forn { --cols: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(190px, auto); }
.b-med { --cols: 110px minmax(0, 1fr) repeat(4, minmax(0, .6fr)); }
.lgpd-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lgpd-linha + .lgpd-linha { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-100); }
.b-func .bl .badge, .b-forn .bl .badge { align-self: flex-start; }

/* campo com prefixo/sufixo curto não quebra linha (ex.: "dias antes") */
.input-group .prefix { white-space: nowrap; }



/* v0.6: aviso lido fica mais discreto (continua legível) */
.notif.is-lido, .balao.is-lido { opacity: .62; }

/* Quatro números lado a lado só quando cabem; no celular, um por linha (L2-007: o 2×2 fixo estourava 390 px). */
.kpis.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .kpis.kpis-2 { grid-template-columns: minmax(0, 1fr); } }
/* Tabela estreita: o título da coluna pode quebrar em duas linhas em vez de estourar a caixa (tabelas largas, 1440 px). */
.table.t-quebra th { white-space: normal; }

/* Chip da clínica (aberta/fechada hoje): volta lendo os horários; fechada = tom de aviso, com ícone de ponto e texto (nunca só cor). */
.clinica-aberta { margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: var(--blue-50); font-size: 14px; color: var(--ink-600); display: flex; gap: 10px; align-items: center; }
.clinica-aberta i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok-700); flex: none; }
.clinica-aberta.fechada i { background: var(--warn-700); }
body.nav-collapsed .clinica-aberta span { display: none; } body.nav-collapsed .clinica-aberta { justify-content: center; }
/* Impressão do contrato: só o documento. */
@page { size: A4; margin: 16mm; }
@media print {
  .sidebar, .topbar, .tabbar, .scrim, #virou-dia, .page-h .btn-group, .crumbs, .toasts, .subtabs { display: none !important; }
  .main { margin: 0 !important; } body { background: #fff; }
  .contrato-papel, .impresso { border: 0; box-shadow: none; }
  .impresso, .contrato-papel { break-inside: avoid; }
  .impresso a, .contrato-papel a { color: inherit; text-decoration: none; }
  .hidden { display: none !important; }
}
@media (max-width: 900px) { body.nav-collapsed .clinica-aberta span { display: revert; } body.nav-collapsed .clinica-aberta { justify-content: flex-start; } }
/* Horário de funcionamento: abre e fecha lado a lado, também no celular. */
.hr-linha { align-items: center; gap: 8px 16px; }
.hr-linha input[type=time] { width: 130px; }
.hr-linha > .row { flex-wrap: wrap; gap: 6px 10px; }

/* Tabelas no celular (v0.8): cada linha vira um cartão com "rótulo: valor", sem rolagem dentro do quadro. Os rótulos (data-label) vêm do cabeçalho,
   postos por app.js (rotularTabelas) em toda tabela .table, também nas que a tela redesenha depois. */
@media (max-width: 700px) {
  .table-wrap { overflow: visible; }
  .table, .table tbody, .table tfoot, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* some da vista, continua para leitor de tela */
  .table tr { padding: 10px var(--cell-px); border-bottom: 1px solid var(--line-100); }
  .table tbody tr:last-child, .table tfoot tr:last-child { border-bottom: 0; }
  .table th, .table td { height: auto; }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 5px 0; text-align: right; min-width: 0; }
  .table td::before { content: attr(data-label); flex: none; max-width: 45%; font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); text-align: left; }
  .table td:not([data-label])::before, .table td[data-label=""]::before, .table td:first-child::before { display: none; }
  .table td:first-child { justify-content: flex-start; text-align: left; font-weight: 650; padding-bottom: 8px; }
  .table td > * { min-width: 0; }
  .table td input, .table td select { max-width: 60%; }
  .table td.right { text-align: right; }
  .table tfoot td { background: transparent; }
  .table tfoot tr { background: var(--surface-1); }
}

/* L3-013: o mesmo "cartão por linha" quando a tabela não cabe no quadro (app.js mede: menu largo, tablet, coluna estreita) — nada rola na horizontal, nem dentro do quadro. */
.em-cartoes { overflow: visible; }
.em-cartoes > .table, .em-cartoes > .table tbody, .em-cartoes > .table tfoot, .em-cartoes > .table tr, .em-cartoes > .table td { display: block; width: 100%; }
.em-cartoes > .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.em-cartoes > .table thead tr, .em-cartoes > .table thead th { display: block; width: 1px; max-width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; white-space: nowrap; }   /* o cabeçalho escondido não pode ter largura: o leitor de tela continua lendo */
.em-cartoes > .table tr { padding: 10px var(--cell-px); border-bottom: 1px solid var(--line-100); }
.em-cartoes > .table tbody tr:last-child, .em-cartoes > .table tfoot tr:last-child { border-bottom: 0; }
.em-cartoes > .table th, .em-cartoes > .table td { height: auto; }
.em-cartoes > .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 5px 0; text-align: right; min-width: 0; }
.em-cartoes > .table td::before { content: attr(data-label); flex: none; max-width: 45%; font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); text-align: left; }
.em-cartoes > .table td:not([data-label])::before, .em-cartoes > .table td[data-label=""]::before, .em-cartoes > .table td:first-child::before { display: none; }
.em-cartoes > .table td:first-child { justify-content: flex-start; text-align: left; font-weight: 650; padding-bottom: 8px; }
.em-cartoes > .table td > * { min-width: 0; }
.em-cartoes > .table td > .cel { flex: 1; min-width: 0; text-align: right; overflow-wrap: anywhere; } .em-cartoes > .table td:first-child > .cel { text-align: left; }
.em-cartoes > .table td input, .em-cartoes > .table td select { max-width: 60%; }
.em-cartoes > .table tfoot td { background: transparent; } .em-cartoes > .table tfoot tr { background: var(--surface-1); }

/* Carregando (v0.8): componente do guia — mensagem + indicador; o giro para quando a pessoa pede menos movimento. */
.loading-ov { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(15, 30, 60, .35); }
.loading-box { display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-radius: var(--radius-lg); background: var(--surface-0); color: var(--ink-700); font-size: 16px; font-weight: 600; box-shadow: var(--shadow-pop); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--blue-800); animation: gira .8s linear infinite; flex: none; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--blue-100); border-right-color: var(--blue-800); } }
/* Campo de data/hora: o foco fica nos segmentos internos; o contorno vai para o campo todo. */
input[type=date]:focus-within, input[type=time]:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); outline: none; }

/* Calendário (v0.9): marcas de prova, devolução, lavagem, ajuste, bloqueio e dia de clínica fechada — sempre com texto, nunca só cor. */
.cd-tag { display: flex; align-items: center; gap: 4px; margin-top: 3px; padding: 2px 6px; border-radius: 8px; font-size: 12px; font-weight: 650; line-height: 1.3; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--blue-50); color: var(--ink-700); border: 1px solid var(--line-100); }
.cd-tag .ic { width: 12px; height: 12px; flex: none; }
.cd-tag.prova, .cd-tag.ajuste { background: var(--warn-50); color: var(--warn-700); border-color: var(--warn-200); }
.cd-tag.lav { background: var(--info-50, var(--blue-50)); color: var(--blue-800); }
.cd-tag.bloq { background: var(--surface-1); color: var(--ink-700); border-style: dashed; }
.cal-day.closed { background: repeating-linear-gradient(135deg, var(--surface-1), var(--surface-1) 8px, var(--surface-0) 8px, var(--surface-0) 16px); }
.cd-closed { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12px; font-weight: 650; color: var(--ink-700); }
.cd-closed .ic { width: 12px; height: 12px; }
.cd-key { display: inline-flex; align-items: center; gap: 6px; }
i.cd-tag, i.cd-closed { display: inline-block; width: 14px; height: 14px; margin: 0; padding: 0; border-radius: 4px; }
i.cd-closed { background: repeating-linear-gradient(135deg, var(--surface-1), var(--surface-1) 3px, var(--line-100) 3px, var(--line-100) 6px); border: 1px solid var(--line-100); }

.legend .cd-key i.cd-tag { border: 1px solid var(--line-100); width: 14px; height: 14px; }
.legend .cd-key i.cd-tag.prova, .legend .cd-key i.cd-tag.ajuste { background: var(--warn-50); border-color: var(--warn-200); }
.legend .cd-key i.cd-tag.dev, .legend .cd-key i.cd-tag.lav { background: var(--blue-50); }
.legend .cd-key i.cd-tag.bloq { background: var(--surface-1); border-style: dashed; }
.cd-n { margin-left: auto; font-variant-numeric: tabular-nums; }
.cd-n { display: none; }
.cd-tag.res { display: none; }   /* no celular as marcas do dia viram ícone + número (L3-012) */
/* Celular: a célula do dia é estreita — as marcas viram ícone + número; o texto continua para leitor de tela e no título. */
@media (max-width: 700px) {
  .cd-tag .cd-t, .cd-closed .cd-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cd-tag .cd-n { display: inline; margin-left: 2px; }
  .cd-tag { padding: 2px 3px; gap: 2px; justify-content: center; }
  .cd-closed { justify-content: center; }
  .cd-tag.res { display: flex; }
  .cal .cd-occ { display: none; }   /* a barra já mostra a ocupação; o texto "N itens" não cabe na célula */
}

/* ---- v0.2 · cadastros (pacientes e cadastros da clínica) ---- */
.b-pac { --cols: minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.2fr) 40px; }
.b-cad { --cols: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) 40px; }
.b-pac .bl .badge, .b-cad .bl .badge { align-self: flex-start; }
.selos { display: flex; gap: 6px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.dl dt { color: var(--text-3); font-size: 14.5px; font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl .vazio { color: var(--text-3); }
.ficha-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.ficha-head .fh-txt { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.ficha-head h1 { font-size: 30px; }
.tabs-link { display: flex; gap: 8px; flex-wrap: wrap; }
.motivo { font-size: 13.5px; color: var(--text-3); }
.priv-linha { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 0; }
.priv-linha + .priv-linha { border-top: 1px solid var(--line-100); }
.priv-linha .pl-txt { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.hor-dia { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; padding: 12px 0; align-items: start; }
.hor-dia + .hor-dia { border-top: 1px solid var(--line-100); }
.hor-iv { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.hor-iv .input { width: 156px; min-height: 44px; }
.b-pac .bl-who .bl-s { white-space: normal; }
.hor-lista { display: flex; flex-direction: column; min-width: 0; }
.cor-bolinha { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sub-chips { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .dl dd { margin-bottom: 10px; } .hor-dia { grid-template-columns: minmax(0, 1fr); } }

/* ---- v0.3 · agenda: grade do dia/semana (computador) e lista por profissional (celular) ---- */
.ag-bar { align-items: flex-end; }
.ag-titulo { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-grid { display: grid; grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr)); gap: 0 8px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--sh-1); padding: 12px; }
.ag-head { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 10px; min-width: 0; border-bottom: 1px solid var(--line-100); }
.ag-head strong { font-size: 15.5px; overflow-wrap: anywhere; }
.ag-obs { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 2px; }
.ag-horas { position: relative; }
.ag-horas span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ag-col { position: relative; min-width: 0; border-left: 1px solid var(--line-100); background-image: repeating-linear-gradient(to bottom, var(--line-100) 0, var(--line-100) 1px, transparent 1px, transparent 96px); cursor: cell; }
.ag-faixa { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--surface-1) 6px, var(--surface-1) 12px); color: var(--text-3); font-size: 12.5px; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-start; cursor: default; }
.ag-faixa.ag-bloqueio { background: var(--warn-50); color: var(--warn-700); border-top: 1px dashed var(--warn-200); border-bottom: 1px dashed var(--warn-200); }
.ag-faixa.ag-feriado, .ag-faixa.ag-fechada { background: var(--surface-2); }
.ag-faixa-t { padding: 3px 8px; font-weight: 600; }
.ag-faixa-x { min-height: 24px; padding: 0 6px; position: relative; z-index: 5; }   /* o botão de remover fica por cima das consultas que cruzam o bloqueio */
.ag-bloco { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--blue-200); background: var(--blue-50); color: var(--text); text-decoration: none; font-size: 13.5px; line-height: 1.25; box-shadow: var(--sh-1); }
.ag-bloco:hover { border-color: var(--blue-500); text-decoration: none; z-index: 3; }
.ag-bloco .ag-b-h { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ag-bloco .ag-b-n { font-weight: 650; overflow-wrap: anywhere; }
.ag-bloco .ag-b-s { color: var(--text-2); font-size: 12.5px; }
/* L1-015: o cartão da agenda cabe em 30 min (46 px): linha 1 = hora + nome (uma linha), linha 2 = alerta clínico compacto + situação; nada fica cortado. */
.ag-bloco { padding: 2px 8px; }
.ag-bloco .ag-b-1 { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.ag-bloco .ag-b-1 .ag-b-h { flex: none; } .ag-bloco .ag-b-1 .ag-b-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.ag-bloco .ag-b-b { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.ag-bloco .ag-b-b .badge { flex: none; max-width: 100%; } .badge-al .al-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-bloco .ag-b-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-bloco .ag-b-b .badge { font-size: 11.5px; padding: 1px 7px 1px 5px; } .ag-bloco .ag-b-b .badge .ic { width: 12px; height: 12px; }
.ag-bloco.sit-confirmado { background: var(--ok-50); border-color: var(--ok-200); }
.ag-bloco.sit-chegou, .ag-bloco.sit-em-atendimento { background: var(--blue-100); border-color: var(--blue-500); }
.ag-bloco.sit-atendido { background: var(--surface-1); border-color: var(--border); color: var(--text-2); }
.ag-bloco.sit-faltou { background: var(--err-50); border-color: var(--err-200); }
.ag-bloco.is-encaixe { border-style: dashed; border-color: var(--warn-700); }
.ag-bloco.is-atraso { box-shadow: inset 4px 0 0 var(--err-700), var(--sh-1); }
.ag-agora { position: absolute; left: 0; right: 0; z-index: 4; height: 0; border-top: 2px solid var(--err-700); pointer-events: none; }
.ag-agora span { position: absolute; left: 0; top: -9px; background: var(--err-700); color: #fff; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 0 8px 8px 0; }
.ag-lista { display: none; flex-direction: column; gap: 14px; }
.ag-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); color: var(--text); text-decoration: none; }
.ag-item:hover { border-color: var(--blue-300); text-decoration: none; }
.ag-item.sit-confirmado { background: var(--ok-50); } .ag-item.sit-chegou, .ag-item.sit-em-atendimento { background: var(--blue-50); } .ag-item.sit-faltou { background: var(--err-50); } .ag-item.sit-atendido { background: var(--surface-1); }
.ag-i-h { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; } .ag-i-h b { font-size: 20px; color: var(--blue-800); } .ag-i-h small { color: var(--text-3); }
.ag-i-c { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .ag-i-c strong { overflow-wrap: anywhere; } .ag-i-b { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.ag-item-faixa { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 14.5px; }
.ag-item-faixa.ag-bloqueio { background: var(--warn-50); color: var(--warn-700); }
.ag-sec .card-h h2 { font-size: 18px; }
@media (max-width: 900px) { .ag-grid { display: none; } .ag-lista { display: flex; } }

/* ---- v0.4 · prontuário: odontograma (símbolo + cor + texto), lista por quadrante, alertas clínicos ---- */
.ag-b-al { display: flex; gap: 4px; flex-wrap: wrap; } .ag-b-al .badge { font-size: 11.5px; padding: 1px 7px 1px 5px; } .ag-b-al .badge .ic { width: 12px; height: 12px; }
.odo-grade { display: flex; flex-direction: column; gap: 18px; }
.odo-arco { display: flex; flex-direction: column; gap: 8px; }
.odo-linha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.odo-quad { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 12px; background: var(--surface-1); }
.odo-arco[data-arco="decidua"] .odo-quad { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.odo-dente { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; min-height: 76px; padding: 4px 1px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.odo-dente:hover { border-color: var(--blue-400); }
.odo-dente.is-sel { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); background: var(--blue-50); }
.odo-dente.tem { border-color: var(--blue-300); }
.odo-n { font-size: 12px; font-weight: 700; color: var(--blue-800); font-variant-numeric: tabular-nums; }
.odo-mini { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 36px; font-size: 10px; line-height: 1.15; text-align: center; font-weight: 700; }
.odo-f { display: block; min-height: 10px; } .odo-sym { font-size: 14px; font-weight: 700; line-height: 1; min-height: 14px; }
.odo-res { font-size: 11px; line-height: 1.15; color: var(--text-2); text-align: center; overflow-wrap: anywhere; max-height: 3.5em; overflow: hidden; }
.odo-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; } .odo-leg-i { font-size: 14px; display: inline-flex; gap: 6px; align-items: center; } .odo-leg-i b { font-size: 16px; min-width: 18px; text-align: center; }
tr.is-sel td { background: var(--blue-50); }
@media (max-width: 700px) { .odo-linha { grid-template-columns: minmax(0, 1fr); } .odo-dente { min-height: 70px; } .odo-n { font-size: 12px; }
  /* L1-016: no celular a grade usa 4 dentes por linha (texto do estado em 12 px legível), e a lista por quadrante só gasta altura com os dentes que têm registro. */
  .odo-quad, .odo-arco[data-arco="decidua"] .odo-quad { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .odo-res { font-size: 12px; max-height: 4.6em; } .odo-mini { max-width: 48px; font-size: 11px; } }
.odo-sem { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); } .odo-sem .btn { min-width: 44px; min-height: 36px; }

/* ---- v0.4.1 · acabamento da revisão do loop 1 (L1-005, L1-018, L1-019) ---- */
/* nome do paciente quebra em vez de ser cortado; selo clínico respeita a coluna */
.b-agenda .bl-who .bl-t { white-space: normal; overflow-wrap: anywhere; }
.bl-who > div { min-width: 0; } .bl-who .selos .badge { max-width: 100%; white-space: normal; }
/* Início no celular: números em 2 colunas compactas (o primeiro ocupa a linha) e consultas em 3 linhas */
@media (max-width: 560px) {
  .kpis[data-numeros] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis[data-numeros] .kpi { padding: 12px 14px; gap: 4px; } .kpis[data-numeros] .kpi.k-hero { grid-column: 1 / -1; }
  .kpis[data-numeros] .k-label { font-size: 13px; gap: 8px; } .kpis[data-numeros] .k-label .ic { width: 28px; height: 28px; padding: 6px; }
  .kpis[data-numeros] .k-value { font-size: 24px; } .kpis[data-numeros] .k-foot { font-size: 12px; }
}
@container (max-width: 560px) {
  .b-agenda { column-gap: 10px; row-gap: 8px; padding: 12px 8px; }
  .b-agenda .bl { flex: 1 1 130px; }
  .b-agenda .bl-time { flex: 0 0 auto; } .b-agenda .bl-who { flex: 1 1 200px; min-width: 0; }
  .b-agenda .bl { min-width: 0; } .b-agenda .selos { min-width: 0; } .b-agenda .bl .badge { max-width: 100%; white-space: normal; }
  .b-agenda .bl-act { flex: 1 1 100%; gap: 12px; padding-top: 10px; } .b-agenda .bl-act .btn { min-height: 44px; }   /* alvo de toque ≥ 44 px e respiro entre "Chegou" e "Falta" */
}
/* aviso com botão (ex.: "Anamnese vencida — atualizar") no celular: o botão desce para a linha de baixo em vez de sair da tela */
@media (max-width: 560px) { .alert[data-anamnese-vencida] { flex-wrap: wrap; } .alert[data-anamnese-vencida] > div { flex: 1 1 200px; min-width: 0; } .alert[data-anamnese-vencida] > .btn { flex: 1 1 100%; } }

/* ---- v0.5 · orçamento, recebimentos, caixa e impressos ---- */
.imp { max-width: 820px; margin-inline: auto; } .imp h1 { font-size: 24px; } .imp h2 { font-size: 18px; margin: 14px 0 6px; }
.imp-cab { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 2px solid var(--blue-600); } .imp-cab strong { font-size: 20px; color: var(--blue-800); }
.assin { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 36px; text-align: center; } .assin span { flex: 1 1 240px; }
.contrato { line-height: 1.55; }
td.right, th.right { text-align: right; } .num { font-variant-numeric: tabular-nums; }
@media print { .no-print { display: none !important; } .imp { max-width: none; box-shadow: none; border: 0; } }

/* v0.6 — documentos clínicos: impresso A4 (uma página, só o documento), imagens simuladas */
@page { size: A4; margin: 15mm; }
.imp-doc { background: #fff; color: #111; max-width: 794px; margin: 0 auto; padding: 24px 28px; border: 1px solid var(--line, #d8dee6); border-radius: 8px; position: relative; }
.imp-meta { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0; font-size: 14px; }
.via-selo { border: 1px solid #111; padding: 1px 8px; border-radius: 4px; font-size: 12px; text-transform: uppercase; }
.imp-texto { white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 1.5; margin: 0 0 16px; }
.imp-doc-via { padding: 8px 0; } .imp-doc-via + .imp-doc-via { border-top: 1px dashed #666; margin-top: 8px; }
.imp-doc-via[data-via-especial] .imp-texto { font-size: 13px; line-height: 1.35; margin-bottom: 8px; }
.via-rot { font-weight: 700; font-size: 12px; text-transform: uppercase; color: #333; margin-bottom: 4px; }
.marca-cancelado { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-20deg); font-size: 64px; font-weight: 800; color: rgba(200, 30, 30, .25); border: 6px solid rgba(200, 30, 30, .25); padding: 4px 24px; pointer-events: none; }
.imp-cancel { font-size: 12px; color: #a00; border-top: 1px solid #a00; padding-top: 6px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.img-card { overflow: hidden; } .img-card.is-arquivada { opacity: .7; }
.img-fake { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 130px; background: repeating-linear-gradient(45deg, #1e293b, #1e293b 10px, #243246 10px, #243246 20px); color: #cbd5e1; }
.img-fake small { font-size: 11px; opacity: .7; }
@media print {
  body:has(.imp-doc) .sidebar, body:has(.imp-doc) .topbar, body:has(.imp-doc) .tabbar, body:has(.imp-doc) .page-h, body:has(.imp-doc) footer, body:has(.imp-doc) .rodape { display: none !important; }
  body:has(.imp-doc) { background: #fff; } body:has(.imp-doc) .main, body:has(.imp-doc) main { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
  .imp-doc { border: 0; border-radius: 0; padding: 0; max-width: none; break-inside: avoid; page-break-inside: avoid; }
}

/* ---- v0.6.1 · acabamento da revisão do loop 2 ---- */
/* L2-012: faixa "Laboratório" do Início usa a largura toda (título completo + botão), como a agenda */
.b-lab { --cols: minmax(0, 1fr) auto; }
.b-lab .bl-t, .b-lab .bl-s { white-space: normal; overflow-wrap: anywhere; }
/* L1-019 (a): o nome do profissional nos cartões do Início não é cortado */
.b-agenda .bl-who .bl-s { white-space: normal; overflow-wrap: anywhere; }
/* L3-022: a mensagem pronta do “Confirmar amanhã” ocupa uma linha inteira embaixo (antes ficava numa coluna de ~120 px, em 10 linhas) */
.balao .bl-msg { grid-column: 1 / -1; flex: 1 1 100%; border-left: 0; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--line-100); }
.balao .bl-msg .bl-s { white-space: normal; overflow-wrap: anywhere; color: var(--text-2); }
/* L2-021: a explicação do grupo de itens do "Aprovar" fica abaixo da legenda, não dentro dela */
fieldset.field > legend.field-label { white-space: normal; max-width: 100%; }

/* ---- v0.7 · gestão: financeiro, relatórios, LGPD, mensagens ---- */
.rel-bar { display: inline-block; width: 100%; min-width: 80px; max-width: 260px; height: 10px; border-radius: 6px; background: var(--surface-2, #eef2f7); vertical-align: middle; overflow: hidden; }
.rel-bar > i { display: block; height: 100%; background: var(--blue-500); border-radius: 6px; }
.chips .chip .ic-sm { margin-right: 6px; }
[data-export-texto] { width: 100%; font-size: 12px; line-height: 1.4; }
@media print { body.imp-export .view:not(.hidden) .nx { display: none !important; } body.imp-export [data-export-resultado] .no-print { display: none !important; } body.imp-export [data-export-texto] { border: 0; height: auto; min-height: 60vh; overflow: visible; resize: none; } }

/* célula com várias partes (v0.7): no cartão do celular ocupa uma coluna só, alinhada à direita */
@media (max-width: 700px) { .table td > .cel { flex: 1; min-width: 0; text-align: right; overflow-wrap: anywhere; } .table td:first-child > .cel { text-align: left; } }

/* ---- v0.8 · menu lateral alcançável em telas baixas ----
   Em até 900 px de altura o menu se compacta (item de 34 px, sem a linha de descrição, rodapé em uma linha de ícones) para caber inteiro, Gestão incluída; se ainda assim não couber
   (janela muito baixa), a rolagem aparece (barra sempre visível + sombra de aviso em cima e embaixo) e o item da tela aberta rola sozinho até a vista. Nada fica atrás de rolagem escondida. */
.nav { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; scrollbar-gutter: stable;
  background: linear-gradient(var(--panel) 30%, transparent) top / 100% 18px no-repeat local, linear-gradient(transparent, var(--panel) 70%) bottom / 100% 18px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(15, 40, 80, .18), transparent) top / 100% 8px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, rgba(15, 40, 80, .18), transparent) bottom / 100% 8px no-repeat scroll; }
.nav::-webkit-scrollbar { width: 8px; } .nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
@media (max-height: 900px) {
  .sidebar { padding: 12px 12px; } .brand { padding: 0 4px 10px; } .brand-mark { width: 38px; height: 38px; } .brand-mark .logo { width: 32px; height: 32px; } .brand-sys { display: none; }
  .nav { gap: 2px; } .nav a { min-height: 34px; padding: 4px 12px; gap: 12px; font-size: 15px; } .nav a .nav-label small { display: none; } .nav a .ic { width: 20px; height: 20px; }
  .nav-sep { margin: 8px 12px 2px; font-size: 12px; } .nav-locked { margin-top: 8px; padding: 8px 10px; font-size: 13px; }
  .nav-foot { flex-direction: row; flex-wrap: wrap; gap: 2px; padding-top: 6px; } .nav-foot a, .nav-foot button { min-height: 34px; padding: 0 10px; gap: 8px; width: auto; flex: 1 1 auto; font-size: 14px; }
  .nav-foot .nav-label { display: none; } .nav-foot a.versao .nav-label { display: inline; font-size: 13px; } .clinica-aberta { margin-top: 4px; padding: 6px 10px; font-size: 13px; }
}
@media (max-height: 700px) { .nav a { min-height: 32px; padding: 3px 10px; } .nav-foot a.versao .nav-label { display: none; } }

/* v0.8 · timbre e impressos em A4 (uma página quando couber) */
.imp-logo { color: var(--blue-700); } .imp-logo .ic { width: 28px; height: 28px; }
.imp-rod { margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-600); text-align: center; }
@media print { .imp-rod { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; background: #fff; } .imp, .imp-doc { padding-bottom: 28px; } .imp h1 { font-size: 20px; } .imp { font-size: 12.5pt; } table { break-inside: avoid; } tr { break-inside: avoid; } .imp-doc { border: 0; } }
.carne-lista { display: grid; gap: 0; } .carne-canhoto { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px dashed var(--border-strong); break-inside: avoid; } .carne-canhoto:last-child { border-bottom: 1px dashed var(--border-strong); }
.carne-canhoto > div:first-child { display: flex; flex-direction: column; } @media (max-width: 560px) { .carne-canhoto { grid-template-columns: 1fr; gap: 4px; } }
@media print { body.app { display: block; min-height: 0; } .imp-a4 { box-shadow: none; border: 0; padding: 0; } .imp-a4 .card-b { padding: 0; } .imp-a4 dl.dl { break-inside: avoid; } }
@media print { .imp-a4 { font-size: 11pt; } .imp-a4 .table th, .imp-a4 .table td { padding: 4px 8px; font-size: 10.5pt; } .imp-a4 h1 { font-size: 17pt; margin: 6px 0; } .imp-a4 .stack { gap: 8px; } }

/* v0.9 · largura do menu ajustável (200–400 px): separador na borda direita do menu; some com o menu recolhido e no celular (gaveta) */
.sidebar-resizer { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 31; touch-action: none; }
.sidebar-resizer::after { content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 2px; background: transparent; transition: background .15s; }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, body.nav-arrastando .sidebar-resizer::after { background: var(--blue-500); }
.sidebar-resizer:focus-visible { outline: 2px solid var(--blue-600); outline-offset: -2px; }
body.nav-arrastando { cursor: col-resize; user-select: none; } body.nav-arrastando .sidebar { transition: none; }
body.nav-collapsed .sidebar-resizer { display: none; }
@media (max-width: 900px) { .sidebar-resizer { display: none; } }
/* v0.9 · etiquetas (6 por folha A4, 2 × 3), QR ilustrativo do carnê */
.etiquetas-folha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.etiqueta { border: 1px dashed var(--border-strong); border-radius: 6px; padding: 14px 16px; min-height: 120px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; break-inside: avoid; } .etiqueta em { margin-top: 6px; font-size: 13px; color: var(--ink-600); }
@media (max-width: 560px) { .etiquetas-folha { grid-template-columns: 1fr; } }
@media print { .imp-etiquetas .etiquetas-folha { gap: 0; } .imp-etiquetas .etiqueta { border: 0; border-radius: 0; height: 85mm; min-height: 0; padding: 12mm 10mm; font-size: 12pt; page-break-inside: avoid; } .imp-etiquetas .etiqueta:nth-child(6n) { page-break-after: always; } }
.carne-pix { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .carne-pix p { margin: 0; flex: 1 1 240px; } .carne-pix code { word-break: break-all; font-size: 11px; } .qr-ilustrativo { flex: none; border: 1px solid var(--border-strong); border-radius: 4px; color: #111; background: #fff; }
/* v0.9 · agenda: visão do mês */
.mes-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; } .mes-cab { text-align: center; font-size: 13px; font-weight: 650; color: var(--ink-600); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0; }
.mes-cel { min-height: 76px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font: inherit; color: inherit; cursor: pointer; text-align: left; } .mes-cel.vazio { border: 0; background: transparent; cursor: default; }
.mes-cel:hover:not(.vazio) { border-color: var(--blue-500); } .mes-cel.hoje { border-color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600); } .mes-cel.fechado { background: var(--blue-50); color: var(--ink-600); } .mes-cel.tem .mes-q { color: var(--blue-800); font-weight: 650; }
.mes-n { font-weight: 700; font-size: 16px; } .mes-q { font-size: 12.5px; color: var(--ink-600); }
@media (max-width: 560px) { .mes-grade { gap: 3px; } .mes-cel { min-height: 56px; padding: 4px; } .mes-q { font-size: 11px; } }

/* Agenda (L3-013): a grade por profissional precisa de largura; com o conteúdo estreito (menu largo no tablet) ela vira a lista, como no celular. Fica no FIM do arquivo: a regra base da .ag-grid vem antes e, com a mesma especificidade, a última vence. */
.views { container-type: inline-size; container-name: conteudo; }
@container conteudo (max-width: 760px) { .ag-grid { display: none; } .ag-lista { display: flex; } }
