/* ==========================================================================
   MI REPORTE INFORMÁTICA - FERROLÁMINAS RICHAUD S.A. DE C.V.
   Diseño Corporativo Oficial Integrado con Suite Nirvana Auditores
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Paleta Corporativa Ferroláminas (Dark Mode por Defecto) */
  --bg-base: #070b12;
  --bg-surface: #0d1320;
  --bg-card: rgba(13, 19, 32, 0.75);
  --bg-card-hover: rgba(22, 32, 54, 0.88);
  --bg-glass: rgba(13, 19, 32, 0.7);
  --bg-input: rgba(15, 23, 42, 0.95);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(239, 68, 68, 0.45);
  --border-active: #dc2626;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Colores de Marca Ferroláminas Richaud */
  --brand-red: #dc2626;
  --brand-red-dark: #991b1b;
  --brand-red-glow: rgba(220, 38, 38, 0.28);
  
  --accent-cyan: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-indigo: #6366f1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.7);
  --shadow-red-glow: 0 0 20px rgba(220, 38, 38, 0.2);
  --blur-glass: blur(14px);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Claro Auditor (Estilo Suite Nirvana) */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.98);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-input: #ffffff;

  --border-subtle: #e2e8f0;
  --border-card: #cbd5e1;
  --border-hover: #dc2626;
  --border-active: #b91c1c;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 10% 10%, rgba(220, 38, 38, 0.07) 0px, transparent 40%),
    radial-gradient(at 90% 90%, rgba(16, 185, 129, 0.05) 0px, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem 2rem;
}

@media (max-width: 768px) {
  .app-layout {
    padding: 1rem 1rem 3rem 1rem;
  }
}

/* ==========================================================================
   HEADER OFICIAL FERROLÁMINAS RICHAUD
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--brand-red);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  position: sticky;
  top: 1rem;
  z-index: 100;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  border-radius: 8px;
  background: #ffffff;
  padding: 3px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: block;
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border: 1px solid rgba(220, 38, 38, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Botones con Acento Rojo Ferroláminas */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--brand-red-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 16px var(--brand-red-glow);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-emerald-glow);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 16px var(--accent-emerald-glow);
  transform: translateY(-1px);
}

.btn-amber {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.35);
}

.btn-amber:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-card);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
}

/* ==========================================================================
   BARRA DE KPIs EJECUTIVOS
   ========================================================================== */
.kpi-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.kpi-red::before { background: var(--brand-red); }
.kpi-card.kpi-green::before { background: var(--accent-emerald); }
.kpi-card.kpi-cyan::before { background: var(--accent-cyan); }
.kpi-card.kpi-amber::before { background: var(--accent-amber); }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-pill {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-red .kpi-icon-pill { background: rgba(220, 38, 38, 0.15); color: #ef4444; }
.kpi-green .kpi-icon-pill { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.kpi-cyan .kpi-icon-pill { background: rgba(14, 165, 233, 0.15); color: var(--accent-cyan); }
.kpi-amber .kpi-icon-pill { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

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

.kpi-subtext strong {
  color: var(--accent-emerald);
}

/* ==========================================================================
   BARRA DE AUDITORÍA, BÚSQUEDA Y FILTROS
   ========================================================================== */
.toolbar-section {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-box-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-box-wrapper svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.7rem 1rem 0.7rem 2.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-filter {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.select-filter:focus {
  outline: none;
  border-color: var(--brand-red);
}

.status-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.status-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.status-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.status-tab-btn.active {
  background: rgba(220, 38, 38, 0.15);
  border-color: var(--brand-red);
  color: #ef4444;
}

.tab-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
}

.status-tab-btn.active .tab-badge {
  background: var(--brand-red);
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   GRID DE EXPEDIENTES / TARJETAS EJECUTIVAS
   ========================================================================== */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

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

.record-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-smooth);
  backdrop-filter: var(--blur-glass);
}

.record-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ticket-folio {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: #ef4444;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  display: inline-block;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill.status-blindado {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-pendiente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.status-transito {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-pill.status-solicitud {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-pill.status-cotizado {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.dossier-action-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dossier-action-banner.banner-owner {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.card-title-group {
  margin-bottom: 0.85rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.card-category {
  font-size: 0.78rem;
  color: #ef4444;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-branch-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border-left: 3px solid var(--brand-red);
}

/* Stepper de 5 Eslabones */
.chain-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 1.25rem 0;
  padding: 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  z-index: 2;
  flex: 1;
}

.step-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  transition: all var(--transition-fast);
}

.step-node.completed .step-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #0f172a;
  box-shadow: 0 0 8px var(--accent-emerald-glow);
}

.step-node.active .step-circle {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #0f172a;
}

.step-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

.step-node.completed .step-label {
  color: var(--text-primary);
}

/* Metadatos */
.card-meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  margin-bottom: 1.25rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta-label {
  color: var(--text-muted);
}

.meta-value {
  color: var(--text-primary);
  font-weight: 600;
}

.meta-value.sn-badge {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #ef4444;
}

.signatures-badge-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.25);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--accent-emerald);
  margin-bottom: 1.15rem;
}

.signatures-badge-strip.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
}

.card-footer-actions {
  display: flex;
  gap: 0.5rem;
}

.card-footer-actions .btn {
  flex: 1;
}

/* ==========================================================================
   MODAL / DOSSIER 360°
   ========================================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-card);
  border-left: 4px solid var(--brand-red);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-header-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.audit-link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  overflow: hidden;
}

.link-card-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-red);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-step-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
}

.link-card-body {
  padding: 1.25rem;
}

.dossier-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .dossier-grid-2 {
    grid-template-columns: 1fr;
  }
}

.dossier-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dossier-item-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dossier-item-val {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.dossier-item-val.highlight {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #ef4444;
}

.evidence-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.evidence-photo-box {
  border: 1px solid var(--border-card);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.evidence-photo-box img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.evidence-photo-caption {
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

.signatures-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .signatures-trio-grid {
    grid-template-columns: 1fr;
  }
}

.sign-dossier-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}

.sign-dossier-box.verified {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.03);
}

.sign-dossier-box.pending {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.03);
}

.sign-box-role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ef4444;
  margin-bottom: 0.25rem;
}

.sign-box-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.signature-img-container {
  height: 70px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.signature-img-container img {
  max-height: 60px;
  max-width: 90%;
}

.sign-box-stamp {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.sign-box-stamp.confirmed {
  color: var(--accent-emerald);
}

.modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-card);
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* ==========================================================================
   CANVAS DE FIRMA INTERACTIVO
   ========================================================================== */
.signature-canvas-wrapper {
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
  touch-action: none;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  display: block;
  cursor: crosshair;
}

.canvas-instruction {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
  font-weight: 600;
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ==========================================================================
   FORMULARIO NUEVO EXPEDIENTE
   ========================================================================== */
.form-group-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

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

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: auto;
}

.toast.toast-success {
  border-color: var(--accent-emerald);
}
.toast.toast-success .toast-icon {
  color: var(--accent-emerald);
}
