/* =====================================================================
   DY Fiscal · Hoja de estilos principal
   Identidad: azul marino profundo + cian eléctrico sobre fondo claro.
   ===================================================================== */
:root {
  --navy: #0A1F44;
  --navy-dark: #061431;
  --cyan: #22E0FF;
  --blue: #1B6FE8;
  --blue-soft: #E7F0FD;
  --bg: #F3F7FB;
  --card: #FFFFFF;
  --text: #14203A;
  --muted: #6B7A99;
  --border: #E3EAF3;
  --success: #16A34A;
  --success-soft: #E6F7EC;
  --warning: #E9A400;
  --warning-soft: #FFF6DB;
  --danger: #E5484D;
  --danger-soft: #FDECEC;
  --info: #1B6FE8;
  --info-soft: #E7F0FD;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(10, 31, 68, 0.06);
  --shadow-hover: 0 10px 32px rgba(10, 31, 68, 0.12);
  --sidebar-w: 264px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.01em; color: var(--navy); }
small, .small { font-size: 0.86rem; }
.text-muted { color: var(--muted) !important; }
.text-navy { color: var(--navy) !important; }
.text-cyan { color: var(--cyan) !important; }
.fw-600 { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- Estructura */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .25s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.sidebar-brand { padding: 26px 22px 14px; text-align: center; }
.sidebar-brand img { width: 128px; max-width: 70%; height: auto; filter: drop-shadow(0 6px 18px rgba(34, 224, 255, .25)); }
.sidebar-brand .tagline {
  margin-top: 10px;
  font-size: 0.66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
}
.sidebar-nav { padding: 8px 14px; flex: 1; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.78);
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 1rem; color: rgba(255,255,255,.6); }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(34, 224, 255, .12); color: #fff; }
.sidebar-nav .nav-link.active i { color: var(--cyan); }
.sidebar-nav .nav-link.active::before {
  content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cyan);
}
.sidebar-nav .nav-sub { padding-left: 30px; display: none; }
.sidebar-nav .nav-group.open .nav-sub { display: block; }
.sidebar-nav .nav-sub .nav-link { padding: 8px 14px; font-size: 0.88rem; }
.sidebar-nav .nav-sub .nav-link::before { display: none; }
.sidebar-nav .nav-link .chev { margin-left: auto; font-size: .75rem; transition: transform .2s; }
.sidebar-nav .nav-group.open .chev { transform: rotate(180deg); }
.sidebar-nav .badge-count { margin-left: auto; background: var(--cyan); color: var(--navy); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.sidebar-note {
  margin: 10px 18px 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(34,224,255,.18);
  font-size: .8rem;
  color: rgba(255,255,255,.75);
  line-height: 1.45;
}
.sidebar-note i { color: var(--cyan); margin-right: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 22px 28px 32px; flex: 1; }

/* ------------------------------------------------------------ Topbar */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .greeting h1 { font-size: 1.32rem; margin: 0; }
.topbar .greeting p { margin: 0; color: var(--muted); font-size: .88rem; }
.topbar .spacer { flex: 1; }
.search-pill { position: relative; }
.search-pill input {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 9px 16px 9px 40px;
  width: 260px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.search-pill input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27,111,232,.12); background: #fff; }
.search-pill i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; position: relative; font-size: 1rem;
}
.icon-btn:hover { background: var(--bg); color: var(--navy); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.user-chip:hover { background: var(--bg); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto; }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.user-chip .name { font-weight: 600; font-size: .88rem; line-height: 1.1; }
.user-chip .role { font-size: .72rem; color: var(--muted); }
.topbar .date { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.header-words { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 14px; }
.burger { display: none; }

.notif-menu { width: 360px; max-width: 92vw; padding: 0; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-hover); border-radius: 14px; }
.notif-menu .head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.notif-menu .item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: .85rem; }
.notif-menu .item:hover { background: var(--bg); }
.notif-menu .item.unread { background: #F8FBFF; }
.notif-menu .item .t { font-weight: 600; font-size: .86rem; }
.notif-menu .item .m { color: var(--muted); font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-menu .foot { padding: 10px 16px; text-align: center; font-size: .85rem; }
.lvl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.lvl-danger { background: var(--danger); } .lvl-warning { background: var(--warning); } .lvl-info { background: var(--info); } .lvl-success { background: var(--success); }

/* ------------------------------------------------------------- Cards */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 16px 22px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.card-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px 22px; }
.card-title { font-size: 1.02rem; margin: 0; }
.card-sub { color: var(--muted); font-size: .84rem; margin: 2px 0 0; font-weight: 400; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.kpi {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 132px; position: relative; overflow: hidden;
}
.kpi .top { display: flex; align-items: center; gap: 12px; }
.kpi .tile { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), #4C93F5); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; flex: 0 0 auto; box-shadow: 0 6px 14px rgba(27,111,232,.28); }
.kpi .tile.navy { background: linear-gradient(135deg, var(--navy), #1E3A70); }
.kpi .tile.cyan { background: linear-gradient(135deg, #12B6D4, var(--cyan)); color: var(--navy); }
.kpi .tile.green { background: linear-gradient(135deg, #12924A, #34C36F); }
.kpi .tile.orange { background: linear-gradient(135deg, #D98A00, #F5B93C); }
.kpi .tile.red { background: linear-gradient(135deg, #C93A40, #F06A6F); }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 500; line-height: 1.2; }
.kpi .value { font-size: 1.38rem; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; line-height: 1.1; }
.kpi .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.kpi .delta { font-size: .74rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.kpi .delta.up { background: var(--success-soft); color: var(--success); }
.kpi .delta.down { background: var(--danger-soft); color: var(--danger); }
.kpi .spark { width: 78px; height: 30px; flex: 0 0 auto; }
.kpi .spark path { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi .spark .area { fill: rgba(27,111,232,.12); stroke: none; }

.stat { padding: 14px 16px; border-radius: 12px; background: var(--bg); }
.stat .l { font-size: .78rem; color: var(--muted); }
.stat .v { font-size: 1.15rem; font-weight: 700; color: var(--navy); }

/* ---------------------------------------------------------- Semáforo */
.semaforo-hero { display: flex; align-items: center; gap: 18px; padding: 6px 0; }
.semaforo-light { width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; flex: 0 0 auto; }
.semaforo-light.success { background: var(--success); box-shadow: 0 0 0 10px var(--success-soft); }
.semaforo-light.warning { background: var(--warning); box-shadow: 0 0 0 10px var(--warning-soft); }
.semaforo-light.danger { background: var(--danger); box-shadow: 0 0 0 10px var(--danger-soft); }
.semaforo-light.secondary { background: #A7B1C6; box-shadow: 0 0 0 10px #EEF1F6; }
.semaforo-light.lg { width: 110px; height: 110px; font-size: 3rem; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.check-list li:last-child { border-bottom: 0; }
.check-list i { margin-top: 4px; }

/* ----------------------------------------------------------- Badges */
.badge-status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: #A36F00; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-secondary { background: #EEF1F6; color: var(--muted); }
.badge-info { background: var(--info-soft); color: var(--blue); }
.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: .78rem; font-weight: 600; margin: 0 6px 6px 0; }
.chip.navy { background: var(--navy); color: #fff; }
.chip.warn { background: var(--warning-soft); color: #A36F00; }

/* ------------------------------------------------------------ Tablas */
.table { --bs-table-color: var(--text); margin-bottom: 0; font-size: .9rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); padding: 10px 12px; background: #FAFCFE; white-space: nowrap; }
.table tbody td { padding: 11px 12px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #F8FBFF; }
.table tfoot td { font-weight: 700; background: #FAFCFE; border-top: 2px solid var(--border); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .btn { padding: 4px 8px; }
.client-cell { display: flex; align-items: center; gap: 10px; }
.client-cell .n { font-weight: 600; line-height: 1.15; }
.client-cell .s { font-size: .78rem; color: var(--muted); }
div.dataTables_wrapper .dataTables_filter input { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; margin-left: 8px; }
div.dataTables_wrapper .dataTables_length select { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; }
div.dataTables_wrapper .dataTables_info, div.dataTables_wrapper .dataTables_paginate { font-size: .85rem; color: var(--muted); padding-top: 12px; }
.dataTables_wrapper .pagination .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--border); color: var(--navy); }
.dataTables_wrapper .pagination .page-item.active .page-link { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------------ Botones */
.btn { border-radius: 10px; font-weight: 600; padding: 8px 16px; font-size: .9rem; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: #155CC4; border-color: #155CC4; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-cyan { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.btn-cyan:hover { background: #0FCCEB; color: var(--navy); }
.btn-outline-primary { border-color: var(--blue); color: var(--blue); }
.btn-outline-primary:hover { background: var(--blue); }
.btn-light { background: #fff; border-color: var(--border); color: var(--navy); }
.btn-light:hover { background: var(--bg); }
.btn-sm { padding: 5px 11px; font-size: .82rem; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: .76rem; border-radius: 7px; }

/* -------------------------------------------------------- Formularios */
.form-label { font-weight: 600; font-size: .85rem; color: var(--navy); margin-bottom: 4px; }
.form-control, .form-select { border-radius: 10px; border: 1px solid var(--border); padding: 9px 12px; font-size: .92rem; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27,111,232,.12); }
.form-text { color: var(--muted); font-size: .78rem; }
.input-group-text { border-radius: 10px; border-color: var(--border); background: var(--bg); color: var(--muted); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.totals-box { background: var(--bg); border-radius: 12px; padding: 14px 18px; }
.totals-box .row-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: .9rem; }
.totals-box .row-line.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.dropzone { border: 2px dashed #BFD0E6; border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); background: #FAFCFE; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.dropzone i { font-size: 1.6rem; color: var(--blue); }

/* --------------------------------------------------------- Utilidades */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.35rem; }
.page-head .sub { color: var(--muted); font-size: .88rem; margin: 2px 0 0; }
.page-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.year-select { min-width: 110px; border-radius: 999px !important; padding: 7px 34px 7px 14px !important; font-weight: 600; background-color: #fff; }
.disclaimer { display: flex; gap: 10px; align-items: flex-start; background: #FFFBEB; border: 1px solid #FCE7A8; color: #7A5B00; border-radius: 12px; padding: 12px 16px; font-size: .82rem; line-height: 1.45; }
.disclaimer i { margin-top: 2px; }
.progress { height: 10px; border-radius: 999px; background: #E8EEF6; }
.progress-bar { border-radius: 999px; background: var(--blue); }
.progress-bar.bg-cyan { background: var(--cyan); }
.progress-bar.bg-navy { background: var(--navy); }
.scenario { border-radius: 14px; padding: 18px 20px; height: 100%; }
.scenario.actual { background: var(--bg); border: 1px solid var(--border); }
.scenario.plan { background: linear-gradient(135deg, #EAF4FF, #F3FBFF); border: 1px solid #CFE3FA; }
.scenario h5 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.scenario .line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.scenario .line:last-child { border-bottom: 0; }
.scenario .line strong { font-variant-numeric: tabular-nums; }
.scenario .line.big { font-size: 1.15rem; color: var(--navy); }
.finding { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; font-size: .88rem; }
.finding.info { background: var(--info-soft); color: #144A9C; }
.finding.warning { background: var(--warning-soft); color: #7A5B00; }
.finding.danger { background: var(--danger-soft); color: #A12B2F; }
.finding.success { background: var(--success-soft); color: #0F6E32; }
.finding i { margin-top: 3px; }
.alert-card { display: flex; gap: 14px; padding: 16px 18px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); margin-bottom: 12px; border-left: 5px solid var(--border); }
.alert-card.danger { border-left-color: var(--danger); } .alert-card.warning { border-left-color: var(--warning); } .alert-card.info { border-left-color: var(--info); } .alert-card.success { border-left-color: var(--success); }
.alert-card.read { opacity: .7; }
.alert-card .t { font-weight: 700; color: var(--navy); }
.alert-card .m { font-size: .88rem; color: var(--text); }
.alert-card .meta { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); white-space: nowrap; min-width: 120px; }
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { border: 0; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 3px solid transparent; }
.nav-tabs .nav-link.active { color: var(--navy); border-bottom-color: var(--cyan); background: transparent; }
.settings-nav .list-group-item { border: 0; border-radius: 10px !important; margin-bottom: 4px; font-weight: 500; color: var(--text); }
.settings-nav .list-group-item.active { background: var(--navy); color: #fff; }
.settings-nav .list-group-item i { width: 22px; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty i { font-size: 2rem; color: #BFD0E6; margin-bottom: 8px; display: block; }
.bracket-row td { padding: 4px 6px !important; }
.bracket-row input { padding: 5px 8px; font-size: .85rem; }
.chart-box { position: relative; width: 100%; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ------------------------------------------------------ Footer marca */
.brand-footer {
  margin: 0 28px 28px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--navy) 0%, #0F2E66 60%, #0B2554 100%);
  color: #fff;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.brand-footer::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(34,224,255,.35), transparent 70%); }
.brand-footer img { width: 64px; }
.brand-footer .motto { font-size: 1.35rem; font-weight: 700; color: var(--cyan); margin: 0; letter-spacing: -0.01em; }
.brand-footer .motto-sub { margin: 2px 0 0; color: rgba(255,255,255,.85); }
.brand-footer .purpose { margin-left: auto; color: rgba(255,255,255,.7); font-style: italic; font-size: .9rem; position: relative; z-index: 1; }
.copyright { text-align: center; color: var(--muted); font-size: .78rem; padding: 0 28px 18px; }

/* ------------------------------------------------------------ Login */
.auth-body { min-height: 100vh; display: flex; background: var(--bg); }
.auth-side {
  flex: 0 0 46%;
  background: radial-gradient(circle at 20% 20%, rgba(34,224,255,.18), transparent 45%), linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px 64px; position: relative; overflow: hidden;
}
.auth-side img { width: 170px; }
.auth-side h1 { color: #fff; font-size: 2rem; margin: 26px 0 8px; }
.auth-side .lead { color: rgba(255,255,255,.8); font-size: 1.02rem; max-width: 440px; }
.auth-side .words { margin-top: 40px; font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--cyan); font-weight: 600; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; color: rgba(255,255,255,.85); }
.auth-side ul li { padding: 6px 0; display: flex; gap: 10px; align-items: center; }
.auth-side ul li i { color: var(--cyan); }
.auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-hover); padding: 40px 38px; }
.auth-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.auth-card .form-control { padding: 12px 14px 12px 42px; }
.auth-card .field { position: relative; }
.auth-card .field i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.auth-card .btn-primary { width: 100%; padding: 12px; font-size: .95rem; letter-spacing: .04em; }
.auth-card .links { display: flex; justify-content: space-between; margin-top: 16px; font-size: .86rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 22px; }

/* -------------------------------------------------------- Impresión */
@media print {
  .sidebar, .topbar, .brand-footer, .no-print, .dataTables_filter, .dataTables_length, .dataTables_paginate, .dataTables_info { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff; }
}

/* -------------------------------------------------------- Responsive */
@media (max-width: 1199.98px) {
  .search-pill input { width: 200px; }
  .topbar .date { display: none; }
}
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(6,20,49,.55); z-index: 1029; }
  .sidebar-backdrop.show { display: block; }
  .burger { display: inline-flex; }
  .content { padding: 18px 16px 24px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .brand-footer { margin: 0 16px 20px; flex-direction: column; align-items: flex-start; }
  .brand-footer .purpose { margin-left: 0; }
  .search-pill { display: none; }
  .user-chip .name, .user-chip .role { display: none; }
  .auth-side { display: none; }
}
@media (max-width: 575.98px) {
  html { font-size: 14px; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .kpi { min-height: 118px; }
  .kpi .value { font-size: 1.15rem; }
  .page-head .tools { margin-left: 0; width: 100%; }
  .auth-card { padding: 30px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------- Inteligencia artificial */
.ai-card { border: 1px solid #CFE8FF; background: linear-gradient(180deg, #FBFDFF 0%, #fff 60%); }
.ai-card .card-header { border-bottom-color: #E3F1FF; }
.ai-icon { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: var(--cyan); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 1rem; box-shadow: 0 6px 14px rgba(27,111,232,.25); }
.ai-body p { margin-bottom: .6rem; }
.ai-h { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }
.ai-list { list-style: none; padding: 0; margin: 0; }
.ai-list li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.ai-list li:last-child { border-bottom: 0; }
.ai-list li i { margin-top: 4px; width: 16px; text-align: center; flex: 0 0 auto; }
.ai-loading { display: flex; align-items: center; gap: 12px; padding: 18px 6px; color: var(--muted); }
.ai-loading .bar { flex: 1; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #E8EEF6, #CFE8FF, #E8EEF6); background-size: 200% 100%; animation: aiShimmer 1.4s linear infinite; }
@keyframes aiShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ai-snippet { background: #F3FBFF; border: 1px solid #CFE8FF; border-radius: 12px; padding: 10px 14px; }
.csf-summary { background: var(--success-soft); border: 1px solid #BFE8CC; border-radius: 12px; padding: 12px 16px; font-size: .86rem; }
.csf-summary.warn { background: var(--warning-soft); border-color: #FCE7A8; }
.csf-summary ul { margin: 6px 0 0; padding-left: 18px; }
.ai-card .card-header { gap: 12px; }
.ai-card .card-header > div:not(.actions) { flex: 1 1 auto; min-width: 0; }
.ai-card .card-header .actions { flex: 0 0 auto; }
