/* =====================================================
   SEAUTOMATIZA · Demo Marítima del Estrecho
   Hoja de estilos basada en el Manual de Identidad Visual
   ===================================================== */

/* ---- Variables ---- */
:root {
  /* Paleta corporativa */
  --blue-deep: #0D47A1;
  --blue-cta: #1E88E5;
  --blue-light: #4FC3F7;
  --blue-deep-dark: #041639;

  /* Neutros */
  --gray-text: #263238;
  --gray-soft: #F5F7FA;
  --gray-border: #E1E8ED;
  --gray-muted: #6B7B85;
  --white: #FFFFFF;

  /* Semánticos */
  --success: #2E7D32;
  --warning: #E65100;
  --danger: #C62828;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(13, 71, 161, 0.06);
  --shadow-md: 0 4px 16px rgba(13, 71, 161, 0.08);
  --shadow-lg: 0 12px 40px rgba(13, 71, 161, 0.10);
  --shadow-cta: 0 0 20px rgba(30, 136, 229, 0.3);
  --shadow-cta-strong: 0 8px 24px rgba(30, 136, 229, 0.35);

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Espaciado base */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray-text);
  background: var(--gray-soft);
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ============ GLOW EFFECTS (fondo) ============ */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: var(--blue-cta);
  top: -200px;
  right: -200px;
  opacity: 0.12;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: var(--blue-light);
  bottom: -150px;
  left: -150px;
  opacity: 0.08;
}


/* ============ NAVBAR ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-border);
}

.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--blue-deep);
  text-decoration: none;
  transition: var(--transition-fast);
}

.brand-name:hover {
  color: var(--blue-cta);
}

.brand-divider {
  color: var(--blue-light);
  font-weight: 600;
}

.brand-product {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--gray-muted);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.15);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ APP / SCREEN ============ */
.app {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 80px;
  position: relative;
  z-index: 1;
  flex: 1;
}

.screen {
  display: none;
  animation: screenIn 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.screen-active {
  display: block;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-cta);
  margin-bottom: 8px;
}

.screen-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--blue-deep);
  line-height: 1.15;
  text-wrap: balance;
}

.screen-subtitle {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--gray-muted);
  max-width: 600px;
}

/* ============ BOTÓN VOLVER ============ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--blue-cta);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.back-btn:hover {
  color: var(--blue-deep);
  transform: translateX(-2px);
}

.back-arrow {
  font-size: 1.125rem;
  font-weight: 400;
}

/* ============ INBOX STATS ============ */
.inbox-stats {
  display: flex;
  gap: 12px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-deep);
  letter-spacing: -0.025em;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-muted);
  margin-top: 4px;
  font-weight: 500;
}

.stat-card-accent {
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-cta) 100%);
  border: none;
  box-shadow: var(--shadow-cta);
}

.stat-card-accent .stat-num {
  color: var(--white);
}

.stat-card-accent .stat-label {
  color: rgba(255, 255, 255, 0.85);
}

/* ============ SAVINGS SECTION (Antes vs Después) ============ */
.savings-section {
  margin-bottom: 28px;
}

.savings-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.savings-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.saving-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

.saving-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, transparent 40%, rgba(30, 136, 229, 0.04) 100%);
  border-radius: 0 0 0 80px;
}

.saving-icon {
  width: 28px;
  height: 28px;
  color: var(--blue-cta);
}

.saving-icon svg {
  width: 100%;
  height: 100%;
}

.saving-data {
  display: flex;
  align-items: center;
  gap: 10px;
}

.saving-before,
.saving-after {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.saving-before span,
.saving-after span {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.saving-before span {
  color: var(--gray-muted);
}

.saving-after span {
  color: var(--success);
}

.saving-before strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--warning);
}

.saving-after strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--success);
}

.saving-arrow {
  font-size: 1.125rem;
  color: var(--blue-light);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 10px;
}

.saving-metric {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-text);
}

.saving-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--blue-cta);
  background: rgba(30, 136, 229, 0.06);
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

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

.inbox-table {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.inbox-row {
  display: grid;
  grid-template-columns: 110px 1.5fr 1fr 1fr 1fr 100px;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-border);
  transition: var(--transition-fast);
}

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

.inbox-row-head {
  background: var(--gray-soft);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-muted);
  padding: 12px 24px;
}

.inbox-row-data {
  cursor: pointer;
  font-size: 0.875rem;
}

.inbox-row-data:hover {
  background: rgba(30, 136, 229, 0.04);
}

.invoice-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending {
  background: rgba(230, 81, 0, 0.1);
  color: var(--warning);
}

.status-ready {
  background: rgba(46, 125, 50, 0.1);
  color: var(--success);
}

.status-review {
  background: rgba(30, 136, 229, 0.1);
  color: var(--blue-cta);
}

.provider-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
}

.provider-avatar svg {
  width: 18px;
  height: 18px;
}

.provider-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.provider-name {
  font-weight: 600;
  color: var(--gray-text);
}

.provider-country {
  font-size: 0.75rem;
  color: var(--gray-muted);
  display: block;
  margin-top: 2px;
}

.invoice-meta {
  color: var(--gray-text);
  font-weight: 500;
}

.invoice-meta-sub {
  font-size: 0.75rem;
  color: var(--gray-muted);
  display: block;
  margin-top: 2px;
}

.confidence-bar {
  height: 6px;
  background: var(--gray-border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-cta), var(--blue-light));
  border-radius: 999px;
  transition: width 600ms ease-out;
}

.confidence-text {
  font-size: 0.75rem;
  color: var(--gray-muted);
  margin-top: 4px;
  font-weight: 500;
}

.row-action {
  text-align: right;
}

.row-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gray-soft);
  color: var(--blue-cta);
  font-size: 1.125rem;
  font-weight: 600;
  transition: var(--transition);
}

.inbox-row-data:hover .row-arrow {
  background: var(--blue-cta);
  color: var(--white);
  transform: translateX(2px);
}

/* ============ BOTONES ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-cta) 0%, var(--blue-deep) 100%);
  color: var(--white);
  box-shadow: var(--shadow-cta);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-strong);
}

.btn-secondary {
  background: var(--white);
  color: var(--blue-deep);
  border: 1px solid var(--gray-border);
}

.btn-secondary:hover {
  background: var(--gray-soft);
  border-color: var(--blue-cta);
}

.btn-arrow {
  transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
  transform: translateX(2px);
}

.validate-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============ SPLIT VIEW ============ */
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.split-pane {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-border);
  background: var(--gray-soft);
}

.pane-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-muted);
}

.pane-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-muted);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(30, 136, 229, 0.1);
  color: var(--blue-cta);
}

.page-indicator {
  font-size: 0.75rem;
  color: var(--gray-muted);
  margin: 0 6px;
  font-weight: 500;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 136, 229, 0.1);
  color: var(--blue-cta);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-cta);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ============ INVOICE VIEWER (factura simulada) ============ */
.invoice-viewer {
  padding: 32px;
  min-height: 600px;
  background:
    linear-gradient(180deg, rgba(13, 71, 161, 0.015) 0%, transparent 100%),
    var(--white);
  overflow: auto;
}

.invoice-doc {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 32px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-sm);
}

.invoice-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--gray-text);
  margin-bottom: 20px;
}

.invoice-supplier {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--gray-text);
  line-height: 1.2;
}

.invoice-supplier-meta {
  font-size: 0.75rem;
  color: var(--gray-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.invoice-number-block {
  text-align: right;
  font-size: 0.75rem;
}

.invoice-number-label {
  color: var(--gray-muted);
  font-weight: 500;
}

.invoice-number-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-text);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.invoice-customer-block {
  margin: 18px 0;
  padding: 12px 14px;
  background: var(--gray-soft);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.invoice-customer-block strong {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 18px 0;
}

.invoice-items-table th {
  background: var(--gray-text);
  color: var(--white);
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invoice-items-table td {
  padding: 10px;
  border-bottom: 1px solid var(--gray-border);
}

.invoice-items-table tr:last-child td {
  border-bottom: none;
}

.invoice-totals {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.invoice-totals-box {
  min-width: 220px;
  padding: 14px 16px;
  background: var(--gray-soft);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.invoice-totals-row.total {
  border-top: 2px solid var(--gray-text);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
  font-size: 0.9375rem;
}

/* Highlight overlay sobre la factura - simula que la IA está "viendo" */
.invoice-highlight {
  background: linear-gradient(90deg, transparent, rgba(30, 136, 229, 0.18), transparent);
  background-size: 200% 100%;
  animation: scanline 2.5s ease-in-out infinite;
  padding: 1px 4px;
  border-radius: 3px;
}

@keyframes scanline {
  0%, 100% { background-position: -100% 0; }
  50% { background-position: 100% 0; }
}

/* ============ INVOICE TEMPLATE: INTL-EXPORT ============ */
.invoice-doc-export {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.invoice-doc-export .export-dual-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 28px 28px 18px;
  border-bottom: 3px double var(--gray-text);
  margin-bottom: 0;
}

.invoice-doc-export .export-company {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.invoice-doc-export .export-company-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--gray-text);
  letter-spacing: -0.02em;
}

.invoice-doc-export .export-company-info {
  font-size: 0.6875rem;
  color: var(--gray-muted);
  line-height: 1.5;
}

.invoice-doc-export .export-refs {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-doc-export .export-ref-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.invoice-doc-export .export-ref-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-muted);
}

.invoice-doc-export .export-ref-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-text);
}

.invoice-doc-export .export-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 28px;
}

.invoice-doc-export .export-party {
  padding: 14px 16px;
  font-size: 0.6875rem;
  line-height: 1.5;
}

.invoice-doc-export .export-party:last-child {
  background: rgba(13, 71, 161, 0.03);
  border-left: 1px solid var(--gray-border);
}

.invoice-doc-export .export-party strong {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-deep);
  margin-bottom: 6px;
}

.invoice-doc-export .export-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.6875rem;
}

.invoice-doc-export .export-items-table thead {
  background: var(--blue-deep);
}

.invoice-doc-export .export-items-table th {
  color: var(--white);
  text-align: left;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.invoice-doc-export .export-items-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-border);
  vertical-align: top;
}

.invoice-doc-export .export-items-table tr:last-child td {
  border-bottom: none;
}

.invoice-doc-export .export-items-table tbody tr:nth-child(even) {
  background: rgba(13, 71, 161, 0.02);
}

.invoice-doc-export .export-totals {
  display: flex;
  justify-content: flex-end;
  padding: 16px 28px 28px;
}

.invoice-doc-export .export-totals-box {
  min-width: 240px;
  border: 2px solid var(--blue-deep);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.invoice-doc-export .export-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.75rem;
}

.invoice-doc-export .export-totals-row.total {
  border-top: 2px solid var(--gray-text);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 700;
  font-size: 0.9375rem;
}

.invoice-doc-export .export-totals-note {
  font-size: 0.625rem;
  color: var(--gray-muted);
  margin-top: 4px;
  text-align: right;
}

/* ============ INVOICE TEMPLATE: EU-COMPACT ============ */
.invoice-doc-compact {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  box-shadow: var(--shadow-sm);
}

.invoice-doc-compact .compact-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--gray-text);
  color: var(--white);
}

.invoice-doc-compact .compact-supplier-name {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.invoice-doc-compact .compact-supplier-tax {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 2px;
}

.invoice-doc-compact .compact-number-box {
  text-align: right;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.invoice-doc-compact .compact-number-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.invoice-doc-compact .compact-number-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-top: 2px;
}

.invoice-doc-compact .compact-body {
  padding: 16px 20px;
}

.invoice-doc-compact .compact-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.invoice-doc-compact .compact-info-item {
  display: flex;
  gap: 8px;
  font-size: 0.6875rem;
}

.invoice-doc-compact .compact-info-label {
  font-weight: 600;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.625rem;
  white-space: nowrap;
}

.invoice-doc-compact .compact-info-val {
  font-weight: 500;
  color: var(--gray-text);
}

.invoice-doc-compact .compact-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6875rem;
  border: 1px solid var(--gray-border);
}

.invoice-doc-compact .compact-items-table thead {
  background: var(--gray-soft);
}

.invoice-doc-compact .compact-items-table th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-muted);
  border-bottom: 2px solid var(--gray-border);
}

.invoice-doc-compact .compact-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-border);
  vertical-align: top;
}

.invoice-doc-compact .compact-items-table tbody tr:last-child td {
  border-bottom: none;
}

.invoice-doc-compact .compact-totals {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-border);
  font-size: 0.75rem;
}

.invoice-doc-compact .compact-totals-group {
  text-align: right;
}

.invoice-doc-compact .compact-totals-label {
  font-size: 0.625rem;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invoice-doc-compact .compact-totals-val {
  font-weight: 700;
  color: var(--gray-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}

.invoice-doc-compact .compact-totals-val.total {
  font-size: 1rem;
  color: var(--blue-deep);
}

.invoice-doc-compact .compact-footer-note {
  padding: 12px 20px;
  background: var(--gray-soft);
  font-size: 0.625rem;
  color: var(--gray-muted);
  border-top: 1px solid var(--gray-border);
  display: flex;
  justify-content: space-between;
}
.extracted-data {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-confidence {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.conf-high {
  background: rgba(46, 125, 50, 0.1);
  color: var(--success);
}

.conf-mid {
  background: rgba(230, 81, 0, 0.1);
  color: var(--warning);
}

.field-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-text);
  background: var(--white);
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.field-input:hover {
  border-color: var(--blue-light);
}

.field-input:focus {
  outline: none;
  border-color: var(--blue-cta);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.12);
}

.field-input.field-mid-confidence {
  border-color: rgba(230, 81, 0, 0.4);
  background: rgba(230, 81, 0, 0.02);
}

.copy-btn {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-muted);
  transition: var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(30, 136, 229, 0.1);
  color: var(--blue-cta);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ============ LINES SECTION ============ */
.lines-section {
  border-top: 1px solid var(--gray-border);
  padding: 20px;
}

.lines-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lines-count {
  font-size: 0.75rem;
  color: var(--gray-muted);
  font-weight: 500;
}

.lines-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.line-row {
  display: grid;
  grid-template-columns: 70px 1fr 80px 80px;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-soft);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  align-items: center;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.line-row:hover {
  border-color: var(--blue-light);
  background: rgba(30, 136, 229, 0.04);
}

.line-cell {
  font-weight: 500;
  color: var(--gray-text);
}

.line-cell-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue-deep);
}

.line-cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.lines-header-row {
  display: grid;
  grid-template-columns: 70px 1fr 80px 80px;
  gap: 10px;
  padding: 0 12px 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-muted);
  font-weight: 600;
}

/* ============ SUCCESS SCREEN ============ */
.success-container {
  max-width: 720px;
  margin: 60px auto;
  text-align: center;
  padding: 48px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.success-container::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: var(--blue-light);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  color: var(--success);
  animation: successPop 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.eyebrow-success {
  color: var(--success);
}

.success-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--blue-deep);
  margin-bottom: 12px;
  line-height: 1.15;
  text-wrap: balance;
}

.success-subtitle {
  font-size: 0.9375rem;
  color: var(--gray-muted);
  margin-bottom: 32px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

.csv-preview {
  background: var(--blue-deep-dark);
  color: #B6D4FF;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  text-align: left;
  margin: 0 auto 32px;
  overflow-x: auto;
  line-height: 1.7;
  position: relative;
}

.csv-preview::before {
  content: 'factura_dua_S4.csv';
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--blue-cta);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.csv-preview .csv-header {
  color: var(--blue-light);
  font-weight: 600;
}

.csv-preview .csv-value {
  color: var(--white);
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ ABOUT SECTION ============ */
.about-section {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  margin-top: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.about-section::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: var(--blue-light);
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.08;
  pointer-events: none;
}

.about-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 32px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.about-text {
  flex: 1;
  min-width: 280px;
}

.about-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--blue-deep);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.about-body {
  font-size: 0.875rem;
  color: var(--gray-muted);
  line-height: 1.6;
  max-width: 620px;
  text-wrap: balance;
}

.about-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .about-actions {
    width: 100%;
  }
  .about-actions .btn {
    flex: 1;
    justify-content: center;
  }
}


/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--gray-border);
  background: var(--white);
  padding: 24px 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--gray-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner strong {
  color: var(--blue-deep);
  font-weight: 700;
}

.footer-inner a {
  text-decoration: none;
  color: inherit;
}

.footer-inner a:hover strong {
  color: var(--blue-cta);
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--blue-deep);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  pointer-events: none;
}

.toast.toast-show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--blue-light);
  font-weight: 700;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .split-view {
    grid-template-columns: 1fr;
  }
  .inbox-row {
    grid-template-columns: 90px 1.4fr 1fr 1fr 1fr 80px;
    gap: 12px;
    padding: 14px 18px;
  }
  .navbar-inner, .app, .footer-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 768px) {
  .screen-title {
    font-size: 1.625rem;
  }
  .inbox-stats {
    width: 100%;
  }
  .stat-card {
    flex: 1;
    min-width: 0;
  }
  .inbox-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .inbox-row-head {
    display: none;
  }
  .inbox-row-data {
    padding: 16px;
  }
  .validate-actions {
    width: 100%;
  }
  .validate-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .success-container {
    padding: 32px 24px;
  }
}
