:root {
  --bg: #f3f6f9;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #64748b;
  --line: #dbe3eb;
  --primary: #0e5f83;
  --primary-dark: #08445f;
  --accent: #11a37f;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 8px 24px rgba(15, 35, 52, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: #0b2635; color: #fff; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand strong, .brand small { display: block; }
.brand small { color: #b9d0dc; font-size: 12px; margin-top: 2px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .03em; }
.brand-mark.large { width: 56px; height: 56px; margin: 0 auto 14px; font-size: 20px; }
.user-box { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.user-box form { margin: 0; }
.link-button { border: 0; background: none; color: #b9d0dc; cursor: pointer; padding: 0; }
.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { background: #102f40; padding: 22px 14px; }
.sidebar nav { display: grid; gap: 5px; position: sticky; top: 90px; }
.sidebar a { color: #d7e6ee; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.sidebar a:hover { background: rgba(255,255,255,.09); color: #fff; }
.content { padding: 28px; min-width: 0; }
.login-main { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 30px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; margin-bottom: 7px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.muted, .page-heading p { color: var(--muted); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading p { margin-bottom: 0; }
.panel, .kpi-card, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel { padding: 20px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.panel-heading h2 { margin: 0; }
.panel-heading span { color: var(--muted); font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { padding: 18px; border-top: 3px solid var(--primary); }
.kpi-card.warning { border-top-color: var(--warning); }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); }
.kpi-card strong { display: block; font-size: 28px; margin: 8px 0 5px; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.filter-bar { display: flex; align-items: end; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.grow { flex: 1; min-width: 220px; }
.form-control, .form-select { width: 100%; border: 1px solid #bfcbd6; border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 11px; min-height: 40px; font: inherit; }
textarea.form-control { resize: vertical; }
.form-control:focus, .form-select:focus { outline: 3px solid rgba(14,95,131,.14); border-color: var(--primary); }
.form-check-input { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 700; font: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: #e6eef3; color: #183746; border-color: #cbd9e2; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-block { width: 100%; }
.login-card { width: min(420px, 100%); padding: 30px; text-align: center; }
.stacked-form { display: grid; gap: 9px; text-align: left; margin-top: 22px; }
.stacked-form .btn { margin-top: 10px; }
.model-form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 13px; }
.field small { color: var(--muted); }
.field-checkbox { align-content: end; grid-template-columns: 1fr auto; }
.field-checkbox label { grid-column: 1; }
.field-checkbox input { grid-column: 2; grid-row: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.form-errors, .field-error { color: var(--danger); }
.form-errors { padding: 12px; background: #fff0ee; border-radius: 8px; }
.field-error { font-size: 12px; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #edf3f7; color: #415765; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: #f8fbfd; }
.wide-cell { min-width: 260px; }
.cell-sub { display: block; color: var(--muted); margin-top: 3px; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; background: #e7edf2; }
.badge.success, .status-closed, .pm-en-fecha { background: #d9f5ec; color: #08745a; }
.badge.muted, .status-cancelled { background: #e8ebee; color: #5c6770; }
.status-open, .pm-no-hecho { background: #ffe1dc; color: #9f251b; }
.pm-pendiente { background: #e3efff; color: #1857a4; }
.pm-atrasado { background: #fff0cf; color: #9a5a00; }
.crit-a { background: #ffe1dc; color: #9f251b; }
.crit-b { background: #fff0cf; color: #9a5a00; }
.crit-c { background: #dceefe; color: #155d8a; }
.ranking-row { display: grid; gap: 7px; margin: 13px 0; }
.ranking-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.ranking-label span { color: var(--muted); white-space: nowrap; }
.bar-track { background: #e8eef2; height: 8px; border-radius: 999px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 100%; border-radius: inherit; }
.empty { color: var(--muted); text-align: center; padding: 22px; }
.alert { padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: #e8f7f2; color: #08634e; border-color: #b9e7d8; }
.alert-error { background: #fff0ee; color: #8e2119; border-color: #f0c1ba; }
.alert-warning { background: #fff5df; color: #855000; border-color: #efd69d; }
.alert-info { background: #eaf3fb; color: #174f72; border-color: #bfd7e8; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 18px; color: var(--muted); }
.clean-list { padding-left: 20px; line-height: 1.8; color: #405462; }
.import-summary { margin-top: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-grid > div { background: #f3f7f9; border-radius: 8px; padding: 12px; }
.summary-grid pre { white-space: pre-wrap; margin-bottom: 0; }
.warning-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.warning-list > div { padding: 9px 11px; border-bottom: 1px solid var(--line); font-size: 13px; }
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 170px minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 20px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .brand small, .user-box span { display: none; }
  .app-shell { display: block; }
  .sidebar { padding: 8px; overflow-x: auto; }
  .sidebar nav { display: flex; position: static; min-width: max-content; }
  .content { padding: 14px; }
  .page-heading { display: grid; }
  .kpi-grid, .two-columns, .summary-grid, .form-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; }
  .filter-bar > * { width: 100%; }
}

/* v0.2 operational workflow */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1d14; color: #fff; }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: #08765e; color: #fff; }
.button-row { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form .form-control { width: auto; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.text-medium { font-size: 22px !important; }
.field-wide { grid-column: 1 / -1; }
.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-gap { margin-top: 18px; }
.alert-panel { border-left: 4px solid var(--danger); margin-bottom: 18px; }
.active-events { display: grid; gap: 8px; }
.active-event { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff9f8; }
.active-event:hover { border-color: #e7a29a; color: var(--ink); }
.active-event small, .compact-row span, .history-item small { display: block; color: var(--muted); margin-top: 3px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(180,35,24,.12); }
.priority-critical, .priority-high, .badge.danger { background: #ffe1dc; color: #9f251b; }
.priority-medium { background: #fff0cf; color: #9a5a00; }
.priority-low { background: #dceefe; color: #155d8a; }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.compact-row:last-child { border-bottom: 0; }
.link-row { color: var(--ink); }
.link-row:hover { color: var(--primary); }
.summary-list { display: grid; gap: 2px; }
.summary-list > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list span { color: var(--muted); }
.detail-grid, .timeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 0; }
.detail-grid div, .timeline-grid div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
dd { margin: 5px 0 0; font-weight: 650; }
.note-box { background: #f6f9fb; border: 1px solid var(--line); border-radius: 9px; padding: 13px; color: #344a58; margin-bottom: 16px; min-height: 48px; }
.transition-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-left: 4px solid var(--primary); }
.transition-panel h2, .transition-panel p { margin-bottom: 4px; }
.transition-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.transition-actions form { margin: 0; }
.badge-large { font-size: 13px; padding: 8px 12px; }
.history-list { display: grid; }
.history-item { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 9px 0; position: relative; }
.history-item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 24px; bottom: -5px; width: 2px; background: var(--line); }
.history-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); margin-top: 3px; z-index: 1; }
.history-item p { color: var(--muted); margin: 6px 0 0; }
.danger-text { color: var(--danger) !important; font-weight: 700; }
.status-reported, .status-assigned { background: #e3efff; color: #1857a4; }
.status-diagnosis, .status-repair, .status-testing { background: #fff0cf; color: #875100; }
.status-waiting_spare, .status-waiting_external { background: #f1e7ff; color: #6b2e9c; }
.status-closed { background: #d9f5ec; color: #08745a; }
.status-cancelled { background: #e8ebee; color: #5c6770; }
.asset-operating { background: #d9f5ec; color: #08745a; }
.asset-stopped, .asset-out_of_service { background: #ffe1dc; color: #9f251b; }
.asset-retired { background: #e8ebee; color: #5c6770; }
.order-draft { background: #e8ebee; color: #5c6770; }
.order-planned { background: #e3efff; color: #1857a4; }
.order-in_progress { background: #fff0cf; color: #875100; }
.order-waiting { background: #f1e7ff; color: #6b2e9c; }
.order-completed { background: #d9f5ec; color: #08745a; }
.order-cancelled { background: #e8ebee; color: #5c6770; }
@media (max-width: 1200px) { .kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .kpi-grid-4, .detail-grid, .timeline-grid { grid-template-columns: 1fr; }
  .transition-panel { display: grid; }
  .transition-actions, .button-row { justify-content: stretch; }
  .transition-actions form, .transition-actions .btn, .button-row .btn { width: 100%; }
  .inline-form { width: 100%; }
  .inline-form .form-control { width: 100%; }
}

/* v0.3 preventive scheduler and executive charts */
.kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-charts { margin-top: 18px; align-items: stretch; }
.chart-panel { min-height: 330px; }
.vertical-chart { height: 245px; display: grid; grid-template-columns: repeat(6, minmax(55px, 1fr)); align-items: end; gap: 12px; padding: 18px 6px 0; border-bottom: 1px solid var(--line); }
.chart-column { height: 100%; display: grid; grid-template-rows: 24px minmax(120px, 1fr) 22px 20px; gap: 4px; text-align: center; min-width: 0; }
.chart-value { color: var(--muted); font-size: 11px; white-space: nowrap; }
.chart-bar-zone { height: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #d9e3e9; background: repeating-linear-gradient(to top, transparent 0, transparent 39px, #edf2f5 40px); border-radius: 5px 5px 0 0; }
.chart-bar { width: min(48px, 64%); min-height: 3px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--primary)); transition: height .2s ease; }
.chart-column strong { font-size: 12px; }
.chart-column small { color: var(--muted); font-size: 11px; }
.availability-chart { display: grid; gap: 18px; padding: 14px 0 5px; }
.availability-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 70px; gap: 12px; align-items: center; }
.availability-row > span { color: var(--muted); font-size: 12px; }
.availability-row > strong { text-align: right; font-size: 13px; }
.availability-track { height: 16px; border-radius: 999px; background: #e7eef2; overflow: hidden; position: relative; }
.availability-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #1f6f8b, var(--accent)); }
.warning-badge { background: #fff0cf; color: #8a5200; }
.panel-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #f5f8fa; color: var(--muted); font-size: 12px; }
.view-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; }
.view-tabs a { padding: 10px 14px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.view-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.schedule-summary { margin-bottom: 4px; }
.financial-summary { margin-bottom: 18px; }
.money-value { font-size: clamp(20px, 2vw, 30px) !important; letter-spacing: -.03em; }
.financial-chart-panel { overflow: hidden; }
.financial-chart-wrap { position: relative; min-height: 330px; padding: 24px 8px 0; }
.financial-bars { height: 285px; display: grid; grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: 12px; align-items: end; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.financial-column { height: 100%; display: grid; grid-template-rows: 30px minmax(165px, 1fr) 22px 34px; gap: 5px; text-align: center; min-width: 0; }
.financial-value { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.financial-bar-zone { display: flex; align-items: flex-end; justify-content: center; background: repeating-linear-gradient(to top, transparent 0, transparent 49px, #edf2f5 50px); }
.financial-bar { width: min(54px, 68%); min-height: 3px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--primary), #1a5269); }
.financial-column strong { font-size: 12px; }
.financial-column small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.average-line { position: absolute; left: 8px; right: 8px; border-top: 2px dashed #b47418; z-index: 3; pointer-events: none; }
.average-line span { position: absolute; right: 0; bottom: 4px; font-size: 10px; font-weight: 800; color: #89530b; background: #fff8e9; padding: 2px 6px; border-radius: 4px; }
@media (max-width: 1000px) {
  .kpi-grid-3 { grid-template-columns: 1fr; }
  .vertical-chart, .financial-bars { overflow-x: auto; grid-template-columns: repeat(6, minmax(80px, 1fr)); }
}
@media (max-width: 760px) {
  .availability-row { grid-template-columns: 48px minmax(0, 1fr) 60px; gap: 7px; }
  .chart-panel { min-height: auto; }
  .vertical-chart { min-width: 620px; }
  .financial-chart-wrap { overflow-x: auto; }
  .financial-bars { min-width: 620px; }
}

/* v0.3 financial history totals */
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 2px 10px; }
.section-label strong { font-size: 15px; }
.section-label span { color: var(--muted); font-size: 12px; }
.financial-filter { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
tfoot th { background: #dfeaf0; color: #183746; border-bottom: 0; font-size: 12px; }
.financial-summary .kpi-card { min-width: 0; }
.financial-summary .money-value { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .section-label { align-items: flex-start; display: grid; }
}

/* v0.4 validated downtime analytics and executive Pareto */
.data-quality-alert {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid #ebcf91;
  border-left: 4px solid #c57a08;
  border-radius: 11px;
  background: #fff9eb;
  color: #60420d;
}
.data-quality-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f5d58b;
  color: #704600;
  font-weight: 900;
}
.data-quality-alert p { margin: 3px 0 0; color: #7a5b21; font-size: 12px; }
.data-quality-assets { display: grid; gap: 4px; text-align: right; font-size: 11px; color: #7a5b21; }
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, .85fr);
  gap: 18px;
  align-items: stretch;
}
.trend-panel, .month-panel { min-height: 410px; }
.trend-heading { align-items: flex-start; }
.chart-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.legend-bar { width: 22px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.legend-dot { width: 17px; height: 17px; margin-left: 8px; border-radius: 50%; background: #f4a340; box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #d4821d; }
.trend-chart {
  height: 310px;
  display: grid;
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 12px;
  padding: 4px 4px 0;
  overflow-x: auto;
}
.trend-column {
  min-width: 82px;
  display: grid;
  grid-template-rows: 24px 215px 22px minmax(32px, auto);
  gap: 5px;
  text-align: center;
  padding: 6px 6px 0;
  border-radius: 9px 9px 0 0;
  transition: background .15s ease;
}
.trend-column.selected { background: #eef7f8; box-shadow: inset 0 -3px 0 var(--accent); }
.trend-value { color: #405766; font-size: 12px; font-weight: 800; }
.trend-plot {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  border-bottom: 1px solid #cfdbe2;
  border-radius: 7px 7px 0 0;
  background: repeating-linear-gradient(to top, transparent 0, transparent 42px, #e9eff3 43px);
}
.trend-bar {
  width: min(52px, 63%);
  min-height: 0;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #18b18b 0%, #0e6587 100%);
  box-shadow: 0 5px 12px rgba(14, 95, 131, .18);
  transition: height .25s ease;
}
.trend-bar.has-overlap { background: linear-gradient(180deg, #e0a13b 0%, #0e6587 100%); }
.failure-marker {
  position: absolute;
  left: calc(50% + 18px);
  transform: translateY(45%);
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e7922e;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(97, 60, 12, .25);
}
.trend-column > strong { font-size: 12px; }
.trend-column > small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.trend-column .overlap-note { color: #96610b; font-weight: 650; }
.month-heading { align-items: flex-start; }
.month-selector { min-width: 170px; }
.month-selector .form-select { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.month-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}
.month-summary > div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7fafb;
}
.month-summary span, .month-summary strong { display: block; }
.month-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .035em; }
.month-summary strong { margin-top: 4px; font-size: 17px; }
.month-overlap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4dc;
  color: #855000;
  font-size: 11px;
}
.month-overlap span { color: #99703a; }
.month-ranking { display: grid; gap: 5px; }
.month-rank-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f4;
}
.month-rank-row:last-child { border-bottom: 0; }
.rank-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e3edf2;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}
.month-rank-main { display: grid; gap: 6px; min-width: 0; }
.month-rank-main > div:first-child { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.month-rank-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.month-rank-main span { color: var(--muted); white-space: nowrap; font-size: 10px; }
.month-track { height: 6px; }
.executive-ranking { padding: 0; overflow: hidden; border-top: 4px solid var(--primary); }
.executive-heading { margin: 0; padding: 19px 20px; background: linear-gradient(110deg, #f8fbfc 0%, #eef7f7 100%); }
.executive-heading h2 { font-size: 21px; margin-bottom: 4px; }
.executive-summary { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; }
.executive-summary > div { min-width: 92px; }
.executive-summary span, .executive-summary strong { display: block; text-align: right; }
.executive-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.executive-summary strong { margin-top: 4px; font-size: 19px; color: #0a4f69; }
.pareto-list { padding: 8px 20px 17px; display: grid; gap: 6px; }
.pareto-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 92px;
  gap: 14px;
  align-items: center;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-bottom-color: #e8edf0;
  border-radius: 10px;
}
.pareto-row.leader { border-color: #b9ddd5; background: linear-gradient(90deg, #eef9f6, #fff); box-shadow: 0 5px 15px rgba(10, 99, 77, .08); }
.pareto-rank {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e3edf2;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 900;
}
.pareto-row.leader .pareto-rank { background: var(--accent); color: #fff; box-shadow: 0 4px 10px rgba(17, 163, 127, .24); }
.pareto-content { min-width: 0; display: grid; gap: 7px; }
.pareto-label { display: flex; justify-content: space-between; gap: 12px; }
.pareto-label strong { font-size: 13px; }
.pareto-label span, .pareto-content small { color: var(--muted); font-size: 10px; }
.pareto-label span { white-space: nowrap; }
.pareto-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e7edf1; }
.pareto-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0e5f83 0%, #11a37f 80%, #65cdb3 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.pareto-hours { text-align: right; }
.pareto-hours strong, .pareto-hours span { display: block; }
.pareto-hours strong { font-size: 23px; letter-spacing: -.03em; }
.pareto-hours span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.system-ranking-row { margin: 16px 0; }
.system-ranking-row .bar-track { height: 10px; }
@media (max-width: 1180px) {
  .analytics-grid { grid-template-columns: 1fr; }
  .month-panel { min-height: auto; }
}
@media (max-width: 900px) {
  .data-quality-alert { grid-template-columns: 38px minmax(0, 1fr); }
  .data-quality-assets { grid-column: 2; text-align: left; }
  .executive-heading { display: grid; }
  .executive-summary { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .executive-summary span, .executive-summary strong { text-align: left; }
}
@media (max-width: 760px) {
  .trend-chart { min-width: 680px; }
  .trend-panel { overflow-x: auto; }
  .month-heading, .pareto-label { display: grid; }
  .month-selector { width: 100%; }
  .month-summary { grid-template-columns: 1fr; }
  .month-overlap { display: grid; }
  .pareto-row { grid-template-columns: 36px minmax(0, 1fr); }
  .pareto-hours { grid-column: 2; text-align: left; display: flex; align-items: baseline; gap: 5px; }
  .executive-summary { grid-template-columns: 1fr; gap: 8px; }
}

/* v0.5 approved PM postponements and executive asset impact */
.kpi-card.postponed { border-top-color: #6f57c9; }
.pm-aplazado-autorizado, .postponement-approved { background: #ece8ff; color: #5638aa; }
.pm-aplazamiento-pendiente, .postponement-pending { background: #fff0cf; color: #8b5700; }
.postponement-rejected { background: #ffe1dc; color: #9f251b; }
.postponement-cancelled { background: #e8ebee; color: #5c6770; }
.authorized-text { color: #6548b8; font-weight: 700; }
.pending-text { color: #9a5a00; font-weight: 700; }
.table-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.action-postpone { color: #6645b8; font-weight: 700; }

.impact-controls { display: grid; gap: 12px; min-width: 520px; }
.impact-selector { display: flex; justify-content: flex-end; }
.impact-selector label { display: grid; grid-template-columns: auto 190px; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.impact-selector .form-select { min-height: 35px; padding: 6px 9px; font-size: 12px; }
.pareto-insight { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 11px 20px; border-bottom: 1px solid #cfe5df; background: #eef8f5; color: #24584c; }
.pareto-insight strong { font-size: 13px; }
.pareto-insight span { font-size: 11px; color: #52736b; }
.pareto-row { color: var(--ink); position: relative; }
.pareto-row:hover { color: var(--ink); border-color: #b9d8e3; background: #f7fbfc; transform: translateY(-1px); }
.pareto-row.pareto-core:not(.leader) { background: linear-gradient(90deg, rgba(17,163,127,.045), #fff 55%); }
.pareto-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pareto-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pareto-secondary { display: flex; flex-wrap: wrap; gap: 6px 16px; color: #506675; font-size: 10px; }
.pareto-secondary span { position: relative; }
.pareto-secondary span:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: #9babb5; }
.trend-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; padding: 4px 7px; border-radius: 999px; font-size: 10px !important; font-weight: 800; }
.trend-up { background: #ffe5df; color: #a12a1d !important; }
.trend-down { background: #def5ec; color: #08745a !important; }
.trend-same { background: #e8eef2; color: #526773 !important; }
.trend-new { background: #e9e6ff; color: #5e43b0 !important; }
.pareto-track { position: relative; }
.pareto-threshold { position: absolute; top: -4px; bottom: -4px; right: 20%; width: 2px; border-radius: 2px; background: #e18c23; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.money-primary { font-size: 17px !important; overflow-wrap: anywhere; }

.postponement-context { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.postponement-context > div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7fafb; }
.postponement-context span, .postponement-context strong { display: block; }
.postponement-context span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .035em; }
.postponement-context strong { margin-top: 5px; font-size: 17px; }
.policy-note { display: grid; gap: 4px; margin-bottom: 18px; padding: 12px 14px; border-left: 4px solid #6f57c9; border-radius: 8px; background: #f1effc; color: #49378b; }
.policy-note span { font-size: 12px; color: #6a5b9b; }
.approval-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.pending-approval { border-color: #e7c87f; background: #fffaed; }
.approval-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.approval-card p { margin: 10px 0 6px; }
.approval-card small { color: var(--muted); }
.decision-form { display: grid; gap: 9px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #ecd9a9; }
.postponement-history { display: grid; gap: 9px; }
.history-card { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfd; }
.history-card > div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.history-card p { margin: 0; font-size: 12px; }
.history-card small { display: block; color: var(--muted); font-size: 10px; }

@media (max-width: 1100px) {
  .impact-controls { min-width: 0; width: 100%; }
  .executive-heading { display: grid; }
  .impact-selector { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .postponement-context { grid-template-columns: 1fr 1fr; }
  .impact-selector label { grid-template-columns: 1fr; width: 100%; }
  .pareto-secondary { display: grid; gap: 3px; }
  .pareto-secondary span::after { display: none; }
  .pareto-insight, .approval-title, .history-card > div { display: grid; }
  .table-actions { flex-wrap: wrap; }
}
.pareto-insight.neutral { background: #f5f8fa; border-bottom-color: #dbe5ea; color: #395765; }
.pareto-insight.neutral span { color: #6a7f89; }
.pareto-row.threshold-row { border-bottom-color: #d89431; box-shadow: inset 0 -2px 0 rgba(216, 148, 49, .18); }
.pareto-row.threshold-row::after {
  content: "UMBRAL 80 %";
  position: absolute;
  right: 104px;
  bottom: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff2d8;
  color: #8a5708;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
}
@media (max-width: 760px) {
  .pareto-row.threshold-row::after { right: 8px; bottom: 5px; }
}

/* v0.6 monthly PDF reporting */
.report-heading { align-items: center; }
.report-download { min-width: 150px; }
.report-selector-panel { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.report-selector { display: flex; align-items: end; gap: 12px; margin: 0; }
.report-selector label { display: grid; gap: 6px; min-width: 240px; color: var(--muted); font-size: 12px; }
.report-selector select { width: 100%; border: 1px solid #bfcbd6; border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 11px; min-height: 40px; font: inherit; }
.report-period-note { display: grid; justify-items: end; gap: 3px; }
.report-period-note strong { color: var(--primary-dark); font-size: 16px; }
.report-period-note span { color: var(--muted); font-size: 12px; }
.report-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-preview-grid { grid-template-columns: 1.25fr .75fr; }
.report-ranking-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 72px; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.report-ranking-row:last-child { border-bottom: 0; }
.report-ranking-row:hover { color: var(--ink); background: #f8fbfc; }
.report-rank { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #e3edf2; color: var(--primary-dark); font-weight: 900; }
.report-ranking-row:first-of-type .report-rank { background: var(--accent); color: #fff; }
.report-ranking-main { display: grid; gap: 7px; min-width: 0; }
.report-ranking-main > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.report-ranking-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-ranking-main span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.report-finance-preview .summary-list strong { text-align: right; }
.warning-note { color: #855000; background: #fff5df; border-left: 3px solid #d98a1d; padding: 10px 12px; border-radius: 7px; }
@media (max-width: 1000px) {
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-preview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .report-selector-panel, .report-selector { display: grid; }
  .report-selector label { min-width: 0; }
  .report-period-note { justify-items: start; }
  .report-kpis { grid-template-columns: 1fr; }
  .report-ranking-row { grid-template-columns: 30px minmax(0, 1fr); }
  .report-ranking-row > strong { grid-column: 2; }
  .report-ranking-main > div:first-child { display: grid; }
}

/* v0.7 consolidated preventive compliance */
.pm-compliance-dashboard { overflow: hidden; }
.pm-compliance-heading { align-items: end; }
.pm-executive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.15fr; gap: 14px; padding: 4px 0 18px; }
.pm-gauge-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #fff, #f8fbfc); }
.pm-gauge-card.ok { border-color: #9ed9c8; background: linear-gradient(180deg, #f4fffb, #edf9f5); }
.pm-gauge-card.risk { border-color: #edc57e; background: linear-gradient(180deg, #fffaf0, #fff5e3); }
.pm-gauge-value { color: var(--primary-dark); font-size: 31px; line-height: 1; font-weight: 900; }
.pm-gauge-label { margin-top: 7px; color: var(--ink); font-size: 13px; font-weight: 800; }
.pm-gauge-card small { display: block; margin-top: 8px; color: var(--muted); }
.pm-progress-track { position: relative; height: 9px; margin-top: 12px; overflow: visible; border-radius: 999px; background: #e3ebef; }
.pm-progress-track.large { height: 13px; margin-top: 18px; }
.pm-progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #08738a, #16aa82); }
.pm-progress-fill.secondary { background: linear-gradient(90deg, #0e7490, #4db2c3); }
.pm-progress-fill.neutral { background: linear-gradient(90deg, #576f7c, #91a8b2); }
.pm-progress-fill.risk-fill { background: linear-gradient(90deg, #c66a12, #e7a537); }
.pm-target-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: #d97706; box-shadow: 0 0 0 2px #fff; }
.pm-status-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.pm-status-matrix > div { display: grid; gap: 3px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pm-status-matrix > div:nth-child(2n) { border-right: 0; }
.pm-status-matrix > div:nth-last-child(-n+2) { border-bottom: 0; }
.pm-status-matrix span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.pm-status-matrix strong { color: var(--primary-dark); font-size: 21px; }
.success-text { color: #0d8d6e !important; }
.warning-text { color: #b56a0b !important; }
.pm-dashboard-bottom { display: grid; grid-template-columns: 1.3fr .9fr; gap: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mini-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.mini-section-title strong { color: var(--ink); }
.mini-section-title span { color: var(--muted); font-size: 11px; }
.pm-trend-bars { display: grid; grid-template-columns: repeat(6, minmax(52px, 1fr)); gap: 11px; min-height: 145px; }
.pm-trend-bars.large-chart { min-height: 250px; padding: 8px 6px 0; }
.pm-trend-month { display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; gap: 5px; min-width: 0; }
.pm-trend-values { width: 100%; display: flex; justify-content: space-around; color: var(--muted); font-size: 9px; }
.pm-trend-values strong { color: #0c8f70; }
.pm-trend-plot { width: 100%; min-height: 92px; display: flex; align-items: end; justify-content: center; gap: 5px; border-bottom: 1px solid #ccd9df; background-image: linear-gradient(to top, transparent 24%, #edf2f4 25%, transparent 26%, transparent 49%, #edf2f4 50%, transparent 51%, transparent 74%, #edf2f4 75%, transparent 76%); }
.large-chart .pm-trend-plot { min-height: 175px; }
.pm-trend-bar { width: 18px; min-height: 2px; border-radius: 5px 5px 0 0; }
.pm-trend-bar.execution { background: #4f93a6; }
.pm-trend-bar.compliance { background: linear-gradient(180deg, #13b487, #087c65); }
.pm-trend-month > strong { font-size: 11px; }
.pm-trend-month > small { color: var(--muted); font-size: 9px; text-align: center; }
.pm-chart-legend { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.pm-legend { width: 14px; height: 7px; border-radius: 3px; }
.pm-legend.execution { background: #4f93a6; }
.pm-legend.compliance { background: #0c9d78; }
.pm-risk-list { min-width: 0; }
.pm-risk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.pm-risk-row:last-child { border-bottom: 0; }
.pm-risk-row div { display: grid; gap: 3px; min-width: 0; }
.pm-risk-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-risk-row span { color: var(--muted); font-size: 10px; }
.pm-risk-percent { color: #b42318 !important; font-size: 17px !important; font-weight: 900; }
.pm-month-filter { align-items: end; }
.filter-period-note { color: var(--muted); font-size: 12px; padding-bottom: 10px; }
.pm-hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 22px; margin-bottom: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 22px rgba(9, 44, 58, .06); }
.pm-hero-ok { border-top: 4px solid #11a47e; }
.pm-hero-risk { border-top: 4px solid #d97706; background: linear-gradient(135deg, #fff 0%, #fffaf1 100%); }
.pm-hero-value { margin-top: 5px; color: var(--primary-dark); font-size: 52px; line-height: 1; font-weight: 900; }
.pm-hero-main h2 { margin: 8px 0 5px; }
.pm-hero-main p { margin: 0; color: var(--muted); }
.pm-hero-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f8fbfc; }
.pm-hero-side > div { display: grid; align-content: center; justify-items: center; gap: 5px; padding: 14px 9px; border-right: 1px solid var(--line); text-align: center; }
.pm-hero-side > div:last-child { border-right: 0; }
.pm-hero-side span, .pm-hero-side small { color: var(--muted); font-size: 10px; }
.pm-hero-side strong { color: var(--primary-dark); font-size: 22px; }
.pm-kpi-grid { margin-top: 0; }
.pm-analysis-grid { grid-template-columns: 1.15fr .85fr; }
.pm-area-list { display: grid; gap: 10px; }
.pm-area-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 74px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pm-area-row:last-child { border-bottom: 0; }
.pm-area-heading { display: grid; gap: 3px; }
.pm-area-heading span { color: var(--muted); font-size: 10px; }
.pm-area-result { display: grid; justify-items: end; }
.pm-area-result strong { color: var(--primary-dark); font-size: 17px; }
.pm-area-result span { color: var(--muted); font-size: 9px; }
.badge.pm-on_time { background: #daf4eb; color: #08775f; }
.badge.pm-late { background: #fff0d6; color: #9a5a05; }
.badge.pm-overdue { background: #fde5e2; color: #a9281d; }
.badge.pm-future { background: #e7f0f5; color: #315d70; }
.badge.pm-postponed { background: #ece8ff; color: #5b46a6; }
.badge.pm-pending_approval { background: #fff1c9; color: #8a5d00; }

@media (max-width: 1100px) {
  .pm-executive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-dashboard-bottom, .pm-analysis-grid, .pm-hero { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pm-executive-grid { grid-template-columns: 1fr; }
  .pm-trend-bars { overflow-x: auto; grid-template-columns: repeat(6, 76px); }
  .pm-hero-side { grid-template-columns: 1fr; }
  .pm-hero-side > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .pm-hero-side > div:last-child { border-bottom: 0; }
  .pm-area-row { grid-template-columns: 1fr; }
  .pm-area-result { justify-items: start; }
}

/* Plataforma modular Inmensa */
.suite-heading { margin-bottom: 22px; }
.eyebrow { display: inline-block; margin-bottom: 6px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.module-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 215px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 32px rgba(9, 44, 58, .08); }
.module-code { display: grid; place-items: center; background: linear-gradient(155deg, #0b2c3a, #0e7490); color: #fff; font-size: 24px; font-weight: 900; letter-spacing: .08em; }
.module-card-preparing .module-code { background: linear-gradient(155deg, #4e5d67, #7a8790); }
.module-card-body { display: grid; align-content: center; justify-items: start; gap: 11px; padding: 26px; }
.module-card-body h2 { margin: 0; color: var(--primary-dark); font-size: 24px; }
.module-card-body p { margin: 0; color: var(--muted); line-height: 1.55; }
.module-status { padding: 5px 9px; border-radius: 999px; background: #daf4eb; color: #08775f; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.module-card-preparing .module-status { background: #edf1f3; color: #526775; }
.suite-note { margin-top: 22px; padding: 16px 18px; border: 1px solid #cfe4ec; border-radius: 13px; background: #f4fafc; color: var(--muted); line-height: 1.5; }
.empty-state-panel { max-width: 900px; padding: 30px; }
@media (max-width: 900px) {
  .module-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .module-card { grid-template-columns: 1fr; }
  .module-code { min-height: 68px; }
}

/* v0.9 simplified access management and late PM traceability */
.form-section-heading { margin-top: 4px; padding: 14px 16px; border-left: 4px solid var(--warning); border-radius: 8px; background: #fff7e9; }
.form-section-heading div { display: grid; gap: 4px; }
.form-section-heading strong { color: #7d4900; font-size: 15px; }
.form-section-heading small { color: #8a6a39; }
.late-justification-card { margin-top: 18px; padding: 16px; border: 1px solid #edc57e; border-left: 4px solid var(--warning); border-radius: 10px; background: #fff9ed; }
.late-justification-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.late-justification-card p { margin-bottom: 8px; color: #5f4930; line-height: 1.55; }
.late-justification-card small { color: #806746; }
.access-profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.access-profile-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(15, 35, 52, .05); }
.access-profile-card.read-only { border-color: #b7ceda; background: linear-gradient(180deg, #f9fcfe, #f1f7fa); }
.access-profile-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.access-profile-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.user-table-heading { padding: 16px 18px 0; }
.user-access-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; }
.access-guide { align-self: start; }
.access-guide-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.access-guide-row:last-of-type { border-bottom: 0; }
.access-guide-row > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.access-guide-row p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.access-security-note { margin-top: 14px; padding: 13px; border-radius: 9px; background: #edf6fa; color: #365867; }
.access-security-note p { margin: 5px 0 0; font-size: 12px; line-height: 1.45; }
@media (max-width: 1050px) {
  .access-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-access-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .access-profile-grid { grid-template-columns: 1fr; }
}

/* v1.0 · Identidad Inmensa y arquitectura modular */
:root {
  --brand-navy: #092b3a;
  --brand-navy-2: #0f3b4d;
  --brand-magenta: #e4004f;
  --brand-magenta-dark: #b90040;
  --brand-teal: #58b7b1;
  --brand-teal-dark: #128b82;
  --brand-purple: #7b268e;
  --primary: #0e6177;
  --primary-dark: #083f50;
  --accent: #15a58f;
}
.topbar { height: 72px; padding: 0 26px; background: linear-gradient(90deg, #071f2b, var(--brand-navy)); box-shadow: 0 2px 16px rgba(2, 19, 27, .22); }
.brand { gap: 11px; }
.brand-icon { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.brand strong { font-size: 15px; letter-spacing: .08em; }
.brand small { color: #a8ccd3; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.app-switcher { padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; color: #d9eef2; font-size: 12px; font-weight: 700; }
.app-switcher:hover { border-color: var(--brand-teal); color: #fff; background: rgba(255,255,255,.06); }
.btn-primary { background: linear-gradient(135deg, var(--brand-magenta), #f02065); box-shadow: 0 6px 16px rgba(228, 0, 79, .18); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-magenta-dark), var(--brand-magenta)); }
.eyebrow { color: var(--brand-magenta); }

/* Login corporativo */
.login-main { min-height: 100vh; padding: 0; background: #07151e url("../img/fondo_inmensa.715a48b6c7fd.webp") center/cover no-repeat fixed; }
.login-stage { position: relative; width: 100%; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); align-items: stretch; }
.login-stage::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2,12,18,.3), rgba(2,12,18,.62) 56%, rgba(2,12,18,.88)); pointer-events: none; }
.login-brand-panel { position: relative; z-index: 1; display: grid; align-content: center; justify-items: center; padding: 70px; text-align: center; }
.login-brand-panel img { width: min(720px, 82%); max-height: 330px; object-fit: contain; filter: drop-shadow(0 16px 28px rgba(0,0,0,.45)); }
.login-brand-panel p { max-width: 560px; margin: 20px 0 0; color: #d1e4e7; font-size: 17px; letter-spacing: .02em; }
.login-stage .login-card { position: relative; z-index: 1; align-self: center; justify-self: center; width: min(430px, calc(100% - 48px)); padding: 38px; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.96); box-shadow: 0 28px 60px rgba(0,0,0,.3); backdrop-filter: blur(10px); }
.login-stage .login-card h1 { font-size: 30px; color: var(--brand-navy); }
.login-security { display: block; margin-top: 20px; color: #8ba0aa; letter-spacing: .08em; }

/* Portal de aplicaciones: sin navegación lateral */
.portal-main { min-height: calc(100vh - 72px); background: #edf2f5; }
.portal-hero { position: relative; min-height: 320px; overflow: hidden; background: #071d28 url("../img/fondo_inmensa.715a48b6c7fd.webp") center 43%/cover no-repeat; }
.portal-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,23,32,.93), rgba(5,23,32,.68) 60%, rgba(5,23,32,.35)); }
.portal-hero-content { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 48px 44px; color: #fff; }
.portal-logo { width: min(440px, 72vw); max-height: 130px; object-fit: contain; object-position: left center; margin-bottom: 18px; filter: drop-shadow(0 10px 22px rgba(0,0,0,.35)); }
.portal-kicker { display: block; color: #91d4d1; font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.portal-hero h1 { margin: 8px 0 6px; font-size: 34px; }
.portal-hero p { color: #c9dde1; font-size: 15px; }
.portal-admin-link { display: inline-flex; margin-top: 11px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; color: #fff; font-size: 12px; font-weight: 700; }
.portal-admin-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.portal-app-section { max-width: 1280px; margin: -32px auto 0; padding: 0 44px 50px; position: relative; z-index: 2; }
.portal-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 22px 24px; border-radius: 16px; background: #fff; box-shadow: 0 12px 35px rgba(6,35,48,.12); }
.portal-section-heading h2 { margin: 2px 0 0; font-size: 24px; }
.portal-section-heading > span { color: var(--muted); font-size: 12px; }
.module-grid-live { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.module-card-live { position: relative; display: grid; grid-template-columns: 82px minmax(0, 1fr); min-height: 230px; overflow: hidden; border: 1px solid #d5e0e5; border-top: 4px solid var(--module-accent); border-radius: 17px; background: #fff; color: var(--ink); box-shadow: 0 10px 30px rgba(8,38,51,.08); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.module-card-live:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--module-accent) 55%, #d5e0e5); box-shadow: 0 18px 38px rgba(8,38,51,.14); color: var(--ink); }
.module-icon { display: grid; place-items: center; background: linear-gradient(165deg, var(--brand-navy), color-mix(in srgb, var(--module-accent) 55%, var(--brand-navy))); color: #fff; font-size: 20px; font-weight: 900; letter-spacing: .08em; }
.module-card-live-body { display: grid; align-content: center; gap: 9px; padding: 23px; }
.module-access-badge { width: max-content; padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--module-accent) 12%, #fff); color: color-mix(in srgb, var(--module-accent) 72%, #263944); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.module-card-live h3 { margin: 0; color: var(--brand-navy); font-size: 21px; }
.module-card-live p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.module-capabilities { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.module-capabilities span { padding: 4px 7px; border-radius: 6px; background: #edf3f5; color: #4f6975; font-size: 9px; }
.module-open { margin-top: 4px; color: var(--module-accent); font-size: 12px; }
.portal-empty { padding: 42px; border: 1px dashed #b9cbd3; border-radius: 16px; background: #fff; text-align: center; }
.portal-empty strong { font-size: 20px; }
.portal-empty p { margin: 8px 0 0; color: var(--muted); }

/* Navegación limitada al módulo activo */
.app-shell { grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { padding: 18px 13px 24px; background: linear-gradient(180deg, #0a2a39, #0d3546); }
.sidebar-module { margin-bottom: 16px; padding: 15px; border: 1px solid rgba(255,255,255,.1); border-left: 3px solid var(--brand-teal); border-radius: 11px; background: rgba(255,255,255,.055); }
.sidebar-module.platform-admin { border-left-color: var(--brand-purple); }
.sidebar-module-kicker { display: block; margin-bottom: 5px; color: #86bbc4; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.sidebar-module strong { display: block; color: #fff; font-size: 14px; }
.sidebar-module small { display: block; margin-top: 4px; color: #a9c8ce; font-size: 10px; }
.sidebar nav { top: 90px; gap: 3px; }
.sidebar a { padding: 9px 11px; font-size: 12px; }
.sidebar .back-apps { margin-bottom: 7px; border: 1px solid rgba(255,255,255,.11); color: #9fd1d3; }
.nav-section { display: block; margin: 15px 10px 4px; color: #7098a2; font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }

/* Matriz de permisos por aplicación */
.permission-concept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.permission-concept-grid article { padding: 17px; border: 1px solid var(--line); border-top: 3px solid var(--brand-teal); border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(15,35,52,.05); }
.permission-concept-grid article:nth-child(2) { border-top-color: var(--brand-purple); }
.permission-concept-grid article:nth-child(3) { border-top-color: var(--brand-magenta); }
.permission-concept-grid p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.user-module-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.module-access-chip { display: inline-flex; gap: 5px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #eef4f6; color: #46616d; font-size: 9px; }
.module-access-chip strong { color: var(--brand-navy); }
.module-access-chip.level-read { background: #e8f2f6; color: #285b70; }
.module-access-chip.level-write { background: #e0f4ee; color: #0c715b; }
.module-access-chip.level-admin { background: #f2e8f5; color: #6d257c; }
.user-permission-form { display: grid; gap: 18px; }
.profile-preset-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: #f2f7f9; }
.profile-preset-bar > div { display: grid; gap: 3px; }
.profile-preset-bar span { color: var(--muted); font-size: 11px; }
.checkbox-line { display: flex; align-items: center; gap: 9px; min-height: 40px; }
.module-permissions-panel { padding: 0; overflow: hidden; }
.module-permissions-panel > .panel-heading { margin: 0; padding: 20px; }
.module-permission-table-wrap { overflow-x: auto; }
.module-permission-table { min-width: 980px; }
.module-permission-table th { white-space: nowrap; }
.module-permission-table td { vertical-align: middle; }
.module-permission-table tr.module-not-ready { background: #fafbfc; }
.module-permission-table tr.module-not-ready td { opacity: .72; }
.module-permission-name { display: flex; align-items: center; gap: 9px; }
.module-permission-name strong { white-space: nowrap; }
.module-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--module-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--module-accent) 14%, transparent); }
.module-permission-table td > small { display: block; margin: 4px 0 0 19px; color: var(--muted); font-size: 9px; }
.permission-toggle { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 9px; text-align: center; }
.permission-toggle input { width: 19px; height: 19px; accent-color: var(--brand-magenta); }
.module-permission-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); background: #f7fafb; }
.module-permission-help > div { display: grid; gap: 3px; padding: 14px 18px; border-right: 1px solid var(--line); }
.module-permission-help > div:last-child { border-right: 0; }
.module-permission-help span { color: var(--muted); font-size: 10px; }
.sticky-form-actions { position: sticky; bottom: 12px; z-index: 4; width: max-content; justify-self: end; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 10px 28px rgba(7,36,48,.14); backdrop-filter: blur(8px); }
.access-note { align-self: center; padding: 8px 11px; border-radius: 8px; background: #eef3f5; color: var(--muted); font-size: 11px; }

@media (max-width: 1100px) {
  .module-grid-live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-stage { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .permission-concept-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .brand small, .app-switcher { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { position: static; }
  .content { padding: 18px; }
  .portal-hero-content, .portal-app-section { padding-left: 20px; padding-right: 20px; }
  .module-grid-live { grid-template-columns: 1fr; }
  .module-card-live { grid-template-columns: 66px minmax(0, 1fr); }
  .portal-section-heading, .profile-preset-bar { align-items: flex-start; flex-direction: column; }
  .module-permission-help { grid-template-columns: 1fr; }
  .module-permission-help > div { border-right: 0; border-bottom: 1px solid var(--line); }
}
.read-only-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 11px 14px; border: 1px solid #b9d4df; border-left: 4px solid #3f8da7; border-radius: 9px; background: #edf7fa; color: #315968; }
.read-only-banner strong { color: #17495c; }
.read-only-banner span { font-size: 12px; }

/* Módulo Análisis de gerencia */
.section-management { --management-accent: #e4004f; --management-deep: #65143a; }
.sidebar-module.management-module { border-left-color: var(--brand-magenta); }
.management-heading { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.management-filter { display: grid; grid-template-columns: 150px 190px auto minmax(280px, 1fr); align-items: end; gap: 14px; margin-bottom: 18px; }
.management-filter label, .transaction-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.data-freshness { display: grid; justify-items: end; gap: 2px; color: var(--muted); text-align: right; }
.data-freshness span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.data-freshness strong { color: var(--brand-navy); font-size: 16px; }
.data-freshness small { max-width: 420px; }
.management-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.management-kpi { position: relative; min-height: 126px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid #b9cbd3; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(10,42,57,.055); }
.management-kpi::after { content: ""; position: absolute; right: -26px; bottom: -36px; width: 100px; height: 100px; border-radius: 50%; background: rgba(10,42,57,.035); }
.management-kpi.primary { border-top-color: var(--brand-magenta); background: linear-gradient(145deg, #fff, #fff6f9); }
.management-kpi.positive { border-top-color: #18a178; }
.management-kpi.negative { border-top-color: #d6455d; }
.management-kpi > span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.management-kpi > strong { display: block; margin: 13px 0 8px; color: var(--brand-navy); font-size: clamp(24px, 2.2vw, 34px); line-height: 1; }
.management-kpi.positive > strong { color: #11765b; }
.management-kpi.negative > strong { color: #b52943; }
.management-kpi > small { position: relative; z-index: 1; color: var(--muted); font-size: 11px; }
.management-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.management-trend-panel, .management-zone-panel { grid-column: 1 / -1; }
.monthly-bars { display: grid; gap: 7px; }
.monthly-bar-row { display: grid; grid-template-columns: 38px minmax(100px, 1fr) 110px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.monthly-bar-row:hover, .monthly-bar-row.selected { background: #f7f1f4; }
.monthly-bar-row > span { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.monthly-bar-row > strong { color: var(--brand-navy); font-size: 11px; text-align: right; }
.monthly-bar-track, .rank-track, .zone-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf2f4; }
.monthly-bar-track i, .rank-track i, .zone-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-magenta), #f06c94); }
.monthly-bar-row.selected .monthly-bar-track i { background: linear-gradient(90deg, var(--brand-purple), var(--brand-magenta)); }
.rank-list { display: grid; gap: 12px; }
.rank-row { display: grid; grid-template-columns: minmax(160px, 1.25fr) minmax(90px, .8fr) 100px; align-items: center; gap: 10px; }
.rank-row > div:first-child { display: flex; align-items: center; min-width: 0; gap: 9px; }
.rank-row > div:first-child span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; background: #eef3f5; color: #54717d; font-size: 10px; font-weight: 900; }
.rank-row > div:first-child strong { overflow: hidden; color: var(--brand-navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rank-row > b { color: #3c5965; font-size: 10px; text-align: right; }
.rank-track i { background: linear-gradient(90deg, #187c87, #5eb4b6); }
.zone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.zone-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.zone-grid span { display: block; min-height: 28px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.zone-grid strong { display: block; margin: 7px 0 12px; color: var(--brand-navy); font-size: 18px; }
.zone-track i { background: linear-gradient(90deg, var(--brand-purple), #a868b2); }
.empty-state-card { display: grid; justify-items: center; gap: 12px; padding: 70px 30px; border: 1px dashed #b9cbd3; border-radius: 16px; background: #fff; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: linear-gradient(145deg, var(--brand-magenta), var(--brand-purple)); color: #fff; font-size: 18px; font-weight: 900; }
.empty-state-card h2 { margin: 0; color: var(--brand-navy); }
.empty-state-card p { max-width: 560px; margin: 0 0 7px; color: var(--muted); }
.import-layout, .management-input-layout { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }
.info-card { padding: 24px; border: 1px solid var(--line); border-top: 4px solid var(--brand-magenta); border-radius: 13px; background: linear-gradient(145deg, #fff, #faf7f9); box-shadow: 0 8px 20px rgba(10,42,57,.05); }
.info-card h2 { margin: 8px 0 14px; color: var(--brand-navy); }
.info-card p, .info-card li { color: var(--muted); font-size: 12px; line-height: 1.6; }
.info-card ol { display: grid; gap: 8px; padding-left: 20px; }
.import-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.import-summary-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.import-summary-grid span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.import-summary-grid strong { display: block; margin-top: 8px; color: var(--brand-navy); font-size: 20px; }
.period-pill { display: inline-flex; margin: 2px; padding: 4px 7px; border-radius: 7px; background: #eef3f5; color: #5a737e; font-size: 9px; font-weight: 800; }
.period-pill.active { background: #e0f4ee; color: #0c715b; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 8px; background: #eef3f5; color: #526d78; font-size: 9px; font-weight: 900; }
.status-imported { background: #e0f4ee; color: #0c715b; }
.status-preview { background: #fff3d9; color: #8a5e00; }
.status-failed { background: #fde6eb; color: #a92b45; }
.table-subline { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.issue-panel { margin-top: 16px; }
.issue-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.issue-list li { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #fff5f6; color: #7e3040; font-size: 11px; }
.confirm-import-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 16px; padding: 20px; border: 1px solid #e7b8c7; border-left: 5px solid var(--brand-magenta); border-radius: 12px; background: #fff8fa; }
.confirm-import-card strong { color: var(--brand-navy); font-size: 16px; }
.confirm-import-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.transaction-filters { display: grid; grid-template-columns: 90px 130px minmax(180px, 1.4fr) minmax(170px, 1fr) minmax(150px, .8fr) 120px auto; align-items: end; gap: 10px; }
.wide-table-card { overflow-x: auto; }
.wide-table-card table { min-width: 1180px; }
.number-cell { font-variant-numeric: tabular-nums; text-align: right; }
.two-column-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.two-column-form .full-width { grid-column: 1 / -1; }
.split-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.table-card-heading { padding: 16px 18px 0; }
.table-card-heading h2 { margin: 0; color: var(--brand-navy); font-size: 16px; }
.change-log { display: grid; gap: 8px; }
.change-log > div { display: grid; grid-template-columns: 120px 240px 1fr; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.change-log span { color: var(--muted); font-size: 10px; }
.change-log strong { color: var(--brand-navy); font-size: 11px; }
.change-log p { margin: 0; color: var(--muted); font-size: 11px; }
.empty-copy, .empty-cell { color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1200px) {
  .management-filter { grid-template-columns: 130px 170px auto 1fr; }
  .transaction-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .management-kpi-grid, .management-dashboard-grid, .split-tables { grid-template-columns: 1fr; }
  .management-trend-panel, .management-zone-panel { grid-column: auto; }
  .management-filter, .import-layout, .management-input-layout { grid-template-columns: 1fr; }
  .data-freshness { justify-items: start; text-align: left; }
  .zone-grid, .import-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-row { grid-template-columns: minmax(140px, 1fr) 80px; }
  .rank-row .rank-track { display: none; }
}
@media (max-width: 620px) {
  .management-kpi-grid, .zone-grid, .import-summary-grid, .two-column-form, .transaction-filters { grid-template-columns: 1fr; }
  .monthly-bar-row { grid-template-columns: 34px 1fr; }
  .monthly-bar-row > strong { grid-column: 2; text-align: left; }
  .confirm-import-card, .change-log > div { align-items: flex-start; flex-direction: column; grid-template-columns: 1fr; }
}

/* Análisis de gerencia · vistas detalladas de ventas */
.analysis-filter-grid { display: grid; grid-template-columns: 120px minmax(220px, 1.3fr) minmax(160px, .8fr) minmax(210px, 1fr) minmax(160px, .8fr) auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.analysis-filter-grid label, .seller-analysis-filter label, .comparison-filter > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.analysis-filter-actions { display: flex; gap: 8px; }
.analysis-summary-grid { margin-top: 0; }
.analysis-table-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.analysis-table-heading h2 { margin-top: 4px; }
.analysis-table-heading > span { color: var(--muted); font-size: 11px; }
.customer-pivot-panel { margin-top: 18px; }
.customer-pivot-table { min-width: 1660px; font-variant-numeric: tabular-nums; }
.customer-pivot-table th, .customer-pivot-table td { padding: 10px 11px; white-space: nowrap; }
.customer-pivot-table .sticky-customer-column { position: sticky; left: 0; z-index: 2; min-width: 310px; max-width: 390px; background: #fff; box-shadow: 1px 0 0 var(--line); white-space: normal; }
.customer-pivot-table thead .sticky-customer-column, .customer-pivot-table tfoot .sticky-customer-column { z-index: 3; background: #edf3f7; }
.customer-pivot-table tbody tr:hover .sticky-customer-column { background: #f8fbfd; }
.customer-cell strong, .customer-cell small { display: block; }
.customer-cell strong { color: var(--brand-navy); font-size: 11px; }
.customer-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.customer-pivot-table .total-column { background: #f8f3f6; color: var(--brand-navy); }
.customer-pivot-table tfoot th { border-top: 2px solid #b9cbd3; }
.comparison-filter { display: grid; grid-template-columns: 220px minmax(360px, 1fr) auto; align-items: end; gap: 16px; margin-bottom: 18px; }
.year-selector { min-width: 0; margin: 0; padding: 0; border: 0; }
.year-selector legend { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.year-selector > div { display: flex; flex-wrap: wrap; gap: 8px; }
.year-selector label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border: 1px solid #cbd9e2; border-radius: 8px; background: #fff; color: var(--brand-navy); font-size: 12px; font-weight: 800; }
.year-selector input { width: 16px; height: 16px; accent-color: var(--brand-magenta); }
.analysis-chart-panel { margin-bottom: 18px; }
.annual-comparison-bars { display: grid; gap: 15px; }
.analysis-horizontal-bar { display: grid; grid-template-columns: 70px minmax(150px, 1fr) 130px; align-items: center; gap: 12px; }
.analysis-horizontal-bar > strong { color: var(--brand-navy); }
.analysis-horizontal-bar > b { color: #405d69; font-size: 11px; text-align: right; }
.analysis-horizontal-track { height: 22px; overflow: hidden; border-radius: 7px; background: repeating-linear-gradient(90deg, #edf2f4 0, #edf2f4 calc(25% - 1px), #dfe8ec 25%); }
.analysis-horizontal-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--series-color, var(--brand-magenta)); }
.series-0 { --series-color: #e4004f; }
.series-1 { --series-color: #0f7f88; }
.series-2 { --series-color: #7b268e; }
.series-3 { --series-color: #d78313; }
.series-4 { --series-color: #2967a4; }
.series-5 { --series-color: #4f8a4b; }
.analysis-table-panel { margin-bottom: 18px; }
.comparison-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; margin-bottom: 12px; }
.comparison-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.comparison-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--series-color); }
.monthly-comparison-chart { display: grid; grid-template-columns: repeat(12, minmax(46px, 1fr)); gap: 8px; height: 330px; padding: 18px 10px 0; overflow-x: auto; border-bottom: 1px solid #cbd9e2; background: repeating-linear-gradient(to top, transparent 0, transparent 64px, #edf2f4 65px); }
.comparison-month-group { display: grid; grid-template-rows: minmax(0, 1fr) 24px; align-items: end; min-width: 46px; }
.comparison-month-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.comparison-month-bars i { display: block; width: min(18px, 35%); min-width: 5px; border-radius: 4px 4px 0 0; background: var(--series-color); opacity: .9; }
.comparison-month-group > strong { color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; }
.monthly-comparison-table { min-width: 620px; }
.seller-analysis-filter { display: grid; grid-template-columns: 150px 210px auto; align-items: end; justify-content: start; gap: 12px; margin-bottom: 18px; }
.seller-chart-panel { margin-bottom: 18px; }
.seller-analysis-bars { display: grid; gap: 11px; }
.seller-analysis-row { display: grid; grid-template-columns: minmax(210px, 1.15fr) minmax(180px, 1fr) 110px; align-items: center; gap: 12px; }
.seller-analysis-label { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 0 9px; min-width: 0; }
.seller-analysis-label > span { grid-row: 1 / 3; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #edf3f5; color: #52717d; font-size: 10px; font-weight: 900; }
.seller-analysis-label strong { overflow: hidden; color: var(--brand-navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.seller-analysis-label small { color: var(--muted); font-size: 9px; }
.seller-analysis-track { height: 12px; overflow: hidden; border-radius: 999px; background: #edf2f4; }
.seller-analysis-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f7f88, #5ab6b8); }
.seller-analysis-row.negative .seller-analysis-track i { background: #d6455d; }
.seller-analysis-row > b { color: #405d69; font-size: 10px; text-align: right; }

@media (max-width: 1280px) {
  .analysis-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-filter-actions { align-self: end; }
}
@media (max-width: 900px) {
  .comparison-filter { grid-template-columns: 1fr; }
  .analysis-horizontal-bar { grid-template-columns: 54px 1fr; }
  .analysis-horizontal-bar > b { grid-column: 2; text-align: left; }
  .seller-analysis-row { grid-template-columns: minmax(180px, 1fr) 100px; }
  .seller-analysis-track { display: none; }
}
@media (max-width: 620px) {
  .analysis-filter-grid, .seller-analysis-filter { grid-template-columns: 1fr; }
  .analysis-filter-actions { flex-direction: column; }
  .year-selector > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seller-analysis-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .seller-analysis-row > b { text-align: left; padding-left: 35px; }
}

/* Análisis de gerencia · ciudades y productos */
.dimension-analysis-filter { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(360px, 1.5fr) 210px auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.dimension-analysis-filter > label, .product-analysis-filter > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.product-analysis-filter { display: grid; grid-template-columns: minmax(360px, 1fr) 250px auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.dimension-grouped-chart { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.dimension-chart-row { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(420px, 2fr); gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dimension-chart-row:last-child { border-bottom: 0; }
.dimension-chart-row:nth-child(even) { background: #fafcfd; }
.dimension-chart-label { min-width: 0; align-self: center; }
.dimension-chart-label strong, .dimension-chart-label small { display: block; }
.dimension-chart-label strong { overflow: hidden; color: var(--brand-navy); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.dimension-chart-label small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.dimension-series-list { display: grid; gap: 6px; }
.dimension-series-row { display: grid; grid-template-columns: 48px minmax(150px, 1fr) 104px; align-items: center; gap: 10px; }
.dimension-series-row > span { color: #526b75; font-size: 9px; font-weight: 900; }
.dimension-series-row > b { color: #405d69; font-size: 9px; text-align: right; white-space: nowrap; }
.dimension-series-track { height: 10px; overflow: hidden; border-radius: 999px; background: repeating-linear-gradient(90deg, #edf2f4 0, #edf2f4 calc(25% - 1px), #dde7eb 25%); }
.dimension-series-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--series-color); }
.dimension-series-row.negative .dimension-series-track i { background: #d6455d; }
.dimension-comparison-table { min-width: 760px; font-variant-numeric: tabular-nums; }
.dimension-comparison-table th, .dimension-comparison-table td { white-space: nowrap; }
.dimension-comparison-table tbody td:first-child { min-width: 180px; white-space: normal; }
.product-comparison-table { min-width: 980px; }
.product-comparison-table tbody td:nth-child(2) { min-width: 330px; max-width: 520px; white-space: normal; }
.product-grouped-chart .dimension-chart-label strong { white-space: normal; }
.table-card-heading > span { color: var(--muted); font-size: 10px; }

@media (max-width: 1100px) {
  .dimension-analysis-filter, .product-analysis-filter { grid-template-columns: 1fr 1fr; }
  .dimension-analysis-filter .year-selector, .product-analysis-filter .year-selector { grid-column: 1 / -1; }
  .dimension-chart-row { grid-template-columns: minmax(180px, .8fr) minmax(340px, 1.7fr); }
}
@media (max-width: 760px) {
  .dimension-analysis-filter, .product-analysis-filter { grid-template-columns: 1fr; }
  .dimension-analysis-filter .year-selector, .product-analysis-filter .year-selector { grid-column: auto; }
  .dimension-chart-row { grid-template-columns: 1fr; gap: 10px; }
  .dimension-series-row { grid-template-columns: 42px 1fr 92px; }
}

/* Revisión Análisis de Gerencia · Fase 3 */
.zone-analysis-filter { display: grid; grid-template-columns: minmax(420px, 1.8fr) 220px auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.zone-analysis-filter > label, .customer-detail-filter > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.customer-detail-filter { display: grid; grid-template-columns: minmax(340px, 1.2fr) minmax(420px, 1.5fr) auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.selected-customer-card { margin-bottom: 18px; padding: 18px 20px; border: 1px solid #cadbe2; border-left: 5px solid var(--brand-magenta); border-radius: 10px; background: linear-gradient(135deg, #fff 0%, #f8fbfc 100%); }
.selected-customer-card h2 { margin: 4px 0 3px; color: var(--brand-navy); font-size: 18px; }
.selected-customer-card p { margin: 0; color: var(--muted); font-size: 11px; }
.customer-product-table tbody td:nth-child(2) { min-width: 300px; max-width: 520px; white-space: normal; }
.customer-product-grouped-chart .dimension-chart-label strong { white-space: normal; }
.customer-selection-empty { margin-top: 18px; }
@media (max-width: 1180px) {
  .zone-analysis-filter, .customer-detail-filter { grid-template-columns: 1fr 1fr; }
  .zone-analysis-filter .year-selector, .customer-detail-filter .year-selector { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .zone-analysis-filter, .customer-detail-filter { grid-template-columns: 1fr; }
  .zone-analysis-filter .year-selector, .customer-detail-filter .year-selector { grid-column: auto; }
}

/* Revisión Análisis de Gerencia · Fase 4 */
.temporal-analysis-filter { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.5fr) auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.daily-analysis-filter { display: grid; grid-template-columns: minmax(280px, .9fr) 200px minmax(420px, 1.5fr) auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.temporal-analysis-filter > label, .daily-analysis-filter > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.monthly-comparison-chart i.negative, .daily-comparison-chart i.negative { background: #d6455d; }
.daily-comparison-chart { display: grid; grid-template-columns: repeat(var(--day-count), minmax(34px, 1fr)); gap: 5px; min-width: calc(var(--day-count) * 38px); height: 350px; padding: 18px 10px 0; overflow-x: auto; border-bottom: 1px solid #cbd9e2; background: repeating-linear-gradient(to top, transparent 0, transparent 64px, #edf2f4 65px); }
.comparison-day-group { display: grid; grid-template-rows: minmax(0, 1fr) 24px; align-items: end; min-width: 34px; }
.comparison-day-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.comparison-day-bars i { display: block; width: min(14px, 36%); min-width: 4px; border-radius: 4px 4px 0 0; background: var(--series-color); opacity: .9; }
.comparison-day-group > strong { color: var(--muted); font-size: 9px; text-align: center; }
.daily-comparison-table { min-width: 620px; font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) {
  .temporal-analysis-filter, .daily-analysis-filter { grid-template-columns: 1fr 1fr; }
  .temporal-analysis-filter .year-selector, .daily-analysis-filter .year-selector { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .temporal-analysis-filter, .daily-analysis-filter { grid-template-columns: 1fr; }
  .temporal-analysis-filter .year-selector, .daily-analysis-filter .year-selector { grid-column: auto; }
}
.daily-line-chart-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.daily-line-chart { display: block; width: 100%; min-width: 980px; height: auto; }
.daily-grid-line { stroke: #e3eaee; stroke-width: 1; }
.daily-zero-line { stroke: #a8bbc4; stroke-width: 1.4; }
.daily-axis-label { fill: #6c8089; font-size: 9px; font-weight: 700; }
.daily-day-label { fill: #60747d; font-size: 9px; font-weight: 800; }
.daily-line { fill: none; stroke: var(--series-color); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.daily-point { fill: #fff; stroke: var(--series-color); stroke-width: 2; }

/* Ajustes v1.2.2 · comparativo, tablas y utilidades */
.content { min-width: 0; }
.panel, .table-panel, .customer-pivot-panel { min-width: 0; max-width: 100%; }
.customer-pivot-panel .table-card-heading { position: sticky; left: 0; }
.customer-pivot-panel .table-wrap,
.customer-pivot-scroll {
  width: 100%;
  max-width: 100%;
  max-height: 64vh;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.customer-pivot-table { width: max-content; min-width: 1540px; }
.customer-pivot-table thead th { position: sticky; top: 0; z-index: 4; background: #edf3f7; }
.customer-pivot-table thead .sticky-customer-column { z-index: 6; }
.customer-pivot-table tfoot th { position: sticky; bottom: 0; z-index: 4; background: #edf3f7; }
.customer-pivot-table tfoot .sticky-customer-column { z-index: 6; }

.monthly-comparison-chart {
  position: relative;
  isolation: isolate;
  min-width: 860px;
  height: 390px;
  padding-top: 54px;
  overflow-x: auto;
  overflow-y: hidden;
}
.comparison-trend-overlay { position: absolute; inset: 0 auto auto 0; z-index: 3; pointer-events: none; overflow: visible; }
.comparison-month-group { position: relative; z-index: 2; }
.comparison-month-bars { gap: 5px; }
.comparison-bar-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(24px, 42%);
  min-width: 10px;
  height: 100%;
}
.comparison-bar-wrap i {
  width: 100%;
  min-width: 6px;
  background: var(--series-color);
  opacity: .9;
}
.comparison-bar-value {
  position: absolute;
  bottom: calc(var(--bar-height, 0%) + 4px);
  left: 50%;
  z-index: 4;
  transform: translateX(-50%) rotate(-90deg);
  transform-origin: center;
  color: #405d69;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.chart-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; text-align: right; }

.financial-period-selector { display: grid; grid-template-columns: 180px 220px auto minmax(280px, 1fr); align-items: end; gap: 14px; margin-bottom: 18px; }
.financial-period-selector > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.financial-entry-layout { margin-bottom: 18px; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.financial-comparison-filter { display: grid; grid-template-columns: minmax(420px, 1fr) auto; align-items: end; gap: 14px; margin-bottom: 18px; }
.financial-year-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.financial-comparison-panel { min-width: 0; }
.financial-table-scroll { width: 100%; max-width: 100%; max-height: 66vh; overflow: auto; scrollbar-gutter: stable both-edges; }
.financial-comparison-table { width: max-content; min-width: 980px; font-variant-numeric: tabular-nums; }
.financial-comparison-table th, .financial-comparison-table td { padding: 9px 11px; white-space: nowrap; }
.financial-comparison-table thead th { position: sticky; top: 0; z-index: 4; background: #eaf1f5; }
.financial-comparison-table thead tr:nth-child(2) th { top: 38px; }
.financial-comparison-table .sticky-financial-month { position: sticky; left: 0; z-index: 5; min-width: 125px; background: #fff; box-shadow: 1px 0 0 var(--line); }
.financial-comparison-table thead .sticky-financial-month,
.financial-comparison-table tfoot .sticky-financial-month { z-index: 7; background: #eaf1f5; }
.financial-year-group { border-left: 2px solid #bdcdd5; text-align: center; }
.financial-comparison-table tbody tr:nth-child(even) td,
.financial-comparison-table tbody tr:nth-child(even) th { background: #fafcfd; }
.financial-comparison-table tfoot th { position: sticky; bottom: 0; z-index: 4; border-top: 2px solid #afc2cc; background: #eaf1f5; }
.financial-comparison-table tfoot .average-row th { bottom: 37px; background: #f5f8fa; }
.empty-financial-value { color: #9aaab1; }
.negative-value { color: #c32643 !important; font-weight: 800; }

@media (max-width: 1080px) {
  .financial-period-selector { grid-template-columns: 1fr 1fr; }
  .financial-period-selector .data-freshness { grid-column: 1 / -1; }
  .financial-comparison-filter { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .financial-period-selector { grid-template-columns: 1fr; }
  .financial-period-selector .data-freshness { grid-column: auto; }
  .customer-pivot-panel .table-wrap, .customer-pivot-scroll, .financial-table-scroll { max-height: 58vh; }
  .customer-pivot-table .sticky-customer-column { min-width: 240px; max-width: 280px; }
}

/* Filtros buscables y selección múltiple de meses */
.searchable-select-input { margin-bottom: 6px; }
select.js-searchable-select[size]:not([size="1"]) {
  position: relative;
  z-index: 12;
  min-height: 42px;
  max-height: 240px;
  padding: 4px;
}
.multi-check-selector {
  min-width: 280px;
  margin: 0;
  padding: 9px 11px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.multi-check-selector legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.multi-check-actions { display: flex; gap: 7px; margin-bottom: 7px; }
.multi-check-actions button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.month-check-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 5px 9px;
}
.month-check-list label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}
.month-check-list input { accent-color: var(--accent); }
@media (max-width: 760px) {
  .month-check-list { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
  .multi-check-selector { min-width: 100%; }
}

/* Ajuste de las barras de filtros para el selector múltiple de meses */
.management-filter { grid-template-columns: 150px minmax(360px, 1fr) auto minmax(280px, 1fr); }
.transaction-filters { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.transaction-filters .month-selector { grid-column: span 2; }
.seller-analysis-filter { grid-template-columns: 150px minmax(360px, 1fr) auto; }
.dimension-analysis-filter { grid-template-columns: minmax(220px, .8fr) minmax(340px, 1.2fr) minmax(360px, 1.2fr) auto; }
.product-analysis-filter { grid-template-columns: minmax(340px, 1fr) minmax(360px, 1fr) auto; }
.zone-analysis-filter { grid-template-columns: minmax(420px, 1.4fr) minmax(360px, 1fr) auto; }
.daily-analysis-filter { grid-template-columns: minmax(280px, .8fr) minmax(360px, 1fr) minmax(420px, 1.3fr) auto; }
@media (max-width: 1180px) {
  .management-filter,
  .seller-analysis-filter,
  .dimension-analysis-filter,
  .product-analysis-filter,
  .zone-analysis-filter,
  .daily-analysis-filter { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}
@media (max-width: 680px) {
  .management-filter,
  .seller-analysis-filter,
  .dimension-analysis-filter,
  .product-analysis-filter,
  .zone-analysis-filter,
  .daily-analysis-filter,
  .transaction-filters { grid-template-columns: 1fr; }
  .transaction-filters .month-selector { grid-column: auto; }
}


/* Plataforma integrada v1.3 · etiquetas legibles en gráficas */
.monthly-comparison-chart {
  height: 430px;
  padding-top: 82px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable;
}
.analysis-chart-panel { overflow: visible; }
.comparison-month-group, .comparison-month-bars, .comparison-bar-wrap { overflow: visible; }
.comparison-bar-value {
  bottom: calc(var(--bar-height, 0%) + 7px);
  font-size: 9px;
  line-height: 1;
}
.comparison-trend-overlay { overflow: visible; }
.daily-line-chart-wrap { padding-top: 24px; overflow: auto; }
.daily-line-chart { min-width: 1260px; overflow: visible; }
.daily-point-value { fill: #405d69; font-size: 8px; font-weight: 900; paint-order: stroke; stroke: #fff; stroke-width: 2px; stroke-linejoin: round; }
@media (max-width: 760px) {
  .monthly-comparison-chart { height: 410px; padding-top: 72px; }
  .comparison-bar-value { font-size: 8px; }
}


/* v1.1 control presupuestal por cuentas */
.budget-filter { align-items: end; }
.budget-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.budget-history-card { display: grid; gap: 15px; padding: 20px; border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: 15px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 9px 28px rgba(9,44,58,.07); transition: transform .15s ease, box-shadow .15s ease; }
.budget-history-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(9,44,58,.12); }
.budget-history-card.near { border-top-color: #d99020; }
.budget-history-card.over { border-top-color: #c5372b; background: linear-gradient(145deg,#fff,#fff7f6); }
.budget-history-head, .budget-history-footer, .budget-history-values { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.budget-history-head > div { display: grid; }
.budget-history-head span, .budget-history-values span, .budget-history-footer { color: var(--muted); font-size: 10px; }
.budget-history-head strong { color: var(--primary-dark); font-size: 22px; text-transform: capitalize; }
.budget-history-values > div { display: grid; gap: 4px; }
.budget-history-values > div:last-child { text-align: right; }
.budget-history-values strong { color: var(--ink); font-size: 16px; }
.budget-status { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; background: #e9f2f5; color: #41616f; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.budget-status.closed { background: #e6ecf0; color: #425562; }
.budget-status.draft { background: #daf4eb; color: #08775f; }
.budget-progress { height: 10px; overflow: hidden; border-radius: 999px; background: #e4ecef; }
.budget-progress.large { height: 15px; margin: 15px 0 7px; }
.budget-progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#08738a,#14a87f); }
.budget-progress-fill.danger { background: linear-gradient(90deg,#d36438,#c22525); }
.budget-account-alert { padding: 8px 10px; border-radius: 8px; background: #fde9e6; color: #a62c22; font-size: 10px; font-weight: 800; }
.budget-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; padding: 24px; border: 1px solid #bcd8e0; border-top: 5px solid var(--primary); border-radius: 16px; background: linear-gradient(135deg,#fff,#f3fafb); box-shadow: 0 10px 30px rgba(9,44,58,.08); }
.budget-hero.over { border-color: #e6a59f; border-top-color: #bd3127; background: linear-gradient(135deg,#fff,#fff4f3); }
.budget-hero-main { display: grid; align-content: center; }
.budget-hero-main > span { color: var(--muted); font-size: 12px; }
.budget-hero-main > strong { margin-top: 6px; color: var(--primary-dark); font-size: 39px; line-height: 1; }
.budget-hero-main small { color: var(--muted); }
.budget-hero-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.8); }
.budget-hero-metrics > div { display: grid; gap: 5px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.budget-hero-metrics > div:nth-child(2n) { border-right: 0; }
.budget-hero-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
.budget-hero-metrics span { color: var(--muted); font-size: 10px; }
.budget-hero-metrics strong { color: var(--primary-dark); font-size: 18px; }
.budget-definition-note { margin-top: 13px; padding: 12px 15px; border-left: 4px solid #6c58a6; border-radius: 8px; background: #f3f0fc; color: #564b78; font-size: 11px; }
.budget-account-chart { overflow: hidden; }
.budget-chart-legend { display: flex; justify-content: flex-end; gap: 18px; margin: -7px 0 11px; color: var(--muted); font-size: 10px; }
.budget-chart-legend i { display: inline-block; width: 18px; height: 5px; margin-right: 5px; border-radius: 3px; vertical-align: middle; }
.budget-chart-legend .actual { background: #0e9f7a; }
.budget-chart-legend .limit { background: #8ba5b0; }
.budget-chart-rows { display: grid; }
.budget-chart-row { display: grid; grid-template-columns: minmax(230px,1.05fr) minmax(260px,1.8fr) 112px; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.budget-chart-row:last-child { border-bottom: 0; }
.budget-chart-row.over { margin: 0 -12px; padding-left: 12px; padding-right: 12px; background: #fff5f3; }
.budget-chart-row.near { background: #fffaf0; }
.budget-chart-label { display: grid; gap: 4px; min-width: 0; }
.budget-chart-label strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.budget-chart-label span { color: var(--muted); font-size: 10px; }
.budget-dual-bars { position: relative; height: 22px; border-radius: 5px; background: #edf2f4; }
.budget-limit-bar { position: absolute; top: 4px; left: 0; height: 14px; border-radius: 4px; background: #9eb2ba; opacity: .65; }
.budget-actual-bar { position: absolute; top: 8px; left: 0; height: 6px; border-radius: 4px; background: linear-gradient(90deg,#08738a,#10ae81); }
.budget-chart-row.over .budget-actual-bar { background: linear-gradient(90deg,#e16a3a,#c62f27); }
.budget-chart-result { display: grid; justify-items: end; }
.budget-chart-result strong { font-size: 15px; }
.budget-chart-result span { color: var(--muted); font-size: 9px; }
.row-over-budget { background: #fff1ef !important; }
.budget-general-form { overflow: visible; }
.budget-entry-table td { vertical-align: top; }
.budget-entry-table textarea { min-width: 260px; resize: vertical; }
.budget-entry-row.over { background: #fff0ee; }
.budget-entry-row.near:not(.over) { background: #fff9eb; }
.budget-mini-progress { width: 105px; height: 7px; margin-bottom: 5px; overflow: hidden; border-radius: 999px; background: #dfe8eb; }
.budget-mini-progress > div { height: 100%; border-radius: inherit; background: #11a47e; }
.budget-entry-row.near .budget-mini-progress > div { background: #d99020; }
.budget-entry-row.over .budget-mini-progress > div { background: #c83228; }
.budget-live-total { display: grid; justify-items: end; }
.budget-live-total span { color: var(--muted); font-size: 10px; }
.budget-live-total strong { color: var(--primary-dark); font-size: 20px; }
@media (max-width: 1150px) { .budget-history-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .budget-hero { grid-template-columns: 1fr; } .budget-chart-row { grid-template-columns: 1fr; gap: 8px; } .budget-chart-result { justify-items: start; } }
@media (max-width: 720px) { .budget-history-grid { grid-template-columns: 1fr; } .budget-hero-metrics { grid-template-columns: 1fr; } .budget-hero-metrics > div { border-right: 0; } }
.badge.ok { background: #d9f5ec; color: #08745a; }
.badge.warning { background: #fff0cf; color: #9a5a00; }
.dashboard-budget-panel { border-top: 4px solid #6f45a1; background: linear-gradient(135deg,#fff,#faf7ff); }
.dashboard-budget-panel.over { border-top-color: #c83228; background: linear-gradient(135deg,#fff,#fff4f3); }
.dashboard-budget-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.85); }
.dashboard-budget-grid > div { display: grid; gap: 5px; padding: 14px; border-right: 1px solid var(--line); }
.dashboard-budget-grid > div:last-child { border-right: 0; }
.dashboard-budget-grid span { color: var(--muted); font-size: 10px; }
.dashboard-budget-grid strong { color: var(--primary-dark); font-size: 17px; }
@media(max-width:950px){.dashboard-budget-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-budget-grid>div{border-bottom:1px solid var(--line)}}
