/* ui-pack.css — LIGHT por defecto; incluye dark como alternativo via .ui-dark */
:root{
  --ui-bg: #f5f7fb;
  --ui-card: #ffffff;
  --ui-ink: #0f172a;
  --ui-muted: #64748b;
  --ui-border: #e5e7eb;
  --ui-accent: #22c55e;
  --ui-accent-2: #3b82f6;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(2,6,23,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* DARK (base) */
.ui-dark{
  --ui-bg: #0b1220;
  --ui-card: #111a2b;
  --ui-ink: #e6f0ff;
  --ui-muted: #9fb3d9;
  --ui-border: rgba(255,255,255,.08);
  --ui-accent: #3ddc84;
  --ui-accent-2: #67b7ff;
  --shadow: 0 6px 24px rgba(0,0,0,.2);
}

html, body{ height:100%; background: var(--ui-bg); color: var(--ui-ink); font-family: var(--font); }

/* Topbar */
.ui-topbar.navbar{ border:0; border-bottom:1px solid var(--ui-border); background: #fff; }
.ui-dark .ui-topbar.navbar{ background: rgba(17,26,43,.6); backdrop-filter: blur(8px); }

.ui-brand{ display:flex; align-items:center; gap:10px; }
.ui-brand-logo{ height:110px; width:auto; border-radius:6px; }
.ui-brand-name{ font-weight:700; letter-spacing:.3px; }

.ui-topbar .navbar-form .form-control{
  border-radius: 999px; background: #f1f5f9; border:1px solid var(--ui-border); color: var(--ui-ink);
}
.ui-dark .ui-topbar .form-control{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color:#fff; }
.ui-topbar .navbar-nav>li>a{ color: var(--ui-ink); }
.ui-dark .ui-topbar .navbar-nav>li>a{ color: var(--ui-ink); }

/* Layout */
.ui-page{ display:flex; gap:18px; padding:86px 18px 18px; }
.ui-sidebar{
  width: 260px; min-height: calc(100vh - 100px);
  background: var(--ui-card);
  border:1px solid var(--ui-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.ui-sidebar .ui-sidebar-toggle{ position:absolute; top:12px; right:12px; border:0; background:transparent; color:var(--ui-muted); }

.ui-menu{ padding:12px; margin:0; list-style:none; }
.ui-menu-item a{
  display:flex; align-items:center; gap:10px; padding:12px 14px;
  border-radius: 12px; color: var(--ui-ink); text-decoration:none;
}
.ui-menu-item a:hover{ background: #f1f5f9; }
.ui-dark .ui-menu-item a:hover{ background: rgba(255,255,255,.06); }

.ui-content{
  flex:1; min-width:0;
  background: var(--ui-card);
  border:1px solid var(--ui-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.ui-page-header{
  display:flex; align-items:flex-end; justify-content:space-between; gap:12px;
  margin-bottom:16px; border-bottom:1px dashed var(--ui-border); padding-bottom:10px;
}
.ui-title{ font-size:22px; margin:0 0 6px; }
.ui-breadcrumb{ background:transparent; margin:0; padding:0; }
.ui-breadcrumb>li>a{ color: var(--ui-muted); }
.ui-breadcrumb>li.active{ color: var(--ui-ink); }

.ui-header-actions .btn{
  border-radius: 999px; padding:8px 14px;
  border:1px solid var(--ui-border); background: #f8fafc; color: var(--ui-ink);
}
.ui-header-actions .btn:hover{ background: #eef2f7; }

/* Tables */
.table{ color: var(--ui-ink); }
.table>thead>tr>th{ border-color: var(--ui-border); color: var(--ui-muted); font-weight:600; }
.table>tbody>tr>td{ border-color: var(--ui-border); }
.table-hover>tbody>tr:hover{ background: #f9fafb; }
.ui-dark .table-hover>tbody>tr:hover{ background: rgba(255,255,255,.04); }

/* Primary success (si lo usás) */
.btn-success.ui-btn-primary{
  background: linear-gradient(180deg, var(--ui-accent), #16a34a);
  border:0; box-shadow: 0 8px 24px rgba(34,197,94,.2);
}
.btn-success.ui-btn-primary:hover{ filter: brightness(1.03); }

/* Flashes */
.ui-flash{ border-radius:12px; border:1px solid var(--ui-border); background: #f8fafc; }
.ui-dark .ui-flash{ border-color: rgba(255,255,255,.12); background: rgba(0,0,0,.2); }
.alert-success.ui-flash{ border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12); }
.alert-danger.ui-flash{ border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12); }

.ui-footer{ margin-top: 18px; padding-top: 12px; border-top:1px dashed var(--ui-border); color: var(--ui-muted); }

/* Multi-level dropdown para Bootstrap 3 */
.dropdown-submenu{ position: relative; }
.dropdown-submenu>.dropdown-menu{ top:0; left:100%; margin-top:-1px; }
.dropdown-submenu>a:after{
  content:" "; float:right; border-left: 4px solid #666; border-top:4px solid transparent; border-bottom:4px solid transparent; margin-top:6px;
}
.dropdown-submenu:hover>.dropdown-menu{ display:block; }
@media (max-width: 767px){
  .dropdown-submenu>.dropdown-menu{ left:0; }
}

/* Login */
.ui-login{ min-height:100vh; display:grid; place-items:center; padding:28px; background: var(--ui-bg); }
.ui-login-card{
  width: 100%; max-width: 420px; padding: 24px 24px 18px;
  background: var(--ui-card); border:1px solid var(--ui-border); border-radius: 18px; box-shadow: var(--shadow);
}
.ui-login-brand{ text-align:center; margin-bottom: 16px; }
.ui-login-logo{ height: 56px; width:auto; border-radius: 10px; margin-bottom: 8px; }
.ui-login h1{ font-size: 22px; margin: 6px 0 2px; }
.ui-login .text-muted{ color: var(--ui-muted); }
.ui-remember{ margin: 12px 0; }

/* =========================
   OVERRIDES LIGHT (al final)
   Navbar celeste + layout sin sidebar + toques de color
   ========================= */
:root{
  --ui-bg: #f3f7fd;
  --ui-accent-2: #3b82f6;
}

/* Navbar celeste con borde suave */
.ui-topbar.navbar{
  background: linear-gradient(180deg, #eaf3ff 0%, #dbeaff 100%);
  border-bottom: 1px solid #c7ddff;
}
.ui-topbar .navbar-brand,
.ui-topbar .navbar-nav>li>a{ color: #0f172a; }
.ui-topbar .navbar-nav>li>a:hover,
.ui-topbar .navbar-nav>li.open>a{ background: rgba(59,130,246,.08); }

/* Botón hamburguesa en celeste */
.navbar-toggle .icon-bar{ background-color:#1d4ed8; }

/* Caja de búsqueda suave */
.ui-topbar .navbar-form .form-control{
  background: #f1f6ff; border:1px solid #cfe1ff; color:#0f172a;
}
.ui-topbar .navbar-form .form-control:focus{
  background:#fff; box-shadow:none; border-color:#a7c6ff;
}

/* ===== Layout sin sidebar ===== */
.ui-page{
  display:block;
  padding:86px 18px 18px;
}
.ui-sidebar{ display:none !important; }

/* Tarjeta de contenido con más presencia */
.ui-content.ui-light-card{
  border:1px solid var(--ui-border);
  border-radius:14px;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
}

/* Espaciado de íconos en el menú superior */
.navbar-nav>li>a i{ margin-right:6px; vertical-align:-1px; }

/* Cards del dashboard */
.ui-card{ background:#fff; border:1px solid var(--ui-border); border-radius:14px; box-shadow:0 6px 14px rgba(2,6,23,.06); }
.ui-card .ui-card-h{ display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px dashed var(--ui-border); }
.ui-card .ui-card-b{ padding:10px; }

/* =========================
   DARK MODE — BOOST DE CONTRASTE (overrides)
   ========================= */
.ui-dark{
  --ui-bg:    #0a1222;
  --ui-card:  #0f1626;
  --ui-ink:   #eaf1ff;
  --ui-muted: #b7c9ef;
  --ui-border: rgba(255,255,255,.14);
}

/* contenedores */
.ui-dark .ui-content,
.ui-dark .ui-card{
  background: var(--ui-card);
  border-color: var(--ui-border);
}
.ui-dark .ui-page-header{ border-bottom-color: var(--ui-border); }
.ui-dark .ui-footer{ border-top-color: var(--ui-border); color: var(--ui-muted); }

/* navbar en dark */
.ui-dark .ui-topbar.navbar{
  background:#0c1528;
  border-bottom:1px solid var(--ui-border);
}
.ui-dark .ui-topbar .navbar-nav>li>a{ color: var(--ui-ink); }

/* tablas: forzar color de texto y bordes */
.ui-dark .table{ color: var(--ui-ink); }
.ui-dark .table>thead>tr>th{
  color:#cfe0ff !important;
  border-color: var(--ui-border);
}
.ui-dark .table>tbody>tr>td{
  color: var(--ui-ink) !important;
  border-color: var(--ui-border);
}
.ui-dark .table-hover>tbody>tr:hover{ background: rgba(103,132,255,.10); }

/* breadcrumb/labels */
.ui-dark .ui-breadcrumb>li>a{ color: var(--ui-muted); }
.ui-dark .ui-breadcrumb>li.active{ color: var(--ui-ink); }

/* botones neutros */
.ui-dark .btn-default{
  background: rgba(255,255,255,.06);
  border-color: var(--ui-border);
  color: var(--ui-ink);
}
.ui-dark .btn-default:hover{ background: rgba(255,255,255,.12); }

/* Íconos en dropdowns */
.dropdown-menu > li > a{
  display:flex; align-items:center; gap:8px;
}
.dropdown-menu > li > a i{
  width:16px; text-align:center; opacity:.9;
}
.ui-dark .dropdown-menu > li > a i{ opacity:1; }

/* Ojito en grillas */
.table .btn.btn-link.p-0{ padding:0 !important; }
.table .bi-eye{ font-size:16px; opacity:.85; }
.table tr:hover .bi-eye{ opacity:1; }

/* thumbs */
.ui-fieldset-title{ margin:18px 0 10px; font-weight:600; color:#334155; }
.ui-thumb{ margin-top:6px; border:1px solid var(--ui-border); border-radius:12px; padding:6px; background:#fff; }
.ui-thumb img{ display:block; width:100%; max-width:100%; height:120px; object-fit:cover; border-radius:8px; }

/* Panel */
.ui-dark .panel{
  background: var(--ui-card);
  border-color: var(--ui-border);
}
.ui-dark .panel-default>.panel-heading{
  background: rgba(255,255,255,.06);
  color: var(--ui-ink);
  border-color: var(--ui-border);
}
.panel .panel-heading .btn{ border-radius:10px; }
.panel-body small{ color: var(--ui-muted); }
.ui-dark .panel-body small{ color: var(--ui-muted); }

/* DetailView */
.detail-view{ width:100%; }
.detail-view th,
.detail-view td{ border-color: var(--ui-border) !important; }
.detail-view th{
  width: 220px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ui-muted);
  background: #f8fafc;
}
.detail-view td{ background: transparent; }
.detail-view tr:hover th,
.detail-view tr:hover td{ background:#f9fafb; }

.ui-dark .detail-view th{
  background: rgba(255,255,255,.06);
  color: #cfe0ff;
}
.ui-dark .detail-view td{
  color: var(--ui-ink);
}
.ui-dark .detail-view tr:hover th,
.ui-dark .detail-view tr:hover td{
  background: rgba(103,132,255,.10);
}

/* Flash stack */
#flash-stack { position:fixed; top:16px; right:16px; pointer-events:none; }
#flash-stack .ui-flash { pointer-events:auto; }

/* ===== Botones CELESTES (restaurados + variantes) ===== */
:root{
  --celeste-100:#eaf3ff;
  --celeste-200:#d6eaff;
  --celeste-400:#48b8f5;
  --celeste-500:#36aff2;
  --celeste-600:#2ea7ee;
  --celeste-700:#1e9fe9;
  --celeste-800:#1d4ed8;
}

.btn-celeste{
  background-color: var(--celeste-400);
  border:1px solid var(--celeste-600);
  color:#fff !important;
  box-shadow:0 6px 18px rgba(72,184,245,.25);
}
.btn-celeste:hover,
.btn-celeste:focus{
  background-color: var(--celeste-500);
  border-color: var(--celeste-700);
  color:#fff !important;
  text-decoration:none;
}
.btn-celeste:active,
.btn-celeste.active{
  background-color: var(--celeste-600);
  border-color: var(--celeste-700);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.12);
}
.btn-celeste:focus{
  outline:0;
  box-shadow:0 0 0 3px rgba(29,78,216,.28), 0 6px 18px rgba(72,184,245,.25);
}
.btn-celeste.disabled,
.btn-celeste[disabled]{ opacity:.65; box-shadow:none; }

.btn-celeste-outline{
  background:transparent;
  color:var(--celeste-700) !important;
  border:1px solid var(--celeste-700);
}
.btn-celeste-outline:hover,
.btn-celeste-outline:focus{
  background:rgba(29,78,216,.08);
  color:#173ea9 !important;
  text-decoration:none;
}

.btn-celeste-soft{
  background: var(--celeste-100);
  border:1px solid var(--celeste-200);
  color: var(--celeste-700) !important;
}
.btn-celeste-soft:hover{ background:#dbeaff; }

.btn-celeste .badge{ background:#fff; color:var(--celeste-700); }
.btn-group .btn-celeste + .btn-celeste{ border-left-color: rgba(255,255,255,.35); }

.ui-dark .btn-celeste{
  border-color: rgba(255,255,255,.22);
  box-shadow:0 8px 24px rgba(59,130,246,.35);
}
.ui-dark .btn-celeste-outline{ color:#9dc1ff !important; border-color:#9dc1ff; }
.ui-dark .btn-celeste-soft{
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.25);
  color:#cfe0ff !important;
}

.btn.ui-btn-primary{
  background: var(--celeste-400) !important;
  border:1px solid var(--celeste-600) !important;
  color:#fff !important;
  box-shadow: 0 4px 12px rgba(72,184,245,.30) !important;
}
.btn.ui-btn-primary:hover{ filter:brightness(1.03); background: var(--celeste-500) !important; }

/* mini logo del navbar */
.ui-nav-logo{
  display:flex; align-items:center;
  padding: 0 10px;
  margin-right: 8px;
  border-right:1px solid rgba(255,255,255,.18);
}
.ui-nav-logo img{
  height: 22px;
  width: auto;
  display:block;
}

/* =========================
   MODAL STACK — ÚNICO Y LIMPIO (FIX REAL)
   ========================= */

/* navbar por debajo de modals */
body .navbar-fixed-top,
body .ui-topbar.navbar,
body .navbar{
  z-index: 1000 !important;
}

/* backdrop debajo del modal y NO bloquea clicks del modal */
body .modal-backdrop,
body .modal-backdrop.in{
  position: fixed !important;
  top:0; left:0; right:0; bottom:0;
  z-index: 2000 !important;
  opacity: .30 !important;
  pointer-events: none !important; /* clave */
}

/* modal arriba de todo y clickeable */
body .modal{
  z-index: 2010 !important;
  pointer-events: auto !important;
}
body .modal *{
  pointer-events: auto !important;
}

/* dropdowns/autocomplete dentro del modal */
body .modal .ui-autocomplete,
body .modal .select2-container,
body .modal .select2-drop,
body .modal .select2-dropdown,
body .modal .select2-results{
  z-index: 2020 !important;
}

/* ============================================================
   CUOTIX ENHANCEMENT PACK v2
   Mejoras visuales globales: forms, botones, portales, login
   ============================================================ */

/* ---------------------------
   Bootstrap 5 utility polyfills
   (compatibilidad con vistas que usan clases BS5 en BS3)
   --------------------------- */
.d-flex          { display: flex !important; }
.d-inline-flex   { display: inline-flex !important; }
.d-block         { display: block !important; }
.d-none          { display: none !important; }
.align-items-center   { align-items: center !important; }
.align-items-start    { align-items: flex-start !important; }
.align-items-end      { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-1 { gap:  4px !important; }
.gap-2 { gap:  8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.border-0 { border: 0 !important; }
.rounded  { border-radius: 8px !important; }
.shadow-sm{ box-shadow: 0 2px 8px rgba(0,0,0,.08) !important; }
.shadow   { box-shadow: 0 6px 18px rgba(2,6,23,.10) !important; }
.fw-bold  { font-weight: 700 !important; }
.text-dark{ color: #0f172a !important; }
.p-0  { padding:  0 !important; }
.p-2  { padding:  8px !important; }
.p-3  { padding: 12px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.mb-0 { margin-bottom:  0 !important; }
.mb-2 { margin-bottom:  8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mt-2 { margin-top:  8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.w-100{ width: 100% !important; }

/* ---------------------------
   Formularios — mejorados
   --------------------------- */
.form-control {
  border-radius: 10px !important;
  border: 1.5px solid var(--ui-border) !important;
  padding: 9px 13px !important;
  font-size: 14px !important;
  color: var(--ui-ink) !important;
  background: #fff !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
  height: auto !important;
  line-height: 1.5 !important;
}
.form-control:focus {
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,.15) !important;
  outline: none !important;
}
textarea.form-control { height: auto !important; min-height: 90px; }
select.form-control   { cursor: pointer; }
label { font-weight: 600; font-size: 13px; color: var(--ui-muted); margin-bottom: 4px; }
.form-group { margin-bottom: 14px !important; }
.has-error .form-control   { border-color: #ef4444 !important; }
.has-error .control-label,
.has-error .help-block     { color: #ef4444 !important; }
.help-block { font-size: 12px; margin-top: 4px; }

.ui-dark .form-control {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: var(--ui-ink) !important;
}
.ui-dark .form-control:focus {
  border-color: #67b7ff !important;
  box-shadow: 0 0 0 3px rgba(103,183,255,.15) !important;
}
.ui-dark select.form-control option { background: #111a2b; }

/* ---------------------------
   Botones — variantes mejoradas
   --------------------------- */
.btn { border-radius: 10px !important; font-weight: 600 !important; transition: filter .15s, box-shadow .15s !important; }
.btn-xs { border-radius: 7px  !important; padding: 4px 10px !important; font-size: 12px !important; }
.btn-sm { border-radius: 9px  !important; }
.btn-lg { border-radius: 12px !important; }

.btn-primary {
  background: linear-gradient(180deg, #1ab0f5 0%, #0284c7 100%) !important;
  border-color: #0272ae !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(14,165,233,.30) !important;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(180deg, #0ea5e9 0%, #0272ae 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(14,165,233,.40) !important;
}

.btn-info {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%) !important;
  border-color: #0ea5e9 !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(14,165,233,.22) !important;
}
.btn-info:hover, .btn-info:focus {
  background: linear-gradient(180deg, #29b4f6 0%, #0b98d9 100%) !important;
  color: #fff !important;
}

.btn-success {
  background: linear-gradient(180deg, #34d574 0%, #16a34a 100%) !important;
  border-color: #15803d !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(34,197,94,.22) !important;
}
.btn-success:hover, .btn-success:focus {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%) !important;
  color: #fff !important;
}
/* Mantener variant especial de login */
.btn-success.ui-btn-primary {
  background: linear-gradient(180deg, var(--ui-accent), #16a34a) !important;
}

.btn-danger {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%) !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}
.btn-danger:hover, .btn-danger:focus {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%) !important;
  color: #fff !important;
}

.btn-warning {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%) !important;
  border-color: #b45309 !important;
  color: #fff !important;
}
.btn-warning:hover, .btn-warning:focus {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%) !important;
  color: #fff !important;
}

.btn-default {
  background: #fff !important;
  border: 1.5px solid var(--ui-border) !important;
  color: var(--ui-ink) !important;
}
.btn-default:hover, .btn-default:focus {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: var(--ui-ink) !important;
}
.ui-dark .btn-default {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.15) !important;
  color: var(--ui-ink) !important;
}
.ui-dark .btn-default:hover {
  background: rgba(255,255,255,.14) !important;
}

/* ---------------------------
   Portal cards — CENTRALIZADAS (dp-*)
   Elimina duplicación inline en cada portal/index.php
   --------------------------- */
.dp-wrap  { max-width: 1180px; margin: 0 auto; padding: 8px 4px 32px; }

/* ── Hero refresh: gradient sutil con doble glow + soporte de avatar opcional ── */
.dp-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgba(34,197,94,.16), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(14,165,233,.16), transparent 55%),
    linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 50%, #eff6ff 100%);
  border: 1px solid rgba(16,185,129,.18);
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(16,185,129,.06);
}
/* ── Cabeceras de secciones colapsables de los portales ──
   Mismo tono que .dp-hero (la tarjeta de saludo). Sólo pinta la barra del
   título: el cuerpo desplegado sigue blanco (lo define cada portal).
   Especificidad (0,3,0) a propósito: los portales declaran
   .dp-section-head:hover en un <style> local que carga después y lo pisaría. */
.dp-wrap .dp-section .dp-section-head {
  background:
    radial-gradient(circle at 15% 0%, rgba(34,197,94,.16), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(14,165,233,.16), transparent 55%),
    linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 50%, #eff6ff 100%);
}
.dp-wrap .dp-section .dp-section-head:hover {
  background:
    radial-gradient(circle at 15% 0%, rgba(34,197,94,.24), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(14,165,233,.24), transparent 55%),
    linear-gradient(135deg, #d1fae5 0%, #ccfbf1 50%, #dbeafe 100%);
}
.ui-dark .dp-wrap .dp-section .dp-section-head {
  background:
    radial-gradient(circle at 15% 0%, rgba(34,197,94,.10), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(14,165,233,.10), transparent 55%),
    linear-gradient(135deg, rgba(16,185,129,.08) 0%, rgba(14,165,233,.06) 100%);
}

/* Layout flex cuando se usa con avatar (estilo portal alumno) */
.dp-hero.dp-hero-avatar {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Avatar circular con iniciales (gradient verde-azul) */
.dp-hero-ava {
  width: 84px; height: 84px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 6px 20px rgba(16,185,129,.32);
  border: 3px solid #fff;
}

.dp-hero-body { flex: 1; min-width: 0; }

/* "BUENOS DÍAS" / "BUENAS TARDES" / "BUENAS NOCHES" */
.dp-hero-hello {
  font-size: 13px; font-weight: 600; color: #0f766e;
  text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 2px;
}

.dp-hero h2 {
  margin: 0 0 8px; font-weight: 800; font-size: 22px;
  color: var(--ui-ink); letter-spacing: -.01em; line-height: 1.15;
}
.dp-hero p  { margin: 0 0 4px; color: var(--ui-muted); font-size: 13.5px; }

/* Badges del hero (pills con info: rol, período, curso, etc.) */
.dp-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dp-hero-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid rgba(0,0,0,.08);
  color: #334155; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.dp-hero-pill i { font-size: 13px; }
.dp-hero-pill.rol     { border-color: rgba(99,102,241,.30);  color: #4338ca; }
.dp-hero-pill.curso   { border-color: rgba(16,185,129,.30);  color: #065f46; }
.dp-hero-pill.periodo { border-color: rgba(14,165,233,.30);  color: #0369a1; }

/* Pill legacy (sigue funcionando) */
.dp-meta    {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 5px 12px;
  background: #fff; border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #334155;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* Mobile: hero con avatar apila vertical */
@media (max-width: 680px) {
  .dp-hero.dp-hero-avatar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .dp-hero-ava { width: 64px; height: 64px; font-size: 22px; border-width: 2px; }
  .dp-hero h2 { font-size: 19px; }
}

/* ── Grid de cards con auto-fill ── */
.dp-cards { margin-top: 0; display: flex !important; flex-wrap: wrap; }
.dp-cards .col-sm-4,
.dp-cards .col-sm-6 { margin-top: 14px; display: flex; }
.row.dp-cards { display: flex !important; flex-wrap: wrap; }

/* ── Card moderna con hover-lift y línea de acento ── */
.dp-card {
  position: relative;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 14px;
  padding: 18px 16px 16px;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  height: 100%;
  /* Piso de alto uniforme: iguala las tarjetas de TODAS las secciones (no solo
     dentro de una misma fila), sin recortar contenido si un texto es más largo. */
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dp-card::before {
  content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #0284c7);
  opacity: 0; transition: opacity .18s;
}
.dp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15,23,42,.10);
  border-color: transparent;
}
.dp-card:hover::before { opacity: 1; }

.dp-ico {
  font-size: 20px;
  display: inline-flex;
  width: 46px;  height: 46px;
  align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(14,165,233,.12);
  color: #0369a1;
  margin-bottom: 12px;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.dp-card:hover .dp-ico { transform: scale(1.06); }

.dp-card h4 {
  margin: 0 0 4px; font-weight: 800; font-size: 15px;
  color: var(--ui-ink); letter-spacing: -.005em;
}
.dp-card p  { margin: 0 0 12px; color: var(--ui-muted); font-size: 12.5px; line-height: 1.45; flex: 1; }

/* Botón dentro de cards: estilo arrow sutil al pie (mismo look que .ap-card del portal alumno).
   El <a> con clase .dp-btn cubre toda la card via ::after → click en cualquier punto navega.
   Aplica SOLO si el botón está dentro de .dp-card (sin afectar otros usos de .dp-btn). */
.dp-card .dp-btn,
.dp-card a.dp-btn,
.dp-card .btn.dp-btn {
  background: transparent !important;
  background-image: none !important;
  color: #0284c7 !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-top: auto;
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  font-size: 12.5px !important;
  font-weight: 700;
  text-align: left;
  transition: gap .2s ease, color .15s ease;
}
.dp-card .dp-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}
.dp-card:hover .dp-btn,
.dp-card:hover a.dp-btn,
.dp-card:hover .btn.dp-btn {
  gap: 9px;
  color: #0369a1 !important;
  transform: none;
  box-shadow: none !important;
}

/* Si el botón está fuera de .dp-card (uso libre), conserva el estilo de gradient */
.dp-btn {
  border-radius: 10px;
  font-weight: 700; font-size: 12.5px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff !important;
  border: 0;
  box-shadow: 0 2px 8px rgba(14,165,233,.25);
  transition: transform .18s ease, box-shadow .18s ease;
}
.dp-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14,165,233,.35); color: #fff !important; }

/* Mobile: cards en 1 columna, hero compacto */
@media (max-width: 680px) {
  .dp-hero { padding: 18px; border-radius: 14px; }
  .dp-hero h2 { font-size: 19px; }
  .dp-cards .col-sm-4, .dp-cards .col-sm-6 { width: 100%; }
  .dp-card { padding: 14px; }
  .dp-ico { width: 40px; height: 40px; font-size: 18px; margin-bottom: 10px; }
}

/* Dark mode */
.ui-dark .dp-card { background: var(--ui-card); border-color: var(--ui-border); }
.ui-dark .dp-card:hover {
  border-color: transparent;
  box-shadow: 0 14px 32px rgba(0,0,0,.30);
}
.ui-dark .dp-hero {
  background:
    radial-gradient(circle at 15% 0%, rgba(34,197,94,.10), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(14,165,233,.10), transparent 55%),
    linear-gradient(135deg, rgba(16,185,129,.08) 0%, rgba(14,165,233,.06) 100%);
  border-color: rgba(16,185,129,.22);
}
.ui-dark .dp-meta {
  background: var(--ui-card); border-color: var(--ui-border);
  color: #cbd5e1;
}

/* ---------------------------
   Secciones colapsables (.dp-section) — accent color por ID
   Cada portal usa IDs como sec-general/sec-informes/sec-academico/etc.
   El border izquierdo pinta el color correspondiente para diferenciar
   visualmente las secciones (estilo idéntico al portal alumno).
   --------------------------- */
.dp-section[id]               { border-left: 4px solid #94a3b8 !important; }
.dp-section[id^="sec-general"]    { border-left-color: #0ea5e9 !important; }
.dp-section[id^="sec-academ"]     { border-left-color: #10b981 !important; }
.dp-section[id^="sec-cuenta"]     { border-left-color: #0ea5e9 !important; }
.dp-section[id^="sec-informes"]   { border-left-color: #10b981 !important; }
.dp-section[id^="sec-asisten"]    { border-left-color: #f59e0b !important; }
.dp-section[id^="sec-legajos"]    { border-left-color: #6366f1 !important; }
.dp-section[id^="sec-legajo"]     { border-left-color: #6366f1 !important; }
.dp-section[id^="sec-asignar"]    { border-left-color: #ef4444 !important; }
.dp-section[id^="sec-pagos"]      { border-left-color: #f59e0b !important; }
.dp-section[id^="sec-cuotas"]     { border-left-color: #f59e0b !important; }
.dp-section[id^="sec-config"]     { border-left-color: #8b5cf6 !important; }
.dp-section[id^="sec-alumno"]     { border-left-color: #ec4899 !important; }
.dp-section[id^="sec-matric"]     { border-left-color: #14b8a6 !important; }
.dp-section[id^="sec-planill"]    { border-left-color: #8b5cf6 !important; }
.dp-section[id^="sec-operac"]     { border-left-color: #06b6d4 !important; }
.dp-section[id^="sec-comunic"]    { border-left-color: #8b5cf6 !important; }
.dp-section[id^="sec-boletin"]    { border-left-color: #16a34a !important; }
.dp-section[id^="sec-tablero"]    { border-left-color: #0ea5e9 !important; }

/* ---------------------------
   Tablas — encabezados mejorados
   --------------------------- */
.table > thead > tr > th {
  background: #f8fafc;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  color: #64748b;
  border-bottom: 2px solid var(--ui-border) !important;
  white-space: nowrap;
}
.ui-dark .table > thead > tr > th {
  background: rgba(255,255,255,.05);
  color: #9fb3d9;
}

/* ---------------------------
   Paginación — mejorada
   --------------------------- */
.pagination { margin: 12px 0 0; }
.pagination > li > a,
.pagination > li > span {
  border-radius: 8px !important;
  margin: 0 2px;
  border: 1.5px solid var(--ui-border) !important;
  color: var(--ui-ink);
  transition: background .12s;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover {
  background: #0ea5e9 !important;
  border-color: #0284c7 !important;
  color: #fff !important;
}
.pagination > li > a:hover {
  background: #f1f5f9 !important;
  color: var(--ui-ink);
}
.ui-dark .pagination > li > a,
.ui-dark .pagination > li > span {
  background: rgba(255,255,255,.06);
  color: var(--ui-ink);
}
.ui-dark .pagination > li > a:hover {
  background: rgba(255,255,255,.12) !important;
}

/* ---------------------------
   Badges de estado (pills)
   --------------------------- */
.badge-verde   { background:#dcfce7; color:#15803d; border:1px solid #86efac;  padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:600; display:inline-block; }
.badge-rojo    { background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5;  padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:600; display:inline-block; }
.badge-azul    { background:#dbeafe; color:#1d4ed8; border:1px solid #93c5fd;  padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:600; display:inline-block; }
.badge-naranja { background:#ffedd5; color:#c2410c; border:1px solid #fdba74;  padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:600; display:inline-block; }
.badge-gris    { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1;  padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:600; display:inline-block; }
.badge-violeta { background:#f5f3ff; color:#6d28d9; border:1px solid #c4b5fd;  padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:600; display:inline-block; }

/* ---------------------------
   Login — mejorado
   --------------------------- */
.ui-login {
  min-height: 100vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #eff6ff 100%) !important;
}
.ui-login-card {
  width: 100%;
  max-width: 430px;
  padding: 34px 30px 26px;
  background: #fff !important;
  border: 1px solid rgba(148,163,184,.2) !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 60px rgba(2,6,23,.12), 0 4px 16px rgba(14,165,233,.08) !important;
}
.ui-login-brand { text-align: center; margin-bottom: 22px; }
.ui-login-logo  { height: 68px; width: auto; border-radius: 14px; margin-bottom: 12px; }
.ui-login h1    { font-size: 26px; font-weight: 800; margin: 0 0 4px; color: #0f172a; }
.ui-login .text-muted    { color: #64748b !important; font-size: 13.5px; }
.ui-login .form-group label { font-size: 13px; font-weight: 600; color: #475569; }
.ui-login .btn-success.ui-btn-primary {
  padding: 12px !important;
  font-size: 15px !important;
  letter-spacing: .3px;
  border-radius: 12px !important;
  margin-top: 4px;
}
.ui-login-help  { text-align: center; margin-top: 14px; color: #94a3b8; }
.ui-remember    { margin: 12px 0; }
.ui-remember label { color: #475569 !important; font-weight: 500 !important; font-size: 13px; }

/* ---------------------------
   Responsivo
   --------------------------- */
@media (max-width: 767px) {
  .ui-page    { padding-top: 72px; }
  .ui-content { border-radius: 10px; padding: 12px; }
  .dp-hero    { padding: 16px; }
  .dp-hero h2 { font-size: 18px; }
  .ui-login   { padding: 16px; }
  .ui-login-card { padding: 24px 18px 18px; border-radius: 18px !important; }
}