/**
 * Estilos Frontend para AMD Falco Asesor
 * Desarrollado por AMD Creativos
 * Paleta: #0151a3, #2e6eb1, #6697c8, #ffffff
 */

:root {
  --falco-primary: #0151a3;
  --falco-primary-dark: #013f80;
  --falco-secondary: #2e6eb1;
  --falco-accent: #6697c8;
  --falco-accent-light: #e8f1f9;
  --falco-accent-subtle: #f4f8fc;
  --falco-white: #ffffff;
  --falco-bg: #f8fafc;
  --falco-border: #dbe6f0;
  --falco-border-focus: #2e6eb1;
  --falco-text-main: #1e293b;
  --falco-text-muted: #64748b;
  --falco-success: #10b981;
  --falco-warning: #f59e0b;
  --falco-danger: #ef4444;
  --falco-shadow-sm: 0 1px 3px rgba(1, 81, 163, 0.06);
  --falco-shadow-md: 0 4px 14px rgba(1, 81, 163, 0.08);
  --falco-shadow-lg: 0 12px 32px rgba(1, 81, 163, 0.12);
  --falco-radius-sm: 8px;
  --falco-radius-md: 14px;
  --falco-radius-lg: 20px;
  --falco-radius-pill: 9999px;
  --falco-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* RESET & CONTENEDOR 100% PANTALLA COMPLETA */
#amd-falco-app,
#falco-auth-wrapper {
  box-sizing: border-box;
  font-family: var(--falco-font);
  color: var(--falco-text-main);
  background-color: var(--falco-bg);
  width: 100vw;
  max-width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

#amd-falco-app *,
#falco-auth-wrapper * {
  box-sizing: border-box;
}

.falco-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   PANTALLA DE INICIO DE SESIÓN CORPORATIVA
   ========================================================================== */
.falco-auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, #e8f1f9 0%, #f8fafc 90%);
}

.falco-auth-card {
  background: var(--falco-white);
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  border-radius: var(--falco-radius-lg);
  box-shadow: var(--falco-shadow-lg);
  border: 1px solid var(--falco-border);
  text-align: center;
}

.falco-auth-header {
  margin-bottom: 28px;
}

.falco-auth-logo {
  display: inline-flex;
  margin-bottom: 14px;
}

.falco-logo-circle {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--falco-primary), var(--falco-secondary));
  color: var(--falco-white);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(1, 81, 163, 0.25);
}

.falco-auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--falco-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.falco-auth-subtitle {
  font-size: 14px;
  color: var(--falco-text-muted);
  margin: 0;
  line-height: 1.5;
}

.falco-auth-footer {
  margin-top: 24px;
}

.falco-auth-notice {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--falco-border);
  font-size: 12px;
  color: var(--falco-text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   BARRA SUPERIOR (TOPBAR)
   ========================================================================== */
.falco-app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.falco-topbar {
  height: 68px;
  background: var(--falco-white);
  border-bottom: 1px solid var(--falco-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 20;
  flex-shrink: 0;
}

.falco-topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.falco-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.falco-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--falco-primary), var(--falco-secondary));
  color: var(--falco-white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 3px 8px rgba(1, 81, 163, 0.2);
}

.falco-brand-text {
  display: flex;
  flex-direction: column;
}

.falco-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--falco-primary);
  line-height: 1.2;
}

.falco-brand-sub {
  font-size: 11px;
  color: var(--falco-text-muted);
  font-weight: 500;
}

.falco-sheet-select {
  padding: 8px 14px;
  border-radius: var(--falco-radius-pill);
  border: 1px solid var(--falco-border);
  background: var(--falco-accent-subtle);
  color: var(--falco-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.falco-sheet-select:focus {
  border-color: var(--falco-secondary);
  background: var(--falco-white);
  box-shadow: 0 0 0 3px rgba(1, 81, 163, 0.12);
}

.falco-topbar-center {
  flex: 1;
  max-width: 360px;
  margin: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.falco-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--falco-text-muted);
}

.falco-progress-pct {
  color: var(--falco-primary);
}

.falco-progress-bar-bg {
  height: 6px;
  background: var(--falco-border);
  border-radius: 6px;
  overflow: hidden;
}

.falco-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--falco-accent), var(--falco-primary));
  border-radius: 6px;
  transition: width 0.3s ease;
}

.falco-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.falco-save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--falco-text-muted);
  font-weight: 500;
  background: var(--falco-accent-subtle);
  padding: 5px 10px;
  border-radius: var(--falco-radius-pill);
}

.falco-save-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--falco-success);
  transition: background-color 0.2s ease;
}

.falco-save-dot.is-saving {
  background: var(--falco-warning);
  animation: falco-pulse 1s infinite alternate;
}

@keyframes falco-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.falco-btn-mobile-doc {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--falco-accent-light);
  color: var(--falco-primary);
  border: 1px solid var(--falco-accent);
  border-radius: var(--falco-radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.falco-advisor-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--falco-white);
  border: 1px solid var(--falco-border);
  padding: 4px 10px 4px 4px;
  border-radius: var(--falco-radius-pill);
}

.falco-avatar {
  width: 26px;
  height: 26px;
  background: var(--falco-primary);
  color: var(--falco-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.falco-advisor-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--falco-text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.falco-advisor-select {
  background: var(--falco-white);
  border: 1px solid var(--falco-border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--falco-primary);
  outline: none;
  cursor: pointer;
  max-width: 180px;
}

.falco-advisor-select:focus {
  border-color: var(--falco-secondary);
}

.falco-btn-icon {
  background: var(--falco-accent-subtle);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
}

.falco-btn-icon:hover {
  background: var(--falco-accent-light);
  border-color: var(--falco-accent);
}

/* ==========================================================================
   SPLIT-SCREEN WORKSPACE (ESCRITORIO & TABLET HORIZONTAL)
   ========================================================================== */
.falco-workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* COLUMNA IZQUIERDA: FORMULARIO */
.falco-pane-form {
  flex: 1 1 54%;
  max-width: 58%;
  overflow-y: auto;
  padding: 24px 32px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.falco-card-form {
  width: 100%;
  max-width: 820px;
  background: var(--falco-white);
  border-radius: var(--falco-radius-md);
  padding: 32px;
  box-shadow: var(--falco-shadow-sm);
  border: 1px solid var(--falco-border);
  display: flex;
  flex-direction: column;
  height: auto;
}

.falco-sheet-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--falco-border);
}

.falco-sheet-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.falco-badge-sheet {
  background: var(--falco-primary);
  color: var(--falco-white);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--falco-radius-pill);
}

.falco-badge-type {
  background: var(--falco-accent-light);
  color: var(--falco-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--falco-radius-pill);
}

.falco-sheet-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--falco-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.falco-sheet-desc {
  font-size: 14px;
  color: var(--falco-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* GRID DINÁMICA DE CAMPOS (ADAPTABLE VERTICALMENTE) */
.falco-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: min-content;
  gap: 18px 20px;
  align-content: start;
  align-items: start;
}

.falco-field-full {
  grid-column: 1 / -1 !important;
  width: 100% !important;
}

.falco-input-group,
.falco-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.falco-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--falco-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.falco-req-star {
  color: var(--falco-danger);
  margin-left: 3px;
}

.falco-badge-prefilled {
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.falco-badge-computed {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 7px;
  border-radius: 4px;
}

.falco-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.falco-input,
.falco-field-input {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--falco-radius-sm);
  border: 1px solid var(--falco-border);
  background: var(--falco-white);
  color: var(--falco-text-main);
  outline: none;
  transition: all 0.2s ease;
}

.falco-input:focus,
.falco-field-input:focus {
  border-color: var(--falco-primary);
  box-shadow: 0 0 0 3px rgba(1, 81, 163, 0.12);
}

.falco-input.is-readonly,
.falco-field-input.is-readonly {
  background: var(--falco-accent-subtle);
  color: #334155;
  border-color: #cbd5e1;
  cursor: default;
}

.falco-input.is-readonly:focus,
.falco-field-input.is-readonly:focus {
  border-color: #cbd5e1;
  box-shadow: none;
}

/* TARJETA INFORMATIVA PARA HOJAS SIN CAMPOS */
.falco-info-sheet-card {
  grid-column: span 2;
  background: linear-gradient(180deg, #f0f7fd 0%, #ffffff 100%);
  border: 1px solid #c8ddf0;
  border-radius: var(--falco-radius-md);
  padding: 32px 24px;
  text-align: center;
  margin: 10px 0;
}

.falco-info-sheet-icon {
  width: 54px;
  height: 54px;
  background: var(--falco-accent-light);
  color: var(--falco-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px auto;
}

.falco-info-sheet-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--falco-primary);
  margin: 0 0 8px 0;
}

.falco-info-sheet-p {
  font-size: 14px;
  color: var(--falco-text-muted);
  max-width: 520px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

/* NAVEGACIÓN INFERIOR DE HOJAS */
.falco-sheet-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--falco-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.falco-sheet-nav-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--falco-text-muted);
}

/* ==========================================================================
   COLUMNA DERECHA: VISOR DE DOCUMENTO (WEBP)
   ========================================================================== */
.falco-pane-document {
  flex: 1 1 46%;
  min-width: 42%;
  display: flex;
  flex-direction: column;
  background: #eef5fb;
  border-left: 1px solid #d4e4f3;
  position: relative;
  overflow: hidden;
}

.falco-doc-toolbar {
  height: 48px;
  background: var(--falco-white);
  border-bottom: 1px solid #d4e4f3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 10;
}

.falco-doc-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.falco-doc-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--falco-primary);
  background: #e0eef9;
  padding: 3px 8px;
  border-radius: var(--falco-radius-pill);
  letter-spacing: 0.5px;
}

.falco-doc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--falco-primary);
}

.falco-doc-actions {
  display: flex;
  gap: 6px;
}

.falco-doc-tool-btn {
  background: #f0f6fb;
  color: var(--falco-secondary);
  border: 1px solid #c5dcee;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.falco-doc-tool-btn:hover {
  background: var(--falco-primary);
  color: var(--falco-white);
  border-color: var(--falco-primary);
}

.falco-doc-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.falco-doc-canvas-wrapper {
  background: var(--falco-white);
  box-shadow: 0 8px 30px rgba(1, 81, 163, 0.15);
  border-radius: 4px;
  border: 1px solid #d0e2f2;
  transition: transform 0.2s ease;
  transform-origin: top center;
  max-width: 100%;
}

.falco-doc-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.falco-doc-fallback {
  width: 480px;
  height: 650px;
  background: var(--falco-white);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: var(--falco-text-muted);
}

.falco-fallback-icon {
  font-size: 56px;
  margin-bottom: 16px;
  color: var(--falco-accent);
}

.falco-doc-fallback h4 {
  font-size: 18px;
  color: var(--falco-primary);
  margin: 0 0 10px 0;
}

.falco-doc-fallback p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   BOTONES Y ELEMENTOS DE ACCIÓN
   ========================================================================== */
.falco-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--falco-radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.falco-btn-primary {
  background: linear-gradient(135deg, var(--falco-primary), var(--falco-secondary));
  color: var(--falco-white);
  box-shadow: 0 4px 12px rgba(1, 81, 163, 0.25);
}

.falco-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--falco-primary-dark), var(--falco-primary));
  box-shadow: 0 6px 16px rgba(1, 81, 163, 0.35);
  transform: translateY(-1px);
}

.falco-btn-secondary {
  background: var(--falco-accent-subtle);
  color: var(--falco-secondary);
  border-color: var(--falco-border);
}

.falco-btn-secondary:hover:not(:disabled) {
  background: var(--falco-accent-light);
  border-color: var(--falco-accent);
}

.falco-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--falco-white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.falco-btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

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

.falco-btn-outline:hover {
  background: var(--falco-accent-subtle);
  color: var(--falco-text-main);
}

.falco-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: var(--falco-white);
  border: 1px solid #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.falco-btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.falco-btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: var(--falco-white);
  border: 1px solid #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.falco-btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #b45309;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.falco-btn-block {
  width: 100%;
}

.falco-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.falco-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: falco-spin 0.8s linear infinite;
}

@keyframes falco-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MODALES Y POPUPS
   ========================================================================== */
.falco-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.falco-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 81, 163, 0.4);
  backdrop-filter: blur(4px);
}

.falco-modal-dialog {
  position: relative;
  background: var(--falco-white);
  border-radius: var(--falco-radius-lg);
  box-shadow: var(--falco-shadow-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  z-index: 10;
  animation: falco-modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes falco-modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.falco-modal-header {
  padding: 20px 24px 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--falco-border);
}

.falco-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--falco-primary);
  flex: 1;
}

.falco-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--falco-text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.falco-modal-body {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--falco-text-main);
}

.falco-modal-footer {
  padding: 16px 24px;
  background: var(--falco-bg);
  border-top: 1px solid var(--falco-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Modal Lightbox para Móvil / Tablet */
.falco-modal-lightbox {
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.falco-modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #eef5fb;
  display: flex;
  justify-content: center;
}

.falco-lightbox-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Resumen del Contrato en Modal de Envío */
.falco-summary-box {
  background: var(--falco-accent-subtle);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-sm);
  padding: 14px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.falco-summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

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

.falco-sum-val {
  color: var(--falco-primary);
  font-weight: 700;
  text-align: right;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ALERTAS */
.falco-alert {
  padding: 12px 16px;
  border-radius: var(--falco-radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

.falco-alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.falco-alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* ==========================================================================
   MODALES DE NOTIFICACIÓN Y ÉXITO DE ENVÍO
   ========================================================================== */
.falco-modal-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px auto;
  flex-shrink: 0;
}

.falco-modal-icon-success {
  background: #ecfdf5;
  color: #059669;
  border: 2px solid #a7f3d0;
}

.falco-modal-icon-warning {
  background: #fffbeb;
  color: #d97706;
  border: 2px solid #fde68a;
}

.falco-modal-icon-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 2px solid #fecaca;
}

.falco-modal-icon-info {
  background: #eff6ff;
  color: #2563eb;
  border: 2px solid #bfdbfe;
}

.falco-dialog-content {
  text-align: center;
  padding: 8px 4px;
}

.falco-dialog-title-center {
  font-size: 20px;
  font-weight: 700;
  color: var(--falco-primary);
  margin: 0 0 10px 0;
  text-align: center;
}

.falco-dialog-desc {
  font-size: 14px;
  color: var(--falco-text-muted);
  line-height: 1.6;
  margin: 0 0 18px 0;
}

.falco-tramite-card {
  background: var(--falco-accent-subtle);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-md);
  padding: 16px;
  margin: 18px 0;
  text-align: left;
}

.falco-tramite-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--falco-text-muted);
  margin-bottom: 6px;
}

.falco-tramite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--falco-white);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-sm);
  padding: 8px 12px;
}

.falco-tramite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--falco-primary);
  word-break: break-all;
}

.falco-btn-copy {
  background: var(--falco-accent-light);
  border: 1px solid var(--falco-border);
  color: var(--falco-primary);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.falco-btn-copy:hover {
  background: var(--falco-secondary);
  color: #ffffff;
}

.falco-copy-feedback {
  display: block;
  font-size: 11px;
  color: #059669;
  font-weight: 600;
  margin-top: 6px;
  text-align: right;
}

/* ==========================================================================
   RESPONSIVE (TABLET VERTICAL & MÓVIL)
   ========================================================================== */
@media (max-width: 1023px) {
  .falco-topbar {
    padding: 0 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .falco-topbar-center {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .falco-pane-form {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 16px 16px 36px;
    align-items: flex-start;
  }

  .falco-card-form {
    padding: 20px 18px;
    height: auto;
  }

  .falco-fields-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    gap: 14px;
    align-content: start;
    align-items: start;
  }

  .falco-field-full {
    grid-column: span 1;
  }

  .falco-info-sheet-card {
    grid-column: span 1;
  }

  /* Ocultar visor lateral permanente en vertical/móvil y mostrar botón modal */
  .falco-pane-document {
    display: none;
  }

  .falco-btn-mobile-doc {
    display: inline-flex;
  }

  .falco-sheet-select {
    max-width: 180px;
  }

  .falco-advisor-name {
    display: none;
  }
}

@media (max-width: 480px) {
  .falco-sheet-select {
    max-width: 140px;
    font-size: 12px;
  }

  .falco-sheet-title {
    font-size: 18px;
  }

  .falco-btn {
    padding: 9px 16px;
    font-size: 13px;
  }
}

/* ==========================================================================
   TABLERO Y LISTADO DE CONTRATOS ([amd_falco_contratos])
   ========================================================================== */
.falco-contratos-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 24px 20px;
  font-family: var(--falco-font);
  color: var(--falco-text-main);
}

.falco-contratos-wrapper *,
.falco-contratos-wrapper *::before,
.falco-contratos-wrapper *::after {
  box-sizing: border-box;
}

.falco-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.falco-list-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.falco-list-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--falco-primary);
  margin: 0 0 4px 0;
}

.falco-list-subtitle {
  font-size: 13px;
  color: var(--falco-text-muted);
  margin: 0;
}

.falco-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--falco-radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.falco-role-admin {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.falco-role-asesor {
  background: var(--falco-accent-light);
  color: var(--falco-primary);
  border: 1px solid var(--falco-border);
}

.falco-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.falco-stat-card {
  background: var(--falco-white);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--falco-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.falco-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--falco-accent-light);
  color: var(--falco-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.falco-stat-info {
  display: flex;
  flex-direction: column;
}

.falco-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--falco-primary);
  line-height: 1.2;
}

.falco-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--falco-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.falco-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.falco-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.falco-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--falco-text-muted);
  pointer-events: none;
}

.falco-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-sm);
  font-size: 13px;
  background: var(--falco-white);
  color: var(--falco-text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.falco-search-input:focus {
  border-color: var(--falco-border-focus);
  box-shadow: 0 0 0 3px rgba(46, 110, 177, 0.12);
}

.falco-table-container {
  background: var(--falco-white);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-md);
  overflow-x: auto;
  box-shadow: var(--falco-shadow-sm);
}

.falco-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.falco-data-table th {
  background: var(--falco-accent-subtle);
  color: var(--falco-primary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--falco-border);
  white-space: nowrap;
}

.falco-data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--falco-border);
  vertical-align: middle;
}

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

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

.falco-code-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  background: var(--falco-accent-subtle);
  color: var(--falco-primary);
  border: 1px solid var(--falco-border);
  padding: 4px 6px;
  border-radius: 4px;
}

.falco-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--falco-radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.falco-status-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.falco-empty-state {
  text-align: center;
  padding: 60px 20px;
}

.falco-dt-box {
  background: var(--falco-bg);
  border: 1px solid var(--falco-border);
  border-radius: var(--falco-radius-sm);
  padding: 10px 12px;
}

.falco-dt-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--falco-text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.falco-dt-val {
  font-size: 13px;
  color: var(--falco-text-main);
  word-break: break-all;
}
