﻿:root {
  --bg: #050914;
  --card: #0f172a;
  --surface: #0d1324;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #22d3ee;
  --accent-strong: #0891b2;
  --accent-2: #a855f7;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  --font: "Poppins", "Trebuchet MS", "Segoe UI", sans-serif;
  --base-size: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--base-size);
  background: radial-gradient(circle at 10% 20%, rgba(34, 211, 238, 0.15), transparent 25%),
              radial-gradient(circle at 90% 10%, rgba(168, 85, 247, 0.12), transparent 25%),
              radial-gradient(circle at 30% 80%, rgba(16, 185, 129, 0.12), transparent 30%),
              var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
body.theme-light {
  --bg: #e9edf5;
  --card: #f5f7fb;
  --surface: #eef2f7;
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #475569;
  --accent-strong: #0f5f75;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  background: radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.18), transparent 28%),
              radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.14), transparent 28%),
              var(--bg);
}
body.font-compact { --base-size: 15px; }
body.font-mini { --base-size: 14px; }

#app { min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.micro { font-size: 0.9rem; margin: 0; }
.tiny { font-size: 0.8rem; margin: 0; }
.success { color: var(--success); }
.warning { color: var(--warning); }
.brand { font-weight: 700; margin: 0; letter-spacing: 0.4px; }
.brand-mark { font-size: 2rem; font-weight: 800; letter-spacing: 0.6px; }
.eyebrow { color: var(--muted); margin: 6px 0 14px; }

.auth-panel { display: grid; place-items: center; padding: 40px 16px; }
.auth-card {
  width: min(420px, 100%);
  padding: 32px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.75));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
body.theme-light .auth-card { background: linear-gradient(145deg, #fdfefe, #eef3f9); }
.login-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.login-logo {
  width: 88px;
  height: auto;
}
.login-title {
  font-size: 1.55rem;
  text-align: center;
}

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; transition: grid-template-columns 0.25s ease; }
.layout.sidebar-collapsed { grid-template-columns: 88px 1fr; }

.sidebar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(10, 14, 26, 0.95));
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, left 0.25s ease, padding 0.25s ease;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
  width: 280px;
}
body.theme-light .sidebar { background: linear-gradient(180deg, #f8fafc, #e6ebf4); box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08); }
.sidebar.collapsed { width: 88px; padding: 20px 10px; }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
body.theme-light .icon-btn { background: rgba(0, 0, 0, 0.04); }

.menu-list {
  margin: 24px 0;
  display: grid;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
}
.menu-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: calc(var(--base-size) - 2px);
}
.menu-item:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--border); }
.menu-item.active { background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(168, 85, 247, 0.18)); border-color: rgba(255, 255, 255, 0.2); }
.menu-icon { font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; }
.menu-icon i { font-size: 1rem; }
.menu-label { font-weight: 600; font-size: 1em; }
.menu-sub { color: var(--muted); font-size: calc(var(--base-size) - 4px); }
.menu-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-caret { font-size: 0.8rem; color: var(--muted); transition: transform 0.2s ease; }
.menu-group { display: grid; gap: 6px; }
.menu-group .submenu { display: none; margin-left: 20px; border-left: 1px dashed var(--border); padding-left: 10px; }
.menu-group.open > .submenu { display: grid; gap: 6px; }
.menu-group.open .menu-caret { transform: rotate(180deg); }
.submenu .menu-item {
  padding: 5px 6px;
  font-size: 0.8rem;
  gap: 8px;
  grid-template-columns: 24px 1fr;
  border-radius: 10px;
}
.submenu .menu-sub {
  font-size: 0.68rem;
  line-height: 1.15;
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-sub,
.sidebar.collapsed .sidebar-header div,
.sidebar.collapsed .user-mini div { display: none; }
.sidebar.collapsed .menu-item { grid-template-columns: 1fr; justify-items: center; }
.sidebar.collapsed .menu-icon { font-size: 1.2rem; }
.sidebar.collapsed .user-mini { justify-content: center; }
.sidebar.collapsed .submenu { display: none !important; }
.sidebar.collapsed .menu-caret { display: none; }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: auto; }
.user-mini { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.avatar { border-radius: 50%; object-fit: cover; }
.avatar.xs { width: 36px; height: 36px; }
.avatar.sm { width: 54px; height: 54px; }
.avatar.lg { width: 96px; height: 96px; }
.avatar-click { cursor: pointer; border: 1px dashed transparent; }
.avatar-click:hover { border-color: var(--border); }

.content { padding: 26px; transition: padding 0.2s ease; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.top-actions { display: flex; gap: 6px; align-items: center; padding-top: 2px; }

.btn {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #0b1020; box-shadow: 0 12px 30px rgba(34, 211, 238, 0.25); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: var(--border); background: transparent; }
.btn.secondary { background: rgba(251, 146, 60, 0.2); border-color: rgba(251, 146, 60, 0.45); color: #fb923c; }
.btn.warn-lite { background: rgba(250, 204, 21, 0.2); border-color: rgba(250, 204, 21, 0.35); color: #fbbf24; }
.btn.danger-lite { background: rgba(248, 113, 113, 0.2); border-color: rgba(248, 113, 113, 0.35); color: #f87171; }
.btn.success-lite { background: rgba(74, 222, 128, 0.2); border-color: rgba(74, 222, 128, 0.4); color: #22c55e; }
.btn.info-lite { background: rgba(96, 165, 250, 0.2); border-color: rgba(96, 165, 250, 0.35); color: #60a5fa; }
.btn.wide { grid-column: 1/-1; }

.panel-section { animation: fade 0.22s ease; }
.panel {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(12, 18, 31, 0.92));
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
body.theme-light .panel { background: linear-gradient(145deg, #fdfefe, #eef2f7); }
.panel.soft { background: rgba(255, 255, 255, 0.02); box-shadow: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.topbar h1 { margin: 0; font-size: 1.25rem; }
.panel-head.compact { margin-bottom: 8px; }

.grid.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { padding: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
body.theme-light .tile { background: rgba(0, 0, 0, 0.02); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }

.activity { display: grid; gap: 10px; }
.activity-row { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.success { background: var(--success); }
.dot.accent { background: var(--accent); }
.dot.warning { background: var(--warning); }

.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: grid; gap: 6px; color: var(--text); font-weight: 600; }
input, textarea, select {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
}
select[multiple] { min-height: 120px; }
.checkbox-inline { align-items: center; display: flex; gap: 8px; }
.checkbox-inline input { accent-color: var(--accent); }

.report-title {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.report-legend {
  display: grid;
  gap: 6px;
  max-width: 280px;
  margin: 10px 0 8px;
}
.legend-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.legend-color {
  width: 22px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.legend-color.orient { background: rgba(251, 146, 60, 0.35); }
.legend-color.norte { background: rgba(96, 165, 250, 0.35); }
.legend-color.garant { background: rgba(34, 197, 94, 0.3); }

.report-total-ingreso {
  margin-top: 10px;
  font-weight: 700;
  padding: 8px 10px;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  width: fit-content;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.report-summary-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
}
.report-summary-box .summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.report-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.report-directores-wrap,
#report-directores-wrap {
  margin-top: 14px;
}
#report-directores-wrap h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.report-row-oriente td { background: rgba(251, 146, 60, 0.12); }
.report-row-norte td { background: rgba(96, 165, 250, 0.12); }
.report-row-garant td { background: rgba(34, 197, 94, 0.12); }
.report-row-total td {
  font-weight: 700;
  background: rgba(34, 211, 238, 0.18);
}
textarea { resize: vertical; }
.form-error { color: var(--danger); font-size: 0.9rem; min-height: 1.2rem; }
.avatar-preview { display: flex; align-items: center; gap: 12px; }
.option-row { display: flex; gap: 10px; flex-wrap: wrap; }
.option-chip {
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}
.option-chip input {
  margin: 0;
  width: 14px;
  height: 14px;
}

.permissions-grid { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 16px; }
.permissions-list { display: grid; gap: 10px; max-height: 420px; overflow: auto; padding-right: 6px; }
.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px dashed var(--border);
  padding: 6px 0 8px calc(var(--perm-indent, 0px) + 4px);
  position: relative;
}
.permission-item[data-level="1"]::before,
.permission-item[data-level="2"]::before,
.permission-item[data-level="3"]::before,
.permission-item[data-level="4"]::before {
  content: '';
  position: absolute;
  left: calc(var(--perm-indent, 0px) - 8px);
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: var(--border);
}
.menu-config-input { width: 100%; }
.sublinea-input { width: 100%; }
.toggle { accent-color: var(--accent); }
.filters-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters-row label { min-width: 200px; }
.novedad-form { margin-bottom: 14px; }
.edad-form { margin-bottom: 14px; }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.cartera-table {
  overflow-x: auto;
}
.cartera-table table {
  min-width: 900px;
  font-size: 0.85rem;
}
.cartera-table th,
.cartera-table td {
  padding: 6px 8px;
}
.cartera-table th {
  font-size: 0.7rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.cartera-input {
  width: 100px;
  padding: 6px 6px;
}
.cartera-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.sublinea-director-group {
  text-align: center;
  font-weight: 700;
  color: var(--text);
}
.sublinea-growth-group {
  text-align: center;
  font-weight: 700;
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
}
.sublinea-director-col {
  text-align: center;
  min-width: 84px;
  width: 84px;
  white-space: nowrap;
  font-size: 0.72rem;
}
.sublinea-growth-zone {
  text-align: center;
  min-width: 150px;
  white-space: nowrap;
  font-size: 0.72rem;
}
.sublinea-growth-range {
  text-align: center;
  min-width: 76px;
  width: 76px;
  white-space: nowrap;
  font-size: 0.68rem;
}
.sublinea-category-select {
  width: 100%;
  min-width: 120px;
}
.sublinea-director-input {
  width: 100%;
  min-width: 76px;
  max-width: 86px;
  text-align: right;
  font-size: 0.78rem;
  padding: 5px 6px;
}
.sublinea-growth-input {
  width: 100%;
  min-width: 76px;
  max-width: 96px;
  text-align: right;
  font-size: 0.78rem;
  padding: 5px 6px;
}
.directores-table table {
  min-width: 1480px;
}
.directores-table input:not([type="checkbox"]),
.directores-table select {
  width: 100%;
  min-width: 120px;
}
.directores-table input.director-cedula {
  width: 110px;
  min-width: 110px;
}
.directores-table .director-vars {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 360px;
}
.directores-table .director-var-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 400;
  margin: 0;
}
.directores-table .director-var-item input[type="checkbox"] {
  width: 14px !important;
  min-width: 14px !important;
  height: 14px;
  margin: 0;
  display: inline-block;
  flex: 0 0 14px;
}
.directores-table .director-var-item span {
  font-weight: 400;
}
.director-cobertura-wrap {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.ced-director-fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.ced-director-fieldset legend {
  padding: 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
}
.ced-director-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ced-director-top .btn.icon {
  width: 28px;
  height: 28px;
}
.ced-director-table table {
  min-width: 540px;
  font-size: 0.84rem;
}
.ced-director-table th,
.ced-director-table td {
  padding: 6px 8px;
}
.exc-table table {
  min-width: 980px;
  font-size: 0.84rem;
}
.exc-table th,
.exc-table td {
  padding: 5px 7px;
}
.exc-table th {
  white-space: nowrap;
}
.exc-table input,
.exc-table select {
  width: 100%;
  min-width: 90px;
}
.vend-config-table table {
  font-size: 0.84rem;
}
.vend-config-table th,
.vend-config-table td {
  padding: 5px 7px;
}
.vend-config-table th {
  white-space: nowrap;
}
.btn.icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.btn.icon i {
  font-size: 0.85rem;
}
.btn.danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}
.liq-header {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.liq-doc-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.liq-doc-title-row h2 {
  margin: 0;
  font-size: 1.35rem;
}
.liq-header-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.liq-header-subtitle {
  margin: 0 0 6px;
  width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(39, 65, 95, 0.45);
  background: #90afd5;
  color: #0f223c;
  font-size: 1.03rem;
  font-weight: 700;
}
.liq-header-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.liq-header-main-row h3 {
  margin: 0;
}
.liq-period,
.liq-period-inline {
  text-align: right;
}
.liq-period-inline span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.55px;
}
.liq-period-inline strong {
  display: block;
  font-size: 0.95rem;
  margin-top: 2px;
}
.liq-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.liq-header-grid span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.liq-header-grid strong {
  font-size: 0.95rem;
}
.liq-panel { margin-top: 16px; }
.liq-var-title {
  margin: 0;
  width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(39, 65, 95, 0.45);
  background: #90afd5;
  color: #0f223c;
  font-size: 1rem;
  font-weight: 700;
}
.liq-dir-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.liq-dir-tab.active {
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.16));
}
.liq-dir-content {
  margin-top: 6px;
}
.liq-summary {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0;
}
.liq-summary-table {
  width: 70%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.liq-summary-table td {
  padding: 5px 10px;
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.liq-summary-table tr:first-child td {
  border-top: none;
}
.liq-summary-table td.val {
  text-align: right;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
}
.liq-summary-table tr.total td {
  font-weight: 700;
  color: var(--accent-strong);
}
.liq-summary-row.total {
  font-size: 1rem;
  color: var(--accent-strong);
}
.liq-category-row td,
.cat-row td {
  background: rgba(34, 211, 238, 0.15);
  font-weight: 700;
  color: var(--text);
}
.liq-subtotal-row td,
.subtotal-row td {
  background: rgba(148, 163, 184, 0.16);
  font-weight: 700;
  color: var(--text);
}
.liq-subtotal-share {
  color: var(--accent-strong);
  font-weight: 700;
}
.liq-cobertura-row td {
  background: rgba(148, 163, 184, 0.08);
  font-weight: 700;
  text-align: center;
}
.liq-resumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.liq-resumen-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.liq-resumen-card {
  border: 1px solid rgba(30, 58, 95, 0.6);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 6px;
  font-weight: 700;
  overflow: hidden;
}
.liq-resumen-card span {
  color: #fff;
  background: linear-gradient(180deg, #1e3a5f, #163154);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 9px 10px;
  text-align: center;
}
.liq-resumen-card strong {
  font-size: 2rem;
  line-height: 1.1;
  padding: 10px 12px 14px;
  text-align: center;
}
.liq-resumen-card.total {
  background: linear-gradient(120deg, rgba(72, 124, 182, 0.18), rgba(30, 58, 95, 0.15));
  border-color: rgba(30, 58, 95, 0.8);
  border-width: 3px;
}
@media (max-width: 900px) {
  .liq-resumen-card span {
    font-size: 0.8rem;
  }
  .liq-resumen-card strong {
    font-size: 1.55rem;
  }
}
.liq-sublinea-row td:first-child {
  color: var(--muted);
}
.liq-table-ventas th,
.liq-table-ventas td {
  padding: 4px 8px;
  font-size: 0.85rem;
}
.liq-table-ventas th {
  font-size: 0.75rem;
  letter-spacing: 0.4px;
}
.liq-var-table {
  border: 2px solid rgba(148, 163, 184, 0.7);
  border-collapse: collapse;
}
.liq-var-table th,
.liq-var-table td {
  border: 1px solid var(--border);
}
.liq-col-center,
.liq-cell-center {
  text-align: center !important;
}
.liq-col-money,
.liq-cell-money {
  text-align: right !important;
  white-space: nowrap;
}
.liq-cell-link {
  border: none;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.liq-cell-link:hover {
  filter: brightness(0.95);
}
.liq-cell-link:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

.liq-detail-modal {
  width: min(1240px, 97vw);
}
.liq-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}
.liq-detail-summary > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 4px;
}
.liq-detail-summary span {
  color: var(--muted);
  font-size: 0.78rem;
}
.liq-detail-summary strong {
  font-size: 0.95rem;
}
.liq-detail-table th,
.liq-detail-table td {
  font-size: 0.78rem;
  padding: 6px 7px;
}
.liq-detail-table td:last-child,
.liq-detail-table td:nth-last-child(2) {
  text-align: right;
}

.table-container { margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }

.dashboard-v12 {
  display: grid;
  gap: 14px;
}
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background:
    radial-gradient(120% 140% at 5% 0%, rgba(8, 145, 178, 0.2), transparent 58%),
    radial-gradient(140% 160% at 95% 5%, rgba(99, 102, 241, 0.14), transparent 60%);
}
.dash-hero h2 {
  margin: 4px 0 2px;
  font-size: 1.25rem;
}
.dash-hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dash-badge {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.55);
}
.dash-demo-board {
  border: 1px solid rgba(30, 64, 175, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.02)),
    linear-gradient(145deg, rgba(219, 234, 254, 0.42), rgba(255, 255, 255, 0.52));
}
.dash-demo-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.dash-demo-title-row h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  color: #0f2f75;
}
.dash-demo-top {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.35fr;
  gap: 12px;
  margin-top: 12px;
}
.demo-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  padding: 10px;
}
.demo-box h4 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}
.demo-gauge-box {
  display: grid;
  gap: 8px;
}
.demo-gauge {
  display: flex;
  justify-content: center;
}
.demo-gauge-ring {
  width: 176px;
  height: 92px;
  border-radius: 176px 176px 0 0;
  overflow: hidden;
  position: relative;
  background: conic-gradient(from 180deg, #ea580c 0 40deg, #f59e0b 40deg 95deg, #1d4ed8 95deg 180deg);
}
.demo-gauge-ring::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: -72px;
  background: #f1f5f9;
  border-radius: 160px 160px 0 0;
  border: 1px solid #dbe4ef;
}
.demo-gauge-ring span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: #0f2f75;
}
.demo-gauge-meta {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
}
.demo-gauge-meta p { margin: 0; }
.demo-zone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.demo-zone-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 9px;
  display: grid;
  gap: 3px;
}
.demo-zone-card strong { font-size: 0.88rem; }
.demo-zone-card p {
  margin: 0;
  font-size: 0.76rem;
}
.demo-zone-card b {
  margin-top: 2px;
  font-size: 1.35rem;
  color: #1d4ed8;
}
.demo-zone-card.norte { background: rgba(30, 64, 175, 0.08); }
.demo-zone-card.oriente { background: rgba(245, 158, 11, 0.12); }
.demo-zone-kpi {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 7px;
}
.demo-zone-kpi p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}
.demo-zone-kpi span {
  color: #334155;
  font-weight: 600;
}
.demo-zone-kpi strong {
  color: #c2410c;
  font-size: 1rem;
}
.demo-vendor-list {
  display: grid;
  gap: 8px;
}
.demo-vendor-row {
  display: grid;
  grid-template-columns: 58px 1fr 96px 44px;
  align-items: center;
  gap: 8px;
}
.demo-vendor-row .name {
  font-size: 0.8rem;
  font-weight: 700;
}
.demo-vendor-bars {
  display: grid;
  gap: 3px;
}
.demo-vendor-bars .bar {
  height: 12px;
  border-radius: 7px;
  border: 1px solid #dbe4ef;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.14);
}
.demo-vendor-bars .bar i {
  display: block;
  height: 100%;
}
.demo-vendor-bars .bar.budget i {
  background: linear-gradient(90deg, #f59e0b, #fb923c);
}
.demo-vendor-bars .bar.sales i {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}
.demo-vendor-row .pct {
  text-align: right;
  font-weight: 800;
  color: #0f2f75;
  font-size: 0.85rem;
}
.demo-vendor-values {
  display: grid;
  gap: 1px;
  text-align: right;
}
.demo-vendor-values strong {
  font-size: 0.74rem;
  color: #0f2f75;
  line-height: 1.15;
}
.demo-vendor-values span {
  font-size: 0.72rem;
  color: #334155;
  font-weight: 700;
  line-height: 1.15;
}
.dash-demo-bottom {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.demo-mini-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.demo-mini-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
  padding: 7px 6px;
  text-align: center;
}
.demo-mini-item .bars {
  height: 88px;
  display: flex;
  gap: 7px;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 6px;
}
.demo-mini-item .bars i {
  width: 16px;
  border-radius: 4px 4px 0 0;
}
.demo-mini-item .bars i.sales {
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
}
.demo-mini-item .bars i.budget {
  background: linear-gradient(180deg, #fdba74, #ea580c);
}
.demo-mini-item span {
  display: block;
  font-size: 0.74rem;
}
.demo-mini-item em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f2f75;
}
.demo-mini-footer {
  margin-top: 7px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  font-size: 0.74rem;
  color: #334155;
  font-weight: 700;
}
.demo-mini-footer i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 5px;
}
.demo-mini-footer i.sales {
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
}
.demo-mini-footer i.budget {
  background: linear-gradient(180deg, #fdba74, #ea580c);
}
.dash-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.dash-kpi-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.dash-kpi-card h3 {
  margin: 6px 0 4px;
  font-size: 1.2rem;
}
.dash-grid-two {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.45fr 1fr;
}
.dash-grid-three {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.1fr 1fr 1fr;
}
.dash-chart-card {
  padding-top: 8px;
}
.dash-svg-line {
  width: 100%;
  height: 210px;
  background:
    linear-gradient(to top, rgba(15, 23, 42, 0.03) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(to right, rgba(15, 23, 42, 0.02) 1px, transparent 1px) 0 0 / 60px 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.dash-svg-line .line-budget {
  fill: none;
  stroke: #64748b;
  stroke-width: 3;
  stroke-dasharray: 6 5;
}
.dash-svg-line .line-sales {
  fill: none;
  stroke: #0891b2;
  stroke-width: 4;
}
.dash-legend {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.74rem;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
}
.legend-dot.sales { background: #0891b2; }
.legend-dot.budget { background: #64748b; }

.dash-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-donut {
  width: 168px;
  height: 168px;
  border-radius: 999px;
  background: conic-gradient(
    #0891b2 0 61%,
    #22d3ee 61% 85%,
    #7dd3fc 85% 98%,
    #cbd5e1 98% 100%
  );
  position: relative;
}
.dash-donut::after {
  content: '';
  position: absolute;
  inset: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.dash-list-compact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.8rem;
}
.chip {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 8px;
}
.chip.sen { background: #0891b2; }
.chip.sec { background: #22d3ee; }
.chip.pardo { background: #7dd3fc; }
.chip.otros { background: #cbd5e1; }

.dash-bars {
  display: grid;
  gap: 10px;
}
.dash-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 46px;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.dash-bar-row > div {
  height: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
}
.dash-bar-row > div i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #6366f1);
}
.dash-funnel {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.dash-funnel > div {
  text-align: center;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.dash-funnel .f-1 { margin: 0 10px; background: rgba(34, 211, 238, 0.15); }
.dash-funnel .f-2 { margin: 0 28px; background: rgba(56, 189, 248, 0.15); }
.dash-funnel .f-3 { margin: 0 46px; background: rgba(125, 211, 252, 0.2); }
.dash-funnel .f-4 { margin: 0 66px; background: rgba(148, 163, 184, 0.22); }

.dash-ranking {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 0.8rem;
}
.dash-ranking li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dash-heat {
  display: grid;
  gap: 8px;
}
.dash-heat > div {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 9px 10px;
  font-size: 0.78rem;
}
.dash-heat .h-high { background: rgba(239, 68, 68, 0.16); }
.dash-heat .h-mid { background: rgba(245, 158, 11, 0.16); }
.dash-heat .h-low { background: rgba(34, 197, 94, 0.16); }

.dash-svg-radar {
  width: 100%;
  height: 210px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.06));
}
.dash-svg-radar .radar-grid {
  fill: none;
  stroke: rgba(71, 85, 105, 0.65);
  stroke-width: 2;
}
.dash-svg-radar .radar-area {
  fill: rgba(34, 211, 238, 0.35);
  stroke: rgba(8, 145, 178, 0.9);
  stroke-width: 2;
}

@media (max-width: 1400px) {
  .dash-demo-top { grid-template-columns: 1fr 1fr; }
  .dash-demo-top .demo-box:last-child { grid-column: span 2; }
  .demo-vendor-row { grid-template-columns: 48px 1fr 88px 42px; }
  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid-three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .dash-demo-top { grid-template-columns: 1fr; }
  .dash-demo-top .demo-box:last-child { grid-column: auto; }
  .dash-demo-bottom { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; }
  .dash-grid-two,
  .dash-grid-three { grid-template-columns: 1fr; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dash-demo-title-row { flex-direction: column; align-items: flex-start; }
  .demo-zone-grid,
  .demo-mini-chart { grid-template-columns: 1fr; }
  .demo-vendor-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .demo-vendor-row .pct,
  .demo-vendor-values {
    text-align: left;
  }
  .demo-mini-footer {
    justify-content: flex-start;
  }
  .dash-kpis { grid-template-columns: 1fr; }
  .dash-donut-wrap { flex-direction: column; align-items: flex-start; }
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 10px 8px; text-align: left; }
th { background: rgba(255, 255, 255, 0.04); color: var(--muted); font-weight: 700; font-size: 0.8rem; }
td { border-top: 1px solid var(--border); }
#clients-table-head th.sortable { cursor: pointer; user-select: none; }
#clients-table-head th.sortable:hover { color: var(--text); }
.sync-fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 0;
}
.sync-fieldset legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--text);
}
.sync-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.sync-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.user-inline { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.drawer-user { margin-bottom: 12px; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 20;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1080px, 96vw);
  max-height: 80vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
  z-index: 40;
  font-size: 0.9rem;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 9, 20, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
}
body.theme-light .loading-overlay {
  background: rgba(233, 237, 245, 0.7);
}
.loading-card {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
body.theme-light .loading-card {
  background: #f5f7fb;
}
.loading-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: pulse 1.2s ease-in-out infinite;
}
.loading-text {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  padding: 22px;
  z-index: 30;
  overflow-y: auto;
  transform: translateX(0);
  animation: slideIn 0.25s ease;
}
body.theme-light .drawer { box-shadow: -12px 0 40px rgba(15, 23, 42, 0.1); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.drawer-tabs { display: grid; grid-auto-flow: column; gap: 8px; margin-bottom: 12px; }
.tab { border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); color: var(--text); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.tab.active { border-color: var(--accent); color: var(--accent); }
.drawer-pane { animation: fade 0.2s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(34, 211, 238, 0.2)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.35)); }
}

/* Responsive */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 240px 1fr; }
  .layout.sidebar-collapsed { grid-template-columns: 78px 1fr; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -320px; top: 0; width: 260px; z-index: 10; height: 100vh; }
  .sidebar.open { left: 0; }
  .content { padding: 80px 18px 32px; }
  .topbar { position: sticky; top: 0; backdrop-filter: blur(6px); background: rgba(11, 18, 32, 0.9); padding: 12px 0; z-index: 5; border-bottom: 1px solid var(--border); }
  .permissions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .top-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .btn { width: 100%; text-align: center; }
  .btn.ghost { width: auto; }
  .menu-item { grid-template-columns: 1fr; }
}
