﻿:root {
  --bg: #f3f7fb;
  --text: #1f2937;
  --muted: #5f6b7a;
  --top-a: #0f766e;
  --top-b: #14532d;
  --card-border: #dde6f1;
  --primary: #0b6bcb;
  --sidebar-bg: #0f2d3a;
  --sidebar-border: #1f4352;
  /* Superficies mas legibles (menos "opacas"). */
  --page: #eaf1f8;
  --surface: #fbfdff;
  --surface-strong: #ffffff;
  --surface-muted: #f2f7fd;
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.10);
  --shadow-strong: 0 18px 44px rgba(15, 23, 42, 0.14);
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% -10%, rgba(15, 118, 110, 0.14) 0%, rgba(234, 241, 248, 0) 38%),
    radial-gradient(circle at 92% 22%, rgba(11, 107, 203, 0.10) 0%, rgba(234, 241, 248, 0) 46%),
    linear-gradient(180deg, var(--page) 0%, #f3f7fb 40%, #eef2f7 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body.mobile-menu-open {
  overflow: hidden;
}

.app-topbar {
  background: linear-gradient(90deg, var(--top-a), var(--top-b));
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.18);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-brand {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.app-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  padding: 3px;
  flex-shrink: 0;
}

.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  width: 170px;
  height: 170px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #dbe6f2;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  margin-bottom: 16px;
  display: block;
}

.login-brand .page-title,
.login-brand .page-subtitle {
  width: 100%;
  text-align: center;
}

.login-powered {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.app-brand span {
  color: #ffffff;
  white-space: nowrap;
}

.user-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.85rem;
}

.sidebar-toggle-btn {
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 62px);
  position: relative;
}

.app-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1rem 0.75rem;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  transition: transform 0.25s ease, opacity 0.2s ease;
  z-index: 1040;
}

.app-overlay {
  display: none;
}

.sidebar-link {
  display: block;
  text-decoration: none;
  color: #dbedf6;
  padding: 0.62rem 0.78rem;
  border-radius: 10px;
  font-weight: 700;
  margin-bottom: 0.35rem;
  border: 1px solid transparent;
}

.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar-text {
  vertical-align: middle;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.sidebar-link.active {
  background: #ffffff;
  color: #0f3a48;
  border: 1px solid #9cc4d6;
}

.app-main {
  min-width: 0;
}

.app-main .container-fluid {
  background: rgba(234, 241, 248, 0.35);
  border-radius: 22px;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 78px 1fr;
}

.app-shell.sidebar-collapsed .app-sidebar {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  padding: 0.8rem 0.45rem;
}

.app-shell.sidebar-collapsed .sidebar-text {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-link {
  text-align: center;
  padding: 0.52rem 0.35rem;
}

.app-shell.sidebar-collapsed .sidebar-icon {
  margin-right: 0;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, #ffffff, var(--surface-muted));
  border: 1px solid #dbe6f2;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.page-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.75rem;
  margin: 0;
}

.page-subtitle {
  color: var(--muted);
}

.app-card {
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, var(--surface));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* Autocomplete (sin selects) */
.ac-root {
  position: relative;
}

.ac-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1080;
  background: #ffffff;
  border: 1px solid #d6e3f0;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
}

.ac-item {
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}

.ac-item:hover,
.ac-item.active {
  background: rgba(11, 107, 203, 0.08);
  border-color: rgba(11, 107, 203, 0.22);
}

.ac-line {
  font-weight: 800;
  color: var(--text);
}

.ac-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.ac-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 6px;
}

.app-table thead th {
  background: linear-gradient(180deg, #eef4fb, #e7eff8);
  border-bottom: 2px solid #c6d4e6;
  color: #223248;
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(198, 212, 230, 0.9);
  font-size: 0.86rem;
}

.app-table td,
.app-table th {
  padding: 0.85rem 1rem;
  border-color: #e6edf7;
}

.app-table td + td,
.app-table th + th {
  border-left: 1px solid rgba(214, 224, 238, 0.9);
}

.app-table tbody tr {
  background: #ffffff;
}

.app-table tbody tr:nth-child(even) {
  background: #f7fbff;
}

.app-table tbody tr:hover {
  background: rgba(11, 107, 203, 0.10);
}

.table-responsive {
  border-radius: 16px;
  border: 1px solid #dbe6f2;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  overflow: auto;
}

.app-table tbody td {
  border-top: 1px solid rgba(214, 224, 238, 0.9);
}

.app-table td:last-child,
.app-table th:last-child {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.9), rgba(242, 247, 253, 0.9));
}

.app-table td:last-child {
  border-left: 1px solid rgba(214, 224, 238, 0.95);
}

.app-table tbody tr:hover td:last-child {
  background: linear-gradient(180deg, rgba(220, 236, 252, 0.92), rgba(232, 244, 255, 0.92));
}

/* Acciones con color (solo en tablas) */
.app-table td:last-child .btn {
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.32rem 0.55rem;
}

.app-table td:last-child .btn.btn-sm {
  padding: 0.28rem 0.5rem;
}

.app-table td:last-child .btn-outline-primary {
  border-color: rgba(11, 107, 203, 0.45);
  background: linear-gradient(180deg, rgba(11, 107, 203, 0.16), rgba(11, 107, 203, 0.08));
  color: #083b7a;
}

.app-table td:last-child .btn-outline-primary:hover {
  background: linear-gradient(180deg, rgba(11, 107, 203, 0.95), rgba(9, 88, 168, 0.95));
  border-color: rgba(11, 107, 203, 0.8);
  color: #ffffff;
}

.app-table td:last-child .btn-outline-secondary {
  border-color: rgba(100, 116, 139, 0.5);
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.16), rgba(100, 116, 139, 0.08));
  color: #334155;
}

.app-table td:last-child .btn-outline-secondary:hover {
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.95), rgba(30, 41, 59, 0.95));
  border-color: rgba(51, 65, 85, 0.85);
  color: #ffffff;
}

.app-table td:last-child .btn-outline-dark {
  border-color: rgba(15, 23, 42, 0.35);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.06));
  color: #0f172a;
}

.app-table td:last-child .btn-outline-dark:hover {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.95));
  border-color: rgba(15, 23, 42, 0.85);
  color: #ffffff;
}

.app-table td:last-child .btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.55);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.08));
  color: #7f1d1d;
}

.app-table td:last-child .btn-outline-danger:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  border-color: rgba(239, 68, 68, 0.85);
  color: #ffffff;
}

.app-table td:last-child .btn-outline-success {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.16), rgba(34, 197, 94, 0.08));
  color: #14532d;
}

.app-table td:last-child .btn-outline-success:hover {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
  border-color: rgba(34, 197, 94, 0.85);
  color: #ffffff;
}

/* Alertas mas evidentes (especialmente peligro/urgente). */
.alert {
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.alert-danger {
  background: linear-gradient(180deg, #ffe8e8, #ffd6d6);
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.12);
  position: relative;
  padding-left: 1.05rem;
  border-left: 6px solid rgba(239, 68, 68, 0.9);
}

.alert-danger::before {
  content: 'Peligro';
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.55rem;
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.alert-warning {
  background: linear-gradient(180deg, #fff7d6, #ffecb0);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.14);
  position: relative;
  padding-left: 1.05rem;
  border-left: 6px solid rgba(245, 158, 11, 0.95);
}

.alert-warning::before {
  content: 'Atencion';
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.55rem;
  color: #7a4a00;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.alert-success {
  background: linear-gradient(180deg, #e8fff0, #d6ffe6);
  border-color: rgba(34, 197, 94, 0.45);
  position: relative;
  padding-left: 1.05rem;
  border-left: 6px solid rgba(34, 197, 94, 0.9);
}

.alert-success::before {
  content: 'OK';
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.55rem;
  color: #14532d;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.alert-info {
  background: linear-gradient(180deg, #e8f4ff, #d8ecff);
  border-color: rgba(59, 130, 246, 0.35);
  position: relative;
  padding-left: 1.05rem;
  border-left: 6px solid rgba(59, 130, 246, 0.9);
}

.alert-info::before {
  content: 'Info';
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 0.55rem;
  color: #1e3a8a;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

/* Badges mas "amigables" y con mas color/contraste */
.badge {
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.badge.text-bg-success {
  background: linear-gradient(180deg, #16a34a, #22c55e) !important;
}

.badge.text-bg-warning {
  background: linear-gradient(180deg, #f59e0b, #fbbf24) !important;
  color: #1f2937 !important;
}

.badge.text-bg-danger {
  background: linear-gradient(180deg, #dc2626, #ef4444) !important;
}

.badge.text-bg-info {
  background: linear-gradient(180deg, #0ea5e9, #38bdf8) !important;
  color: #0b1220 !important;
}

.badge.text-bg-primary {
  background: linear-gradient(180deg, #0759a8, var(--primary)) !important;
}

.badge.text-bg-secondary {
  background: linear-gradient(180deg, #475569, #64748b) !important;
}

.badge.text-bg-dark {
  background: linear-gradient(180deg, #0f172a, #111827) !important;
}

/* Filas clickeables en tablas (mejora "entendimiento" en listados). */
tr.row-clickable td {
  cursor: pointer;
}

tr.row-clickable:hover td {
  background: rgba(11, 107, 203, 0.10);
}

/* Acciones dentro de fila no deben "verse" como parte del click general. */
tr.row-clickable a,
tr.row-clickable button,
tr.row-clickable input,
tr.row-clickable select,
tr.row-clickable textarea,
tr.row-clickable label {
  cursor: default;
}

/* Tarjetas interactivas del dashboard */
.stat-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.stat-link .stat-card {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.stat-link:hover .stat-card {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.form-control,
.form-select {
  border-color: #ced8e6;
  border-radius: 10px;
  padding: 0.62rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #7aaee6;
  box-shadow: 0 0 0 0.2rem rgba(11, 107, 203, 0.15);
}

.form-label {
  font-weight: 700;
  color: #3f4f64;
}

.btn:not(.btn-close) {
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:not(.btn-close):hover,
.btn:not(.btn-close):focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

.btn-primary {
  background: linear-gradient(180deg, #1784e8, #0b63c7);
  border-color: #0b63c7;
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(180deg, #0f72d0, #084f9d);
  border-color: #084f9d;
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(180deg, #22c55e, #159447);
  border-color: #159447;
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444, #c52828);
  border-color: #c52828;
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(180deg, #fbbf24, #e09a08);
  border-color: #d18a06;
  color: #1f2937;
}

.btn-info {
  background: linear-gradient(180deg, #38bdf8, #1388c9);
  border-color: #1388c9;
  color: #ffffff;
}

.btn-secondary {
  background: linear-gradient(180deg, #718198, #526174);
  border-color: #526174;
  color: #ffffff;
}

.btn-dark {
  background: linear-gradient(180deg, #334155, #111827);
  border-color: #111827;
  color: #ffffff;
}

.btn-outline-primary {
  border-color: #0b63c7;
  background: linear-gradient(180deg, #2f9bf3, #0b6bcb);
  color: #ffffff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: linear-gradient(180deg, #1784e8, #0b63c7);
  border-color: #0b63c7;
  color: #ffffff;
}

.btn-outline-secondary {
  border-color: #526174;
  background: linear-gradient(180deg, #8b9bb0, #64748b);
  color: #ffffff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: linear-gradient(180deg, #718198, #526174);
  border-color: #526174;
  color: #ffffff;
}

.btn-outline-dark {
  border-color: #111827;
  background: linear-gradient(180deg, #3b4a60, #1f2937);
  color: #ffffff;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
  background: linear-gradient(180deg, #334155, #111827);
  border-color: #111827;
  color: #ffffff;
}

.btn-outline-success {
  border-color: #159447;
  background: linear-gradient(180deg, #36d873, #16a34a);
  color: #ffffff;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
  background: linear-gradient(180deg, #22c55e, #159447);
  border-color: #159447;
  color: #ffffff;
}

.btn-outline-danger {
  border-color: #c52828;
  background: linear-gradient(180deg, #ff6767, #dc2626);
  color: #ffffff;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: linear-gradient(180deg, #ef4444, #c52828);
  border-color: #c52828;
  color: #ffffff;
}

.btn-outline-warning {
  border-color: #d18a06;
  background: linear-gradient(180deg, #ffd45a, #f59e0b);
  color: #1f2937;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
  background: linear-gradient(180deg, #fbbf24, #e09a08);
  border-color: #d18a06;
  color: #1f2937;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.88);
  color: #ffffff;
}

.btn-light {
  border-color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, #ffffff, #eef5fb);
  color: #0f3a48;
}

.btn-sm {
  padding: 0.32rem 0.58rem;
}

.btn-soft {
  background: linear-gradient(90deg, #0f7ae0, var(--primary));
  border: none;
  border-radius: 10px;
  padding-inline: 1rem;
}

.btn-soft:hover,
.btn-soft:focus {
  background: linear-gradient(90deg, #0f72d0, #0759a8);
}

/* Botones del dashboard (mas vivos y faciles de identificar). */
.dash-btn {
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.9rem;
  border-width: 1px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  position: relative;
  padding-left: 1.25rem;
}

.dash-btn::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.dash-btn:hover,
.dash-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  filter: saturate(1.05);
}

.dash-btn-asig {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.10));
  color: #14532d;
}

.dash-btn-asig::before { background: rgba(34, 197, 94, 0.9); }

.dash-btn-mov {
  border-color: rgba(245, 158, 11, 0.50);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.20), rgba(245, 158, 11, 0.10));
  color: #78350f;
}

.dash-btn-mov::before { background: rgba(245, 158, 11, 0.95); }

.dash-btn-mant {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.20), rgba(56, 189, 248, 0.10));
  color: #0c4a6e;
}

.dash-btn-mant::before { background: rgba(56, 189, 248, 0.95); }

/* Alineacion: que todos los botones del dashboard queden centrados y con el mismo alto visual. */
.dash-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-actions .btn-soft {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.05;
}

/* Centro de alertas: mas contraste incluso sin hover. */
.btn.dash-btn-alertas {
  border-color: rgba(234, 179, 8, 0.75) !important;
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.36), rgba(245, 158, 11, 0.18)) !important;
  color: #7c2d12 !important;
}

.btn.dash-btn-alertas::before { background: rgba(234, 179, 8, 0.95); }

.btn.dash-btn-alertas:hover,
.btn.dash-btn-alertas:focus {
  border-color: rgba(217, 119, 6, 0.78) !important;
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.40), rgba(245, 158, 11, 0.20)) !important;
  color: #7c2d12 !important;
}

.stat-card .card-body {
  padding: 0.95rem 1rem;
}

.stat-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff, var(--surface-muted));
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--top-a), var(--primary));
  opacity: 0.55;
}

.stat-value {
  color: #0f172a;
}

.stat-label {
  color: #44556d;
  font-weight: 700;
  font-size: 0.81rem;
  min-height: 2.1em;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.alert {
  border-radius: 12px;
  font-weight: 700;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #cdd8e6;
  background: #f7fbff;
  color: #35506b;
  font-weight: 700;
  text-decoration: none;
}

.filter-chip:hover {
  color: #12385f;
  border-color: #9bb9d7;
  background: #eef5fd;
}

.filter-chip.active {
  background: linear-gradient(90deg, #0f7ae0, var(--primary));
  border-color: transparent;
  color: #ffffff;
}

.permission-panel {
  border: 1px solid #dbe6f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f4f8fc);
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.permission-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem;
  border: 1px solid #d5e1ee;
  border-radius: 14px;
  background: #ffffff;
  min-height: 100%;
  cursor: pointer;
}

.permission-content {
  display: grid;
  gap: 0.2rem;
}

.permission-title {
  font-weight: 700;
  color: #17324d;
}

.permission-desc {
  color: #5f6b7a;
  font-size: 0.92rem;
}

.permissions-disabled {
  opacity: 0.6;
}

.settings-card {
  border: 1px solid #dbe6f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f5f9fd);
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.institution-preview {
  border: 1px dashed #c9d6e5;
  border-radius: 16px;
  background: var(--surface-muted);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.institution-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.audit-lines {
  display: grid;
  gap: 0.25rem;
}

.scanner-panel {
  border: 1px dashed #c6d5e7;
  border-radius: 16px;
  background: var(--surface-muted);
  padding: 1rem;
}

.qr-reader {
  max-width: 360px;
}

.qr-reader video {
  width: 100% !important;
  border-radius: 14px;
}

.app-modal {
  border: 1px solid #d7e3f1;
  border-radius: 14px;
}

.qr-label-sheet {
  display: flex;
  justify-content: center;
}

.qr-label-card {
  width: 100%;
  max-width: 760px;
  background: #ffffff;
  border: 1px solid #d8e4f0;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.qr-label-header {
  background: linear-gradient(135deg, #0f766e, #0b6bcb);
  color: #ffffff;
  padding: 1.5rem 1.75rem;
}

.qr-label-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  opacity: 0.88;
}

.qr-label-title {
  font-family: 'Merriweather', serif;
  font-size: 2rem;
  margin: 0.35rem 0 0.15rem;
}

.qr-label-name {
  font-size: 1.05rem;
  opacity: 0.96;
}

.qr-label-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  padding: 1.6rem 1.75rem 1.75rem;
}

.qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff, #eef5fb);
  border: 1px solid #dce8f4;
}

.qr-box-code {
  min-width: 196px;
  min-height: 196px;
}

.qr-box-code img {
  display: block;
  width: 196px;
  height: 196px;
}

.qr-meta {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.tarjeta-print {
  max-width: 980px;
  margin: 0 auto;
}

.firma-line {
  border-top: 1px solid #475569;
  width: 75%;
  margin: 0 auto 8px;
}

@media print {
  @page {
    size: auto;
    margin: 10mm;
  }

  .no-print,
  .app-topbar,
  .app-sidebar,
  .sidebar-toggle-btn,
  .app-overlay {
    display: none !important;
  }

  body {
    background: #ffffff !important;
  }

  .app-card,
  .hero-panel,
  .settings-card,
  .permission-panel,
  .permission-card,
  .scanner-panel {
    background: #ffffff !important;
    backdrop-filter: none !important;
  }

  .app-main,
  .container-fluid {
    padding: 0 !important;
  }

  .app-shell {
    display: block !important;
  }

  .app-content {
    min-height: auto !important;
  }

  .card,
  .app-card,
  .hero-panel {
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
  }

  .table-responsive {
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 1px solid #cfd8e3 !important;
  }

  .app-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .app-table thead th {
    position: static !important;
    top: auto !important;
    box-shadow: none !important;
    white-space: normal !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    padding: 6px !important;
  }

  .app-table td,
  .app-table th {
    font-size: 11px !important;
    line-height: 1.2 !important;
    padding: 6px !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    vertical-align: top !important;
  }

  .app-table td:last-child,
  .app-table th:last-child,
  .app-table tbody tr:hover td:last-child {
    background: #fff !important;
  }

  .app-table tbody tr,
  .app-table tbody tr:nth-child(even),
  .app-table tbody tr:hover {
    background: #fff !important;
  }

  a[href] {
    color: #111 !important;
    text-decoration: none !important;
  }

  .qr-label-card {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    border: 0;
  }
}

@media (max-width: 992px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 62px;
    height: calc(100vh - 62px);
    width: 260px;
    border-right: 1px solid var(--sidebar-border);
    transform: translateX(-104%);
    opacity: 0;
    pointer-events: none;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar-link {
    margin-bottom: 0.35rem;
  }

  .sidebar-icon {
    margin-right: 10px;
  }

  .sidebar-text {
    display: inline;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.sidebar-open .app-overlay {
    display: block;
    position: fixed;
    inset: 62px 0 0 0;
    background: rgba(2, 6, 23, 0.34);
    z-index: 1035;
  }

  .app-main,
  .app-content,
  .container-fluid,
  .card,
  .card-body,
  .hero-panel {
    min-width: 0;
  }

  .modal-dialog {
    margin: 0.75rem;
    max-width: calc(100vw - 1.5rem);
  }

  .modal-content {
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden;
  }

  .modal-body {
    overflow-y: auto;
  }
}

@media (max-width: 768px) {
  .user-pill {
    display: none;
  }

  .sidebar-toggle-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.45rem;
  }

  .app-brand span {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-panel .d-flex {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .app-main .container-fluid,
  main.container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .row > [class*="col-"] {
    min-width: 0;
  }

  .form-control,
  .form-select,
  .input-group,
  textarea {
    width: 100%;
    max-width: 100%;
  }

  .card-footer.d-flex,
  .hero-panel .d-flex,
  .dash-actions {
    flex-wrap: wrap;
  }

  .card-footer.d-flex > .btn,
  .card-footer.d-flex > form,
  .card-footer.d-flex > form > .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .btn {
    min-height: 44px;
  }

  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-table {
    min-width: 680px;
  }

  .app-topbar .container-fluid {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .app-topbar .container-fluid > .d-flex {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .qr-label-body {
    grid-template-columns: 1fr;
  }

  .qr-box {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .app-brand span {
    max-width: 125px;
  }

  .app-logo {
    width: 34px;
    height: 34px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .app-sidebar {
    width: min(86vw, 300px);
  }
}
