/* ===================================================================
   Design system dos portais Orbit (copiado do Orbit Edu)
   Mesma identidade do NFE Orbit: sidebar escura + conteudo claro,
   azul/ciano Orbit, Inter, cards com barra de acento, tema escuro.
   Ajustes especificos do Despesas ficam em despesas.css.
   =================================================================== */
:root {
  --o-blue: #2563eb;
  --o-blue-600: #1d4ed8;
  --o-cyan: #06b6d4;
  --o-cyan-300: #67e8f9;
  --o-ink: #0f2747;
  --o-ink-2: #334867;
  --o-muted: #6b7a95;
  --o-bg: #eef3fb;
  --o-bg-2: #f5f8fd;
  --o-panel: #ffffff;
  --o-line: #e6edf7;
  --o-green: #10b981;
  --o-amber: #f59e0b;
  --o-red: #ef4444;
  --o-side-1: #0b1230;
  --o-side-2: #0a0f24;
  --o-grad: linear-gradient(135deg, var(--o-cyan), var(--o-blue));
  --o-r-sm: 10px;
  --o-r: 14px;
  --o-r-lg: 18px;
  --o-sh-sm: 0 1px 2px rgba(16, 40, 73, .05);
  --o-sh: 0 8px 24px rgba(20, 55, 92, .06);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--o-ink-2);
  background: linear-gradient(180deg, var(--o-bg) 0%, var(--o-bg-2) 100%);
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* O login fica em login.css, copiado do portal NFE Orbit. */

/* ---------------- LAYOUT DO PORTAL (padrao NFE Orbit) ---------------- */
#portal {
  --orbit-sidebar-w: var(--sidebar-w);
  --orbit-sidebar-w-collapsed: 76px;
  display: grid;
  grid-template-columns: var(--orbit-sidebar-w) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  transition: grid-template-columns .22s ease;
}
#portal.sidebar-collapsed { grid-template-columns: var(--orbit-sidebar-w-collapsed) minmax(0, 1fr); }

/* Botao redondo na borda do menu, como no NFE */
#orbit-sidebar-toggle {
  position: fixed; left: calc(var(--orbit-sidebar-w) - 16px); top: 22px; z-index: 40;
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, .4); background: #0b1230; color: #67e8f9;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  transition: left .22s ease, transform .18s ease;
}
#orbit-sidebar-toggle:hover { border-color: #67e8f9; }
#portal.sidebar-collapsed #orbit-sidebar-toggle { left: calc(var(--orbit-sidebar-w-collapsed) - 16px); transform: rotate(180deg); }

/* Sidebar */
#sidebar {
  grid-row: 1 / 3;
  background: linear-gradient(180deg, var(--o-side-2), var(--o-side-1));
  border-right: 1px solid rgba(99, 102, 241, .18);
  display: flex; flex-direction: column;
  padding: 18px 12px 20px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  z-index: 30;
}
.brand { padding: 0 4px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 4px; }
.brand-logo { width: 46px; height: 46px; object-fit: contain; flex: 0 0 46px; }
.brand-title { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.brand-utility {
  margin: 14px 0 10px; padding: 12px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 11px; line-height: 1.4; color: #7c88a8; overflow-wrap: break-word;
}

#nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.nav-group { display: flex; flex-direction: column; }
.nav-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border: 0; background: transparent;
  color: #e2e8f0; font-weight: 700; font-size: 14px;
  border-radius: 10px; text-align: left; text-decoration: none;
  transition: background .15s, color .15s; min-height: 44px;
}
.nav-head:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-head .ic { width: 22px; text-align: center; font-size: 16px; flex: 0 0 22px; }
.nav-head .txt { flex: 1 1 auto; min-width: 0; }
.nav-head .caret { color: var(--o-cyan-300); font-size: 17px; line-height: 1; transition: transform .2s ease; }
.nav-head .ext { margin-left: auto; font-size: 12px; color: #8ea0c5; }
.nav-group.open > .nav-head { color: #fff; background: rgba(6, 182, 212, .08); }
.nav-group.open > .nav-head .caret { transform: rotate(90deg); }
.nav-head.active { background: linear-gradient(135deg, rgba(6, 182, 212, .92), rgba(37, 99, 235, .92)); color: #fff; box-shadow: 0 6px 16px rgba(6, 182, 212, .22); }
.nav-sub {
  display: none; flex-direction: column; gap: 2px;
  padding: 2px 0 6px 10px; margin-left: 16px;
  border-left: 1px solid rgba(99, 102, 241, .2);
}
.nav-group.open > .nav-sub { display: flex; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; border: 0; background: transparent;
  color: #93a0bd; font-weight: 600; font-size: 13px;
  text-align: left; border-radius: 8px; text-decoration: none;
  transition: background .15s, color .15s; min-height: 38px;
}
.nav-item .subic { width: 18px; text-align: center; font-size: 13px; flex: 0 0 18px; }
.nav-item .ext { margin-left: auto; font-size: 12px; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, .92), rgba(37, 99, 235, .92));
  color: #fff; box-shadow: 0 6px 16px rgba(6, 182, 212, .22);
}
.nav-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 10px 6px; }
.badge-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }

/* Menu recolhido: so os icones */
#portal.sidebar-collapsed #sidebar { padding-left: 8px; padding-right: 8px; }
#portal.sidebar-collapsed .brand-title, #portal.sidebar-collapsed .brand-utility,
#portal.sidebar-collapsed .nav-head .txt, #portal.sidebar-collapsed .nav-head .caret, #portal.sidebar-collapsed .nav-head .ext,
#portal.sidebar-collapsed .nav-sub, #portal.sidebar-collapsed .badge-count { display: none !important; }
#portal.sidebar-collapsed .brand-lockup { justify-content: center; padding: 0; margin-bottom: 14px; }
#portal.sidebar-collapsed .brand-logo { width: 34px; height: 34px; flex-basis: 34px; }
@media (min-width: 901px) { #portal.sidebar-collapsed .brand-lockup { justify-content: flex-start; padding-left: 4px; } }
#portal.sidebar-collapsed .nav-head { justify-content: center; padding: 11px 0; }

/* Topbar (#orbit-topbar do NFE) */
#topbar {
  grid-column: 2;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 32px;
  background: #fff; border-bottom: 1px solid #e9eef5;
  position: sticky; top: 0; z-index: 20;
}
.otb-search {
  position: relative;
  flex: 1 1 auto; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  background: #f5f8fc; border: 1px solid #e6edf7; border-radius: 10px;
  padding: 0 12px; height: 40px; color: #8593ad;
}
.otb-search svg { width: 18px; height: 18px; flex: 0 0 18px; }
.otb-search input { border: 0; background: transparent; outline: 0; height: 38px; flex: 1 1 auto; min-width: 0; color: #334867; font-size: 14px; }
.otb-actions { position: relative; margin-left: auto; display: flex; align-items: center; gap: 14px; }
.otb-icon {
  position: relative; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid #e6edf7; background: #fff; color: #475569;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.otb-icon:hover, .otb-icon[aria-expanded="true"] { background: #f5f8fc; border-color: #b8cbe3; }
.otb-icon svg { width: 19px; height: 19px; }
.otb-dot {
  display: none; position: absolute; top: 5px; right: 5px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #dc2626; color: #fff; box-shadow: 0 0 0 2px #fff;
  font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
}
.otb-dot.has-alerts { display: block; }
.otb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid #e6edf7; background: #fff; font: inherit;
}
.otb-user:hover, .otb-user[aria-expanded="true"] { background: #f5f8fc; border-color: #b8cbe3; }
.otb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #2563eb); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.otb-name { font-size: 13px; font-weight: 600; color: #334867; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otb-user-caret { width: 14px; height: 14px; color: #71829b; transition: transform .18s ease; }
.otb-user[aria-expanded="true"] .otb-user-caret { transform: rotate(180deg); }

/* Popovers do topo: notificacoes, conta e busca */
.orbit-topbar-popover {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 90;
  width: min(390px, calc(100vw - 28px)); overflow: hidden;
  border: 1px solid #dce6f2; border-radius: 8px; background: #fff;
  box-shadow: 0 22px 60px rgba(28, 53, 84, .2); color: #243b59;
}
.orbit-topbar-popover[hidden] { display: none; }
.orbit-topbar-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #e7edf5; }
.orbit-topbar-popover-head strong { font-size: 15px; color: #173861; }
.orbit-topbar-popover-action { border: 0; background: transparent; color: #2f72b8; font-size: 12px; font-weight: 700; padding: 5px; }
.orbit-topbar-popover-action:hover { text-decoration: underline; }
.orbit-notification-list { max-height: min(520px, calc(100vh - 150px)); overflow: auto; }
.orbit-notification-empty { padding: 28px 20px; text-align: center; color: #71829b; font-size: 13px; }
.orbit-notification-item {
  --alert: #f59e0b; position: relative; width: 100%;
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px;
  padding: 14px 16px; border: 0; border-bottom: 1px solid #edf1f6;
  background: #fff; color: #243b59; text-align: left;
}
.orbit-notification-item:last-child { border-bottom: 0; }
.orbit-notification-item:hover, .orbit-notification-item.sel { background: #f7faff; }
.orbit-notification-item[data-tone="critical"] { --alert: #dc2626; }
.orbit-notification-item[data-tone="info"] { --alert: #2563eb; }
.orbit-notification-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--alert) 12%, #fff); color: var(--alert); font-size: 14px; font-weight: 900; }
.orbit-notification-copy { min-width: 0; padding-right: 10px; }
.orbit-notification-copy strong { display: block; color: #1d3553; font-size: 13px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orbit-notification-copy span { display: block; margin-top: 3px; color: #687b96; font-size: 12px; line-height: 1.4; }
.orbit-account-popover { width: min(320px, calc(100vw - 28px)); }
.orbit-account-identity { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 18px; border-bottom: 1px solid #e7edf5; }
.orbit-account-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #06b6d4, #2563eb); color: #fff; font-weight: 800; }
.orbit-account-name { display: block; overflow: hidden; text-overflow: ellipsis; color: #173861; font-size: 14px; font-weight: 800; white-space: nowrap; }
.orbit-account-email { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; color: #6b7d96; font-size: 12px; white-space: nowrap; }
.orbit-account-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.orbit-account-meta span { padding: 2px 7px; border-radius: 999px; background: #eef5ff; color: #315f91; font-size: 10px; font-weight: 700; }
.orbit-account-menu { padding: 7px; }
.orbit-account-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 6px; background: transparent; color: #284360; font-size: 13px; font-weight: 650; text-align: left; }
.orbit-account-menu button:hover { background: #f2f7fc; }
.orbit-account-menu button svg { width: 17px; height: 17px; color: #597391; flex: 0 0 17px; }
.orbit-account-menu .orbit-account-danger { color: #b42318; }
.orbit-account-menu .theme-state { margin-left: auto; }
.orbit-account-divider { height: 1px; margin: 5px 3px; background: #e7edf5; }
.theme-state { font-size: 11px; color: #8593ad; background: #f0f4fb; padding: 1px 8px; border-radius: 999px; }
.otb-results { left: 0; right: auto; width: min(560px, calc(100vw - 28px)); top: calc(100% + 8px); }
.otb-results .orbit-notification-item { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; }
.otb-results .amt { font-weight: 800; color: #0f2747; font-size: 13px; white-space: nowrap; }

/* Conteudo */
#content { grid-column: 2; padding: 22px 32px 44px; }
.crumbs { font-size: 12px; color: #8a97b3; font-weight: 600; margin-bottom: 14px; }
.crumbs b { color: var(--o-blue); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 21px; color: var(--o-ink); letter-spacing: -.01em; }
.page-head p { font-size: 13px; color: var(--o-muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--o-panel); border: 1px solid var(--o-line);
  border-radius: var(--o-r-lg); box-shadow: var(--o-sh);
  padding: 20px 22px; margin-bottom: 16px;
}
.card h2 { font-size: 16px; color: var(--o-ink); margin-bottom: 14px; }

/* Cards de estatistica */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-box {
  position: relative; overflow: hidden;
  background: var(--o-panel); border: 1px solid var(--o-line); border-radius: 16px;
  padding: 18px 20px 16px; box-shadow: var(--o-sh-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 92px;
}
.stat-box:hover { transform: translateY(-2px); box-shadow: var(--o-sh); }
.stat-box:before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--o-cyan), var(--o-blue));
}
.stat-box.green:before { background: linear-gradient(180deg, #34d399, var(--o-green)); }
.stat-box.amber:before { background: linear-gradient(180deg, #fbbf24, var(--o-amber)); }
.stat-box.red:before { background: linear-gradient(180deg, #f87171, var(--o-red)); }
.stat-box strong { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8593ad; }
.stat-box .num { font-size: 32px; font-weight: 800; color: var(--o-ink); line-height: 1.15; margin-top: 8px; }

/* Botoes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 11px; font-weight: 700; font-size: 13px;
  min-height: 42px; padding: 0 18px; border: 1px solid transparent;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--o-blue); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .2); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: #fff; border-color: #d9e2f1; color: var(--o-blue-600); }
.btn-secondary:hover { border-color: var(--o-cyan); }
.btn-light { background: #eef3fb; border-color: var(--o-line); color: var(--o-ink-2); }
.btn-light:hover { background: #e4ecf8; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.btn-danger { background: #fff; border-color: #f3c1c1; color: #dc2626; }
.btn-danger:hover { background: #fef2f2; }

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--o-muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid #d9e2f1; border-radius: var(--o-r-sm);
  background: #fff; color: var(--o-ink); outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { border-color: var(--o-cyan); box-shadow: 0 0 0 4px rgba(6, 182, 212, .14); }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Tabelas */
.table-wrap { border: 1px solid var(--o-line); border-radius: var(--o-r); overflow: auto; background: #fff; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
  background: #f1f6fd; color: #8593ad; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 14px; border-bottom: 1px solid var(--o-line);
  white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #eef2f9; color: var(--o-ink-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faff; }
td .sub { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }
.empty { padding: 22px; text-align: center; color: #8a97b3; font-size: 13px; }

/* Pills de status */
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.blue { background: rgba(37, 99, 235, .1); color: var(--o-blue-600); }
.pill.green { background: rgba(16, 185, 129, .12); color: #047857; }
.pill.amber { background: rgba(245, 158, 11, .14); color: #b45309; }
.pill.red { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.pill.gray { background: #eef2f8; color: #64748b; }

/* Filtros acima da tabela */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 180px; }

/* Toast */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #10203c; color: #eaf1ff; font-size: 13px; font-weight: 600;
  padding: 12px 20px; border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s ease;
  max-width: min(560px, 90vw); text-align: center;
}
#toast.show { opacity: 1; }
#toast.err { background: #7f1d1d; }

/* Dialogo central (confirmacoes, camera) */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 12, 28, .55);
  backdrop-filter: blur(2px); z-index: 250;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: min(520px, 96vw); max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 18px; padding: 24px;
  box-shadow: 0 30px 80px rgba(8, 20, 45, .4);
}
.modal h2 { font-size: 17px; color: var(--o-ink); margin-bottom: 16px; }

/* Painel lateral direito (#orbit-fiscal-detail do NFE): formularios e detalhes */
.drawer {
  --drawer-w: 680px;
  position: fixed; inset: 0; z-index: 170;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--drawer-w);
  visibility: hidden; pointer-events: none;
}
.drawer.open { visibility: visible; pointer-events: auto; }
.drawer-backdrop { grid-column: 1 / -1; grid-row: 1; border: 0; background: rgba(10, 22, 40, .42); opacity: 0; transition: opacity .2s ease; cursor: default; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer + .drawer .drawer-backdrop { background: rgba(10, 22, 40, .2); }
.drawer-panel {
  position: relative; grid-column: 2; grid-row: 1;
  background: #fff; box-shadow: -18px 0 55px rgba(15, 39, 71, .2);
  transform: translateX(102%); transition: transform .22s ease;
  display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; height: 100vh;
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-resize { position: absolute; z-index: 3; left: -7px; top: 0; width: 14px; height: 100%; border: 0; background: transparent; cursor: ew-resize; touch-action: none; }
.drawer-resize:before { content: ""; position: absolute; left: 5px; top: calc(50% - 30px); width: 4px; height: 60px; border-radius: 4px; background: #a9b9cf; box-shadow: 0 0 0 1px rgba(255, 255, 255, .75); }
.drawer.resizing .drawer-resize:before { background: #2f72b8; }
.drawer.resizing * { cursor: ew-resize !important; user-select: none !important; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid #e6edf7; background: #f8fbff; }
.drawer-head h2 { margin: 0; color: #0f2747; font-size: 20px; line-height: 1.25; }
.drawer-sub { margin-top: 5px; color: #6b7a95; font-size: 13px; }
.drawer-sub:empty { display: none; }
.drawer-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border: 1px solid #d8e0ec; border-radius: 9px; background: #fff; color: #334867; font-size: 25px; line-height: 1; }
.drawer-close:hover { border-color: #b8cbe3; background: #f5f8fc; }
.drawer-body { overflow: auto; padding: 20px 22px 32px; }
.drawer-body .two-col { grid-template-columns: 1fr; }
.drawer-body .totals { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.drawer-body .form-foot { position: sticky; bottom: -32px; margin: 16px -22px -32px; padding: 14px 22px; background: #fff; border-top: 1px solid #e6edf7; z-index: 2; }

/* ---------------- TEMA ESCURO ---------------- */
body.dark { background: linear-gradient(180deg, #0a0f24 0%, #0b1020 100%); color: #d6deef; }
body.dark #topbar { background: #0e1633; border-color: rgba(255, 255, 255, .08); }
body.dark .otb-search { background: #131c3d; border-color: rgba(255, 255, 255, .1); color: #8a97b3; }
body.dark .otb-search input { color: #e6ecfb; }
body.dark .otb-icon, body.dark .otb-user { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #cdd8f2; }
body.dark .otb-name { color: #e9eefb; }
body.dark .otb-dot { box-shadow: 0 0 0 2px #0e1633; }
body.dark .orbit-topbar-popover { background: #101935; border-color: rgba(255, 255, 255, .12); color: #cdd8f2; }
body.dark .orbit-topbar-popover-head, body.dark .orbit-account-identity { border-color: rgba(255, 255, 255, .08); }
body.dark .orbit-topbar-popover-head strong, body.dark .orbit-account-name, body.dark .orbit-notification-copy strong { color: #e9eefb; }
body.dark .orbit-notification-item { background: #101935; color: #cdd8f2; border-color: rgba(255, 255, 255, .07); }
body.dark .orbit-notification-item:hover, body.dark .orbit-notification-item.sel, body.dark .orbit-account-menu button:hover { background: rgba(255, 255, 255, .05); }
body.dark .orbit-notification-copy span, body.dark .orbit-account-email { color: #9fb0d0; }
body.dark .orbit-account-menu button { color: #cdd8f2; }
body.dark .orbit-account-divider { background: rgba(255, 255, 255, .1); }
body.dark .otb-results .amt { color: #e9eefb; }
body.dark .theme-state { color: #0b1020; background: var(--o-cyan-300); }
body.dark .drawer-panel { background: #101935; box-shadow: -18px 0 55px rgba(0, 0, 0, .45); }
body.dark .drawer-head { background: #0e1633; border-color: rgba(255, 255, 255, .08); }
body.dark .drawer-head h2 { color: #e9eefb; }
body.dark .drawer-sub { color: #9fb0d0; }
body.dark .drawer-close { background: #131c3d; border-color: rgba(255, 255, 255, .1); color: #e9eefb; }
body.dark .drawer-body .form-foot { background: #101935; border-color: rgba(255, 255, 255, .08); }
body.dark .crumbs { color: #8a97b3; }
body.dark .page-head h1 { color: #e9eefb; }
body.dark .page-head p { color: #9fb0d0; }
body.dark .card { background: #101935; border-color: rgba(255, 255, 255, .08); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
body.dark .card h2 { color: #e9eefb; }
body.dark .stat-box { background: #131c3d; border-color: rgba(255, 255, 255, .08); }
body.dark .stat-box .num { color: #f2f5ff; }
body.dark .field label { color: #93a3c4; }
body.dark .field input, body.dark .field select { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #e6ecfb; }
body.dark .btn-secondary { background: #131c3d; border-color: rgba(255, 255, 255, .12); color: #9fc2ff; }
body.dark .btn-light { background: #182348; border-color: rgba(255, 255, 255, .1); color: #cdd8f2; }
body.dark .btn-danger { background: #131c3d; border-color: rgba(248, 113, 113, .4); color: #f87171; }
body.dark .table-wrap { background: #101935; border-color: rgba(255, 255, 255, .08); }
body.dark thead th { background: #0e1633; color: #8a97b3; border-color: rgba(255, 255, 255, .08); }
body.dark tbody td { color: #d6deef; border-color: rgba(255, 255, 255, .07); }
body.dark tbody tr:hover { background: rgba(255, 255, 255, .04); }
body.dark .empty { color: #8a97b3; }
body.dark .pill.gray { background: rgba(255, 255, 255, .08); color: #a9b6d3; }
body.dark .modal { background: #101935; }
body.dark .modal h2 { color: #e9eefb; }

/* Responsivo */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  #portal, #portal.sidebar-collapsed { grid-template-columns: 1fr; }
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(82vw, 280px); transform: translateX(0); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(0, 0, 0, .35); }
  #portal.sidebar-collapsed #sidebar { transform: translateX(-102%); box-shadow: none; }
  #orbit-sidebar-toggle { left: calc(min(82vw, 280px) - 16px); top: 16px; z-index: 50; }
  #portal.sidebar-collapsed #orbit-sidebar-toggle { left: 14px; transform: none; }
  #topbar, #content { grid-column: 1; min-width: 0; }
  #topbar { padding: 10px 12px 10px 56px; }
  .otb-name { display: none; }
  .otb-search { max-width: none; }
  #content { padding: 18px 16px 40px; }
}
@media (max-width: 760px) {
  .drawer { grid-template-columns: 1fr; }
  .drawer-panel { grid-column: 1; width: 100% !important; }
  .drawer-resize { display: none; }
  .drawer-body { padding: 16px 16px 28px; }
  .drawer-body .form-foot { margin: 16px -16px -28px; padding: 12px 16px; bottom: -28px; }
}
@media (max-width: 680px) {
  .otb-search { display: none; }
  .otb-actions { gap: 8px; }
  .orbit-topbar-popover { position: fixed; left: 14px; right: 14px; top: 68px; width: auto; }
}
