:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary2: #16a34a;
  --accent: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 16px;
  --shadow: 0 14px 34px rgba(15,23,42,.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.app {
  min-height: 100vh;
  display: block;
  width: 100%;
  overflow-x: hidden;
}

.app-layout {
  min-height: 100vh;
  display: block;
  width: 100%;
  overflow-x: hidden;
}

.main {
  margin-left: 260px;
  padding: 28px 32px;
  min-height: 100vh;
  width: calc(100% - 260px);
  background: #f5f7fb !important;
}

.main-content {
  margin-left: 260px;
  padding: 28px 32px;
  min-height: 100vh;
  width: calc(100% - 260px);
  position: relative;
  z-index: 1;
}

@media (max-width: 920px) {
  .main,
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 18px;
  }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

@media (max-width: 920px) {
  .sidebar {
    position: relative;
    width: 100%;
    inset: auto;
    border-right: none;
    box-shadow: none;
  }
}

.sidebar__brand {
  padding: 22px 18px;
  background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
  color: #fff;
}

.sidebar__brand h1 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.sidebar__brand p {
  margin-top: 4px;
  font-size: 13px;
  opacity: .92;
}

.sidebar__user {
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.user__meta .name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.user__meta .mail {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.sidebar__nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #0f172a;
  font-size: 14px;
  transition: all .18s ease;
}

.navlink svg {
  width: 18px;
  height: 18px;
  color: #334155;
}

.navlink:hover {
  background: #f1f5f9;
  transform: translateX(2px);
}

.navlink.active {
  background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
  color: #fff;
}

.navlink.active svg {
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  min-width: 20px;
  height: 18px;
  margin-left: auto;
}

.pill.blue {
  background: #2563eb;
}

.pill-danger {
  background: #ef4444;
}

.pill-warning {
  background: #f59e0b;
}

.pill-info {
  background: #3b82f6;
}

.pill-success {
  background: #10b981;
}

.sidebar__footer {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid #eef2f7;
}

.logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #dc2626;
  transition: .18s ease;
}

.logout:hover {
  background: #fee2e2;
}

.page-header {
  margin-bottom: 18px;
}

.page-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.3px;
  color: #1f2937 !important;
}

.page-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: 14px;
}

.stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

@media (max-width: 980px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

.stat {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid transparent;
}

.stat.blue {
  border-left-color: #3b82f6;
}

.stat.yellow {
  border-left-color: #f59e0b;
}

.stat.red {
  border-left-color: #ef4444;
}

.stat .label {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 700;
}

.stat .value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
}

.ico {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.ico.blue {
  background: #dbeafe;
  color: #2563eb;
}

.ico.yellow {
  background: #fef3c7;
  color: #ca8a04;
}

.ico.red {
  background: #fee2e2;
  color: #dc2626;
}

.ico svg {
  width: 22px;
  height: 22px;
}

.section {
  margin-top: 18px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  padding: 18px;
  border: 1px solid #e5e7eb;
}

.section h2 {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 12px;
}

.empty {
  text-align: center;
  color: #64748b;
  padding: 18px 0;
  font-size: 13.5px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #e5e7eb;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
  text-align: left;
}

.table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 900;
}

.table tr:last-child td {
  border-bottom: none;
}

.overlay-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2,6,23,.55);
  backdrop-filter: blur(10px);
  z-index: 999;
}

.overlay-gate.show {
  display: flex;
}

.gate-box {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.gate-head {
  padding: 18px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(22,163,74,.10));
}

.gate-title {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.gate-sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: #475569;
  line-height: 1.45;
}

.gate-mid {
  padding: 14px 18px 6px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.progressRing {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #0f172a;
}

.kpiBar {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  width: min(420px, 100%);
}

.kpiFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #2563eb, #16a34a);
  transition: width .25s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  color: #334155;
}

.badge-ok {
  background: rgba(22,163,74,.10);
  border-color: rgba(22,163,74,.25);
  color: #166534;
}

.badge-danger {
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.25);
  color: #991b1b;
}

.badge-warn {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.28);
  color: #92400e;
}

.gate-list {
  list-style: none;
  padding: 0 18px 14px;
  display: grid;
  gap: 10px;
}

.gate-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.gate-item.missing {
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.05);
}

.gate-actions {
  padding: 16px 18px;
  border-top: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all .2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: #fff;
  color: #0f172a;
}

.btn-ghost:hover {
  background: #f1f5f9;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: transparent;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid;
}

.chip.info {
  background: rgba(59,130,246,.10);
  border-color: rgba(59,130,246,.30);
  color: #1e40af;
}

.chip.ok {
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.30);
  color: #15803d;
}

.chip.warn {
  background: rgba(245,158,11,.10);
  border-color: rgba(245,158,11,.30);
  color: #92400e;
}

.chip.danger,
.chip.bad {
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.30);
  color: #991b1b;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 3px solid;
}

.timeline-dot.ok {
  background: #22c55e;
  border-color: #86efac;
}

.timeline-dot.warn {
  background: #f59e0b;
  border-color: #fcd34d;
}

.timeline-dot.danger {
  background: #ef4444;
  border-color: #fca5a5;
}

.timeline-card {
  flex: 1;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 16px;
}

.urgency-bar {
  margin-top: 12px;
  height: 6px;
  background: rgba(255,255,255,.10);
  border-radius: 999px;
  overflow: hidden;
}

.urgency-fill {
  height: 100%;
  transition: width .3s ease;
  border-radius: 999px;
}

.urgency-fill.ok {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.urgency-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.urgency-fill.danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.modal-bg {
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  border: 1px solid #e5e7eb;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border .2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

input[type="file"].input {
  padding: 8px;
  font-size: 13px;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 32px;
}

@media (max-width: 920px) {
  .container {
    padding: 18px;
  }
}

.back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 900;
  color: #2563eb;
}

.sub {
  margin: 6px 0 18px;
  font-size: 14px;
  color: #64748b;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.overflow-x-auto {
  overflow-x: auto;
}

.hourglass {
  width: 40px;
  height: 40px;
  position: relative;
  animation: hourglass-rotate 2s infinite ease-in-out;
}

.hourglass svg {
  width: 100%;
  height: 100%;
  fill: #7c5cff;
}

@keyframes hourglass-rotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

.pl-shadow-soft { box-shadow: 0 10px 20px rgba(0,0,0,.06); }
.pl-card { border-radius: 0.75rem; }
.pl-border { border: 1px solid rgba(17,24,39,.08); }
.pl-muted { color: #6b7280; }
.pl-textarea-xl {
  min-height: 280px;
  resize: vertical;
  line-height: 1.35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}
.pl-preview {
  border: 1px dashed rgba(17,24,39,.18);
  border-radius: 0.75rem;
  background: #fff;
  padding: 14px;
  overflow: auto;
}
.pl-badge{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.15rem .55rem;
  border-radius:9999px;
  font-size:.75rem;
  font-weight:600;
}
.pl-badge-ok{ background:#dcfce7; color:#166534; border:1px solid #86efac; }
.pl-badge-warn{ background:#fef9c3; color:#854d0e; border:1px solid #fde047; }
.pl-badge-err{ background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }

.bg-hero-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
}
.gradient-primary {
  background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
}
.hero-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.fade-in {
  animation: fadeIn .6s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px) }
  to   { opacity: 1; transform: translateY(0) }
}
.glass {
  backdrop-filter: blur(18px);
  background: rgba(255,255,255,0.92);
}
.attempts-bar {
  height: 4px;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
}
.attempts-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width .4s ease, background-color .4s ease;
}
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}
.blocked-pulse {
  animation: pulse-red 1.5s ease-in-out infinite;
}
.fade {
  animation: fadeSlide 0.5s ease-in-out;
}
@keyframes fadeSlide {
  from {opacity:0; transform: translateY(20px);}
  to {opacity:1; transform: translateY(0);}
}
.modal-show {
  animation: zoom 0.3s ease-out;
}
@keyframes zoom {
  from {opacity:0; transform: scale(0.7);}
  to {opacity:1; transform: scale(1);}
}
.tab-btn {
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}
.tab-btn.active {
  color: white;
}
.tab-indicator {
  position: absolute;
  height: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  border-radius: 9999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6);
  z-index: 9999;
  transition: width 0.3s ease;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.5);
}
@keyframes progressAnimation {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}
.progress-bar.active {
  animation: progressAnimation 2s ease-in-out;
}
.btn-submit {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(0.98);
}
.btn-submit:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.btn-submit:not(:disabled):active {
  transform: translateY(0);
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-dni {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(59,130,246,0.3);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.sidebar-asesor {
  width: 260px;
  min-width: 240px;
  max-width: 280px;
  background: #fff;
  border-right: 1px solid #ddd;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  z-index: 1000;
  transition: left 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
}

.sidebar-logo-icon {
  font-size: 2rem;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: bold;
}

.sidebar-menu {
  padding: 1rem 0;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.sidebar-item:hover {
  background: #f3f4f6;
  color: #2563eb;
}

.sidebar-item.active {
  background: #e0f2fe;
  color: #0284c7;
  border-left: 3px solid #0284c7;
}

.sidebar-item-icon {
  font-size: 1.5rem;
}

.sidebar-item-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
  animation: pulse 2s infinite;
}

.sidebar-badge.badge-success {
  background: #22c55e;
}

.sidebar-badge.badge-warning {
  background: #f59e0b;
}

.sidebar-badge.badge-info {
  background: #3b82f6;
}

.sidebar-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1rem;
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.sidebar-user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.sidebar-user-info {
  flex: 1;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.sidebar-user-status {
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #22c55e;
}

@media (max-width: 768px) {
  .sidebar-asesor {
    left: -100%;
  }

  .sidebar-asesor.open {
    left: 0;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 998;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.2s;
}

.mobile-menu-btn:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

.page-content {
  margin-left: 260px;
  min-width: 0;
}

@media (max-width: 768px) {
  .page-content {
    margin-left: 0 !important;
  }
}
nav.bg-white { margin-left: 260px; }
@media (max-width: 768px) { nav.bg-white { margin-left: 0; } }

body, .main, p, span, div, label, .page-title, .page-sub {
  color: #1f2937 !important;
}

.tipo-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tipo-card:hover {
  border-color: #7c5cff;
  background: #f9fafb;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.2);
}

.tipo-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.badge-reutiliza {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white !important;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 20px;
  margin-top: 10px;
}

.tipo-card.tipo-card-bloqueada {
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #e2e8f0;
  filter: grayscale(1);
  opacity: 0.6;
  box-shadow: none;
}

.tipo-card.tipo-card-bloqueada:hover {
  border-color: #e2e8f0;
  background: #f1f5f9;
  transform: none;
  box-shadow: none;
}

.badge-bloqueado {
  display: inline-block;
  padding: 6px 14px;
  background: #94a3b8;
  color: white !important;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 20px;
  margin-top: 10px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827 !important;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280 !important;
  cursor: pointer;
}

.modal-body {
  padding: 24px 30px 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151 !important;
  margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  color: #111827 !important;
  background: #FFFFFF;
  box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: #6b7280 !important;
  margin-top: 6px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding-top: 24px;
}

.btn-cancel {
  flex: 1;
  padding: 12px 24px;
  border: 1px solid #d1d5db;
  background: #FFFFFF;
  color: #374151 !important;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
}

.btn-submit {
  flex: 1;
  padding: 12px 24px;
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
  color: #FFFFFF !important;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
}

.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.file-upload-area:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.file-upload-area.has-file {
  border-color: #10b981;
  background: #d1fae5;
  padding: 20px;
}

.file-upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: #9ca3af;
}

.file-upload-text {
  font-weight: 600;
  color: #374151 !important;
  margin-bottom: 4px;
}

.file-upload-hint {
  font-size: 0.8rem;
  color: #9ca3af !important;
}

.file-preview-container {
  display: none;
  margin-top: 12px;
}

.file-preview-container.active {
  display: block;
}

.file-preview {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.file-preview-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-weight: 600;
  color: #111827 !important;
  font-size: 0.9rem;
  margin-bottom: 4px;
  word-break: break-all;
}

.file-preview-size {
  font-size: 0.75rem;
  color: #6b7280 !important;
}

.file-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ef4444;
  color: white !important;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  transition: all 0.2s;
  flex-shrink: 0;
}

.file-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.multiple-files-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.multiple-file-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: white;
}

.multiple-file-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.multiple-file-item .file-remove {
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  font-size: 1rem;
}

.file-count-badge {
  display: inline-block;
  background: #3b82f6;
  color: white !important;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
  }

  .modal-content {
    max-height: calc(100vh - 20px);
    margin: 10px 0;
    border-radius: 16px;
  }

  .modal-header {
    padding: 20px;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .modal-body {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
  }

  .btn-cancel, .btn-submit {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-title {
    font-size: 1.5rem;
  }

  .tipo-card {
    padding: 20px;
  }

  .tipo-icon {
    font-size: 2.5rem;
  }

  .multiple-files-preview {
    grid-template-columns: repeat(2, 1fr);
  }

  .file-upload-area {
    padding: 24px 16px;
  }

  .file-preview {
    padding: 12px;
  }

  .file-preview-image {
    width: 60px;
    height: 60px;
  }
}

.banner-documentacion {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 16px;
  margin-bottom: 24px;
  animation: slideIn 0.4s ease-out;
}

.banner-preaprobado {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 2px solid #10b981;
  border-radius: 16px;
  margin-bottom: 24px;
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.banner-content {
  flex: 1;
}

.banner-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #78350f !important;
  margin-bottom: 6px;
}

.banner-preaprobado .banner-title {
  color: #065f46 !important;
}

.banner-message {
  font-size: 0.95rem;
  color: #92400e !important;
  line-height: 1.5;
}

.banner-preaprobado .banner-message {
  color: #047857 !important;
}

.banner-action {
  flex-shrink: 0;
}

.banner-btn {
  display: inline-block;
  padding: 12px 24px;
  background: #f59e0b;
  color: #000 !important;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}

.banner-btn:hover {
  background: #fbbf24;
  transform: translateY(-2px);
}

.banner-btn.green {
  background: #10b981;
  color: #fff !important;
}

.banner-btn.green:hover {
  background: #059669;
}

.mensaje-sistema {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.4s ease-out;
}

.mensaje-sistema.exito {
  background: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46 !important;
}

.mensaje-sistema.error {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #991b1b !important;
}

.notificaciones-container {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 360px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  border-left: 4px solid #7c5cff;
  animation: slideInRight 0.3s ease-out;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.notif-card:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.notif-card.success { border-left-color: #10b981; }
.notif-card.warning { border-left-color: #f59e0b; }
.notif-card.error { border-left-color: #ef4444; }
.notif-card.info { border-left-color: #3b82f6; }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notif-header {
  display: flex;
  align-items: start;
  gap: 12px;
  margin-bottom: 8px;
}

.notif-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
}

.notif-title {
  font-weight: 700;
  color: #1f2937 !important;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.notif-message {
  font-size: 0.85rem;
  color: #6b7280 !important;
  line-height: 1.4;
}

.notif-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.notif-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.notif-action {
  margin-top: 12px;
}

.notif-btn {
  display: inline-block;
  padding: 6px 14px;
  background: #7c5cff;
  color: white !important;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.notif-btn:hover {
  background: #6a4de8;
}

.notif-time {
  font-size: 0.75rem;
  color: #9ca3af !important;
  margin-top: 8px;
}

.banner-afiliado {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #fce7f3, #fdf2f8);
  border: 2px solid #ec4899;
  border-radius: 16px;
  margin-bottom: 24px;
  animation: slideIn 0.4s ease-out;
}
.banner-afiliado .banner-title   { color: #831843 !important; }
.banner-afiliado .banner-message { color: #9d174d !important; }
.banner-btn.pink { background: #ec4899; color: #fff !important; }
.banner-btn.pink:hover { background: #db2777; }

.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:2000; align-items:center; justify-content:center; }
.modal-overlay.active { display:flex; }
.modal-box { background:#fff; border-radius:16px; padding:32px; max-width:440px; width:calc(100% - 40px); box-shadow:0 20px 60px rgba(0,0,0,.3); animation:slideIn .3s ease-out; }
.modal-box h3 { font-size:1.2rem; font-weight:700; color:#1f2937 !important; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.modal-cuotas-selector { display:flex; align-items:center; gap:12px; margin:20px 0; }
.modal-cuotas-selector label { font-size:.9rem; font-weight:600; color:#374151 !important; flex-shrink:0; }
.modal-cuotas-selector input[type=range] { flex:1; accent-color:#ec4899; }
.modal-cuotas-value { font-size:1.4rem; font-weight:800; color:#ec4899 !important; min-width:32px; text-align:center; }
.modal-monto-total { text-align:center; padding:16px; background:#fdf2f8; border-radius:12px; margin-bottom:20px; }
.modal-monto-total span { display:block; font-size:.85rem; color:#9d174d !important; margin-bottom:4px; }
.modal-monto-total strong { font-size:2rem; font-weight:900; color:#831843 !important; }
.modal-actions { display:flex; gap:12px; }
.btn-pagar-afiliado { flex:1; padding:14px; background:linear-gradient(135deg,#ec4899,#db2777); color:#fff !important; font-size:1rem; font-weight:700; border:none; border-radius:12px; cursor:pointer; transition:all .2s; display:flex; align-items:center; justify-content:center; gap:8px; }
.btn-pagar-afiliado:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 6px 20px rgba(236,72,153,.4); }
.btn-pagar-afiliado:disabled { opacity:.6; cursor:not-allowed; }
.btn-cancelar-modal { padding:14px 20px; background:#f3f4f6; color:#374151 !important; font-size:1rem; font-weight:600; border:none; border-radius:12px; cursor:pointer; transition:background .2s; }
.btn-cancelar-modal:hover { background:#e5e7eb; }
.msg-pago-error { margin-top:12px; padding:10px 14px; background:#fee2e2; border-radius:8px; color:#991b1b !important; font-size:.875rem; display:none; }

.estado-prestamo {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.estado-prestamo.pendiente { background: #fef3c7; color: #92400e !important; }
.estado-prestamo.aprobado { background: #d1fae5; color: #065f46 !important; }
.estado-prestamo.activo { background: #d1fae5; color: #065f46 !important; }
.estado-prestamo.rechazado { background: #fee2e2; color: #991b1b !important; }
.estado-prestamo.contraoferta {
  background: linear-gradient(135deg, #a78bfa, #c4b5fd);
  color: #5b21b6 !important;
  animation: pulse-estado 2s infinite;
}

@keyframes pulse-estado {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.tipo-prestamo {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(124, 92, 255, 0.15);
  color: #7c5cff !important;
  border: 1px solid rgba(124, 92, 255, 0.3);
  white-space: nowrap;
}

.tipo-prestamo.prendario {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6 !important;
  border-color: rgba(59, 130, 246, 0.3);
}

.tipo-prestamo.empeno {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-solicitar {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white !important;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  animation: pulse 2s infinite;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.btn-solicitar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-contraoferta {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, #7c5cff, #a78bfa);
  color: white !important;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  animation: pulse-purple 2s infinite;
  white-space: nowrap;
}

@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(124, 92, 255, 0); }
}

.btn-contraoferta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

.table tbody tr:hover {
  background: #f9fafb;
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@media (max-width: 768px) {
  .notificaciones-container {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    top: 70px;
    max-height: calc(100vh - 90px);
  }

  .notif-card {
    padding: 12px;
  }

  .notif-icon {
    font-size: 1.2rem;
  }

  .notif-title {
    font-size: 0.9rem;
  }

  .notif-message {
    font-size: 0.8rem;
  }

  .notif-btn {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .banner-documentacion,
  .banner-preaprobado {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }

  .banner-icon {
    font-size: 2rem;
  }

  .banner-title {
    font-size: 1.1rem;
  }

  .banner-message {
    font-size: 0.9rem;
  }

  .banner-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }

  .mensaje-sistema {
    flex-direction: column;
    text-align: center;
    padding: 12px 16px;
    gap: 8px;
  }

  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: block;
  }

  .table tbody tr {
    display: block;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: white;
  }

  .table tbody tr:hover {
    background: white;
  }

  .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    text-align: right;
  }

  .table tbody td:last-child {
    border-bottom: none;
    justify-content: center;
    padding-top: 12px;
  }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280 !important;
    text-align: left;
    flex: 0 0 40%;
  }

  .table tbody td:nth-child(1)::before { content: "ID"; }
  .table tbody td:nth-child(2)::before { content: "Tipo"; }
  .table tbody td:nth-child(3)::before { content: "Monto"; }
  .table tbody td:nth-child(4)::before { content: "Cuotas"; }
  .table tbody td:nth-child(5)::before { content: "Estado"; }
  .table tbody td:nth-child(6)::before { content: ""; }

  .estado-prestamo {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  .tipo-prestamo {
    font-size: 0.75rem;
    padding: 3px 8px;
  }

  .btn-solicitar,
  .btn-contraoferta {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
  }

  .section h2 {
    font-size: 1.2rem !important;
    margin-bottom: 16px !important;
  }

  .empty {
    font-size: 0.9rem !important;
    padding: 20px !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .banner-icon {
    font-size: 1.8rem;
  }

  .banner-title {
    font-size: 1rem;
  }

  .banner-message {
    font-size: 0.85rem;
  }

  .banner-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .notif-card {
    padding: 10px;
  }

  .notif-icon {
    font-size: 1rem;
  }

  .notif-title {
    font-size: 0.85rem;
  }

  .notif-message {
    font-size: 0.75rem;
  }

  .notif-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .section h2 {
    font-size: 1.1rem !important;
  }

  .btn-solicitar,
  .btn-contraoferta {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .estado-prestamo {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .tipo-prestamo {
    font-size: 0.7rem;
    padding: 2px 6px;
  }

  .table tbody td {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 0;
  }

  .table tbody td::before {
    flex: none;
    margin-bottom: 2px;
  }

  .table tbody td:last-child {
    align-items: stretch;
  }
}

.page-header{margin-bottom:2rem;}
.page-title{font-size:2rem;font-weight:800;color:#0f172a;margin-bottom:0.5rem;}
.page-sub{color:#64748b;font-size:1rem;}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1.5rem;margin-bottom:2rem;}
.stat-card{background:#fff;border-radius:16px;padding:1.5rem;box-shadow:0 1px 3px rgba(0,0,0,0.05);border:1px solid #e2e8f0;transition:all 0.2s;}
.stat-card:hover{box-shadow:0 4px 12px rgba(0,0,0,0.08);transform:translateY(-2px);}
.stat-label{font-size:0.875rem;font-weight:600;color:#64748b;margin-bottom:0.5rem;text-transform:uppercase;letter-spacing:0.5px;}
.stat-value{font-size:2.5rem;font-weight:800;}
.stat-value.blue{color:#3b82f6;}
.stat-value.red{color:#ef4444;}
.stat-value.green{color:#22c55e;}
.card{background:#fff;border-radius:16px;padding:2rem;box-shadow:0 1px 3px rgba(0,0,0,0.05);border:1px solid #e2e8f0;margin-bottom:2rem;}
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;}
.card-title{font-size:1.5rem;font-weight:700;color:#0f172a;display:flex;align-items:center;gap:0.5rem;}
.alert{padding:1rem 1.5rem;border-radius:12px;margin-bottom:1.5rem;display:flex;align-items:center;gap:0.75rem;font-weight:600;}
.alert.success{background:#dcfce7;border-left:4px solid #22c55e;color:#166534;}
.alert.error{background:#fee2e2;border-left:4px solid #ef4444;color:#991b1b;}
.chip{display:inline-flex;align-items:center;padding:0.25rem 0.75rem;border-radius:999px;font-size:0.75rem;font-weight:700;text-transform:uppercase;letter-spacing:0.5px;}
.chip.prestamo{background:#dbeafe;color:#1e40af;}
.chip.empeno{background:#fce7f3;color:#9f1239;}
.chip.prendario{background:#e9d5ff;color:#6b21a8;}
.chip.ok{background:#d1fae5;color:#065f46;}
.chip.warn{background:#fef3c7;color:#92400e;}
.chip.danger{background:#fee2e2;color:#991b1b;}
.chip.pending{background:#fed7aa;color:#9a3412;}
.cuota-card{background:#fff;border:2px solid #e2e8f0;border-radius:16px;padding:1.5rem;transition:all 0.3s;margin-bottom:1rem;}
.cuota-card:hover{border-color:#3b82f6;box-shadow:0 8px 24px rgba(59,130,246,0.15);transform:translateY(-2px);}
.cuota-card.danger{border-color:#fee2e2;background:linear-gradient(135deg,#fff 0%,#fef2f2 100%);}
.cuota-info{display:flex;justify-content:space-between;align-items:flex-start;gap:2rem;flex-wrap:wrap;}
.cuota-left h3{font-size:1.25rem;font-weight:700;color:#0f172a;margin-bottom:0.5rem;}
.cuota-left p{color:#64748b;font-size:0.875rem;margin-bottom:0.5rem;}
.cuota-meta{display:flex;gap:0.5rem;flex-wrap:wrap;margin-top:0.75rem;}
.cuota-right{text-align:right;}
.cuota-monto{font-size:2rem;font-weight:800;margin-bottom:0.5rem;}
.cuota-monto.danger{color:#ef4444;}
.cuota-monto.normal{color:#0f172a;}
.cuota-actions{display:flex;gap:0.75rem;margin-top:1rem;flex-wrap:wrap;justify-content:flex-end;}
.btn{display:inline-flex;align-items:center;gap:0.5rem;padding:0.75rem 1.5rem;border-radius:10px;font-weight:700;font-size:0.875rem;cursor:pointer;transition:all 0.2s;border:none;text-decoration:none;}
.btn-primary{background:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);color:#fff;box-shadow:0 4px 12px rgba(59,130,246,0.3);}
.btn-primary:hover{box-shadow:0 6px 20px rgba(59,130,246,0.4);transform:translateY(-2px);}
.btn-mobbex{background:linear-gradient(135deg,#7c5cff 0%,#6544e8 100%);color:#fff;box-shadow:0 4px 12px rgba(124,92,255,0.3);}
.btn-mobbex:hover{box-shadow:0 6px 20px rgba(124,92,255,0.4);transform:translateY(-2px);}
.btn-ghost{background:#f8fafc;color:#475569;border:2px solid #e2e8f0;}
.btn-ghost:hover{background:#e2e8f0;border-color:#cbd5e1;}
.urgency-bar{width:100%;height:8px;background:#f1f5f9;border-radius:999px;overflow:hidden;margin-top:1rem;}
.urgency-fill{height:100%;border-radius:999px;transition:width 0.5s cubic-bezier(0.4,0,0.2,1);}
.urgency-fill.ok{background:linear-gradient(90deg,#22c55e,#16a34a);}
.urgency-fill.warn{background:linear-gradient(90deg,#f59e0b,#d97706);}
.urgency-fill.danger{background:linear-gradient(90deg,#ef4444,#dc2626);}
.empty-state{text-align:center;padding:4rem 2rem;color:#94a3b8;}
.empty-state svg{width:80px;height:80px;margin:0 auto 1rem;opacity:0.3;}
table{width:100%;border-collapse:collapse;}
thead{background:#f8fafc;border-bottom:2px solid #e2e8f0;}
th{text-align:left;padding:1rem;font-weight:700;font-size:0.75rem;color:#64748b;text-transform:uppercase;letter-spacing:0.5px;}
td{padding:1rem;border-bottom:1px solid #f1f5f9;}
tr:hover{background:#f8fafc;}
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,0.6);backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;z-index:9999;padding:1rem;}
.modal-bg.active{display:flex;}
.modal{background:#fff;border-radius:24px;max-width:500px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,0.3);}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:2rem;border-bottom:1px solid #e2e8f0;}
.modal-title{font-size:1.5rem;font-weight:700;color:#0f172a;}
.modal-close{background:none;border:none;font-size:1.5rem;color:#94a3b8;cursor:pointer;padding:0.5rem;transition:color 0.2s;}
.modal-close:hover{color:#0f172a;}
.modal-body{padding:2rem;}
.form-group{margin-bottom:1.5rem;}
.form-label{display:block;margin-bottom:0.5rem;font-weight:700;color:#0f172a;font-size:0.875rem;}
.form-input{width:100%;padding:0.875rem 1rem;border:2px solid #e2e8f0;border-radius:10px;font-size:1rem;transition:all 0.2s;font-family:inherit;}
.form-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,0.1);}
.file-area{border:3px dashed #cbd5e1;border-radius:16px;padding:2rem;text-align:center;cursor:pointer;transition:all 0.3s;background:#f8fafc;}
.file-area:hover{border-color:#3b82f6;background:#eff6ff;}
.file-icon{font-size:3rem;margin-bottom:1rem;}
.file-text{font-weight:700;color:#0f172a;margin-bottom:0.25rem;}
.file-hint{font-size:0.875rem;color:#64748b;}
.modal-footer{display:flex;gap:1rem;margin-top:2rem;}
@media(max-width:768px){
.cuota-info{flex-direction:column;}
.cuota-right{text-align:left;}
.cuota-actions{justify-content:flex-start;}
.modal{max-width:95%;}
}
/* ===== ESTILOS QUE FALTAN EN EL BLOQUE GRANDE ===== */

.stat-value.gray {
  color: #94a3b8;
}

.stat-sub {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: .25rem;
}

.tbl-wrap {
  overflow-x: auto;
}

.badge-verde {
  background: #dcfce7;
  color: #166534;
}

.badge-rojo {
  background: #fee2e2;
  color: #991b1b;
}

.badge-azul {
  background: #dbeafe;
  color: #1e40af;
}

.badge-gris {
  background: #f1f5f9;
  color: #64748b;
}

.alerta-deuda {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 1px solid #fecdd3;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.alerta-deuda__info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alerta-deuda__icon {
  width: 48px;
  height: 48px;
  background: #ef4444;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alerta-deuda__texto h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: .2rem;
}

.alerta-deuda__texto p {
  font-size: .875rem;
  color: #b91c1c;
}

.banner-aldia {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.banner-aldia__icon {
  width: 48px;
  height: 48px;
  background: #22c55e;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-aldia h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #166534;
}

.banner-aldia p {
  font-size: .875rem;
  color: #15803d;
}

.sin-afiliacion {
  text-align: center;
  padding: 4rem 2rem;
}

.sin-afiliacion svg {
  opacity: .2;
  margin-bottom: 1rem;
}

.sin-afiliacion h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: .5rem;
}

.sin-afiliacion p {
  color: #94a3b8;
}

.btn-pagar {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}

.btn-pagar:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124,58,237,.4);
}

.btn-pagar:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-pagar svg {
  width: 18px;
  height: 18px;
}

.modal-cuotas {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.modal-cuotas label {
  font-size: .85rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.modal-cuotas input {
  width: 80px;
  padding: .5rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.modal-cuotas input:focus {
  outline: none;
  border-color: #7c3aed;
}

.modal-total {
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-total span {
  font-size: .85rem;
  font-weight: 600;
  color: #7c3aed;
}

.modal-total strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: #5b21b6;
}

.modal-btns {
  display: flex;
  gap: .75rem;
}

.btn-cancelar {
  flex: 1;
  padding: .75rem;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-confirmar {
  flex: 2;
  padding: .75rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.btn-confirmar:disabled {
  opacity: .6;
  cursor: not-allowed;
}

#msg-pago {
  margin-top: 1rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  display: none;
}

#msg-pago.error {
  background: #fee2e2;
  color: #991b1b;
}

#msg-pago.success {
  background: #dcfce7;
  color: #166534;
}

.spin {
  animation: spin .8s linear infinite;
  display: inline-block;
}

    body, .main, .card, p, span, div, td, th, label, input, button, a { color: #1f2937; }
    .main { background: #f5f7fb !important; }

    .page-head{
      display:flex; align-items:flex-end; justify-content:space-between;
      gap:16px; margin-bottom:18px;
    }
    .page-title{ font-size:1.6rem; font-weight:900; letter-spacing:-0.02em; }
    .page-sub{ color:#64748b; font-weight:600; margin-top:4px; }

    .toolbar{
      display:flex; flex-wrap:wrap; gap:10px; align-items:center;
      margin: 14px 0 18px;
    }
    .toolbar .chip{
      display:inline-flex; align-items:center; gap:8px;
      padding: 8px 12px; border-radius: 999px;
      background: white; border:1px solid #e5e7eb;
      font-weight:800; font-size:0.85rem; text-decoration:none;
    }
    .toolbar .chip.active{ border-color:#7c5cff; box-shadow:0 0 0 3px rgba(124,92,255,0.12); }
    .toolbar form{ display:flex; gap:10px; flex:1; min-width:260px; }
    .toolbar input{
      flex:1; background:white; border:1px solid #e5e7eb;
      border-radius: 12px; padding:10px 12px; font-weight:700;
      outline:none;
    }
    .btn{
      border:none; cursor:pointer; border-radius:12px;
      padding:10px 12px; font-weight:900; text-decoration:none;
      background:#7c5cff; color:white !important;
      box-shadow: 0 8px 20px rgba(124,92,255,0.25);
      transition: transform .15s ease, box-shadow .15s ease;
    }
    .btn:hover{ transform: translateY(-1px); box-shadow:0 12px 26px rgba(124,92,255,0.28); }
    .btn-ghost{
      background:white; color:#111827 !important; border:1px solid #e5e7eb;
      box-shadow:none;
    }

    .list{ display:flex; flex-direction:column; gap:12px; }
    .notif{
      background:white; border-radius:16px; border:1px solid #eef2f7;
      padding:14px 14px;
      display:flex; gap:12px; align-items:flex-start;
      box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    .notif.unread{ border-color:#c7d2fe; box-shadow:0 0 0 4px rgba(99,102,241,0.08); }
    .notif .ico{
      width:44px; height:44px; border-radius:12px;
      display:flex; align-items:center; justify-content:center;
      background:#f1f5f9; font-size:1.4rem; flex-shrink:0;
    }
    .notif.success .ico{ background: #ecfdf5; }
    .notif.warning .ico{ background: #fffbeb; }
    .notif.error .ico{ background: #fef2f2; }
    .notif.info .ico{ background: #eff6ff; }

    .notif .body{ flex:1; min-width:0; }
    .notif .title{ font-weight:900; font-size:1rem; margin-bottom:4px; }
    .notif .msg{ color:#374151; font-weight:600; line-height:1.5; }
    .notif .meta{ display:flex; gap:10px; align-items:center; margin-top:10px; flex-wrap:wrap; }
    .badge{
      font-size:.75rem; font-weight:900; padding:4px 10px; border-radius:999px;
      background:#f1f5f9; color:#334155;
    }
    .badge.unread{ background:#e0e7ff; color:#3730a3; }
    .time{ color:#64748b; font-weight:700; font-size:.85rem; }

    .actions{ display:flex; gap:8px; align-items:center; }
    .a-btn{
      border:1px solid #e5e7eb; background:white;
      padding:8px 10px; border-radius:12px; cursor:pointer;
      font-weight:900; font-size:.85rem;
      transition: transform .12s ease;
    }
    .a-btn:hover{ transform: translateY(-1px); }
    .a-danger{ border-color:#fecaca; color:#991b1b; background:#fff5f5; }
    .link{
      display:inline-flex; align-items:center; gap:8px;
      padding:9px 12px; border-radius:12px;
      background:#7c5cff; color:white !important; text-decoration:none;
      font-weight:900;
    }

    .empty{
      background:white; border:1px dashed #cbd5e1;
      border-radius:16px; padding:22px; text-align:center;
      color:#64748b; font-weight:700;
    }

    .pager{
      display:flex; justify-content:space-between; align-items:center;
      gap:10px; margin-top:18px; flex-wrap:wrap;
    }
    .pager .pinfo{ color:#64748b; font-weight:800; }
    .pager a{ text-decoration:none; }
    @media (max-width: 768px){
      .page-head{ flex-direction:column; align-items:flex-start; }
      .toolbar form{ min-width: 100%; }
    }
#cb-launcher,
#cb-window {
  pointer-events: auto !important;
}

@media (max-width: 480px) {
  .sidebar { z-index: 50; }
  .mobile-menu-btn { z-index: 998; }
}