:root {
  --bg:      #080e1a;
  --surface: #0d1525;
  --card:    #111827;
  --muted:   #64748b;
  --muted2:  #94a3b8;
  --text:    #cbd5e1;
  --heading: #e2e8f0;
  --line:    #1a2540;
  --line2:   #243050;
  --accent:  #22c55e;
  --accent2: #60a5fa;
  --blue:    #3b82f6;
  --amber:   #d97706;
  --purple:  #7c3aed;
  --danger:  #e11d48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 400px at 0% 0%, rgba(59,130,246,.07), transparent 60%),
    radial-gradient(ellipse 700px 350px at 100% 100%, rgba(34,197,94,.05), transparent 55%);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* Wrapper / Container */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 16px 36px;
}

/* Base Inputs & Buttons */
input, select, textarea {
  width: 100%;
  padding: 10px;
  margin: 6px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #0b1220;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

button:hover:not(:disabled), .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

button:active:not(:disabled), .btn:active:not(:disabled) {
  transform: translateY(0px);
  box-shadow: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--line2);
  color: var(--muted);
}

.btn-secondary {
  background: rgba(15,23,42,.55);
  color: var(--text);
  border: 1px solid var(--line2);
}

.btn-secondary:hover {
  border-color: rgba(96,165,250,.75);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.btn-danger {
  background: rgba(251,113,133,.14);
  color: var(--danger);
  border: 1px solid rgba(251,113,133,.40);
}
.btn-danger:hover {
  border-color: rgba(251,113,133,.75);
  box-shadow: 0 4px 12px rgba(251, 113, 133, 0.2);
}

/* Cards / Boxes */
.card, .box {
  background: rgba(17,24,39,.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
}

/* Typography elements */
.title { font-size: 14px; margin: 0 0 10px; color: var(--muted); }
.big { font-size: 18px; margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 13px; }
.mini { font-size: 12px; opacity: .85; margin-top:-6px; margin-bottom:10px; color: var(--muted); }

h2, h3, h4 {
  margin-top: 0;
  color: var(--text);
}

/* Grids */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media(max-width:900px){ .grid { grid-template-columns: 1fr; } }

/* Tags */
.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  display: inline-block;
  border: 1px solid var(--line2);
  font-size: 12px;
}

/* Dashboard Tiles & Interactive Elements */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  background: rgba(15,23,42,.65);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(96,165,250,.6);
  box-shadow: 0 12px 24px rgba(0,0,0,.3);
}

.tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.05), transparent 40%);
  opacity: 0;
  transition: opacity 0.2s;
}

.tile:hover::before { opacity: 1; }

.tile .t {
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--blue);
}

.tile .d {
  font-size: 12px;
  color: var(--muted);
  flex-grow: 1;
  margin-bottom: 12px;
  line-height: 1.4;
}

.tile .go {
  font-size: 13px;
  font-weight: bold;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}

.tile:hover .go {
  color: var(--accent2);
}

.tile.green { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.05); }
.tile.green .t { color: var(--accent); }
.tile.green:hover { border-color: rgba(34,197,94,.8); box-shadow: 0 12px 24px rgba(34,197,94,.15); }
.tile.green:hover .go { color: var(--accent); }

/* Dashboard Chart & KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  background: rgba(11,18,32,.65);
  border: 1px solid var(--line2);
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
}
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.kpi .v { font-size: 24px; font-weight: 900; color: var(--text); }

.chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lbl { width: 90px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; }
.bar {
  flex-grow: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line2);
}
.fill {
  height: 100%;
  background: var(--accent2);
  border-radius: 999px;
  transition: width 1s ease-out;
}
.val { width: 30px; font-size: 12px; font-weight: 900; }

.card .footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px dashed var(--line2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

/* Login Specifics */
.login-wrap {
  display: flex;
  height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 16px;
  width: 100%;
}
.login-card {
  background: rgba(17,24,39,.75);
  padding: 30px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.login-logoWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.login-logo {
  width: 250px;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.35));
}
.login-card label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}
.login-card button {
  margin-top: 10px;
  width: 100%;
}

/* Form Specifics (from tramites) */
.moneyWrap { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.moneyWrap span { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--muted); font-weight: 900; min-width: 44px; text-align: center; }
.moneyWords { font-size: 12px; opacity: .85; margin-bottom: 12px; color: var(--muted); }
.rowSearch { display: flex; gap: 10px; align-items: center; margin-bottom: 2px; }
.btnMini { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); cursor: pointer; font-weight: 900; font-size: 12px; transition: 0.2s; }
.btnMini:hover { background: var(--line); border-color: var(--accent2); }

/* KPI Row Bandeja */
.kpiRow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.kpi { border: 1px solid var(--line2); background: var(--bg); padding: 10px 12px; border-radius: 14px; font-weight: 800; }

/* Process VSteps */
.vsteps { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.vstep {
  padding: 12px 14px;
  border-radius: 16px; border: 1px solid var(--line2); background: rgba(11,18,32,.55);
  color: var(--muted); font-weight: 900;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.vstep:hover { transform: translateY(-1px); border-color: rgba(96,165,250,.45); box-shadow: 0 16px 30px rgba(0,0,0,.22); }
.vleft { display: flex; flex-direction: column; gap: 6px; }
.vtitle { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.vnum {
  width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); background: var(--bg); font-weight: 900; color: var(--muted);
}
.vdate { font-size: 12px; color: var(--muted); font-weight: 800; }
.vicon {
  width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); background: var(--bg); font-weight: 900; color: var(--muted); flex-shrink: 0;
}
.vstep.done {
  border-color: rgba(34,197,94,.85); color: var(--text); background: rgba(34,197,94,.12); box-shadow: 0 18px 38px rgba(34,197,94,.12);
}
.vstep.done .vnum, .vstep.done .vicon { border-color: rgba(34,197,94,.90); background: rgba(34,197,94,.16); color: var(--text); }
.vstep.next {
  border-color: rgba(96,165,250,.85); color: var(--text); background: rgba(96,165,250,.10); box-shadow: 0 18px 38px rgba(96,165,250,.12);
}
.vstep.next .vnum, .vstep.next .vicon { border-color: rgba(96,165,250,.9); background: rgba(96,165,250,.14); color: var(--text); }

/* Custom DataTables Styling overrides for Dark Mode */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter, 
.dataTables_wrapper .dataTables_info, 
.dataTables_wrapper .dataTables_processing, 
.dataTables_wrapper .dataTables_paginate {
  color: var(--muted);
  margin-bottom: 15px;
  font-size: 13px;
}

/* Topbar Styles (from dashboard) */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(17,24,39,.72); backdrop-filter: blur(8px);
  margin-bottom: 24px;
}

/* BRAND: solo logo grande, sin texto */
.brand { display: flex; align-items: center; gap: 0; }
.brand img {
  height: 38px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}

.actions { display: flex; gap: 10px; align-items: center; }
.pill {
  padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line2);
  background: rgba(15,23,42,.55); color: var(--muted); font-size: 12px;
}

/* Subtítulo a la derecha del logo */
.roleline {
  margin-left: 14px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line2);
  background: rgba(15,23,42,.45);
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.5em;
  width: auto;
  display: inline-block;
  margin-bottom: 0;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  border-radius: 8px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: rgba(96,165,250,.2) !important;
  color: var(--text) !important;
  border: 1px solid var(--line2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--line) !important;
  color: var(--text) !important;
  border: 1px solid var(--line2) !important;
}
.dataTables_wrapper .dataTables_length select {
  width: auto;
  display: inline-block;
  padding: 4px 24px 4px 8px;
  margin: 0;
}
table.dataTable {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-top: 10px !important;
  margin-bottom: 15px !important;
}
table.dataTable thead th {
  background: var(--bg);
  color: var(--muted);
  border-bottom: 1px solid var(--line) !important;
  padding: 12px 10px;
  font-weight: 600;
  font-size: 13px;
}
table.dataTable tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
}
table.dataTable tbody tr {
  background-color: transparent !important;
}
table.dataTable tbody tr:hover {
  background-color: rgba(255,255,255,0.02) !important;
}
table.dataTable.no-footer {
  border-bottom: 1px solid var(--line) !important;
}

/* SweetAlert overrides */
div:where(.swal2-container) div:where(.swal2-popup) {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
  border-radius: 16px;
}
div:where(.swal2-container) h2:where(.swal2-title) {
  color: var(--text);
}
div:where(.swal2-container) div:where(.swal2-html-container) {
  color: var(--muted);
}
div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm {
  background-color: var(--accent);
  color: #0b1220;
  border-radius: 10px;
  font-weight: bold;
}
div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 10px;
}

/* ═══════════════════════════════════════
   DASHBOARD INSTITUCIONAL
   ═══════════════════════════════════════ */

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ── Header institucional ── */
.inst-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.inst-left  { display: flex; align-items: center; gap: 16px; }
.inst-name  { font-size: 15px; font-weight: 700; color: var(--heading); letter-spacing: -.2px; }
.inst-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: .2px; text-transform: uppercase; }
.inst-divider { width: 1px; height: 32px; background: var(--line2); }
.inst-dept  { font-size: 12px; color: var(--muted2); }
.inst-right { display: flex; align-items: center; gap: 12px; }
.inst-user {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--surface, #0d1525);
}
.inst-avatar {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.inst-user-name { font-size: 12px; font-weight: 600; color: var(--heading); }
.inst-user-role { font-size: 11px; color: var(--muted); }
.inst-clock { font-size: 12px; font-weight: 600; color: var(--muted2); font-variant-numeric: tabular-nums; }
.btn-exit {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
  background: transparent; color: var(--muted2);
  border: 1px solid var(--line2); cursor: pointer; text-decoration: none;
  transition: .18s;
}
.btn-exit:hover { border-color: rgba(225,29,72,.4); color: var(--danger); background: rgba(225,29,72,.05); }
.btn-exit svg { width: 14px; height: 14px; }

/* ── Sub-nav ── */
.subnav {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px; overflow-x: auto;
}
.subnav-item {
  padding: 11px 16px; font-size: 12px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: .15s; white-space: nowrap;
}
.subnav-item:hover { color: var(--text); }
.subnav-item.active { color: var(--heading); border-bottom-color: var(--blue); font-weight: 600; }
.subnav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.btn-back {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 7px; font-size: 11px; font-weight: 600;
  background: transparent; color: var(--muted2);
  border: 1px solid var(--line2); cursor: pointer; text-decoration: none;
  transition: .18s;
}
.btn-back:hover { border-color: rgba(96,165,250,.5); color: var(--blue); background: rgba(59,130,246,.06); }
.status-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: rgba(34,197,94,.08); color: var(--accent); border: 1px solid rgba(34,197,94,.2);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: blink 2.5s ease-in-out infinite;
}

/* ── Page header ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 24px; animation: rise .4s ease both;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--heading); letter-spacing: -.3px; }
.page-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.page-meta  { display: flex; gap: 10px; flex-shrink: 0; }
.meta-chip {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line2);
  background: var(--surface, #0d1525); min-width: 80px; text-align: right;
}
.meta-chip .mc-val { font-size: 19px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; }
.meta-chip .mc-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }
.meta-chip.highlight { border-color: rgba(59,130,246,.3); background: rgba(59,130,246,.06); }
.meta-chip.highlight .mc-val { color: var(--blue); }

/* ── KPI row (nueva versión del dashboard) ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media(max-width:900px){ .kpi-row { grid-template-columns: repeat(3,1fr); } }
@media(max-width:500px){ .kpi-row { grid-template-columns: repeat(2,1fr); } }

.kpi-card {
  padding: 14px 14px 12px;
  background: rgba(13,21,37,.85); border: 1px solid var(--line2); border-radius: 10px;
  position: relative; overflow: hidden;
  animation: rise .4s ease both;
  transition: box-shadow .2s;
}
.kpi-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.kpi-bar-stripe {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  border-radius: 0 0 10px 10px;
}
.kpi-card .kpi-lbl { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.kpi-card .kpi-val { font-size: 26px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-card .kpi-trend { font-size: 10px; color: var(--muted); margin-top: 6px; }
.kpi-card:nth-child(1){animation-delay:.04s}
.kpi-card:nth-child(2){animation-delay:.08s}
.kpi-card:nth-child(3){animation-delay:.12s}
.kpi-card:nth-child(4){animation-delay:.16s}
.kpi-card:nth-child(5){animation-delay:.20s}
.kpi-card:nth-child(6){animation-delay:.24s}

/* ── Card header ── */
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-hd .card-title {
  font-size: 12px; font-weight: 700; color: var(--muted2);
  text-transform: uppercase; letter-spacing: .6px;
  margin: 0;
}
.card-badge {
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
  background: rgba(59,130,246,.1); color: var(--blue); border: 1px solid rgba(59,130,246,.2);
}

/* ── Flujo de estatus ── */
.flow { display: flex; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.flow-step {
  flex: 1; min-width: 90px; display: flex; flex-direction: column;
  align-items: center; position: relative;
}
.flow-connector {
  position: absolute; top: 15px; left: 50%; right: -50%;
  height: 1px; background: var(--line2); z-index: 0;
}
.flow-step:last-child .flow-connector { display: none; }
.flow-node {
  width: 30px; height: 30px; border-radius: 7px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; border: 1px solid var(--line2);
  background: var(--bg); color: var(--muted); margin-bottom: 8px;
  transition: transform .2s;
}
.flow-step:hover .flow-node { transform: scale(1.1); }
.flow-step.s-done .flow-node  { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.5); color: var(--accent); }
.flow-step.s-done .flow-connector { background: rgba(34,197,94,.35); }
.flow-step.s-active .flow-node { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.5); color: var(--blue); box-shadow: 0 0 10px rgba(59,130,246,.2); }
.flow-step.s-pend .flow-node   { opacity: .45; }
.flow-lbl  { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.35; max-width: 74px; }
.flow-n    { font-size: 14px; font-weight: 800; margin-top: 4px; color: var(--muted); }
.flow-step.s-done   .flow-n { color: var(--accent); }
.flow-step.s-active .flow-n { color: var(--blue); }

/* ── Bar chart (nueva versión) ── */
.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row  { display: flex; align-items: center; gap: 10px; }
.bar-lbl  { width: 110px; font-size: 11px; color: var(--muted2); font-weight: 500; text-align: right; flex-shrink: 0; }
.bar-track {
  flex-grow: 1; height: 7px; background: rgba(255,255,255,.04);
  border-radius: 999px; overflow: hidden; border: 1px solid var(--line2);
}
.bar-fill { height: 100%; border-radius: 999px; width: 0; transition: width 1.1s cubic-bezier(.4,0,.2,1); }
.bar-val  { width: 26px; font-size: 11px; font-weight: 700; color: var(--muted2); text-align: right; flex-shrink: 0; }

/* ── Donut ── */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.dash-legend { display: flex; flex-direction: column; gap: 9px; flex-grow: 1; }
.legend-row  { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted2); }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend-val  { margin-left: auto; font-weight: 700; color: var(--heading); }

/* ── Actividad reciente ── */
.act-list { display: flex; flex-direction: column; }
.act-row  {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.act-row:last-child { border-bottom: none; }
.act-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.act-icon svg { width: 15px; height: 15px; }
.act-body  { flex-grow: 1; }
.act-title { font-size: 12px; font-weight: 600; color: var(--heading); line-height: 1.35; }
.act-meta  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.act-time  { font-size: 10px; color: var(--muted); white-space: nowrap; padding-top: 2px; flex-shrink: 0; }

/* ── Tiles institucionales ── */
.dash-tiles { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
@media(max-width:700px){ .dash-tiles { grid-template-columns: 1fr; } }
.dash-tile {
  display: flex; flex-direction: column;
  padding: 16px; border-radius: 10px;
  border: 1px solid var(--line2); background: var(--surface, #0d1525);
  text-decoration: none; color: var(--text);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.dash-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.3); border-color: rgba(59,130,246,.45); }
.dash-tile-ico {
  width: 36px; height: 36px; border-radius: 9px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); background: rgba(255,255,255,.03);
}
.dash-tile-ico svg { width: 18px; height: 18px; }
.dash-tile-name { font-size: 13px; font-weight: 700; color: var(--heading); margin-bottom: 4px; }
.dash-tile-desc { font-size: 11px; color: var(--muted); line-height: 1.5; flex-grow: 1; margin-bottom: 14px; }
.dash-tile-link { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 4px; transition: color .18s; }
.dash-tile:hover .dash-tile-link { color: var(--blue); }
.dash-tile.primary { border-color: rgba(59,130,246,.3); background: rgba(59,130,246,.05); }
.dash-tile.primary .dash-tile-ico { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.25); }
.dash-tile.primary .dash-tile-name { color: var(--blue); }
.dash-tile.primary:hover { border-color: rgba(59,130,246,.65); box-shadow: 0 10px 24px rgba(59,130,246,.1); }

/* ── Page footer ── */
.page-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted); margin-top: 32px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.page-footer .status-ok { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════
   MOBILE APP UI — oculto en escritorio
   ═══════════════════════════════════════ */
.mob-topbar, .mob-tabs { display: none; }

.mob-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 54px; padding: 0 14px;
  background: rgba(8,14,26,.97);
  border-bottom: 1px solid rgba(255,255,255,.08);
  align-items: center; gap: 10px;
}
.mob-topbar-title {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--heading);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.mob-back {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: var(--text); text-decoration: none;
}
.mob-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg,#1d4ed8,#7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,.12); flex-shrink: 0;
}
.mob-tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8,14,26,.97);
  border-top: 1px solid rgba(255,255,255,.08);
  align-items: stretch;
}
.mob-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none;
  font-size: 10px; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.mob-tab.active { color: var(--blue); }
.mob-tab:active { opacity: .7; }

/* ═══════════════════════════════════════
   RESPONSIVE — MÓVIL (≤ 640px)
   ═══════════════════════════════════════ */
@media (max-width: 640px) {

  .inst-header { display: none !important; }
  .subnav      { display: none !important; }
  .mob-topbar  { display: flex; }
  .mob-tabs    { display: flex; }

  .wrap { padding: 66px 12px calc(68px + env(safe-area-inset-bottom)) !important; }

  .page-header { flex-direction: column; gap: 10px; }
  .page-meta   { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .page-title  { font-size: 17px; }
  .meta-chip   { min-width: 0; padding: 8px 10px; }
  .meta-chip .mc-val { font-size: 16px; }

  .kpi-row { grid-template-columns: repeat(2,1fr); }
  .kpi-card .kpi-val { font-size: 22px; }

  .dataTables_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.dataTable thead th,
  table.dataTable tbody td { padding: 9px 8px; font-size: 12px; }

  .rowSearch { flex-direction: column; align-items: stretch; }
  .moneyWrap { flex-wrap: wrap; }

  .flow-step { min-width: 60px; }
  .flow-lbl  { font-size: 9px; max-width: 58px; }
  .bar-lbl   { width: 75px; font-size: 10px; }

  .card, .box  { padding: 14px; border-radius: 12px; }
  .login-card  { padding: 22px 16px; }
  .login-logo  { width: 180px; }
  .login-wrap  { transform: none !important; }

  .grid        { grid-template-columns: 1fr; }
  .dash-tiles  { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tiles       { grid-template-columns: 1fr 1fr; }
  .page-footer { flex-direction: column; gap: 6px; text-align: center; }

  input, select, textarea { font-size: 16px; }

  /* ── Tablas → formato tarjeta en móvil ── */
  .grupo-body table thead,
  .box table thead,
  .tbl-responsive thead { display: none; }

  .grupo-body table tbody tr,
  .box table tbody tr,
  .tbl-responsive tbody tr {
    display: block;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 10px 12px;
  }
  .grupo-body table tbody tr:last-child,
  .box table tbody tr:last-child,
  .tbl-responsive tbody tr:last-child { border-bottom: none; }

  .grupo-body table tbody td,
  .box table tbody td,
  .tbl-responsive tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 4px 0;
    border-bottom: none !important;
    font-size: 13px;
    gap: 8px;
  }
  .grupo-body table tbody td::before,
  .box table tbody td::before,
  .tbl-responsive tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    flex-shrink: 0;
    padding-top: 2px;
    min-width: 80px;
  }
  .grupo-body table tbody td[data-label=""]::before,
  .box table tbody td[data-label=""]::before { display: none; }
  .grupo-body table tbody td[data-label=""],
  .box table tbody td[data-label=""] { justify-content: flex-end; margin-top: 4px; }

  /* Ocultar preview de PDF en móvil */
  .preview-row { display: none !important; }
}
