/* ============================================================
   LOBR APP — CSS System
   Único arquivo. Zero conflitos. Zero duplicatas.
   ============================================================ */

/* ── VARIÁVEIS ──────────────────────────────────────────────── */
:root {
  --brand: #004590;
  --brand-light: #eff6ff;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f3f6fa;
  --surface: #fff;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(2,6,23,.08);
  --rail-w: 76px;
  --side-w: 268px;
  --topbar-h: 64px;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, Arial, sans-serif;
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }

/* ── GRID PRINCIPAL ─────────────────────────────────────────── */
.app {
  min-height: 100dvh;
  display: grid;
  gap: 12px;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "side top" "side main";
  transition: grid-template-columns .25s ease;
}
body.menu-open .app { grid-template-columns: var(--side-w) 1fr; }
.app--no-right { /* sem sidebar direita — já é o padrão */ }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  grid-area: side;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  transition: width .25s ease;
  z-index: 50;
  overflow: hidden;
}
body.menu-open .sidebar { width: var(--side-w); }
.sb-head {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.sb-title img { max-height: 24px; width: auto; display: block; }
.sb-toggle {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: .2s;
}
.sb-toggle:hover { background: #f1f5f9; color: var(--brand); }
.sb-context-chip {
  margin: 12px 10px 0;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg,#f8fbff 0%,#eef5ff 100%);
  border: 1px solid #d8e7ff;
  display: grid;
  gap: 3px;
}
.sb-context-chip strong { font-size: .88rem; }
.sb-context-chip small { color: var(--muted); font-size: .76rem; }
.menu {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.menu-section-label {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 12px 10px 6px;
  letter-spacing: .06em;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: .15s;
  white-space: nowrap;
}
.menu-item:hover { background: #f8fafc; color: var(--brand); }
.menu-item.active {
  background: var(--brand-light);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px #d9e7ff;
}
.menu-item .ico { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
body:not(.menu-open) .sb-context-chip,
body:not(.menu-open) .sb-title,
body:not(.menu-open) .label,
body:not(.menu-open) .menu-section-label,
body:not(.menu-open) .sb-footer { display: none; }
body:not(.menu-open) .sb-head,
body:not(.menu-open) .menu-item { justify-content: center; }
.sb-footer {
  padding: 14px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
}
.user-text { display: flex; flex-direction: column; line-height: 1.25; }
.u-name { font-size: .86rem; font-weight: 700; }
.u-role { font-size: .74rem; color: var(--muted); }

/* client-sidebar-card */
.client-sidebar-card {
  margin: 12px 10px 0;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg,#f8fbff 0%,#eef5ff 100%);
  border: 1px solid #d8e7ff;
  display: grid;
  gap: 2px;
  flex-shrink: 0;
}
.client-sidebar-kicker { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); opacity: .7; }
.client-sidebar-card strong { font-size: .88rem; font-weight: 700; }
.client-sidebar-card span { font-size: .76rem; color: var(--muted); }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  margin: 10px 12px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}
.topbar-section { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-date { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; color: #334155; min-width: 0; }
.topbar-date span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: var(--brand-light); color: var(--brand);
  font-size: .76rem; font-weight: 700;
}
.topbar-refresh-btn, .topbar-client-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  background: #f8fafc; border: 1px solid var(--border);
  color: #334155; font-size: .84rem; font-weight: 600;
  text-decoration: none; transition: .15s;
}
.topbar-refresh-btn:hover, .topbar-client-chip:hover { background: #eef5ff; color: var(--brand); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: #f8fafc; border: 1px solid var(--border);
  color: #475569; font-size: 1rem;
  text-decoration: none; transition: .15s;
}
.topbar-icon-btn:hover { background: var(--brand-light); color: var(--brand); }
.topbar-badge {
  position: absolute; top: 5px; right: 5px;
  min-width: 16px; height: 16px;
  background: #ef4444; color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 999px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.topbar-badge.empty { display: none; }
.dark-mode-toggle {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: #f8fafc; border: 1px solid var(--border);
  color: #475569; font-size: 1rem;
  transition: .15s;
}
.dark-mode-toggle:hover { background: var(--brand-light); color: var(--brand); }
.topbar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 5px;
  border-radius: 12px;
  background: #fff; border: 1px solid var(--border);
  min-width: 200px; max-width: 280px;
  transition: .15s;
}
.topbar-profile:hover { background: #f8fafc; }
.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg,#0f5bd6 0%,#004590 100%);
  color: #fff; font-weight: 700; font-size: .84rem;
  flex-shrink: 0;
}
.topbar-avatar--lg { width: 48px; height: 48px; }
.topbar-avatar-initials { font-weight: 700; }
.topbar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topbar-user-name { font-size: .88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user-role { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-chevron { color: #94a3b8; flex-shrink: 0; transition: transform .2s; }
.topbar-profile[aria-expanded="true"] .topbar-chevron { transform: rotate(180deg); }
.topbar-dropdown {
  position: absolute; right: 12px;
  top: calc(var(--topbar-h) + 14px);
  width: min(340px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15,23,42,.14);
  padding: 12px; z-index: 120;
}
.topbar-dropdown[hidden] { display: none; }
.topbar-dropdown-header { display: flex; gap: 12px; align-items: center; padding: 4px 4px 12px; }
.topbar-dropdown-user { min-width: 0; flex: 1; }
.topbar-dropdown-name { font-weight: 700; font-size: .92rem; }
.topbar-dropdown-email { font-size: .8rem; color: var(--muted); word-break: break-word; }
.topbar-divider { height: 1px; background: #f1f5f9; margin: 8px 0; }
.topbar-dropdown-section { display: grid; gap: 4px; }
.topbar-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #334155; background: #fff; border: 0;
  width: 100%; text-align: left; font-size: .88rem;
  text-decoration: none; transition: background .12s;
}
.topbar-dropdown-item:hover { background: #f8fafc; }
.topbar-dropdown-item--danger { color: #b42318; }
.topbar-dropdown-item--danger:hover { background: #fef3f2; }
.topbar-dropdown-item--static { cursor: default; color: var(--muted); font-size: .84rem; }
.topbar-client-context {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 10px;
  background: var(--brand-light); border: 1px solid #d6e4ff;
  font-size: .8rem; color: #334155; white-space: nowrap;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.topbar-client-context strong { color: var(--brand); font-weight: 700; }

/* ── WORKSPACE ──────────────────────────────────────────────── */
.workspace, .workspace-shell {
  grid-area: main;
  padding: 16px 12px 18px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

/* ── OVERLAY ────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(2,6,23,.35); opacity: 0; pointer-events: none; transition: .2s; z-index: 30; }
.overlay.open { opacity: 1; pointer-events: auto; }

/* ── TOASTS ─────────────────────────────────────────────────── */
#toast-container { position: fixed; right: 16px; top: 16px; z-index: 300; display: grid; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 400px; padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: 0 16px 40px rgba(15,23,42,.14); border: 1px solid var(--border); transition: .3s; }
.toast-icon { color: var(--brand); padding-top: 2px; }
.toast-success .toast-icon { color: #067647; }
.toast-error .toast-icon { color: #b42318; }
.toast-message { flex: 1; line-height: 1.5; font-size: .9rem; }
.toast-close { font-size: 1.2rem; color: #94a3b8; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-size: .9rem; }
.alert-error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.alert-success { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.flash { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.flash.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.flash.success { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }

/* ── PÁGINA GENÉRICA ────────────────────────────────────────── */
.dash-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-header-title { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.dash-header-subtitle { font-size: .86rem; color: var(--muted); margin-top: 2px; }
.dash-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 10px; font-size: .86rem; font-weight: 600; text-decoration: none; transition: .15s; background: #f8fafc; border: 1px solid var(--border); color: #334155; }
.dash-btn:hover { background: var(--brand-light); color: var(--brand); border-color: #d6e4ff; }
.dash-btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.dash-btn-primary:hover { background: #003a7a; border-color: #003a7a; color: #fff; }
.dash-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-size: .76rem; font-weight: 700; }

/* ── TABELAS ────────────────────────────────────────────────── */
.table-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.status-table { width: 100%; border-collapse: collapse; }
.status-table th { padding: 12px 16px; text-align: left; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; background: #fbfdff; border-bottom: 1px solid var(--border); }
.status-table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: .86rem; }
.status-table tbody tr:hover td { background: #fafbff; }
.status-table tbody tr:last-child td { border-bottom: none; }
.table-actions { text-align: right !important; white-space: nowrap; }

/* Célula de identidade do usuário */
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: .88rem; }
.user-email { font-size: .78rem; color: var(--muted); }
.user-row td { transition: background .12s; }
.user-avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
}

/* Badges de status */
.badge-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.status-ativo { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.status-bloqueado { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.status-pendente { background: #fefce8; color: #854d0e; border: 1px solid #fde047; }

/* Botão ícone */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); text-decoration: none; transition: .15s; }
.btn-icon:hover { background: var(--brand-light); color: var(--brand); }

/* Admin search */
.admin-search { position: relative; display: flex; align-items: center; }
.admin-search i { position: absolute; left: 12px; color: #94a3b8; font-size: .9rem; }
.admin-search input { padding: 9px 14px 9px 36px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; font-size: .86rem; width: 240px; }
.admin-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(0,69,144,.08); }

/* Table-shell (process-search) */
.table-shell, .form-shell { background: #fff; border: 1px solid #e7ebf0; border-radius: 18px; box-shadow: 0 8px 20px rgba(15,23,42,.05); overflow: hidden; }
.form-shell { padding: 22px; }
.form-shell--stacked { display: grid; gap: 16px; }
.table-shell-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #eef2f6; flex-wrap: wrap; }
.table-shell-head strong { display: block; font-size: .96rem; font-weight: 700; }
.table-shell-head span { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }
.table-shell-body { overflow: auto; }
.table-shell-body--scroll-md { max-height: 340px; }
.table-shell-body--scroll-lg { max-height: 420px; }
.table-shell-body--scroll-xl { max-height: 560px; }
.table-shell-head--with-tools { align-items: flex-end; }
.section-separator-top { padding-top: 16px; border-top: 1px solid #eef2f6; }

/* Data-table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid #eef2f6; text-align: left; vertical-align: middle; }
.data-table th { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; background: #fbfdff; }
.data-table--sticky-head thead th { position: sticky; top: 0; z-index: 2; }
.identity-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.identity-cell strong { display: block; font-size: .9rem; }
.identity-cell span { display: block; color: var(--muted); font-size: .8rem; }
.pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--brand-light); color: var(--brand); font-size: .76rem; font-weight: 700; }
.pill--code { font-family: ui-monospace,monospace; background: #f8fafc; color: var(--text); border: 1px solid var(--border); }
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.status-badge--ok { background: #ecfdf3; color: #067647; }
.status-badge--muted { background: #f2f4f7; color: #475467; }
.status-badge--warn { background: #fff7ed; color: #b54708; }
.status-badge--danger { background: #fef3f2; color: #b42318; }
.status-badge--info { background: #eff6ff; color: #1d4ed8; }
@keyframes pulse-ring { 0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,.4)} 70%{box-shadow:0 0 0 6px rgba(59,130,246,0)} }
.status-badge--processing { background: #eff6ff; color: #1d4ed8; animation: pulse-ring 1.8s infinite; }
.actions-col { white-space: nowrap; }
.inline-form { display: inline-flex; gap: 8px; margin-left: 8px; }
.text-muted { color: var(--muted); }
.table-empty-action { font-size: .82rem; color: var(--muted); }

/* Search-box */
.search-box { position: relative; display: flex; align-items: center; min-width: min(300px,100%); }
.search-box i { position: absolute; left: 14px; color: #94a3b8; }
.search-box input { width: 100%; padding: 11px 14px 11px 38px; border: 1px solid #d7deea; border-radius: 12px; background: #f8fafc; font-size: .86rem; }
.search-box input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(0,69,144,.08); }
.search-box--compact { min-width: min(240px,100%); }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; text-align: center; gap: 12px; }
.empty-state-icon { width: 64px; height: 64px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #94a3b8; }
.empty-state-title { font-size: .96rem; font-weight: 700; margin: 0; }
.empty-state-text { font-size: .84rem; color: var(--muted); max-width: 300px; margin: 0; line-height: 1.6; }
.empty-state-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 10px; background: var(--brand); color: #fff; font-size: .86rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none; }

/* ── FORMULÁRIOS ────────────────────────────────────────────── */
.form-label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid #d7deea; border-radius: 10px; background: #fff; font-size: .9rem; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,69,144,.08); }
.form-group { margin-bottom: 16px; }
.stack-form { display: grid; gap: 16px; }
.stack-form label span, .stack-form legend { display: block; font-weight: 700; margin-bottom: 7px; }
.stack-form input[type=text], .stack-form input[type=email], .stack-form input[type=password], .stack-form select, .stack-form textarea { width: 100%; padding: 12px 14px; border: 1px solid #d7deea; border-radius: 12px; background: #fff; font-size: .9rem; }
.split-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.split-grid--compact { grid-template-columns: minmax(0,240px); }
.module-grid { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.checkbox-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid #d7deea; border-radius: 12px; background: #f8fafc; }
.checkbox-card small { display: block; color: var(--muted); margin-top: 3px; font-size: .8rem; }
.checkbox-card-list { display: grid; gap: 10px; }
.checkbox-card-modern { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid #d7deea; border-radius: 12px; background: #f8fafc; cursor: pointer; transition: .15s; }
.checkbox-card-modern:hover { border-color: var(--brand); background: var(--brand-light); }
.form-actions, .form-actions-modern { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: flex-start; }
.main-content { display: flex; flex-direction: column; gap: 16px; }
.sidebar-content { display: flex; flex-direction: column; gap: 16px; }
.settings-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.settings-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }

/* Botões */
.button-primary, .button-link, .button-inline {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: .75rem 1rem; border-radius: 10px;
  border: 1px solid #0f5bd6; background: #0f5bd6; color: #fff;
  text-decoration: none; cursor: pointer; font-weight: 700; font-size: .9rem;
  transition: background .15s;
}
.button-primary:hover, .button-link:hover { background: #0a4bbd; }
.button-primary--full, .button-block { width: 100%; }
.button-link-secondary, .button-inline-secondary { background: #fff; color: #0f5bd6; border-color: #d6e4ff; }
.button-link-secondary:hover { background: var(--brand-light); }
.button-secondary { background: #f8fafc; color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { background: #f1f5f9; }

/* ── CONTENT / PAGE SHELLS ──────────────────────────────────── */
.page-shell { display: grid; gap: 16px; }
.page-shell--narrow { max-width: 960px; }
.page-hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-hero-row h1 { margin: 4px 0 6px; font-size: 1.8rem; letter-spacing: -.02em; }
.page-hero-row p { margin: 0; color: var(--muted); max-width: 680px; line-height: 1.7; }
.section-grid { display: grid; gap: 14px; }
.section-grid--three { grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.section-grid--two { grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); }
.hero-panel { position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; background: linear-gradient(135deg,#062a54 0%,#0f5bd6 100%); color: #fff; box-shadow: 0 16px 36px rgba(0,69,144,.2); display: grid; gap: 18px; }
.hero-panel--client { background: linear-gradient(135deg,#0f172a 0%,#0f5bd6 100%); }
.hero-kicker { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.hero-panel h1 { margin: 8px 0 6px; font-size: clamp(1.7rem,2.6vw,2.4rem); line-height: 1.06; letter-spacing: -.03em; }
.hero-panel p { margin: 0; max-width: 700px; color: rgba(255,255,255,.86); line-height: 1.7; }
.hero-meta-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; }
.hero-meta-grid article { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.12); display: grid; gap: 5px; }
.hero-meta-grid strong { font-size: .96rem; }
.hero-meta-grid span { font-size: .8rem; color: rgba(255,255,255,.76); }
.feature-card { display: grid; gap: 10px; padding: 20px; border-radius: 18px; background: #fff; border: 1px solid #e7ebf0; box-shadow: 0 8px 20px rgba(15,23,42,.05); color: var(--text); }
.feature-card:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(15,23,42,.08); }
.feature-card--muted { background: linear-gradient(180deg,#fff 0%,#f8fafc 100%); }
.feature-card-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; font-size: 1rem; }
.feature-card h2 { margin: 0; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: .86rem; }
.feature-card-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand); font-weight: 700; font-size: .86rem; }

/* Toolbar */
.toolbar-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-bar--compact { gap: 10px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: .15s; }
.filter-chip.is-active { background: var(--brand-light); border-color: #d6e4ff; color: #0f5bd6; }

/* Note card */
.note-card { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; }
.note-card--soft { background: #eef5ff; border-color: #d8e7ff; }
.note-card--inline { margin-bottom: 16px; }
.note-card strong { display: block; margin-bottom: 4px; font-size: .88rem; }
.note-card span { color: var(--muted); line-height: 1.6; font-size: .84rem; }

/* Process search */
.process-mini-list { display: grid; gap: 10px; }
.process-mini-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid #e7ebf0; border-radius: 14px; background: #fff; text-decoration: none; color: inherit; transition: .15s; }
.process-mini-card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,23,42,.06); }
.process-mini-card strong { display: block; font-size: .9rem; }
.process-mini-card span { display: block; margin-top: 3px; color: var(--muted); line-height: 1.5; font-size: .82rem; }
.process-mini-card small { color: #475569; font-weight: 700; white-space: nowrap; font-size: .8rem; }
.process-mini-card--dense { padding: 10px 13px; }
.process-stage-list { display: grid; gap: 10px; }
.process-stage-item { padding: 12px 14px; border-radius: 12px; border: 1px solid #e7ebf0; background: #fff; display: grid; gap: 3px; }
.process-stage-item span { color: #334155; font-weight: 600; font-size: .88rem; }
.process-stage-item small { color: var(--muted); font-size: .8rem; }
.definition-list-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.definition-list-grid small { display: block; color: var(--muted); margin-bottom: 5px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.definition-list-grid strong { font-size: .92rem; line-height: 1.45; }
.table-summary-stack { display: grid; gap: 4px; }
.component-empty-state--compact { min-height: 140px; padding: 16px; }

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb a { color: var(--brand); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #cbd5e1; font-size: .7rem; }
.breadcrumb-current { color: #334155; font-weight: 600; }

/* ── DASHBOARD V2 ───────────────────────────────────────────── */
.dash-v2 { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 1600px; margin: 0 auto; }

/* Hero */
.dash-hero {
  position: relative;
  background: var(--brand);
  border-radius: 18px;
  padding: 28px 32px 18px;
  overflow: hidden;
  min-height: 130px;
  flex-shrink: 0;
}
.dash-hero--platform { background: linear-gradient(135deg,#062a54 0%,#004590 100%); }
.dash-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.dash-hero-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .22; }
.dash-hero-orb--1 { width: 260px; height: 260px; background: #60a5fa; top: -70px; left: -50px; }
.dash-hero-orb--2 { width: 180px; height: 180px; background: #a78bfa; bottom: -50px; right: 22%; }
.dash-hero-orb--3 { width: 160px; height: 160px; background: #34d399; top: -30px; right: 8%; }
.dash-hero-content { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dash-hero-left { flex: 1; }
.dash-hero-greeting { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.dash-hero-name { font-size: clamp(1.5rem,2.8vw,2.2rem); font-weight: 800; color: #fff; margin: 0 0 4px; letter-spacing: -.02em; line-height: 1.1; }
.dash-hero-date { font-size: .8rem; color: rgba(255,255,255,.5); margin: 0; }
.dash-hero-right { display: flex; align-items: center; gap: 24px; background: rgba(255,255,255,.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 14px 20px; flex-shrink: 0; }
.dash-hero-stat { text-align: center; }
.dash-hero-stat-value { font-size: clamp(1.3rem,2.2vw,1.8rem); font-weight: 800; color: #fff; line-height: 1; margin-bottom: 2px; }
.dash-hero-stat-value span { font-size: .65em; opacity: .8; }
.dash-hero-stat-label { font-size: .7rem; color: rgba(255,255,255,.55); white-space: nowrap; }
.dash-hero-divider { width: 1px; height: 36px; background: rgba(255,255,255,.2); flex-shrink: 0; }
.dash-hero-progress { position: relative; height: 3px; background: rgba(255,255,255,.15); border-radius: 999px; margin-top: 18px; overflow: hidden; }
.dash-hero-progress-bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg,rgba(255,255,255,.6),rgba(255,255,255,.9)); border-radius: 999px; transition: width 1.4s cubic-bezier(.16,1,.3,1); }

/* KPI Strip */
.dash-kpi-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.dash-kpi-tile {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dash-kpi-tile:hover { transform: translateY(-2px); }
.dash-kpi-tile--blue:hover   { box-shadow: 0 6px 20px rgba(59,130,246,.14);  border-color: rgba(59,130,246,.28); }
.dash-kpi-tile--green:hover  { box-shadow: 0 6px 20px rgba(34,197,94,.14);   border-color: rgba(34,197,94,.28); }
.dash-kpi-tile--amber:hover  { box-shadow: 0 6px 20px rgba(245,158,11,.14);  border-color: rgba(245,158,11,.28); }
.dash-kpi-tile--purple:hover { box-shadow: 0 6px 20px rgba(139,92,246,.14);  border-color: rgba(139,92,246,.28); }
.dash-kpi-tile-top { display: flex; align-items: center; justify-content: space-between; }
.dash-kpi-tile-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.dash-kpi-tile--blue   .dash-kpi-tile-icon { background: #eff6ff; color: #3b82f6; }
.dash-kpi-tile--green  .dash-kpi-tile-icon { background: #f0fdf4; color: #22c55e; }
.dash-kpi-tile--amber  .dash-kpi-tile-icon { background: #fffbeb; color: #f59e0b; }
.dash-kpi-tile--purple .dash-kpi-tile-icon { background: #faf5ff; color: #8b5cf6; }
.dash-kpi-tile-badge { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.dash-kpi-tile-badge--blue   { background: #eff6ff; color: #3b82f6; }
.dash-kpi-tile-badge--green  { background: #f0fdf4; color: #22c55e; }
.dash-kpi-tile-badge--amber  { background: #fffbeb; color: #d97706; }
.dash-kpi-tile-badge--purple { background: #faf5ff; color: #8b5cf6; }
.dash-kpi-tile-value { font-size: clamp(1.5rem,2.2vw,2rem); font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.dash-kpi-tile-label { font-size: .78rem; color: var(--muted); }
.dash-kpi-tile-sub { font-size: .72rem; }
.kpi-up { color: #22c55e; font-weight: 500; }
.kpi-warn { color: #f59e0b; font-weight: 500; }
.dash-kpi-tile-progress { height: 4px; background: rgba(34,197,94,.15); border-radius: 999px; overflow: hidden; }
.dash-kpi-tile-bar { height: 100%; background: linear-gradient(90deg,#22c55e,#16a34a); border-radius: 999px; transition: width 1.2s cubic-bezier(.16,1,.3,1); width: 0; }

/* Gráficos v2 */
.dash-charts-v2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-chart-v2 { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.dash-chart-v2--wide { grid-column: 1 / -1; }
.dash-chart-v2-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dash-chart-v2-title { font-size: .92rem; font-weight: 700; color: var(--text); }
.dash-chart-v2-sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.dash-chart-v2-link { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; padding: 5px 10px; border-radius: 8px; transition: background .12s; }
.dash-chart-v2-link:hover { background: var(--brand-light); }
.dash-chart-v2-body { flex: 1; position: relative; min-height: 140px; }
.dash-chart-v2-body canvas { position: absolute; inset: 0; }
.dash-chart-v2-body--donut { display: flex; align-items: center; justify-content: center; }
.dash-chart-v2-body--donut canvas { position: relative; inset: auto; max-height: 150px; }
.dash-donut-center { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.dash-donut-value { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1; }
.dash-donut-label { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.dash-chart-v2-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.dash-chart-v2-legend b { color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; font-style: normal; }
.dot--green { background: #22c55e; }
.dot--amber { background: #f59e0b; }
.dot--blue  { background: #3b82f6; }

/* Feature list e quick links (usados nos dashboards) */
.dash-feature-list { display: grid; gap: 12px; }
.dash-feature-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 4px; }
.dash-feature-card strong { font-size: .9rem; font-weight: 700; color: var(--text); }
.dash-feature-card span { font-size: .82rem; color: var(--muted); line-height: 1.55; }
.quick-links-stack { display: grid; gap: 8px; }
.quick-link-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; transition: .15s; }
.quick-link-card:hover { background: var(--brand-light); border-color: #d6e4ff; }
.quick-link-card strong { display: block; font-size: .9rem; font-weight: 700; }
.quick-link-card span { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.quick-link-card::after { content: '→'; color: var(--brand); font-weight: 700; flex-shrink: 0; }

/* ── AUTH ───────────────────────────────────────────────────── */
.auth-body { margin: 0; min-height: 100vh; font-family: Inter, Arial, sans-serif; background: #f8fafc; }
.auth-main-wrapper { display: flex; min-height: 100vh; overflow: hidden; }
.auth-brand-panel {
  flex: 1.25;
  background: #003366;
  background-image: radial-gradient(circle at 20% 30%, #004080 0%, #003366 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 52px 60px;
  position: relative;
  overflow: hidden;
}
.auth-brand-panel::after { content: ''; position: absolute; bottom: 0; right: 0; width: 300px; height: 300px; background: rgba(255,255,255,.04); border-radius: 50% 0 0 0; pointer-events: none; }
.auth-brand-top { margin-bottom: auto; }
.auth-logo-svg { max-height: 38px; width: auto; display: block; filter: brightness(0) invert(1); }
.auth-brand-content { position: relative; z-index: 1; margin: auto 0; display: grid; gap: 18px; }
.auth-brand-content h1 { margin: 0; font-size: clamp(1.9rem,3vw,2.8rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.auth-brand-content p { margin: 0; font-size: .96rem; line-height: 1.7; color: rgba(255,255,255,.8); max-width: 460px; }
.auth-brand-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-brand-pills span { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: .76rem; font-weight: 600; letter-spacing: .02em; }
.auth-brand-footer { position: relative; z-index: 1; margin-top: auto; font-size: .8rem; color: rgba(255,255,255,.5); display: grid; gap: 3px; }
.auth-form-panel { flex: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px 48px; overflow-y: auto; }
.auth-container-card { width: 100%; max-width: 400px; display: grid; gap: 0; }
.auth-container-card--wide { max-width: 480px; }
.auth-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: #0f5bd6; text-decoration: none; font-weight: 600; margin-bottom: 22px; }
.auth-back-link:hover { text-decoration: underline; }
.auth-header-block { margin-bottom: 26px; }
.auth-eyebrow { display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #0f5bd6; margin-bottom: 7px; }
.auth-header-block h1 { margin: 0 0 7px; font-size: 1.7rem; font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.auth-header-block p { margin: 0; font-size: .88rem; color: #64748b; line-height: 1.6; }
.auth-form-stack { display: grid; gap: 16px; }
.field-block { display: grid; gap: 6px; }
.field-block > span { font-size: .86rem; font-weight: 700; color: #0f172a; }
.field-block input, .field-block select, .field-block textarea { width: 100%; padding: 12px 14px; border: 1.5px solid #d7deea; border-radius: 12px; font-size: .9rem; font-family: inherit; background: #f8fafc; color: #0f172a; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.field-block input:focus, .field-block select:focus, .field-block textarea:focus { outline: none; border-color: #0f5bd6; box-shadow: 0 0 0 3px rgba(15,91,214,.1); background: #fff; }
.auth-inline-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.checkbox-row-muted { color: #64748b; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: #0f5bd6; }
.text-link { color: #0f5bd6; text-decoration: none; font-size: .86rem; font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.auth-support-footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid #f1f5f9; text-align: center; font-size: .82rem; color: #94a3b8; }
.auth-support-footer p { margin: 0 0 5px; }
.field-help { font-size: .8rem; color: #64748b; line-height: 1.55; }
.field-help-box { padding: 11px 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; }
.auth-debug-card { display: grid; gap: 7px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; color: #92400e; padding: 12px 14px; }
.auth-debug-code { font-family: ui-monospace,monospace; font-size: 1.2rem; font-weight: 800; letter-spacing: .18em; color: #0f172a; }
.otp-grid { display: flex; gap: 9px; }
.otp-group { display: flex; gap: 9px; }
.otp-input { width: 50px; height: 60px; text-align: center; font-size: 1.4rem; font-weight: 700; border: 1.5px solid #d7deea; border-radius: 12px; background: #f8fafc; box-sizing: border-box; transition: .15s; }
.otp-input:focus { outline: none; border-color: #0f5bd6; box-shadow: 0 0 0 4px rgba(15,91,214,.12); background: #fff; }
.auth-secondary-form { margin-top: 10px; }

/* ── CLIENT SELECT ──────────────────────────────────────────── */
.client-grid-select { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; margin-top: 6px; }
.client-select-card { background: #fff; border: 1.5px solid var(--border); border-radius: 16px; padding: 20px; display: grid; gap: 12px; transition: all .18s ease; }
.client-select-card:hover { border-color: #b8d0ff; box-shadow: 0 6px 20px rgba(15,91,214,.1); transform: translateY(-2px); }
.client-select-card.is-current { border-color: var(--brand); background: linear-gradient(180deg,#f5f9ff 0%,#eef5ff 100%); box-shadow: 0 0 0 3px rgba(15,91,214,.1); }
.client-select-head { display: flex; align-items: center; gap: 12px; }
.client-select-avatar { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg,#0f5bd6,#004590); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .96rem; flex-shrink: 0; }
.client-select-head strong { display: block; font-size: .94rem; font-weight: 700; }
.client-select-head span { display: block; font-size: .78rem; color: var(--muted); margin-top: 1px; }
.client-select-card p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.6; }
.client-select-status { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; color: #067647; background: #ecfdf3; border: 1px solid #abefc6; padding: 4px 10px; border-radius: 999px; }
.client-select-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.client-grid-empty { grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 56px 20px; gap: 12px; }
.client-grid-empty-icon { width: 60px; height: 60px; border-radius: 50%; background: #f1f5f9; display: grid; place-items: center; font-size: 1.5rem; color: #94a3b8; }
.client-grid-empty h3 { margin: 0; font-size: 1rem; }
.client-grid-empty p { margin: 0; color: var(--muted); max-width: 300px; line-height: 1.6; font-size: .86rem; }

/* ── BUSCA GLOBAL ───────────────────────────────────────────── */
.global-search-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.52); backdrop-filter: blur(3px); z-index: 500; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; opacity: 0; visibility: hidden; transition: all .16s ease; }
.global-search-overlay.open { opacity: 1; visibility: visible; }
.global-search-box { width: min(580px,calc(100vw - 32px)); background: #fff; border-radius: 18px; box-shadow: 0 24px 56px rgba(2,6,23,.28); overflow: hidden; transform: translateY(-10px); transition: transform .18s cubic-bezier(.16,1,.3,1); }
.global-search-overlay.open .global-search-box { transform: translateY(0); }
.global-search-input-row { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #f1f5f9; }
.global-search-input-row i { color: #94a3b8; font-size: 1rem; flex-shrink: 0; }
.global-search-input-row input { flex: 1; border: none; outline: none; font-size: .96rem; background: transparent; color: #0f172a; }
.global-search-input-row input::placeholder { color: #94a3b8; }
.global-search-kbd { font-size: .7rem; font-weight: 600; font-family: monospace; padding: 3px 7px; border-radius: 6px; background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom: 2px solid #94a3b8; color: #475569; flex-shrink: 0; }
.global-search-hint { padding: 10px 18px; font-size: .8rem; color: #94a3b8; }
.global-search-results { max-height: 320px; overflow-y: auto; }
.global-search-result { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid #f8fafc; text-decoration: none; color: #0f172a; transition: background .1s; }
.global-search-result:hover { background: #f5f9ff; }
.global-search-result-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; font-size: .86rem; flex-shrink: 0; }
.global-search-result-label { font-size: .9rem; font-weight: 600; }
.global-search-result-sub { font-size: .76rem; color: #64748b; }

/* ── SHORTCUTS MODAL ────────────────────────────────────────── */
.shortcuts-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.52); backdrop-filter: blur(3px); z-index: 600; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all .16s ease; }
.shortcuts-overlay.open { opacity: 1; visibility: visible; }
.shortcuts-modal { background: #fff; border-radius: 18px; width: min(460px,calc(100vw - 32px)); padding: 26px; box-shadow: 0 24px 56px rgba(2,6,23,.22); transform: scale(.96); transition: transform .18s cubic-bezier(.16,1,.3,1); }
.shortcuts-overlay.open .shortcuts-modal { transform: scale(1); }
.shortcuts-title { font-size: .96rem; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 9px; margin: 0 0 18px; }
.shortcuts-list { display: grid; gap: 4px; }
.shortcut-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.shortcut-item:last-child { border-bottom: none; }
.shortcut-desc { font-size: .86rem; color: #334155; }
.shortcut-keys { display: flex; gap: 4px; }
.shortcut-key { font-size: .7rem; font-weight: 700; font-family: monospace; padding: 3px 8px; border-radius: 6px; background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom: 2px solid #94a3b8; color: #334155; }

/* Topbar client-context indicator */
.topbar-client-context { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--brand-light); border: 1px solid #d6e4ff; font-size: .78rem; color: #334155; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.topbar-client-context strong { color: var(--brand); font-weight: 700; }

/* ── DARK MODE ──────────────────────────────────────────────── */
html.dark-force body { background: #0b1220; color: #e5edf9; }
html.dark-force .sidebar, html.dark-force .topbar, html.dark-force .feature-card, html.dark-force .table-shell, html.dark-force .form-shell, html.dark-force .settings-card, html.dark-force .table-card { background: #101a2b; border-color: #1f2a3c; color: #e5edf9; }
html.dark-force .topbar-refresh-btn, html.dark-force .topbar-client-chip, html.dark-force .topbar-icon-btn, html.dark-force .dark-mode-toggle { background: #0f1726; border-color: #243146; color: #9fb0c8; }
html.dark-force .topbar-refresh-btn:hover, html.dark-force .topbar-icon-btn:hover, html.dark-force .dark-mode-toggle:hover { background: #11203a; color: #93c5fd; }
html.dark-force .topbar-profile { background: #101a2b; border-color: #1f2a3c; }
html.dark-force .topbar-profile:hover { background: #0f1726; }
html.dark-force .topbar-user-name { color: #e5edf9; }
html.dark-force .topbar-user-role, html.dark-force .u-role, html.dark-force .text-muted { color: #9fb0c8; }
html.dark-force .topbar-dropdown { background: #101a2b; border-color: #1f2a3c; box-shadow: 0 16px 48px rgba(0,0,0,.5); }
html.dark-force .topbar-dropdown-header { border-bottom-color: #1f2a3c; }
html.dark-force .topbar-dropdown-name { color: #e5edf9; }
html.dark-force .topbar-dropdown-email { color: #9fb0c8; }
html.dark-force .topbar-dropdown-item { color: #cbd5e1; background: transparent; }
html.dark-force .topbar-dropdown-item:hover { background: #0f1726; }
html.dark-force .topbar-divider, html.dark-force .sb-head, html.dark-force .sb-footer, html.dark-force .menu-item { border-color: #1f2a3c; }
html.dark-force .menu-item { color: #9fb0c8; }
html.dark-force .menu-item:hover { background: #0f1726; color: #93c5fd; }
html.dark-force .menu-item.active { background: #11203a; color: #93c5fd; box-shadow: inset 0 0 0 1px #1f3b68; }
html.dark-force .sb-context-chip, html.dark-force .client-sidebar-card { background: linear-gradient(180deg,#0f1726 0%,#11203a 100%); border-color: #1f3b68; }
html.dark-force .client-sidebar-card strong { color: #e5edf9; }
html.dark-force .dash-header-title { color: #e5edf9; }
html.dark-force .dash-header-subtitle { color: #9fb0c8; }
html.dark-force .dash-btn { background: #0f1726; border-color: #243146; color: #9fb0c8; }
html.dark-force .dash-btn:hover { background: #11203a; color: #93c5fd; border-color: #1f3b68; }
html.dark-force .dash-btn-primary { background: #0f5bd6; border-color: #0f5bd6; color: #fff; }
html.dark-force .data-table th { background: #0f1726; color: #94a3b8; border-color: #1f2a3c; }
html.dark-force .data-table td { border-color: #1f2a3c; color: #e5edf9; }
html.dark-force .table-shell-head { border-bottom-color: #1f2a3c; }
html.dark-force .table-shell-head span, html.dark-force .page-hero-row p { color: #9fb0c8; }
html.dark-force .status-table th { background: #0f1726; color: #94a3b8; }
html.dark-force .status-table td { border-bottom-color: #1f2a3c; color: #e5edf9; }
html.dark-force .status-table tbody tr:hover td { background: #0f1726; }
html.dark-force .form-control, html.dark-force .stack-form input, html.dark-force .stack-form select, html.dark-force .stack-form textarea { background: #0f1726; border-color: #243146; color: #e5edf9; }
html.dark-force .form-label { color: #cbd5e1; }
html.dark-force .settings-title { color: #e5edf9; }
html.dark-force .checkbox-card, html.dark-force .checkbox-card-modern { background: #0f1726; border-color: #243146; color: #e5edf9; }
html.dark-force .note-card { background: #101a2b; border-color: #1f2a3c; }
html.dark-force .search-box input { background: #0f1726; border-color: #243146; color: #e5edf9; }
html.dark-force .toast { background: #101a2b; border-color: #1f2a3c; color: #e5edf9; }
html.dark-force .pill--code { background: #0f1726; color: #e5edf9; border-color: #243146; }
html.dark-force .process-mini-card, html.dark-force .process-stage-item { background: #101a2b; border-color: #1f2a3c; color: #e5edf9; }
html.dark-force .process-mini-card span, html.dark-force .process-stage-item small { color: #9fb0c8; }
html.dark-force .dash-kpi-tile { background: #101a2b; border-color: #1f2a3c; }
html.dark-force .dash-kpi-tile-value { color: #e5edf9; }
html.dark-force .dash-kpi-tile-label { color: #9fb0c8; }
html.dark-force .dash-chart-v2 { background: #101a2b; border-color: #1f2a3c; }
html.dark-force .dash-chart-v2-title { color: #e5edf9; }
html.dark-force .dash-donut-value { color: #e5edf9; }
html.dark-force .dash-chart-v2-legend b { color: #e5edf9; }
html.dark-force .dash-feature-card { background: #0f1726; border-color: #1f2a3c; }
html.dark-force .dash-feature-card strong { color: #e5edf9; }
html.dark-force .dash-feature-card span { color: #9fb0c8; }
html.dark-force .quick-link-card { background: #101a2b; border-color: #1f2a3c; color: #e5edf9; }
html.dark-force .quick-link-card:hover { background: #11203a; border-color: #1f3b68; }
html.dark-force .quick-link-card span { color: #9fb0c8; }
html.dark-force .client-select-card { background: #101a2b; border-color: #1f2a3c; }
html.dark-force .client-select-card.is-current { background: #11203a; border-color: #2d5ba3; }
html.dark-force .client-select-card p { color: #9fb0c8; }
html.dark-force .client-select-head strong { color: #e5edf9; }
html.dark-force .global-search-box { background: #101a2b; }
html.dark-force .global-search-input-row { border-bottom-color: #1f2a3c; }
html.dark-force .global-search-input-row input { color: #e5edf9; }
html.dark-force .global-search-result { color: #e5edf9; border-bottom-color: #162236; }
html.dark-force .global-search-result:hover { background: #0f1726; }
html.dark-force .shortcuts-modal { background: #101a2b; }
html.dark-force .shortcuts-title { color: #e5edf9; }
html.dark-force .shortcut-item { border-bottom-color: #1f2a3c; }
html.dark-force .shortcut-desc { color: #cbd5e1; }
html.dark-force .shortcut-key { background: #0f1726; border-color: #243146; border-bottom-color: #3b5270; color: #9fb0c8; }
html.dark-force .auth-form-panel { background: #101a2b; }
html.dark-force .auth-header-block h1 { color: #e5edf9; }
html.dark-force .auth-header-block p { color: #9fb0c8; }
html.dark-force .auth-eyebrow { color: #60a5fa; }
html.dark-force .field-block > span { color: #cbd5e1; }
html.dark-force .field-block input, html.dark-force .field-block select, html.dark-force .field-block textarea { background: #0f1726; border-color: #243146; color: #e5edf9; }
html.dark-force .field-block input:focus { border-color: #3b82f6; background: #101a2b; }
html.dark-force .otp-input { background: #0f1726; border-color: #243146; color: #e5edf9; }
html.dark-force .breadcrumb { color: #4a6080; }
html.dark-force .breadcrumb a { color: #60a5fa; }
html.dark-force .breadcrumb-current { color: #cbd5e1; }
html.dark-force .filter-chip { background: #0f1726; border-color: #243146; color: #9fb0c8; }
html.dark-force .filter-chip.is-active { background: #11203a; border-color: #1f3b68; color: #93c5fd; }
html.dark-force .topbar-client-context { background: #11203a; border-color: #1f3b68; color: #9fb0c8; }
html.dark-force .topbar-client-context strong { color: #93c5fd; }
html.dark-force .user-avatar-sm { background: #0f5bd6; }
html.dark-force .btn-icon { color: #9fb0c8; }
html.dark-force .btn-icon:hover { background: #11203a; color: #93c5fd; }
html.dark-force .admin-search input { background: #0f1726; border-color: #243146; color: #e5edf9; }
html.dark-force .feature-card h2 { color: #e5edf9; }
html.dark-force .feature-card p { color: #9fb0c8; }

/* ── RESPONSIVIDADE ─────────────────────────────────────────── */
@media (max-width: 1280px) {
  .dash-kpi-strip { grid-template-columns: repeat(2,1fr); }
  .dash-charts-v2 { grid-template-columns: 1fr; }
  .dash-chart-v2--wide { grid-column: 1; }
  .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .topbar-profile { min-width: 0; max-width: none; }
  .topbar-user-info { display: none; }
}
@media (max-width: 900px) {
  .app, body.menu-open .app { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); width: min(300px,calc(100vw - 56px)); box-shadow: 0 20px 56px rgba(2,6,23,.32); }
  body.menu-open .sidebar { transform: translateX(0); }
  body:not(.menu-open) .sb-title, body:not(.menu-open) .sb-context-chip, body:not(.menu-open) .label, body:not(.menu-open) .menu-section-label, body:not(.menu-open) .sb-footer { display: initial; }
  body:not(.menu-open) .menu-item, body:not(.menu-open) .sb-head { justify-content: normal; }
  .topbar { margin: 10px 10px 0; padding: 0 14px; }
  .workspace, .workspace-shell { padding: 14px 10px 18px; }
  .split-grid, .section-grid--three, .section-grid--two { grid-template-columns: 1fr; }
  .dash-kpi-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .definition-list-grid { grid-template-columns: 1fr; }
  .split-grid--compact { grid-template-columns: 1fr; }
  .search-box { min-width: 100%; }
}
@media (max-width: 768px) {
  .dash-hero-content { flex-direction: column; }
  .dash-hero-right { width: 100%; justify-content: center; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 30px 24px; }
  .client-grid-select { grid-template-columns: 1fr; }
  .admin-search input { width: 180px; }
}
@media (max-width: 640px) {
  .topbar-section { gap: 8px; min-width: 0; }
  .topbar-date span, .topbar-refresh-btn span, .topbar-client-chip span { display: none; }
  .hero-panel { padding: 20px; }
  .table-shell-head, .form-shell { padding: 16px; }
  .dash-kpi-strip { grid-template-columns: 1fr; }
  .otp-grid, .otp-group { gap: 7px; }
  .otp-input { width: 44px; height: 54px; font-size: 1.3rem; }
  .auth-form-panel { padding: 24px 16px; }
}
