@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600&display=swap");

:root {
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #10b981;
  --muted: #64748b;
  --text-strong: #0f172a;
  --text: #111827;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --background: #eef1f7;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --shadow-soft: 0 30px 60px -35px rgba(15, 23, 42, 0.45);
  --shadow-card: 0 24px 50px -32px rgba(15, 23, 42, 0.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --gradient: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--background);
}

.sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 4px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark--sm {
  width: 38px;
  height: 38px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section {
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 12px 6px;
}

.nav-item {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  cursor: pointer;
  min-height: 48px;
  position: relative;
}

.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.nav-item.is-active {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.15);
  color: #ffffff;
}

.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 9999px;
  background: #60a5fa;
}

.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  height: 76px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 13px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text);
  width: 200px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.icon-lg {
  width: 20px;
  height: 20px;
}

.content {
  padding: clamp(16px, 2vw, 28px) clamp(16px, 2vw, 28px) clamp(24px, 3vw, 40px);
  flex: 1;
  min-width: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: clamp(18px, 2.5vw, 28px);
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
}

.actions-row {
  display: flex;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-success {
  background: #10b981;
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-success:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-danger:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-info {
  background: #0ea5e9;
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-info:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-success {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.badge-warning {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fed7aa;
}

.badge-danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-info {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card + .card {
  margin-top: 18px;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.card-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 16px);
}

.kpi-grid.kpi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--primary);
  font-weight: 700;
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.delta.up {
  color: var(--accent);
}

.delta.down {
  color: #f97316;
}

.pill-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-muted);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pill {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s ease;
}

.pill.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.2);
}

.tab-content {
  display: none;
  margin-top: 14px;
}

.tab-content.active {
  display: block;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--surface-muted);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.3px;
}

tbody tr:hover {
  background: #f9fafb;
}

/* Tabla documentos subidos — usuario */
.usuario-subidos-card .table-container--historial {
  border: none;
  border-radius: 0;
  overflow-x: auto;
}

.table-historial {
  table-layout: fixed;
  width: 100%;
}

.table-pendientes {
  table-layout: fixed;
  width: 100%;
}

.table-historial th,
.table-historial td {
  vertical-align: middle;
}

.table-historial th:nth-child(1),
.table-historial td:nth-child(1) {
  width: 26%;
}

.table-historial th:nth-child(2),
.table-historial td:nth-child(2) {
  width: 12%;
  white-space: nowrap;
}

.table-historial th:nth-child(3),
.table-historial td:nth-child(3) {
  width: 12%;
}

.table-historial th:nth-child(4),
.table-historial td:nth-child(4) {
  width: 18%;
}

.table-historial th.col-acciones,
.table-historial td.table-actions-cell {
  width: 32%;
  min-width: 300px;
  text-align: right;
}

.table-pendientes th:nth-child(1),
.table-pendientes td:nth-child(1) {
  width: 24%;
}

.table-pendientes th:nth-child(2),
.table-pendientes td:nth-child(2) {
  width: 12%;
}

.table-pendientes th:nth-child(3),
.table-pendientes td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
}

.table-pendientes th:nth-child(4),
.table-pendientes td:nth-child(4) {
  width: 12%;
}

.table-pendientes th:nth-child(5),
.table-pendientes td:nth-child(5) {
  width: 12%;
}

.table-pendientes th:nth-child(6),
.table-pendientes td.table-actions-cell {
  width: 26%;
  min-width: 260px;
  text-align: right;
}

.table-historial .table-empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 28px 14px;
}

.doc-cell-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.doc-cell-title {
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.35;
  word-break: break-word;
}

.doc-cell-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
}

.table-actions .btn-sm {
  white-space: nowrap;
  flex-shrink: 0;
}

.table-pendientes td.table-actions-cell,
.table-historial td.table-actions-cell {
  white-space: nowrap;
}

.table-pendientes td.table-actions-cell .table-actions,
.table-historial td.table-actions-cell .table-actions {
  justify-content: flex-end;
}

.table-pendientes td:last-child .table-actions,
.table-pendientes td:last-child {
  white-space: nowrap;
}

.table-pendientes .doc-cell-meta {
  font-size: 11px;
  margin-top: 4px;
}

.usuario-subidos-card .paginacion {
  padding: 0 4px 4px;
}

/* Layout responsive: ver css/responsive.css */

@media (max-width: 768px) {
  .table-historial,
  .table-pendientes {
    table-layout: auto;
  }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 16px);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 14px);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-entry {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.timeline-entry:last-child {
  border-bottom: none;
}

.timeline-entry-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.timeline-entry-body {
  flex: 1;
  min-width: 0;
}

.timeline-entry-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.45;
  word-break: break-word;
}

.timeline-entry-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.timeline-message {
  text-align: center;
  color: var(--muted);
  padding: 20px 16px;
  margin: 0;
}

.timeline-message.is-error {
  color: #ef4444;
}

.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.paginacion .btn-sm {
  min-width: 96px;
}

.paginacion span {
  color: var(--text-strong);
  font-weight: 500;
  font-size: 13px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: flex-start;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.auth-page {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.08), transparent 32%),
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.1), transparent 32%),
    #0f172a;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-grid {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.auth-hero {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 32px;
  color: #e2e8f0;
  box-shadow: 0 30px 60px -35px rgba(0, 0, 0, 0.6);
}

.auth-hero h1 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 34px;
  line-height: 1.2;
  margin: 12px 0 12px;
}

.auth-hero p {
  color: #d5deeb;
  margin-bottom: 22px;
}

.auth-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-pill {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 600;
  color: #e2e8f0;
}

.auth-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.auth-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-alert {
  margin-bottom: 18px;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-alert.hidden {
  display: none;
}

.login-alert.show {
  display: block;
  animation: loginAlertIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-alert-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 14px;
  align-items: start;
  padding: 16px 16px 16px 0;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 16px 34px -24px rgba(15, 23, 42, 0.35),
    0 6px 14px -10px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.login-alert-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.login-alert-card.is-error .login-alert-accent {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.login-alert-card.is-warning .login-alert-accent {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
}

.login-alert-card.is-info .login-alert-accent {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.login-alert-icon-wrap {
  margin-left: 16px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-alert-card.is-error .login-alert-icon-wrap {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(220, 38, 38, 0.08));
  color: #dc2626;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.16);
}

.login-alert-card.is-warning .login-alert-icon-wrap {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.08));
  color: #d97706;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.login-alert-card.is-info .login-alert-icon-wrap {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(29, 78, 216, 0.08));
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.login-alert-icon {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.login-alert-content {
  min-width: 0;
  padding-top: 2px;
}

.login-alert-title {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.login-alert-message {
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.login-alert-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.login-alert-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.login-alert-card.is-error .form-control.is-invalid,
#loginForm.login-error .form-control {
  border-color: #fca5a5;
  background: #fffafa;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

#loginForm.login-shake {
  animation: loginShake 0.45s ease;
}

@keyframes loginAlertIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-label {
  font-weight: 600;
  color: var(--text);
}

.form-control {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--surface-muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.helper {
  color: var(--muted);
  font-size: 13px;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  display: flex;
  gap: 10px;
  align-items: center;
}

.alert strong {
  font-weight: 700;
}

.stacked {
  display: grid;
  gap: 12px;
}

/* Layout responsive: ver css/responsive.css */


.toast-stack-user {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-stack-user.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.toast-stack-user.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-stack-user .toast-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 14px;
  align-items: start;
  padding: 18px 16px 14px 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 24px 48px -28px rgba(15, 23, 42, 0.5),
    0 10px 20px -14px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-stack-user .toast-card.is-hiding {
  opacity: 0;
  transform: translateX(16px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.toast-stack-user .toast-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.toast-stack-user .toast-card.is-success .toast-accent {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
}

.toast-stack-user .toast-card.is-upload .toast-accent {
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
}

.toast-stack-user .toast-card.is-error .toast-accent {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.toast-stack-user .toast-card.is-info .toast-accent {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.toast-stack-user .toast-icon-wrap {
  grid-column: 1;
  grid-row: 1;
  margin-left: 18px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-stack-user .toast-card.is-success .toast-icon-wrap {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.08));
  color: #059669;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}

.toast-stack-user .toast-card.is-upload .toast-icon-wrap {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.1));
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.toast-stack-user .toast-card.is-error .toast-icon-wrap {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.08));
  color: #dc2626;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.toast-stack-user .toast-card.is-info .toast-icon-wrap {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(37, 99, 235, 0.08));
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.toast-stack-user .toast-lucide-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.25px;
}

.toast-stack-user .toast-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding-top: 2px;
}

.toast-stack-user .toast-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.toast-stack-user .toast-title {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.toast-stack-user .toast-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.toast-stack-user .toast-message {
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.toast-stack-user .toast-close {
  grid-column: 3;
  grid-row: 1;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.toast-stack-user .toast-close:hover {
  background: #f1f5f9;
  color: #475569;
}

.toast-stack-user .toast-progress {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 3px;
  margin-top: 14px;
  background: #eef2f7;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
}

.toast-stack-user .toast-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
}

.toast-stack-user .toast-progress span.is-running {
  animation: toastProgressUser 4.5s linear forwards;
}

.toast-stack-user .toast-card.is-success .toast-progress span {
  background: linear-gradient(90deg, #10b981, #059669);
}

.toast-stack-user .toast-card.is-upload .toast-progress span {
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.toast-stack-user .toast-card.is-error .toast-progress span {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.toast-stack-user .toast-card.is-info .toast-progress span {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastProgressUser {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 768px) {
  .toast-stack-user {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 20px);
}

.modal-content {
  background: #fff;
  padding: clamp(16px, 3vw, 24px);
  width: 100%;
  max-width: min(420px, 100%);
  margin: 0 auto;
  border-radius: var(--radius-lg);
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
}

#cerrarModal {
  float: right;
  cursor: pointer;
  font-size: 20px;
}

.modal.modal-vencidos {
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

.modal.modal-vencidos.is-open {
  display: flex;
}

.modal-vencidos-content {
  width: min(92vw, 460px);
  max-height: min(85vh, 520px);
  overflow: auto;
  border: 1px solid #fecaca;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
}

.modal-vencidos-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.modal-vencidos-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-vencidos-icon .icon {
  width: 22px;
  height: 22px;
}

.modal-vencidos-title {
  margin: 0;
  color: #dc2626;
  font-size: 1.25rem;
  line-height: 1.3;
}

.modal-vencidos-subtitle {
  margin: 6px 0 0;
  color: #475569;
  line-height: 1.5;
  font-size: 0.95rem;
}

.modal-vencidos-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-vencidos-list li {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-weight: 600;
  line-height: 1.4;
}

.modal-vencidos-list .modal-vencidos-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
}

.modal-vencidos-close {
  float: right;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #94a3b8;
  background: none;
  border: none;
  padding: 0;
}

.modal-vencidos-actions {
  margin-top: 20px;
}

.modal-vencidos-actions .btn {
  width: 100%;
}
