/* pay7bus admin — tema oscuro (fondos claros reducidos) */
:root {
  --bg-deep: #070f16;
  --bg-mid: #0c1a26;
  --bg-page: #0a1520;
  --bg-card: #122433;
  --bg-elevated: #163044;
  --ink: #e6eef5;
  --muted: #8fa3b3;
  --line: #243848;
  --accent: #3d8ec4;
  --accent-2: #2a6f9c;
  --cta: #d97706;
  --cta-hover: #b45309;
  --ok: #22a06b;
  --danger: #f07167;
  --sidebar: #08141e;
  --sidebar-text: #c5d6e4;
  --row-alt: #0e1f2c;
  --row-sel: #1a3a52;
  --input-bg: #0d1c28;
  --radius: 10px;
  --font: "Segoe UI", "Helvetica Neue", Calibri, sans-serif;
  --display: "Segoe UI Semibold", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { color-scheme: dark; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-page);
}

/* —— Auth (login) —— */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, #1a4d6e 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, #c45c1633 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-deep), var(--bg-mid) 55%, #050c12);
  z-index: 0;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 2rem));
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: var(--ink);
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #9fd0f0;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}
.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.auth-sub {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.auth-alt {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-alt a {
  color: var(--accent);
  text-decoration: none;
}
.auth-alt a:hover {
  text-decoration: underline;
}
.prop-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}
.prop-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.prop-topbar h1 {
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
}
.prop-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.prop-content {
  padding: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.prop-content-wide {
  max-width: 1280px;
}
.prop-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.65rem;
}
.prop-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}
.prop-nav a:hover {
  color: var(--ink);
}
.prop-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.prop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.prop-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.prop-filter input,
.prop-filter select {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: var(--input-bg);
  min-width: 9rem;
}
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-accent:hover {
  background: var(--accent-2);
}
.data .num {
  text-align: right;
  white-space: nowrap;
}
tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: var(--row-sel);
}
.badge.estado-abierta {
  color: var(--ok);
}
.badge.estado-cerrada {
  color: var(--muted);
}
.badge.estado-anulada {
  color: var(--danger);
}
.prop-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.prop-modal.hidden {
  display: none;
}
.prop-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.prop-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  margin: 2vh auto 3rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.prop-modal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.prop-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.prop-modal-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.prop-modal-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 0.9rem;
}
.prop-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .prop-modal-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.prop-modal-grid h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
body.modal-open {
  overflow: hidden;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9ec4de;
}
.field input,
.field select,
.field textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: var(--input-bg);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid #3d8ec455;
  border-color: var(--accent);
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.4rem 0 1rem;
}
.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #d66a1f, var(--cta));
  cursor: pointer;
}
.btn-primary:hover { background: var(--cta-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

/* —— App shell / sidebar —— */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg-page);
  transition: grid-template-columns 0.2s ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: 64px 1fr; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.sidebar .brand {
  color: #fff;
  padding: 0.35rem 0.5rem;
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.25;
  word-break: break-word;
}
.sidebar-collapsed .brand { display: none; }
.btn-sidebar-toggle {
  border: 0;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 10px;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-sidebar-toggle:hover { background: rgba(255,255,255,0.16); }
.btn-sidebar-toggle .ico-chevron {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform 0.2s ease;
}
.sidebar-collapsed .btn-sidebar-toggle .ico-chevron {
  transform: scaleX(-1);
}
.sidebar-context-wrap {
  padding: 0 0.25rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.35rem;
}
.sidebar-context-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 0.35rem;
}
.sidebar-context-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  font: inherit;
  font-size: 0.88rem;
}
.sidebar-context-select:focus {
  outline: 2px solid rgba(196, 92, 22, 0.55);
  outline-offset: 1px;
}
.sidebar-collapsed .sidebar-context-wrap {
  display: none;
}
.sidebar-filter-wrap { padding: 0 0.25rem 0.35rem; }
.sidebar-filter {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}
.sidebar-filter::placeholder { color: rgba(255,255,255,0.45); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: auto;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-link .nav-ico {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  opacity: 0.95;
}
.nav-link .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-link.nav-disabled:hover {
  background: transparent;
  color: #8a9aa8;
}
.nav-link.filter-hl {
  outline: 2px solid #c45c16;
  background: rgba(196, 92, 22, 0.25);
  color: #fff;
}
.nav-link.nav-disabled {
  opacity: 0.38;
  color: #8a9aa8;
  cursor: not-allowed;
  pointer-events: auto;
}
.sidebar-collapsed .nav-link {
  padding: 0.65rem 0.2rem;
  justify-content: center;
  gap: 0;
}
.sidebar-collapsed .nav-link .nav-label {
  display: none;
}
.sidebar-collapsed .nav-link .nav-ico {
  width: 1.35rem;
  height: 1.35rem;
}
.sidebar-foot {
  margin-top: auto;
  padding: 0.5rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.session-info {
  font-size: 0.75rem;
  opacity: 0.75;
  padding: 0 0.35rem;
}
.sidebar-collapsed .session-info,
.sidebar-collapsed .btn-sidebar span { display: none; }
.btn-sidebar {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e8f0f5;
}
.sidebar-collapsed .btn-theme span { display: none; }
.btn .ico,
.btn-sidebar .ico,
.btn-sidebar-toggle .ico {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-sizing: border-box;
  height: 2.35rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0 0.85rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.btn:hover { background: #1c3a50; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.nav-hint {
  position: fixed;
  z-index: 100;
  transform: translateY(-50%);
  background: #02080d;
  color: #fff;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.55);
  white-space: nowrap;
}
table.data tr.data-row { cursor: pointer; }
table.data tr.row-selected td {
  background: var(--row-sel) !important;
}
.module-panel {
  color: var(--ink);
}
.module-panel canvas {
  max-width: 100%;
  height: auto;
  background: #0a1620;
  border-radius: 8px;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.topbar h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.content {
  padding: 1.25rem 1.5rem 2rem;
  background: var(--bg-page);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #9ec4de;
  font-weight: 600;
}
.modal textarea.memo {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.8rem;
  white-space: pre;
  min-height: 10rem;
}
.toolbar select,
.toolbar input,
.field-inline input[type="date"] {
  box-sizing: border-box;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.65rem;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--input-bg);
  line-height: 1.25;
  vertical-align: middle;
  color-scheme: dark;
}
.toolbar select {
  max-width: 16rem;
}
.toolbar input:focus,
.toolbar select:focus,
.field-inline input[type="date"]:focus {
  outline: 2px solid #3d8ec455;
  border-color: var(--accent);
}
.btn-accent {
  border: 0;
  background: var(--accent-2);
  color: #fff;
}
.btn-accent:hover { background: var(--accent); }
.btn-danger {
  border-color: #6b3030;
  color: var(--danger);
  background: #2a1515;
}
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--ink);
}
table.data th {
  text-align: left;
  background: #0d2030;
  color: #d7e8f5;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  background: var(--bg-card);
}
table.data tr:nth-child(even) td { background: var(--row-alt); }
table.data tr.data-row:hover td { background: #183248; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: #fff;
  background: var(--accent-2);
}
.badge.ok { background: var(--ok); }
.badge.warn { background: var(--cta); }
.badge.off { background: #526574; }
.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 14, 0.72);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 1rem;
}
.modal {
  width: min(520px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  max-height: 90vh;
  overflow: auto;
  color: var(--ink);
}
.modal:has(.field-permisos) {
  width: min(640px, 100%);
}
.modal:has(.field-propietario-buses) {
  width: min(760px, 100%);
}
.field-propietario-buses .pb-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  max-height: 14rem;
  margin-bottom: 0.65rem;
  background: var(--input-bg);
}
.field-propietario-buses .pb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.field-propietario-buses .pb-table th,
.field-propietario-buses .pb-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.field-propietario-buses .pb-empty td {
  color: var(--muted);
  font-style: italic;
}
.field-propietario-buses .pb-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
}
.field-propietario-buses .pb-add select,
.field-propietario-buses .pb-add input {
  min-width: 0;
}
.field-propietario-buses .pb-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.field-propietario-buses .pb-search-wrap {
  position: relative;
  flex: 1 1 14rem;
  min-width: 12rem;
}
.field-propietario-buses .pb-search-wrap input[type='text'] {
  width: 100%;
}
.pb-search-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 60;
  max-height: 12rem;
  overflow: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.pb-search-list.hidden {
  display: none;
}
.pb-search-item {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.pb-search-item:hover,
.pb-search-item:focus {
  background: rgba(126, 184, 218, 0.15);
  outline: none;
}
.pb-search-empty {
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.field-propietario-buses .pb-add input#pbPct {
  width: 5rem;
}
.field-propietario-buses .pb-copro {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.field-propietario-buses .pb-hint {
  font-size: 0.8rem;
  color: #9ec4de;
  min-height: 1.2rem;
}
.field-permisos .perm-checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  max-height: 16rem;
  overflow: auto;
  background: var(--input-bg);
}
.perm-group { margin-bottom: 0.75rem; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ec4de;
  margin-bottom: 0.35rem;
}
.check-perm {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 400;
  font-size: 0.85rem;
  margin: 0.25rem 0;
  color: var(--ink);
}
.check-perm code {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.25rem;
}
.modal h3 { margin: 0 0 1rem; color: var(--ink); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.report-backdrop .modal-report {
  width: min(1140px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.report-head h3 { margin: 0; color: var(--ink); }
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.report-canvas-wrap {
  overflow: auto;
  max-height: calc(92vh - 5.5rem);
  background: #d0d4d8;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0.75rem;
  display: flex;
  justify-content: center;
}
.report-canvas-wrap canvas {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  max-width: 100%;
  height: auto;
}
.cobros-totals {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.cobros-totals strong {
  color: #9fd0f0;
  font-weight: 700;
}
.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
}
html[data-theme="light"] .cobros-totals strong {
  color: #0b3d5c;
}
html[data-theme="light"] .report-canvas-wrap {
  background: #d0d4d8;
}
html[data-theme="light"] .report-canvas-wrap canvas,
html[data-theme="light"] .module-panel canvas {
  background: #fff;
}
.hidden { display: none !important; }

/* Portal operador (subdominio o path tenant): solo usuario + clave */
html[data-tenant-portal='1'] #regionField,
html[data-tenant-portal='1'] #contextPanel,
html[data-tenant-portal='1'] .auth-alt {
  display: none !important;
}
html[data-tenant-portal='1'] #authSub {
  display: none;
}
@media (max-width: 800px) {
  .app-shell,
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar-collapsed .brand,
  .sidebar-collapsed .session-info,
  .sidebar-collapsed .btn-sidebar span { display: initial; }
  .sidebar-collapsed .nav-link {
    font-size: 0.92rem;
    text-align: left;
    font-weight: 400;
  }
}

/* Tema claro opcional (localStorage s7b.theme=light) */
html[data-theme="light"] {
  color-scheme: light;
  --bg-deep: #e8eef3;
  --bg-mid: #d5e0ea;
  --bg-page: #eef3f7;
  --bg-card: #ffffff;
  --bg-elevated: #f7fafc;
  --ink: #0b1c28;
  --muted: #5a6b78;
  --line: #d5dee5;
  --accent: #1a6b9a;
  --accent-2: #155a82;
  --sidebar: #0f2433;
  --sidebar-text: #c5d6e4;
  --row-alt: #f4f8fb;
  --row-sel: #d6ebf8;
  --input-bg: #ffffff;
}
html[data-theme="light"] body,
html[data-theme="light"] .main,
html[data-theme="light"] .content,
html[data-theme="light"] .app-shell {
  background: var(--bg-page);
  color: var(--ink);
}
html[data-theme="light"] .auth-card,
html[data-theme="light"] .topbar,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .modal,
html[data-theme="light"] .report-backdrop .modal-report {
  background: var(--bg-card);
  color: var(--ink);
}
html[data-theme="light"] table.data th {
  background: #e8f0f6;
  color: #0b1c28;
}
html[data-theme="light"] table.data td {
  background: #fff;
}
html[data-theme="light"] table.data tr:nth-child(even) td {
  background: var(--row-alt);
}
html[data-theme="light"] table.data tr.data-row:hover td {
  background: #e3f0fa;
}
html[data-theme="light"] .btn {
  background: #fff;
  color: var(--ink);
}
html[data-theme="light"] .btn:hover {
  background: #eef3f7;
}
html[data-theme="light"] .field,
html[data-theme="light"] .field-inline,
html[data-theme="light"] .auth-card h1,
html[data-theme="light"] .brand {
  color: inherit;
}
html[data-theme="light"] .field { color: #1a4a66; }
html[data-theme="light"] .brand { color: #0b3d5c; }
html[data-theme="light"] .report-canvas-wrap {
  background: #e8eef3;
}
html[data-theme="light"] .module-panel canvas,
html[data-theme="light"] .report-canvas-wrap canvas {
  background: #fff;
}

.context-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.context-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
.tenant-portal {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: var(--input-bg);
  border: 1px solid var(--line);
  font-weight: 600;
}
.context-cards {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}
.context-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--ink);
  cursor: pointer;
}
.context-card:hover {
  border-color: var(--cta);
}
.context-card-code {
  font-weight: 700;
  font-size: 0.95rem;
}
.context-card-name {
  font-size: 0.88rem;
  opacity: 0.9;
}
.context-card-region {
  font-size: 0.78rem;
  opacity: 0.65;
  text-transform: uppercase;
}
.topbar .empresa-badge {
  margin-right: 0.5rem;
  background: #2a4a6b;
}
.topbar .context-wrap select {
  margin-right: 0.75rem;
  max-width: 220px;
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

