/**
 * common.css — Clases de compatibilidad y extensiones
 * Cargado DESPUÉS de design-system.css.
 * Solo contiene clases que NO existen en design-system.css.
 * NO redefinir: .btn, .card, .badge, .stat-card, .page-content,
 *               .page-header, .section-title, .table-wrap, label, input, select
 */

/* ── STAT CARDS: estructura legacy (.number / .label) ── */
/* Páginas antiguas usan .stat-card > .number / .label en lugar de .stat-val / .stat-label */
.stat-card .number {
  font-size: 1.875rem;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--blue);
  margin: 0;
}
.stat-card .label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ── BOTÓN ACCIÓN PRIMARIA (alias de .btn-primary) ── */
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r-sm);
  padding: .55rem 1.1rem;
  min-height: 38px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-action-primary:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
}

/* ── BOTONES ADICIONALES ── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .55rem 1.1rem;
  min-height: 38px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

/* Alias legacy; equivale visualmente a .btn.btn-primary con width:100% */
.btn-floating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* El hueco entre icono y texto tiene que ser explícito. Siendo `flex`, el espacio que hay
     escrito en el HTML entre el SVG y la palabra no se pinta. Con la fuente de iconos no se
     notaba porque el glifo traía su propio margen lateral; con SVG en línea, no. */
  gap: .45rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r-sm);
  padding: .6rem 1.25rem;
  min-height: 40px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: all .18s;
  width: 100%;
}
.btn-floating:hover { background: var(--blue-deep); }

/* ── TABLAS LEGACY ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--sh-sm);
  margin-bottom: 1.75rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
.data-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.92);
  padding: .875rem 1.25rem;
  background: linear-gradient(180deg, #0b2f86 0%, var(--blue) 100%);
  border-bottom: 1px solid rgba(0,0,0,.08);
  white-space: nowrap;
}
.data-table td {
  padding: .875rem 1.25rem;
  font-size: .8125rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--blue-soft); }

/* ── BREADCRUMB LEGACY ── */
.page-breadcrumb {
  background: var(--white);
  padding: .5rem 1.5rem;
  font-size: .8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .25rem;
  color: var(--muted);
}
.page-breadcrumb a {
  color: var(--blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.page-breadcrumb a:hover { text-decoration: underline; }
.page-breadcrumb .separator { color: var(--muted); margin: 0 .25rem; opacity: .5; }
.page-breadcrumb .current { color: var(--muted); font-weight: 500; }

/* ── FLASH MESSAGES ── */
.flash-message {
  padding: .75rem 1rem;
  margin: .75rem 0;
  border-radius: var(--r-sm);
  font-size: .875rem;
  border-left: 3px solid;
}
.flash-message.success, .flash-message:not([class*="error"]):not([class*="warning"]):not([class*="info"]) {
  background: var(--green-lt);
  border-color: var(--green);
  color: var(--green);
}
.flash-message.error {
  background: var(--red-lt);
  border-color: var(--red);
  color: var(--red);
}
.flash-message.warning {
  background: var(--orange-lt);
  border-color: var(--orange);
  color: var(--orange);
}
.flash-message.info {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

/* ── ACCIONES EN FILAS ── */
.row-actions {
  display: flex;
  gap: .25rem;
  align-items: center;
  flex-wrap: nowrap;
}

.filters-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 767px) {
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-bar .filter-group {
    width: 100%;
    flex: 1 1 auto;
  }

  .filters-bar .filter-input,
  .filters-bar .filter-select {
    width: 100%;
    min-height: 44px;
  }

  .filters-bar-actions {
    width: 100%;
    margin-left: 0;
  }

  .filters-bar-actions .btn {
    flex: 1;
  }

  .data-table .row-actions .icon-action,
  .data-table .row-actions .icon-button {
    min-width: 44px;
    min-height: 44px;
  }
}

.data-table .row-actions {
  justify-content: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.icon-form { display: inline-flex; }

.icon-action {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--blue);
  background: var(--white);
  text-decoration: none;
  transition: background .15s, border-color .15s;
  cursor: pointer;
  font-size: .875rem;
}
.icon-action:hover { background: var(--blue-soft); border-color: var(--blue); }
.icon-action.disabled { color: var(--muted); background: var(--bg); cursor: not-allowed; }
.icon-action.danger { color: var(--red); }
.icon-action.danger:hover { background: var(--red-lt); border-color: var(--red); }

.icon-button {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--red);
  padding: 0;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.icon-button:hover { background: var(--red-lt); border-color: rgba(200,16,46,.2); }

.action-link {
  color: var(--blue);
  text-decoration: none;
  font-size: .8125rem;
  margin-right: .5rem;
  transition: opacity .18s;
}
.action-link:hover { text-decoration: underline; opacity: .8; }
.action-link.delete { color: var(--red); }
.action-link.close { color: var(--orange); }
.action-link.reopen { color: var(--green); }

/* ── FORMULARIO CARD ── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2rem;
  box-shadow: var(--sh-sm);
  margin-bottom: 1.75rem;
  max-width: 700px;
}
.form-card fieldset { margin: 0 0 1.5rem; padding: 0; border: none; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: normal;
  cursor: pointer;
  margin-top: .5rem;
  font-size: .875rem;
}
.checkbox-label input[type="checkbox"] { width: auto; cursor: pointer; }

/* ── READONLY NOTICE ── */
.readonly-notice {
  background: var(--orange-lt);
  border-left: 3px solid var(--orange);
  padding: .875rem 1rem;
  border-radius: var(--r-sm);
  margin-bottom: 1rem;
  color: var(--orange);
  font-size: .875rem;
}

/* ── EMPTY STATE LEGACY ── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .5; }
.empty-state h3 { margin: 0 0 .5rem; color: var(--text); font-size: 1rem; font-weight: 700; }
.empty-state p { margin: .25rem 0 0; font-size: .875rem; }
.empty-cell { text-align: center; padding: 2.5rem 1rem !important; }

/* ── MODAL ── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,.5);
}
.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: var(--white);
  border-radius: var(--r);
  width: 90%;
  max-width: 600px;
  box-shadow: var(--sh-lg);
  animation: modalIn .25s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(-24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .4rem;
  transition: background .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

@media (max-width: 767px) {
  .modal.active,
  .modal.show {
    align-items: flex-end;
    padding: .5rem;
  }

  .modal-content {
    width: 100%;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }

  .modal-footer,
  .modal .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer > *,
  .modal .form-actions > * {
    width: 100%;
    min-height: 44px;
  }
}

/* ── LOADING SPINNER ── */
.loading-spinner { text-align: center; padding: 2rem; color: var(--muted); }

/* ── SISTEMA DE AYUDA ── */
.help-floating-btn {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--sh-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
  z-index: 999;
}
.help-floating-btn:hover { background: var(--blue-deep); transform: scale(1.08); }

.help-panel {
  position: fixed;
  right: -400px; top: 0;
  width: 400px; height: 100vh;
  background: var(--white);
  box-shadow: -2px 0 12px rgba(0,0,0,.1);
  transition: right .3s ease;
  z-index: 1000;
  overflow-y: auto;
}
.help-panel.active { right: 0; }

.help-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--blue);
  color: #fff;
}
.help-panel-header h3 { margin: 0; font-size: 1.1rem; }

.help-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .4rem;
  transition: background .2s;
}
.help-close-btn:hover { background: rgba(255,255,255,.1); }
.help-panel-content { padding: 1.5rem; }

@media (max-width: 600px) {
  .help-floating-btn {
    right: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
  }

  .help-panel {
    right: -100vw;
    width: min(400px, 100vw);
  }

  .help-panel.active { right: 0; }

  .help-panel-header,
  .help-panel-content {
    padding: 1rem;
  }

  .help-close-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── UTILITIES ── */
.text-center  { text-align: center; }
.text-muted   { color: var(--muted); }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
@media print { .no-print { display: none !important; } }

/* ── PÁGINAS DE AUTENTICACIÓN ── */
.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(255,204,0,.22), transparent 28%),
    radial-gradient(circle at top right, rgba(0,36,125,.10), transparent 32%),
    linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
}

.auth-layout {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 460px);
  gap: 1.5rem;
  align-items: stretch;
}

.auth-panel {
  background: linear-gradient(135deg, #062b86 0%, #0b3aa9 58%, #1648be 100%);
  border-radius: calc(var(--r) + .25rem);
  padding: 2.5rem;
  color: #fff;
  box-shadow: 0 28px 60px rgba(0,36,125,.22);
  position: relative;
  overflow: hidden;
}

.auth-panel::after {
  content: "";
  position: absolute;
  inset: auto -8% -22% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,204,0,.14);
  filter: blur(8px);
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-hero-title {
  margin: 1.25rem 0 .85rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  color: #fff;
}

.auth-hero-copy {
  max-width: 52ch;
  color: rgba(255,255,255,.78);
  font-size: 1rem;
  line-height: 1.75;
}

.auth-hero-points {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .85rem;
}

.auth-hero-points li {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.9);
  font-size: .92rem;
}

/* La regla apuntaba a `i` y con la fuente de iconos retirada no pintaba nada: los tres puntos
   del panel de login perdieron su medallón. El relleno es nuevo — antes la caja de 2rem rodeaba
   una letra, y ahora rodea un SVG que si no la llenaría entera. */
.auth-hero-points .icon {
  width: 2rem;
  height: 2rem;
  padding: .45rem;
  border-radius: .75rem;
  flex-shrink: 0;
  background: rgba(255,255,255,.12);
  color: var(--yellow);
}

.auth-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(216,225,242,.92);
  border-radius: calc(var(--r) + .25rem);
  box-shadow: 0 24px 48px rgba(15,23,42,.08);
  backdrop-filter: blur(12px);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 460px;
  justify-self: end;
}

.auth-main > .auth-card {
  justify-self: center;
}

.auth-header {
  margin-bottom: 1.75rem;
  text-align: center;
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
  margin-bottom: .35rem;
}
.auth-sub {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
}

.auth-submit {
  width: 100%;
  margin-top: .25rem;
}

.auth-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.auth-links a {
  font-size: .8125rem;
  color: var(--blue);
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid #dbe4f3;
  border-radius: 1rem;
  background: #fff;
  color: var(--text);
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-card input[type="text"]::placeholder,
.auth-card input[type="email"]::placeholder,
.auth-card input[type="password"]::placeholder {
  color: #7b8aa5;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  outline: none;
  border-color: rgba(18,52,145,.42);
  box-shadow: 0 0 0 4px rgba(18,52,145,.12);
}

.input-with-icon {
  position: relative;
}
.input-with-icon input[type="password"] {
  padding-right: 2.75rem;
}
.input-icon-btn {
  position: absolute;
  right: .625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: .35rem;
  display: flex;
  align-items: center;
  font-size: 1rem;
  transition: color .15s;
}
.input-icon-btn:hover { color: var(--text); }

/* ── LAYOUT PÚBLICO (páginas sin sidebar) ── */
.app-public {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-top: var(--stripe-h);
}
.app-header-public {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: var(--sh-sm);
}
.app-footer {
  background: var(--text);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 1.25rem;
  font-size: .8125rem;
}

.dashboard-hero {
  background: linear-gradient(180deg, rgba(255,204,0,.12) 0%, rgba(255,204,0,.06) 100%);
  border: 1px solid rgba(255,204,0,.55);
  border-radius: calc(var(--r) + .15rem);
  box-shadow: var(--sh-sm);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-hero-copy {
  display: flex;
  align-items: center;
  gap: .9rem;
  color: var(--text);
}

.dashboard-hero-copy .icon {
  font-size: 1.15rem;
  color: var(--yellow-d);
}

.dashboard-hero-copy strong {
  font-weight: 800;
}

.dashboard-stats-grid,
.dashboard-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-stats-grid {
  margin-bottom: 1.75rem;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 1rem;
  color: #58729d;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .82rem;
  font-weight: 800;
}

.dashboard-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d9e2f0;
}

.dashboard-stat-card {
  background: var(--white);
  border: 1px solid #d9e2f0;
  border-radius: calc(var(--r) + .15rem);
  box-shadow: var(--sh-sm);
  padding: 1.45rem 1.5rem;
}

.dashboard-stat-label {
  margin: 0 0 .7rem;
  color: #58729d;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  font-weight: 800;
}

.dashboard-stat-value {
  margin: 0;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--blue);
}

.dashboard-stat-meta {
  margin: .55rem 0 0;
  color: #58729d;
  font-size: .95rem;
}

.dashboard-quick-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  background: var(--white);
  border: 1px solid #d9e2f0;
  border-radius: calc(var(--r) + .15rem);
  box-shadow: var(--sh-sm);
  padding: 1.55rem;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.dashboard-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: rgba(0,36,125,.22);
}

.dashboard-quick-icon {
  width: 3.55rem;
  height: 3.55rem;
  flex-shrink: 0;
  border-radius: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-size: 1.5rem;
}

.dashboard-quick-title {
  margin: 0 0 .3rem;
  font-size: 1.45rem;
  letter-spacing: -.03em;
  color: var(--text);
}

.dashboard-quick-meta {
  margin: 0;
  color: #58729d;
  font-size: .98rem;
}

.dashboard-panel-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.dashboard-panel {
  background: var(--white);
  border: 1px solid #d9e2f0;
  border-radius: calc(var(--r) + .15rem);
  box-shadow: var(--sh-sm);
  padding: 1.15rem 1.2rem;
}

.dashboard-panel-title {
  margin: 0 0 1rem;
  color: #58729d;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .9rem;
}

.dashboard-panel-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d9e2f0;
}

.dashboard-list {
  list-style: none;
  display: grid;
  gap: .85rem;
}

.dashboard-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dashboard-list-name {
  margin: 0;
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
}

.dashboard-list-sub {
  margin: .2rem 0 0;
  color: #58729d;
  font-size: .78rem;
}

.dashboard-list-value {
  color: var(--blue);
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.dashboard-activity {
  list-style: none;
  display: grid;
  gap: .9rem;
}

.dashboard-activity-item {
  display: flex;
  gap: .8rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dashboard-activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-top: .35rem;
}

.dashboard-activity-dot.yellow { background: #c49a00; }
.dashboard-activity-dot.red { background: var(--red); }

.dashboard-activity-text {
  color: var(--text);
  font-size: .84rem;
  line-height: 1.55;
}

.dashboard-activity-time {
  color: #58729d;
  font-size: .74rem;
  margin-top: .15rem;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.config-entry {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.35rem;
  border-radius: calc(var(--r) + .1rem);
  border: 1px solid #d9e2f0;
  background: var(--white);
  box-shadow: var(--sh-sm);
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.config-entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: rgba(0,36,125,.18);
}

.config-entry-head {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.config-entry-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,36,125,.08);
  color: var(--blue);
  font-size: 1.25rem;
}

.config-entry-title {
  margin: 0;
  font-size: 1.08rem;
  color: var(--text);
}

.config-entry-copy {
  margin: 0;
  color: #58729d;
  font-size: .92rem;
  line-height: 1.65;
}

.config-entry-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.config-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
}

.config-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.config-card {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.35rem;
  border-radius: calc(var(--r) + .1rem);
  border: 1px solid #d9e2f0;
  background: var(--white);
  box-shadow: var(--sh-sm);
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.config-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: rgba(0,36,125,.18);
}

.config-card-header {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.config-card-icon {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,36,125,.08);
  color: var(--blue);
  font-size: 1.25rem;
}

.config-card h2 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--text);
}

.config-card p {
  margin: 0;
  color: #58729d;
  font-size: .92rem;
  line-height: 1.65;
}

.config-card-stats {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.config-card-stats .stat-item {
  min-width: 110px;
  padding: .55rem .7rem;
  border-radius: .85rem;
  background: #eef3ff;
}

.config-card-stats .stat-number {
  margin: 0;
  color: var(--blue);
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 800;
}

.config-card-stats .stat-label {
  margin: .15rem 0 0;
  color: #58729d;
  font-size: .75rem;
}

.config-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  color: var(--blue);
  font-weight: 700;
  font-size: .9rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 240px;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid #d9e2f0;
  border-radius: calc(var(--r) + .1rem);
  box-shadow: var(--sh-sm);
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: rgba(0,36,125,.18);
}

.module-card-icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-size: 1.45rem;
}

.module-card-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -.03em;
  color: var(--text);
}

.module-card-desc {
  margin: 0;
  color: #58729d;
  line-height: 1.65;
  font-size: .95rem;
  flex: 1;
}

.module-card-stats {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
}

.module-card-stats .stat-item {
  min-width: 120px;
}

.module-card-stats .stat-number {
  margin: 0;
  color: var(--blue);
  font-size: 1.55rem;
  line-height: 1.05;
  font-weight: 800;
}

.module-card-stats .stat-label {
  margin: .2rem 0 0;
  color: #58729d;
  font-size: .78rem;
}

.module-card-footer {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--blue);
  font-weight: 700;
  font-size: .92rem;
}

@media (max-width: 980px) {
  .auth-layout,
  .dashboard-stats-grid,
  .dashboard-quick-grid,
  .dashboard-panel-grid,
  .config-grid,
  .config-cards,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .auth-main {
    padding: 1.5rem 1rem;
  }

  .auth-panel,
  .auth-card {
    padding: 1.5rem 1.15rem;
  }

  .dashboard-hero {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── AVISO DE SOLO LECTURA ──
   Amarillo de acento, no rojo: la cuenta no ha hecho nada mal y lo que ya tiene sigue ahi.
   El rojo esta reservado para lo destructivo. */
.readonly-notice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1rem;
  margin: 0 0 1rem;
  background: rgba(255, 204, 0, .12);
  border: 1px solid var(--yellow);
  border-left: 4px solid var(--yellow);
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: var(--text);
}
.readonly-notice-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: .1rem;
  color: var(--yellow-d);
}
.readonly-notice-text { flex: 1 1 auto; line-height: 1.5; }
.readonly-notice-text strong { display: block; margin-bottom: .15rem; }
.readonly-notice-action {
  flex: 0 0 auto;
  align-self: center;
  padding: .45rem .9rem;
  background: var(--blue);
  color: var(--white);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.readonly-notice-action:hover { background: var(--blue-deep); }

/* Un boton bloqueado se muestra apagado, nunca escondido: esconderlo hace que la aplicacion
   parezca rota, y apagarlo con su motivo en el `title` explica por que. */
.is-readonly-blocked {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  .readonly-notice { flex-wrap: wrap; }
  .readonly-notice-action { width: 100%; text-align: center; }
}
