:root {
  --color-primary: #0f2042;
  --color-primary-dark: #0a162e;
  --color-primary-light: #18417a;
  --color-accent: #0066cc;
  --color-accent-hover: #0052a3;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f5f9;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-info: #0284c7;
  --color-info-bg: #e0f2fe;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Enlace de accesibilidad para saltar navegación */
.skip-link {
  position: absolute;
  top: -60px;
  left: 10px;
  background-color: var(--color-accent);
  color: #ffffff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ffffff;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Header & Navbar */
.app-header {
  background-color: var(--color-primary);
  color: #ffffff;
  border-bottom: 2px solid var(--color-primary-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.brand-badge {
  background-color: var(--color-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
}

/* User Switcher */
.qa-switcher-box {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  gap: 0.6rem;
}

.qa-badge {
  background-color: #f59e0b;
  color: #78350f;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.qa-user-select {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.qa-user-select option {
  background-color: var(--color-primary-dark);
  color: #ffffff;
}

/* Navigation tabs */
.app-nav {
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-border-hover);
}

.nav-item.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.nav-counter {
  background-color: var(--color-surface-alt);
  color: var(--color-text);
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.nav-counter.alert {
  background-color: var(--color-danger);
  color: #ffffff;
}

/* Main Container */
.main-content {
  max-width: 1280px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.page-description {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

/* Cards & Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.stat-footer {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Cards Panel */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background-color: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

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

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill.SOLICITADA {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
}

.status-pill.APROBADA {
  background-color: var(--color-info-bg);
  color: var(--color-info);
}

.status-pill.ENTREGADA {
  background-color: #ede9fe;
  color: #6d28d9;
}

.status-pill.DEVUELTA {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.status-pill.DEVUELTA_CON_INCIDENCIA {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}

.status-pill.RECHAZADA {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}

.status-pill.CANCELADA {
  background-color: var(--color-surface-alt);
  color: var(--color-text-muted);
}

/* Modality badge */
.badge-modality {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: #e2e8f0;
  color: #334155;
}

.badge-area {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.badge-area.DTI {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-area.SERVICIOS_GENERALES {
  background-color: #fef3c7;
  color: #b45309;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-surface-alt);
  border-color: var(--color-border-hover);
}

.btn-success {
  background-color: var(--color-success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.form-label .required {
  color: var(--color-danger);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--color-text);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-help {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

/* Catalog Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.resource-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hover);
}

.resource-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.resource-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.resource-stock {
  background-color: var(--color-surface-alt);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resource-stock .available {
  font-weight: 700;
  color: var(--color-success);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface-alt);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Timeline Bitácora */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 7px;
  width: 2px;
  height: 100%;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-content {
  background: var(--color-surface-alt);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.timeline-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary);
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.timeline-details {
  font-size: 0.8rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  background: #ffffff;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-top: 0.35rem;
  overflow-x: auto;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 4px solid var(--color-primary);
  font-size: 0.9rem;
  min-width: 280px;
  animation: slideIn 0.2s ease-out;
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .qa-switcher-box {
    justify-content: space-between;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   MÓDULO PATRIMONIO INSTITUCIONAL (RES-PAT-003)
   ========================================================================= */

.patrimonio-header-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.patrimonio-header-banner h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.patrimonio-header-banner p {
  color: #cbd5e1;
  font-size: 0.95rem;
}

/* Grid de Métricas y KPIs Patrimoniales */
.patrimonio-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.patrimonio-kpi-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.patrimonio-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.kpi-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Gráficos de barra horizontal de distribución */
.distribution-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.distribution-panel h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.dist-bar-item {
  margin-bottom: 0.75rem;
}

.dist-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.dist-bar-track {
  height: 8px;
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Badges Patrimoniales */
.badge-regime {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-regime.ALMACEN_PRESTAMOS {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-regime.RESGUARDO_INDEFINIDO {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.badge-regime.USO_COMUN_AULA {
  background-color: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.badge-regime.LABORATORIO {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-condition {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-condition.EXCELENTE {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-condition.BUENO,
.badge-condition.BUENA {
  background-color: #ecfccb;
  color: #4d7c0f;
}

.badge-condition.REGULAR {
  background-color: #fef9c3;
  color: #a16207;
}

.badge-condition.MALO {
  background-color: #ffedd5;
  color: #c2410c;
}

.badge-condition.INSERVIBLE {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Barra de Filtros Patrimonial */
.filter-bar-patrimonio {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.filter-input-search {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.filter-select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  font-size: 0.85rem;
  min-width: 140px;
}

/* Ficha del Activo y Modal */
.asset-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.detail-card-section {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.detail-card-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.field-pair {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.85rem;
}

.field-pair:last-child {
  border-bottom: none;
}

.field-pair-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.field-pair-val {
  font-weight: 600;
  text-align: right;
}

/* Trazabilidad Historial Pericial */
.history-timeline {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.history-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  background-color: var(--color-border);
}

.history-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.history-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--color-accent);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.history-item-body {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* =========================================================================
   ETIQUETA PATRIMONIAL INSTITUCIONAL E IMPRESIÓN (PRINTABLE ASSET LABEL)
   ========================================================================= */

.asset-tag-wrapper {
  background: #ffffff;
  border: 2px solid #0f2042;
  border-radius: 6px;
  padding: 12px 14px;
  max-width: 440px;
  margin: 0 auto 1.5rem auto;
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
  color: #000000;
}

.tag-header {
  border-bottom: 2px solid #0f2042;
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag-institution-logo {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f2042;
  letter-spacing: -0.02em;
}

.tag-slogan {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #475569;
  font-weight: 700;
}

.tag-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tag-qr-box {
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px;
}

.tag-qr-box svg {
  width: 100% !important;
  height: 100% !important;
}

.tag-info-box {
  flex: 1;
  min-width: 0;
}

.tag-code-highlight {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f2042;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.tag-desc {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-meta-line {
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.3;
}

.tag-barcode-box {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #cbd5e1;
  text-align: center;
}

.tag-footer-stamp {
  font-size: 0.62rem;
  text-transform: uppercase;
  text-align: center;
  color: #64748b;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* Reglas Estrictas de Impresión (@media print) */
@media print {
  body * {
    visibility: hidden !important;
  }
  #printableAssetTag,
  #printableAssetTag * {
    visibility: visible !important;
  }
  #printableAssetTag {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 380px !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 10px !important;
  }
  .no-print {
    display: none !important;
  }
}

/* Responsividad para móviles (375x667) */
@media (max-width: 640px) {
  .patrimonio-header-banner {
    padding: 1rem;
  }
  .patrimonio-kpi-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar-patrimonio {
    flex-direction: column;
    align-items: stretch;
  }
  .tag-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .tag-desc {
    text-align: center;
  }
  .field-pair {
    flex-direction: column;
    gap: 0.15rem;
  }
  .field-pair-val {
    text-align: left;
  }
}

/* ============================================================================
   ESTILOS DE RESGUARDOS Y RESPONSIVAS PATRIMONIALES (RES-CUST-001)
   ============================================================================ */

.badge-resguardo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-resguardo.BORRADOR {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-resguardo.PENDIENTE_ACEPTACION {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge-resguardo.ACTIVO {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-resguardo.EN_DEVOLUCION {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.badge-resguardo.CERRADO {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-resguardo.CON_INCIDENCIA {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-resguardo.CANCELADO {
  background: #f3f4f6;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
}

.badge-line-status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-line-status.ASIGNADO {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-line-status.DEVUELTO_CONFORME {
  background: #dcfce7;
  color: #15803d;
}

.badge-line-status.DEVUELTO_CON_INCIDENCIA {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-line-status.TRANSFERIDO {
  background: #f3e8ff;
  color: #6b21a8;
}

/* Ficha y Constancia Imprimible */
.constancia-sheet {
  background: #ffffff;
  color: #1e293b;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  max-width: 800px;
  margin: 0 auto;
  font-family: inherit;
}

.constancia-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.constancia-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.constancia-sub {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.constancia-folio-badge {
  text-align: right;
}

.constancia-folio {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.05em;
}

.constancia-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.constancia-meta-item label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.constancia-meta-item span {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

.constancia-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.constancia-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem;
  border: 1px solid #cbd5e1;
}

.constancia-table td {
  padding: 0.6rem;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.constancia-acceptance-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.constancia-disclaimer {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
  border-top: 1px solid #cbd5e1;
  padding-top: 0.75rem;
  font-style: italic;
  text-align: justify;
}

.asset-selection-box {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem;
  background: #f8fafc;
}

.asset-select-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.asset-select-row:last-child {
  border-bottom: none;
}

/* Reglas de impresión oficial para constancias */
@media print {
  body * {
    visibility: hidden;
  }
  .modal-backdrop.open {
    position: static;
    background: transparent;
    padding: 0;
  }
  .modal-dialog {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }
  .modal-header, .modal-close, .btn-print-action, .app-header, .app-nav {
    display: none !important;
  }
  .constancia-sheet, .constancia-sheet * {
    visibility: visible;
  }
  .constancia-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
  }
}


/* Badge Bajas Patrimoniales (RES-BAJA-001) */
.badge-baja {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-baja.SOLICITADA { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-baja.EN_REVISION { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-baja.AUTORIZADA { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-baja.EJECUTADA { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.badge-baja.RECHAZADA { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-baja.CANCELADA { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }


/* =========================================================================
   ITAG-RES-UX-BRANDING-01 — IDENTIDAD ITAG DIGITAL, ESCALA Y LEGIBILIDAD
   Sin zoom CSS global ni transformaciones artificiales; 100% basado en tokens.
   ========================================================================= */

:root {
  --color-primary: var(--itag-darkblue, #132847);
  --color-primary-dark: #0c1b33;
  --color-primary-light: var(--itag-blue, #1C3B69);
  --color-accent: var(--itag-blue, #1C3B69);
  --color-accent-hover: var(--itag-darkblue, #132847);
  --color-bg: var(--itag-bg-page, #F8FAFC);
  --color-surface: var(--itag-surface-card, #FFFFFF);
  --color-border: var(--itag-border-subtle, #E2E8F0);
  --color-text: var(--itag-text-primary, #0F172A);
  --color-text-muted: var(--itag-text-secondary, #475569);
  --font-sans: var(--itag-font-sans, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);

  /* Escala tipográfica y dimensional institucional */
  --itag-max-width: 1440px;
  --itag-text-base: 1rem;         /* 16px */
  --itag-text-secondary-size: 0.875rem; /* 14px */
  --itag-heading-section: 1.3125rem;    /* 21px */
  --itag-heading-main: 1.75rem;         /* 28px */
  --itag-kpi-number: 2.125rem;          /* 34px */
  --itag-control-height: 44px;
}

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--itag-text-base);
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Aislamiento visual del entorno cuando la sesión staging no está autenticada */
body.staging-auth-pending .app-header,
body.staging-auth-pending .app-nav,
body.staging-auth-pending .main-content,
body.staging-auth-pending .app-footer {
  display: none !important;
}

/* Contenedores con aprovechamiento horizontal óptimo */
.header-container,
.nav-container,
.main-content,
.app-footer {
  width: 100%;
  max-width: var(--itag-max-width);
  margin-left: auto;
  margin-right: auto;
}

.header-container {
  padding: 0.85rem 1.75rem;
}

.main-content {
  flex: 1 0 auto;
  margin-top: 1.75rem;
  margin-bottom: 3rem;
  padding: 0 1.75rem;
}

/* Encabezado Institucional con Logo Blanco Oficial */
.app-header {
  background: linear-gradient(90deg, var(--itag-darkblue, #132847) 0%, var(--itag-blue, #1C3B69) 100%);
  border-bottom: 3px solid var(--itag-red, #C1272D);
}

.brand {
  gap: 1rem;
}

.header-brand-logo {
  height: 40px;
  width: auto;
  max-width: 120px;
  flex-shrink: 0;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background-color: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--itag-lightblue, #95D5F0);
  display: block;
  margin-top: 0.1rem;
}

.staging-session-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.staging-user-pill {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
}

.btn-header-logout {
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--itag-darkblue, #132847);
  border: 1px solid #ffffff;
  border-radius: 8px;
  cursor: pointer;
}

.btn-header-logout:hover {
  background: #f1f5f9;
}

.uat-env-banner {
  background: var(--itag-status-maint-bg, #FEF3C7);
  color: var(--itag-status-maint-text, #92400E);
  border-top: 1px solid var(--itag-status-maint-border, #FCD34D);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
}

/* Navegación Completa sin Cortes */
.app-nav {
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.nav-container {
  padding: 0.5rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  overflow-x: visible;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  min-height: 40px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--itag-text-secondary, #475569);
  border-bottom: 2px solid transparent;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--itag-darkblue, #132847);
  background-color: #f1f5f9;
  border-bottom-color: transparent;
}

.nav-item.active {
  color: var(--itag-darkblue, #132847);
  background-color: #e8effa;
  border-bottom: 2px solid var(--itag-blue, #1C3B69);
  font-weight: 700;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--itag-blue, #1C3B69);
}

/* Jerarquía Tipográfica y Escala Global */
.page-title {
  font-size: var(--itag-heading-main);
  line-height: 1.25;
}

.page-description {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.patrimonio-header-banner {
  background: linear-gradient(135deg, var(--itag-darkblue, #132847) 0%, var(--itag-blue, #1C3B69) 100%);
  padding: 1.75rem 2rem;
  border-radius: 12px;
  margin-bottom: 1.75rem;
}

.patrimonio-header-banner h1 {
  font-size: var(--itag-heading-main);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

.patrimonio-header-banner p {
  font-size: 1rem;
  color: #dbeafe;
  max-width: 780px;
}

.btn-banner-primary {
  min-height: var(--itag-control-height);
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--itag-darkblue, #132847);
  border: 1.5px solid #ffffff;
  border-radius: 8px;
}

.btn-banner-primary:hover {
  background: #f1f5f9;
}

.btn-banner-outline {
  min-height: var(--itag-control-height);
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-banner-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Tarjetas KPI y Paneles de Distribución */
.patrimonio-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.patrimonio-kpi-card {
  padding: 1.4rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value,
.stat-value {
  font-size: var(--itag-kpi-number);
  font-weight: 800;
  line-height: 1.15;
  color: var(--itag-darkblue, #132847);
  margin-bottom: 0.45rem;
}

.kpi-value-currency {
  font-size: 1.85rem;
  color: #166534;
}

.kpi-value-accent {
  color: var(--itag-blue, #1C3B69);
}

.kpi-inline-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.kpi-subtitle {
  font-size: var(--itag-text-secondary-size);
  color: var(--color-text-muted);
  line-height: 1.4;
}

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

.distribution-panel {
  padding: 1.5rem;
  border-radius: 12px;
}

.distribution-panel h3 {
  font-size: var(--itag-heading-section);
  font-weight: 700;
  color: var(--itag-darkblue, #132847);
  margin-bottom: 1.1rem;
}

.dist-bar-labels {
  font-size: 0.92rem;
}

/* Controles, Campos, Botones y Tablas Cómodas */
.form-control,
.filter-input-search,
.filter-select {
  min-height: var(--itag-control-height);
  font-size: 0.95rem;
  padding: 0.6rem 0.95rem;
}

textarea.form-control {
  min-height: 88px;
}

.btn {
  min-height: var(--itag-control-height);
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
}

.btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

table th {
  font-size: 0.85rem;
}

table td {
  font-size: 0.9375rem;
}

/* Pantalla de Acceso Institucional (Login Staging) */
.staging-login-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, var(--itag-darkblue, #132847) 0%, var(--itag-blue, #1C3B69) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.staging-login-card {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(10, 22, 46, 0.35);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.staging-login-header {
  padding: 2rem 2rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  background: #ffffff;
}

.staging-login-logo {
  height: 54px;
  width: auto;
  margin: 0 auto 1rem;
}

.staging-login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--itag-darkblue, #132847);
  margin: 0 0 0.3rem;
  line-height: 1.25;
}

.staging-login-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.staging-login-uat-badge {
  display: inline-block;
  background: var(--itag-status-maint-bg, #FEF3C7);
  color: var(--itag-status-maint-text, #92400E);
  border: 1px solid var(--itag-status-maint-border, #FCD34D);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  line-height: 1.35;
}

.staging-login-form {
  padding: 1.75rem 2rem 2rem;
}

.staging-field {
  margin-bottom: 1.25rem;
}

.staging-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--itag-text-primary, #0F172A);
  margin-bottom: 0.45rem;
}

.staging-input {
  min-height: 46px;
  font-size: 1rem;
  padding: 0.65rem 0.95rem;
  border: 1.5px solid var(--itag-border-control, #94A3B8);
  border-radius: 8px;
}

.staging-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.staging-password-input {
  padding-right: 5.5rem;
}

.staging-pass-toggle {
  position: absolute;
  right: 0.45rem;
  min-height: 34px;
  padding: 0 0.7rem;
  background: #f1f5f9;
  color: var(--itag-darkblue, #132847);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.staging-pass-toggle:hover {
  background: #e2e8f0;
}

.staging-submit-btn {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--itag-blue, #1C3B69);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.25rem;
}

.staging-submit-btn:hover {
  background: var(--itag-darkblue, #132847);
}

.staging-login-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  margin: 1.1rem 0 0;
  line-height: 1.45;
}

/* Pie Institucional */
.app-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--itag-darkblue, #132847);
}

.footer-brand-logo {
  height: 26px;
  width: auto;
}

/* Responsive Multi-Resolución (1920 / 1440 / 1366 / 768 / 390) */
@media (max-width: 1200px) {
  .patrimonio-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .patrimonio-dist-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header,
  .app-nav,
  .main-content,
  .app-footer {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .header-container,
  .nav-container,
  .main-content,
  .app-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .brand,
  .brand > div,
  .qa-switcher-box,
  .staging-session-box,
  .patrimonio-header-banner > div {
    min-width: 0;
    max-width: 100%;
  }
  .qa-user-select,
  .staging-user-pill {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-subtitle {
    white-space: normal;
    line-height: 1.3;
  }
  .header-brand-logo {
    height: 32px;
  }
  .brand-divider {
    display: none;
  }
  .nav-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.6rem;
  }
  .patrimonio-header-banner {
    padding: 1.25rem;
  }
  .patrimonio-header-banner h1 {
    font-size: 1.35rem;
  }
  .patrimonio-kpi-grid {
    grid-template-columns: 1fr;
  }
  .staging-login-header,
  .staging-login-form {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
