/* =====================================================================
   Aurea Health — design system & shell
   Palette §5 · radii 6–12 · transitions 150–250ms · dense enterprise UI
   ===================================================================== */
:root {
  --ink: #142C3C;          /* azul petróleo escuro */
  --ink-2: #1B3749;
  --ink-3: #24465B;
  --primary: #294D65;      /* azul institucional */
  --accent: #416D92;       /* azul de interação */
  --accent-50: #EEF3F8;
  --accent-100: #DCE7F1;
  --teal: #47796D;         /* verde acinzentado */
  --teal-50: #EDF4F2;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F4F8;
  --text: #202C39;
  --text-2: #64748B;
  --text-3: #8A97A8;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --success: #32765D;
  --success-50: #EBF4F0;
  --warn: #B28742;
  --warn-text: #8A6427;
  --warn-50: #FBF4E8;
  --danger: #B94D55;
  --danger-50: #FBEEEF;
  --info: #416D92;
  --info-50: #EEF3F8;
  --neutral: #94A3B8;
  --neutral-50: #F1F5F9;

  --r-xs: 6px; --r-sm: 7px; --r: 8px; --r-md: 10px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(20, 44, 60, .05);
  --sh-2: 0 1px 3px rgba(20, 44, 60, .06), 0 4px 12px rgba(20, 44, 60, .04);
  --sh-3: 0 10px 30px rgba(20, 44, 60, .14), 0 2px 6px rgba(20, 44, 60, .06);
  --sh-4: 0 24px 60px rgba(13, 30, 42, .22), 0 4px 12px rgba(13, 30, 42, .08);
  --ring: 0 0 0 3px rgba(65, 109, 146, .28);
  --t: 180ms cubic-bezier(.2, .6, .2, 1);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sb-w: 252px;
  --sb-w-c: 64px;
  --top-h: 56px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-100); }
.num, .tabular, td.num, .kpi-value, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.t-success { color: var(--success); } .t-warn { color: var(--warn-text); } .t-danger { color: var(--danger); }
.t-info, .t-accent { color: var(--accent); } .t-neutral { color: var(--text-2); } .t-teal { color: var(--teal); } .t-primary { color: var(--primary); }

/* ---------- layout primitives (module authors) ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.row-nw { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cols-2-1 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-1-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.cols-3-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi-grid.dense { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; border: 0; }

/* =====================================================================
   SHELL
   ===================================================================== */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: var(--sb-w);
  background: var(--ink); color: #C9D6E0; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .04); transition: width var(--t), transform var(--t);
}
.sb-brand { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 16px; flex: none; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sb-logo { width: 30px; height: 30px; border-radius: 8px; background: #E9EFF4; color: var(--ink); display: grid; place-items: center; flex: none; }
.sb-logo svg { width: 18px; height: 18px; }
.sb-brand-text { min-width: 0; line-height: 1.15; }
.sb-brand-name { color: #fff; font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.sb-brand-sub { color: #8FA6B6; font-size: 11.5px; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.sb-nav::-webkit-scrollbar { width: 6px; } .sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.sb-group { margin-bottom: 4px; }
.sb-group-h {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 0; background: none;
  color: #7F97A8; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; padding: 10px 10px 6px; border-radius: 6px;
}
.sb-group-h:hover { color: #B9CAD6; }
.sb-group-h .ic { transition: transform var(--t); opacity: .7; }
.sb-group.collapsed .sb-group-h .ic { transform: rotate(-90deg); }
.sb-group.collapsed .sb-items { display: none; }
.sb-items { list-style: none; margin: 0; padding: 0; }
.sb-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 7px; color: #C3D1DC;
  font-size: 13.5px; text-decoration: none; position: relative; transition: background var(--t), color var(--t); white-space: nowrap;
}
.sb-item:hover { background: rgba(255, 255, 255, .055); color: #fff; text-decoration: none; }
.sb-item .ic { color: #8DA5B6; transition: color var(--t); }
.sb-item:hover .ic { color: #D5E1EA; }
.sb-item.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 550; }
.sb-item.active .ic { color: #fff; }
.sb-item.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #8FB8D8; }
.sb-item:focus-visible { outline: 2px solid #8FB8D8; outline-offset: -2px; }
.sb-label { overflow: hidden; text-overflow: ellipsis; }
.sb-foot { flex: none; border-top: 1px solid rgba(255, 255, 255, .06); padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; }
.sb-foot-btn { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: #A9BCCA; font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; }
.sb-foot-btn:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.sb-foot-btn.explore { color: #D6E3EC; background: rgba(143, 184, 216, .1); }
.sb-foot-btn.explore:hover { background: rgba(143, 184, 216, .18); }
.sb-overlay { position: fixed; inset: 0; background: rgba(13, 30, 42, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity var(--t); }

.main-wrap { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left var(--t); min-width: 0; }

/* collapsed sidebar (icon mode) */
.shell.sb-collapsed .sidebar { width: var(--sb-w-c); }
.shell.sb-collapsed .main-wrap { margin-left: var(--sb-w-c); }
.shell.sb-collapsed .sb-brand-text, .shell.sb-collapsed .sb-label, .shell.sb-collapsed .sb-group-h span, .shell.sb-collapsed .sb-foot-btn span { display: none; }
.shell.sb-collapsed .sb-brand { padding: 0 17px; }
.shell.sb-collapsed .sb-group-h { justify-content: center; padding: 8px 0 4px; }
.shell.sb-collapsed .sb-group-h .ic { display: none; }
.shell.sb-collapsed .sb-group-h::after { content: ""; display: block; width: 18px; height: 1px; background: rgba(255,255,255,.12); }
.shell.sb-collapsed .sb-group.collapsed .sb-items { display: block; }
.shell.sb-collapsed .sb-item, .shell.sb-collapsed .sb-foot-btn { justify-content: center; padding: 0; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 16px 0 12px; min-width: 0;
}
.tb-icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-2);
  position: relative; flex: none; transition: background var(--t), color var(--t);
}
.tb-icon-btn:hover { background: var(--surface-3); color: var(--text); }
.tb-inst { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; margin-right: 4px; }
.tb-inst-name { font-weight: 650; font-size: 14px; white-space: nowrap; }
.tb-inst-sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; text-align: left; }
.tb-inst-sub::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.tb-inst-sub:hover { color: var(--text); }
.tb-select { height: 34px; border: 1px solid var(--border); border-radius: 8px; background-color: var(--surface); padding: 0 28px 0 10px; font-size: 13px; color: var(--text); width: auto; max-width: 180px; flex: none; }
.tb-search {
  flex: 1 1 240px; max-width: 460px; min-width: 150px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2); color: var(--text-3); font-size: 13px; text-align: left; transition: border-color var(--t), background var(--t);
}
.tb-search:hover { border-color: var(--border-2); background: var(--surface); }
.tb-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { font: 500 11px/1 var(--font); color: var(--text-2); border: 1px solid var(--border); background: var(--surface); border-radius: 5px; padding: 3px 5px; white-space: nowrap; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.tb-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; padding: 0 6px; white-space: nowrap; }
.tb-clock b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-clock small { font-size: 11px; color: var(--text-2); }
.tb-count { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; border: 2px solid #fff; box-sizing: content-box; }
.tb-profile { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-profile .tb-select { max-width: 190px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 60px; height: 60px; font-size: 19px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.teal { background: var(--teal); } .avatar.accent { background: var(--accent); }
.env-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.env-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* privacy notice */
.privacy-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 20px; background: #EEF3F7; border-bottom: 1px solid #DCE5EC; color: #34536A; font-size: 12.5px; }
.privacy-bar .ic { color: var(--accent); }
.privacy-bar p { flex: 1; min-width: 0; }
.privacy-bar strong { font-weight: 600; }
.privacy-bar .tb-icon-btn { width: 26px; height: 26px; color: #5B7A90; }

.main { flex: 1; min-width: 0; padding: 22px 24px 40px; outline: none; }
.view { max-width: 1680px; margin: 0 auto; min-width: 0; }
.view-enter { animation: viewIn 200ms ease-out; }
@keyframes viewIn { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head-text { min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); margin-bottom: 4px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.page-title { font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 14px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .muted { font-weight: 400; font-size: 12.5px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.toolbar.flat { padding: 0; border: 0; margin-bottom: 12px; }
.toolbar .search-input { flex: 1 1 220px; max-width: 320px; }
.toolbar .spacer { flex: 1; }
.search-input { position: relative; display: flex; align-items: center; min-width: 0; }
.search-input .ic { position: absolute; left: 9px; color: var(--text-3); pointer-events: none; }
.search-input input, .search-input input[type] { padding-left: 30px; width: 100%; }

/* =====================================================================
   COMPONENTS
   ===================================================================== */
/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r);
  border: 1px solid transparent; font-size: 13px; font-weight: 550; line-height: 1; white-space: nowrap; user-select: none; text-decoration: none;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(20, 44, 60, .18); }
.btn-primary:hover { background: #22435A; }
.btn-primary:active { background: var(--ink); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--sh-1); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A4434B; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #2A654F; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #3A6385; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-xs { height: 24px; padding: 0 7px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 28px; } .btn-xs.btn-icon { width: 24px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.btn-group .btn.active { background: var(--accent-50); color: var(--primary); border-color: var(--accent-100); z-index: 1; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; font-size: inherit; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }

/* inputs */
.input, .select, .textarea, input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"], input[type="email"], input[type="tel"], select, textarea {
  height: 34px; width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text);
  font-size: 13.5px; transition: border-color var(--t), box-shadow var(--t); min-width: 0;
}
select, .select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
textarea, .textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-3); color: var(--text-2); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; cursor: pointer; flex: none; }
input[type="file"] { height: auto; padding: 6px; font-size: 12.5px; }
.input-sm, select.input-sm { height: 28px; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 550; color: #334155; }
.field .req { color: var(--danger); margin-left: 2px; }
.field-help { font-size: 11.5px; color: var(--text-2); }
.field-error { font-size: 11.5px; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid input:focus, .field.invalid select:focus, .field.invalid textarea:focus { box-shadow: 0 0 0 3px rgba(185, 77, 85, .18); }
.money-wrap { position: relative; display: flex; align-items: center; }
.money-wrap > span { position: absolute; left: 10px; color: var(--text-2); font-size: 13px; pointer-events: none; }
.money-wrap input, .money-wrap input[type] { padding-left: 32px; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; min-height: 22px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r); max-height: 190px; overflow: auto; background: var(--surface); }
.file-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.file-list li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .col-2 { grid-column: 1 / -1; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.dtable { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.card-b > .dtable:only-child { margin: -16px; border: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); background: transparent; }
.card-b.flush > .dtable:only-child { margin: 0; }
.drawer-b > .dtable:only-child, .modal-b > .dtable:only-child { border-radius: var(--r); }
.form-error { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--danger-50); border: 1px solid #F0D3D6; color: #8E3740; font-size: 13px; margin-bottom: 14px; }
.form-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); min-height: 50px; flex-wrap: wrap; }
.card-h-text { min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-b { padding: 16px; min-width: 0; }
.card-b.flush { padding: 0; }
.card-f { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.card.plain { box-shadow: none; }
.card.muted-bg { background: var(--surface-2); }
.card.clickable { cursor: pointer; transition: border-color var(--t), box-shadow var(--t); }
.card.clickable:hover { border-color: var(--border-2); box-shadow: var(--sh-2); }

/* KPI tiles */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; box-shadow: var(--sh-1); text-align: left; color: inherit; font: inherit; width: 100%; }
button.kpi, a.kpi { cursor: pointer; transition: border-color var(--t), box-shadow var(--t); text-decoration: none; }
button.kpi:hover, a.kpi:hover { border-color: var(--border-2); box-shadow: var(--sh-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--primary); flex: none; }
.kpi-value { font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 4px; min-height: 16px; }
.kpi-go { position: absolute; right: 10px; bottom: 10px; color: var(--text-3); opacity: 0; transition: opacity var(--t); }
button.kpi:hover .kpi-go, a.kpi:hover .kpi-go { opacity: 1; }
.kpi.tone-success .kpi-ic { background: var(--success-50); color: var(--success); }
.kpi.tone-warn .kpi-ic { background: var(--warn-50); color: var(--warn-text); }
.kpi.tone-danger .kpi-ic { background: var(--danger-50); color: var(--danger); }
.kpi.tone-info .kpi-ic, .kpi.tone-accent .kpi-ic { background: var(--accent-50); color: var(--accent); }
.kpi.tone-teal .kpi-ic { background: var(--teal-50); color: var(--teal); }
.kpi.tone-danger .kpi-value { color: var(--danger); }
.kpi-spark { margin-top: 2px; height: 26px; }

/* badges & tags */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 550; white-space: nowrap; line-height: 1; border: 1px solid transparent; vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }
.badge.no-dot::before { display: none; }
.tone-success.badge, .badge.tone-success { background: var(--success-50); color: var(--success); border-color: #D3E7DE; }
.tone-warn.badge, .badge.tone-warn { background: var(--warn-50); color: var(--warn-text); border-color: #F0E1C6; }
.tone-danger.badge, .badge.tone-danger { background: var(--danger-50); color: var(--danger); border-color: #F1D5D8; }
.tone-info.badge, .badge.tone-info { background: var(--info-50); color: var(--accent); border-color: var(--accent-100); }
.tone-accent.badge, .badge.tone-accent { background: #EEF0F8; color: #4A5A92; border-color: #DDE1F0; }
.tone-teal.badge, .badge.tone-teal { background: var(--teal-50); color: var(--teal); border-color: #D6E6E1; }
.tone-neutral.badge, .badge.tone-neutral { background: var(--neutral-50); color: #556274; border-color: var(--border); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; background: var(--surface-3); color: #475569; border: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.tag.tone-success { background: var(--success-50); color: var(--success); border-color: #D3E7DE; }
.tag.tone-warn { background: var(--warn-50); color: var(--warn-text); border-color: #F0E1C6; }
.tag.tone-danger { background: var(--danger-50); color: var(--danger); border-color: #F1D5D8; }
.tag.tone-info, .tag.tone-accent { background: var(--info-50); color: var(--accent); border-color: var(--accent-100); }
.tag.tone-teal { background: var(--teal-50); color: var(--teal); border-color: #D6E6E1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; vertical-align: middle; }
.dot.tone-success { background: var(--success); } .dot.tone-warn { background: var(--warn); } .dot.tone-danger { background: var(--danger); }
.dot.tone-info, .dot.tone-accent { background: var(--accent); } .dot.tone-teal { background: var(--teal); } .dot.tone-primary { background: var(--primary); }
/* triage colour chips (manual record) */
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.prio::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--neutral); }
.prio-vermelho::before { background: #B94D55; } .prio-laranja::before { background: #C47A45; } .prio-amarelo::before { background: #C9A548; }
.prio-verde::before { background: #4F8B6A; } .prio-azul::before { background: #4F7BA5; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; height: 38px; padding: 0 12px; font-size: 13.5px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: color var(--t), border-color var(--t); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab.active .tab-count { background: var(--accent-50); color: var(--primary); }
.card .tabs { padding: 0 12px; margin-bottom: 0; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; position: relative; }
.table-wrap.scroll-y { max-height: 520px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 11.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th .sort-ic { display: inline-flex; vertical-align: -3px; margin-left: 3px; opacity: .35; }
.tbl th.sorted .sort-ic { opacity: 1; color: var(--accent); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid #EDF1F5; vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background 120ms; }
.tbl tbody tr:hover { background: #F7F9FC; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.selected { background: var(--accent-50); }
.tbl tbody tr.selected:hover { background: #E5EDF5; }
.tbl tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl .right { text-align: right; }
.tbl .center { text-align: center; }
.tbl .col-check { width: 36px; padding-right: 0; }
.tbl .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.tbl td .cell-main { font-weight: 550; color: var(--text); }
.tbl td .cell-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.tbl.compact td { padding: 6px 10px; } .tbl.compact th { padding: 7px 10px; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--accent-50); border-bottom: 1px solid var(--accent-100); font-size: 12.5px; color: var(--primary); flex-wrap: wrap; }
.bulk-bar strong { font-weight: 600; margin-right: 4px; }
.tbl-empty { padding: 36px 16px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font-size: 12.5px; color: var(--text); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pager button:hover:not([disabled]) { background: var(--surface-2); border-color: var(--border-2); }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button[disabled] { opacity: .45; cursor: not-allowed; }
.pager .gap { padding: 0 4px; color: var(--text-3); }
.filter-select { width: auto; min-width: 130px; max-width: 200px; height: 32px; font-size: 12.5px; }

/* key/value list */
.dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 7px 16px; font-size: 13px; margin: 0; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.dl.cols-2 { grid-template-columns: minmax(110px, max-content) 1fr minmax(110px, max-content) 1fr; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.kv-grid .k { font-size: 11.5px; color: var(--text-2); }
.kv-grid .v { font-size: 13.5px; font-weight: 550; margin-top: 2px; overflow-wrap: anywhere; }

/* detail header */
.detail-head { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 16px; flex-wrap: wrap; }
.detail-head-main { flex: 1; min-width: 220px; }
.detail-title { font-size: 18px; font-weight: 650; letter-spacing: -.015em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 5px; font-size: 12.5px; color: var(--text-2); }
.detail-meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* callouts */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text); }
.callout .ic { margin-top: 1px; }
.callout.tone-info { background: var(--info-50); border-color: var(--accent-100); color: #2F4F69; } .callout.tone-info .ic { color: var(--accent); }
.callout.tone-warn { background: var(--warn-50); border-color: #F0E1C6; color: #6F5120; } .callout.tone-warn .ic { color: var(--warn); }
.callout.tone-danger { background: var(--danger-50); border-color: #F1D5D8; color: #873840; } .callout.tone-danger .ic { color: var(--danger); }
.callout.tone-success { background: var(--success-50); border-color: #D3E7DE; color: #285E4A; } .callout.tone-success .ic { color: var(--success); }

/* split panes */
.split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); }
.pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; overflow: hidden; }
.pane-scroll { max-height: calc(100vh - 230px); overflow-y: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #EDF1F5; cursor: pointer; transition: background 120ms; min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #F7F9FC; }
.list-item.active { background: var(--accent-50); box-shadow: inset 3px 0 0 var(--accent); }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-sub { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* progress */
.progress { display: block; width: 100%; height: 6px; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row .progress { flex: 1; }
.progress-row .num { font-size: 12px; color: var(--text-2); min-width: 38px; text-align: right; }

/* stepper */
.stepper { display: flex; align-items: flex-start; gap: 0; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; font-size: 11.5px; color: var(--text-3); padding: 0 4px; }
.step::before { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--border); }
.step:first-child::before { display: none; }
.step-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text-3); z-index: 1; font-variant-numeric: tabular-nums; }
.step.done { color: var(--text-2); } .step.done::before { background: var(--teal); }
.step.done .step-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.current { color: var(--text); font-weight: 600; } .step.current::before { background: var(--teal); }
.step.current .step-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--accent-50); }
.stepper.cancelled .step.current .step-dot { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 0 4px var(--danger-50); }
.stepper.cancelled .step.current { color: var(--danger); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child { padding-bottom: 0; } .tl-item:last-child::before { display: none; }
.tl-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--neutral); margin-top: 1px; position: relative; z-index: 1; }
.tl-dot.tone-success { border-color: var(--success); } .tl-dot.tone-warn { border-color: var(--warn); } .tl-dot.tone-danger { border-color: var(--danger); }
.tl-dot.tone-info, .tl-dot.tone-accent { border-color: var(--accent); } .tl-dot.tone-teal { border-color: var(--teal); } .tl-dot.tone-primary { border-color: var(--primary); }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-title { font-weight: 600; font-size: 13px; }
.tl-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; white-space: pre-line; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

/* checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ck-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; color: var(--text); }
.ck-item:hover { background: var(--surface-3); }
.ck-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-2); display: grid; place-items: center; flex: none; background: var(--surface); color: #fff; transition: background var(--t), border-color var(--t); }
.ck-item.done .ck-box { background: var(--teal); border-color: var(--teal); }
.ck-item.done .ck-label { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.ck-item[aria-disabled="true"] { cursor: default; }
.ck-item[aria-disabled="true"]:hover { background: none; }

/* empty state */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 20px; gap: 6px; color: var(--text-2); }
.empty-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); margin-bottom: 6px; }
.empty-title { font-weight: 600; color: var(--text); font-size: 14px; }
.empty-sub { font-size: 12.5px; max-width: 420px; }
.empty .btn { margin-top: 10px; }

/* skeleton */
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.sk-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, #EDF1F5 0%, #F5F7FA 50%, #EDF1F5 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-line.w-90 { width: 90%; } .sk-line.w-75 { width: 75%; } .sk-line.w-60 { width: 60%; } .sk-line.w-40 { width: 40%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* panels (error / no access / not found) */
.panel-msg { max-width: 560px; margin: 48px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 28px; text-align: center; }
.panel-msg .empty-ic { margin: 0 auto 14px; width: 48px; height: 48px; }
.panel-msg h2 { font-size: 17px; margin-bottom: 6px; }
.panel-msg p { color: var(--text-2); font-size: 13.5px; }
.panel-msg .row { justify-content: center; margin-top: 18px; }
.panel-msg.tone-danger .empty-ic { background: var(--danger-50); color: var(--danger); }
.panel-msg.tone-warn .empty-ic { background: var(--warn-50); color: var(--warn); }
.panel-msg pre { text-align: left; font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow: auto; max-height: 160px; color: var(--text-2); margin-top: 14px; white-space: pre-wrap; }

/* =====================================================================
   OVERLAYS
   ===================================================================== */
.backdrop { position: fixed; inset: 0; background: rgba(13, 30, 42, .42); z-index: 60; animation: fadeIn 160ms ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-host { position: fixed; inset: 0; z-index: 61; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-4); display: flex; flex-direction: column; max-height: 88vh; animation: modalIn 200ms cubic-bezier(.2, .7, .2, 1); border: 1px solid rgba(20, 44, 60, .08); }
.modal.sm { max-width: 420px; } .modal.md { max-width: 560px; } .modal.lg { max-width: 780px; } .modal.xl { max-width: 1040px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15.5px; font-weight: 650; }
.modal-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.modal-b { padding: 18px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
.close-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--text-2); flex: none; }
.close-btn:hover { background: var(--surface-3); color: var(--text); }

.drawer-host { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
.drawer-host .backdrop { z-index: auto; pointer-events: auto; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); box-shadow: var(--sh-4); display: flex; flex-direction: column; pointer-events: auto; animation: drawerIn 220ms cubic-bezier(.2, .7, .2, 1); border-left: 1px solid var(--border); }
.drawer.wide { width: min(720px, 100%); }
@keyframes drawerIn { from { transform: translateX(24px); opacity: .3; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-title { font-size: 15.5px; font-weight: 650; }
.drawer-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px; min-height: 0; }
.drawer-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: var(--r-md); background: var(--ink); color: #E8EEF3; box-shadow: var(--sh-3); font-size: 13px; pointer-events: auto; animation: toastIn 200ms ease-out; border-left: 3px solid var(--neutral); }
.toast.leaving { animation: toastOut 180ms ease-in forwards; }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 1px; }
.toast .ic { margin-top: 1px; }
.toast.success { border-left-color: #5FA889; } .toast.success .ic { color: #7CC2A4; }
.toast.error { border-left-color: #D9737B; } .toast.error .ic { color: #E8959B; }
.toast.warn { border-left-color: #D4A65F; } .toast.warn .ic { color: #E2BC7E; }
.toast.info { border-left-color: #7FA6C8; } .toast.info .ic { color: #9FC0DC; }
.toast button { background: none; border: 0; color: #91A7B7; padding: 0; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; }
.toast button:hover { color: #fff; }
body.has-drawer .toasts { right: calc(min(520px, 100%) + 16px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* tooltip */
.tip { position: fixed; z-index: 95; max-width: 280px; padding: 6px 9px; border-radius: 6px; background: #1A2F3E; color: #F1F5F9; font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: var(--sh-3); opacity: 0; transition: opacity 120ms; white-space: pre-line; font-variant-numeric: tabular-nums; }
.tip.show { opacity: 1; }

/* dropdown / popover */
.dropdown { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 4px; z-index: 50; animation: fadeIn 120ms ease-out; }
.menu.left { right: auto; left: 0; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; background: none; border-radius: 6px; font-size: 13px; text-align: left; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.popover { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 12px; }

/* command palette */
.palette-host { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.palette { position: relative; width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-4); overflow: hidden; display: flex; flex-direction: column; max-height: 72vh; animation: modalIn 180ms ease-out; border: 1px solid rgba(20, 44, 60, .08); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.palette-in .ic { color: var(--text-3); }
.palette-in input { border: 0; height: 52px; font-size: 15px; padding: 0; box-shadow: none !important; background: none; }
.palette-res { overflow-y: auto; padding: 6px; flex: 1; }
.pal-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; text-align: left; color: var(--text); font-size: 13px; }
.pal-item .pal-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--primary); flex: none; }
.pal-item-main { flex: 1; min-width: 0; }
.pal-item-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item-sub { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .ic-go { color: var(--text-3); opacity: 0; }
.pal-item.active, .pal-item:hover { background: var(--accent-50); }
.pal-item.active .ic-go { opacity: 1; }
.pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); background: var(--surface-2); flex-wrap: wrap; }
.pal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.pal-empty { padding: 28px 16px; text-align: center; color: var(--text-2); font-size: 13px; }
mark { background: #F6E7C9; color: inherit; border-radius: 2px; padding: 0 1px; }

/* notifications drawer list */
.ntf-list { list-style: none; margin: 0; padding: 0; }
.ntf { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #EDF1F5; align-items: start; }
.ntf:last-child { border-bottom: 0; }
.ntf-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: transparent; }
.ntf.unread .ntf-dot { background: var(--accent); }
.ntf-main { min-width: 0; cursor: pointer; border: 0; background: none; text-align: left; padding: 0; color: inherit; }
.ntf-main:hover .ntf-title { color: var(--accent); }
.ntf-title { font-size: 13px; font-weight: 500; color: var(--text); }
.ntf.unread .ntf-title { font-weight: 650; }
.ntf-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.ntf-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }

/* scenario panel */
.scn { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.scn-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; border: 0; background: none; text-align: left; }
.scn-h:hover { background: var(--surface-2); }
.scn-num { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-3); color: var(--primary); font-weight: 650; font-size: 12px; display: grid; place-items: center; flex: none; font-variant-numeric: tabular-nums; }
.scn.complete .scn-num { background: var(--teal); color: #fff; }
.scn-title { font-weight: 600; font-size: 13px; }
.scn-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.scn-b { padding: 0 14px 12px; }
.scn-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; border-top: 1px dashed #EDF1F5; }
.scn-step:first-child { border-top: 0; }
.scn-step .ck-box { width: 16px; height: 16px; }
.scn-step.done .ck-box { background: var(--teal); border-color: var(--teal); }
.scn-step.done .scn-step-l { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-3); }
.scn-step-l { flex: 1; min-width: 0; }

/* =====================================================================
   DOMAIN WIDGETS
   ===================================================================== */
/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; min-width: 0; }
.kanban-col { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 120px; max-height: calc(100vh - 210px); min-width: 0; }
.kanban-col-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.kanban-col-h .tab-count { background: var(--surface); }
.kanban-col-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 11px; box-shadow: var(--sh-1); cursor: pointer; transition: border-color var(--t), box-shadow var(--t); font-size: 12.5px; text-align: left; width: 100%; color: inherit; }
.kanban-card:hover { border-color: var(--border-2); box-shadow: var(--sh-2); }
.kanban-card-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.kanban-card-meta { display: flex; gap: 6px 10px; flex-wrap: wrap; color: var(--text-2); font-size: 11.5px; margin-top: 6px; align-items: center; }
.kanban-empty { font-size: 12px; color: var(--text-3); text-align: center; padding: 16px 6px; }

/* bed tiles */
.bed-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.bed-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bed-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bed-floor { margin-bottom: 16px; }
.bed-floor-h { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.bed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.bed-tile { position: relative; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--r); background: var(--surface); padding: 8px 9px; text-align: left; font-size: 12px; min-height: 66px; cursor: pointer; transition: box-shadow var(--t), transform var(--t), border-color var(--t); color: var(--text); width: 100%; display: flex; flex-direction: column; gap: 2px; }
.bed-tile:hover { box-shadow: var(--sh-2); }
.bed-tile-code { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.bed-tile-pt { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.bed-tile-st { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-top: auto; }
.bed-tile.st-disponivel, .bed-legend .st-disponivel { border-left-color: var(--success); } .bed-tile.st-disponivel .bed-tile-st { color: var(--success); }
.bed-tile.st-ocupado, .bed-legend .st-ocupado { border-left-color: var(--primary); } .bed-tile.st-ocupado .bed-tile-st { color: var(--primary); }
.bed-tile.st-reservado, .bed-legend .st-reservado { border-left-color: var(--accent); } .bed-tile.st-reservado .bed-tile-st { color: var(--accent); } .bed-tile.st-reservado { background: #F7FAFD; }
.bed-tile.st-higienizacao, .bed-legend .st-higienizacao { border-left-color: var(--warn); } .bed-tile.st-higienizacao .bed-tile-st { color: var(--warn-text); } .bed-tile.st-higienizacao { background: #FFFCF6; }
.bed-tile.st-manutencao, .bed-legend .st-manutencao { border-left-color: #7C8796; } .bed-tile.st-manutencao .bed-tile-st { color: #5E6876; } .bed-tile.st-manutencao { background: var(--surface-2); }
.bed-tile.st-bloqueado, .bed-legend .st-bloqueado { border-left-color: #334155; } .bed-tile.st-bloqueado .bed-tile-st { color: #334155; } .bed-tile.st-bloqueado { background: repeating-linear-gradient(135deg, #fff, #fff 6px, #F4F6F9 6px, #F4F6F9 12px); }
.bed-tile.st-isolamento, .bed-legend .st-isolamento { border-left-color: var(--danger); } .bed-tile.st-isolamento .bed-tile-st { color: var(--danger); } .bed-tile.st-isolamento { background: #FFF9F9; }
.bed-legend i.st-disponivel { background: var(--success); } .bed-legend i.st-ocupado { background: var(--primary); } .bed-legend i.st-reservado { background: var(--accent); }
.bed-legend i.st-higienizacao { background: var(--warn); } .bed-legend i.st-manutencao { background: #7C8796; } .bed-legend i.st-bloqueado { background: #334155; } .bed-legend i.st-isolamento { background: var(--danger); }
.bed-tile.selected { box-shadow: 0 0 0 2px var(--accent); }

/* calendar */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title { font-size: 15px; font-weight: 600; min-width: 160px; text-transform: capitalize; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: var(--surface-2); padding: 7px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-2); letter-spacing: .04em; }
.cal-day { background: var(--surface); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; border: 0; text-align: left; color: inherit; font: inherit; }
.cal-day:hover { background: #FAFBFD; }
.cal-day.other { background: var(--surface-2); color: var(--text-3); }
.cal-day.today .cal-daynum { background: var(--primary); color: #fff; }
.cal-daynum { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-ev { display: block; font-size: 11px; padding: 2px 5px; border-radius: 4px; background: var(--accent-50); color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 2px solid var(--accent); text-align: left; width: 100%; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-ev.tone-success { background: var(--success-50); color: var(--success); border-left-color: var(--success); }
.cal-ev.tone-warn { background: var(--warn-50); color: var(--warn-text); border-left-color: var(--warn); }
.cal-ev.tone-danger { background: var(--danger-50); color: var(--danger); border-left-color: var(--danger); }
.cal-ev.tone-neutral { background: var(--neutral-50); color: #556274; border-left-color: var(--neutral); }
.cal-ev.tone-teal { background: var(--teal-50); color: var(--teal); border-left-color: var(--teal); }
.cal-more { font-size: 11px; color: var(--text-2); padding-left: 4px; }
.cal-week { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: auto; background: var(--surface); max-height: 640px; }
.cal-week.day { grid-template-columns: 56px minmax(0, 1fr); }
.cal-wh { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 7px 8px; font-size: 12px; font-weight: 600; text-align: center; }
.cal-wh.today { color: var(--primary); }
.cal-hour { font-size: 11px; color: var(--text-3); text-align: right; padding: 2px 6px 0 0; border-top: 1px solid #EEF2F6; height: 52px; font-variant-numeric: tabular-nums; }
.cal-slot { border-top: 1px solid #EEF2F6; border-left: 1px solid #EEF2F6; height: 52px; padding: 2px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-width: 0; }
.cal-slot.clickable { cursor: pointer; } .cal-slot.clickable:hover { background: #FAFBFD; }
.cal-slot.blocked { background: repeating-linear-gradient(135deg, #fff, #fff 5px, #F3F5F8 5px, #F3F5F8 10px); }

/* metric bars (HTML-free SVG progress used in lists) */
.meter-list { display: flex; flex-direction: column; gap: 10px; }
.meter-item-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 4px; }
.meter-item-h span:last-child { font-variant-numeric: tabular-nums; color: var(--text-2); }

/* call panel / big ticket */
.ticket { font-size: 28px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--ink); }

/* charts */
.chart { width: 100%; min-width: 0; }
.chart-frame { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.chart-plot { position: relative; min-width: 0; }
.chart-plot svg, .chart-x { display: block; width: 100%; overflow: visible; }
.chart-ov { position: absolute; inset: 0; pointer-events: none; }
.chart-y { overflow: visible; }
.chart .strong-label { fill: #475569; font-size: 11.5px; }
.chart .value-label { fill: #334155; font-weight: 600; }
.chart text { font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: #EDF1F5; stroke-width: 1; }
.chart .axis-line { stroke: var(--border-2); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; }
.chart .hit { cursor: default; }
.chart .hit:hover { opacity: .82; }
.chart-svg rect.hit[fill="transparent"]:hover { fill: rgba(65, 109, 146, .06); opacity: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend svg { flex: none; }
.chart-legend .lg-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap > svg { width: 150px; height: 150px; flex: none; }
.donut-wrap .chart-legend { flex-direction: column; flex: 1; min-width: 140px; margin-top: 0; }
.donut-wrap .chart-legend span { justify-content: space-between; width: 100%; }
.donut-wrap .chart-legend span > span { gap: 6px; }
.chart-empty { display: grid; place-items: center; min-height: 140px; font-size: 12.5px; color: var(--text-3); border: 1px dashed var(--border); border-radius: var(--r); }
.spark { display: inline-block; vertical-align: middle; }

/* =====================================================================
   PRINT
   ===================================================================== */
#print-root { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  .print-doc { font-size: 11.5pt; color: #111; position: relative; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #142C3C; padding-bottom: 8px; margin-bottom: 14px; }
  .print-head-brand { font-weight: 700; font-size: 13pt; color: #142C3C; }
  .print-head-sub { font-size: 9pt; color: #555; }
  .print-head-meta { text-align: right; font-size: 9pt; color: #555; }
  .print-title { font-size: 15pt; font-weight: 700; margin: 0 0 2px; }
  .print-subtitle { font-size: 10pt; color: #555; margin-bottom: 12px; }
  .print-foot { margin-top: 24px; padding-top: 8px; border-top: 1px solid #ccc; font-size: 8.5pt; color: #666; }
  .print-watermark { position: fixed; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-32deg); font-size: 34pt; font-weight: 800; color: rgba(185, 77, 85, .14); white-space: nowrap; pointer-events: none; letter-spacing: .04em; z-index: 0; }
  .print-body { position: relative; z-index: 1; }
  .print-doc .tbl th { position: static; background: #f2f2f2 !important; color: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-doc .tbl td, .print-doc .tbl th { border-bottom: 1px solid #ddd; padding: 5px 7px; }
  .print-doc .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .print-doc .btn, .print-doc .no-print { display: none !important; }
  .print-doc .badge, .print-doc .tag { border: 1px solid #bbb; background: none !important; color: #222 !important; }
}

/* =====================================================================
   RESPONSIVE (§46)
   ===================================================================== */
@media (max-width: 1499px) {
  .tb-restore-label { display: none; }
}
@media (max-width: 1399px) {
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  /* tablet: collapsible sidebar — collapsed (icon mode) by default, expands over content */
  .shell .sidebar { width: var(--sb-w-c); }
  .shell .main-wrap { margin-left: var(--sb-w-c); }
  .shell:not(.sb-open) .sb-brand-text, .shell:not(.sb-open) .sb-label, .shell:not(.sb-open) .sb-group-h span, .shell:not(.sb-open) .sb-foot-btn span { display: none; }
  .shell:not(.sb-open) .sb-brand { padding: 0 17px; }
  .shell:not(.sb-open) .sb-group-h { justify-content: center; padding: 8px 0 4px; }
  .shell:not(.sb-open) .sb-group-h .ic { display: none; }
  .shell:not(.sb-open) .sb-group-h::after { content: ""; display: block; width: 18px; height: 1px; background: rgba(255,255,255,.12); }
  .shell:not(.sb-open) .sb-group.collapsed .sb-items { display: block; }
  .shell:not(.sb-open) .sb-item, .shell:not(.sb-open) .sb-foot-btn { justify-content: center; padding: 0; }
  .shell.sb-open .sidebar { width: var(--sb-w); box-shadow: var(--sh-4); }
  .shell.sb-open .sb-overlay { opacity: 1; pointer-events: auto; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2-1, .cols-1-2, .cols-3-2 { grid-template-columns: minmax(0, 1fr); }
  .split, .split.wide-left { grid-template-columns: minmax(0, 1fr); }
  .pane-scroll { max-height: 420px; }
  .tb-clock small { display: none; }
}
@media (max-width: 991px) {
  .tb-clock { display: none; }
  .tb-profile .tb-select { max-width: 150px; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-6, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  :root { --top-h: 54px; }
  .shell .sidebar { width: min(284px, 86vw); transform: translateX(-100%); box-shadow: none; }
  .shell .main-wrap { margin-left: 0; }
  .shell .sb-brand-text, .shell .sb-label, .shell .sb-group-h span, .shell .sb-foot-btn span { display: initial !important; }
  .shell .sb-brand { padding: 0 16px !important; }
  .shell .sb-group-h { justify-content: space-between !important; padding: 10px 10px 6px !important; }
  .shell .sb-group-h .ic { display: inline-block !important; }
  .shell .sb-group-h::after { display: none !important; }
  .shell .sb-group.collapsed .sb-items { display: none !important; }
  .shell .sb-item, .shell .sb-foot-btn { justify-content: flex-start !important; padding: 0 10px !important; }
  .shell.sb-open .sidebar { transform: none; box-shadow: var(--sh-4); width: min(284px, 86vw); }
  .sb-collapse-btn { display: none !important; }
  .topbar { padding: 0 10px 0 6px; gap: 6px; }
  .tb-inst, .tb-unit, .tb-profile .tb-select, .tb-restore-label { display: none; }
  .tb-search { flex: 1; max-width: none; }
  .tb-search .kbd { display: none; }
  .main { padding: 16px 16px 32px; }
  .page-title { font-size: 18px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-actions { width: 100%; }
  .g-2, .g-3, .g-4, .g-5, .g-6, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .kpi-grid, .kpi-grid.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 11px; }
  .kpi-value { font-size: 18px; }
  .dl, .dl.cols-2 { grid-template-columns: minmax(100px, max-content) 1fr; }
  .toolbar .search-input { max-width: none; flex-basis: 100%; }
  .filter-select { flex: 1 1 130px; max-width: none; }
  .modal-host { padding: 0; align-items: flex-end; }
  .modal, .modal.sm, .modal.md, .modal.lg, .modal.xl { max-width: none; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal-f { border-radius: 0; }
  .modal-f .btn { flex: 1; }
  .drawer, .drawer.wide { width: 100%; }
  .palette-host { padding: 0; }
  .palette { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; }
  .privacy-bar { padding: 8px 10px 8px 16px; font-size: 12px; align-items: flex-start; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-ev { font-size: 10px; padding: 1px 3px; }
  .kanban { grid-auto-columns: minmax(240px, 82vw); }
  .bed-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .detail-head { padding: 14px; }
  .tbl-foot { justify-content: center; }
  .toasts { left: 16px; right: 16px; width: auto; }
  body.has-drawer .toasts { right: 16px; bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* late fixes */
.pal-item-main, .pal-item-title, .pal-item-sub, .scn-h .list-item-main, .scn-title, .scn-sub { display: block; }
.ntf-main .ntf-title, .ntf-main .ntf-desc { display: block; }
body.has-modal .toasts { top: 16px; bottom: auto; }
.skip-link:focus { position: fixed !important; left: 12px; top: 12px; width: auto; height: auto; clip: auto; margin: 0; padding: 8px 12px; background: var(--surface); color: var(--primary); border-radius: var(--r); box-shadow: var(--sh-3); z-index: 100; white-space: normal; }
.tb-inst { flex: none; max-width: 190px; overflow: hidden; }
.tb-inst-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1099px) { .tb-inst { display: none; } }
