/*
 * GZStack — Cotizaciones Module Styles
 * =====================================
 * Coherente con la estética dark del sitio principal.
 * Usa las mismas fuentes (Inter + Sora) y paleta de colores.
 */

/* ========== FONTS ========== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/sora-latin-var.woff2') format('woff2');
}

/* ========== RESET & VARIABLES ========== */
:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', system-ui, sans-serif;

  --bg-base: #0b1220;
  --bg-surface: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #253449;
  --bg-input: #0f172a;

  --brand: #14468c;
  --brand-light: #2f6fb8;
  --brand-dark: #0b2447;
  --accent: #00c2ff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #a78bfa;

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

  --border: #1e293b;
  --border-light: #334155;
  --border-accent: rgba(0, 194, 255, 0.3);

  --glass-bg: rgba(20, 70, 140, 0.12);
  --glass-border: rgba(255, 255, 255, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(0, 194, 255, 0.15);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== BACKGROUND PATTERN ========== */
.gz-bg-pattern {
  background-image: radial-gradient(rgba(0,194,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(0, 194, 255, 0); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-in {
  animation: fadeInUp 0.5s ease-out both;
}
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

/* ========== LAYOUT ========== */
.gz-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.gz-container-sm {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px;
}

.gz-container-md {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== NAVBAR ========== */
.gz-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.gz-navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gz-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--text-primary);
}
.gz-logo img {
  width: 36px;
  height: 36px;
}
.gz-logo span { color: var(--accent); }

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

/* ========== CARDS / GLASS PANELS ========== */
.gz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.gz-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.gz-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ========== BUTTONS ========== */
.gz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.gz-btn:active { transform: scale(0.97); }
.gz-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.gz-btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(20, 70, 140, 0.4);
}
.gz-btn-primary:hover {
  background: var(--brand-light);
  box-shadow: 0 4px 16px rgba(20, 70, 140, 0.5);
  transform: translateY(-1px);
}

.gz-btn-accent {
  background: var(--accent);
  color: var(--text-inverse);
}
.gz-btn-accent:hover {
  background: #33d1ff;
  transform: translateY(-1px);
}

.gz-btn-success {
  background: var(--success);
  color: #fff;
}
.gz-btn-success:hover { background: #16a34a; }

.gz-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.gz-btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.gz-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.gz-btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent);
}

.gz-btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.gz-btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.gz-btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ========== FORM ELEMENTS ========== */
.gz-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gz-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gz-input, .gz-textarea, .gz-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}
.gz-input:focus, .gz-textarea:focus, .gz-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.15);
}
.gz-input::placeholder, .gz-textarea::placeholder {
  color: var(--text-muted);
}

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

.gz-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.gz-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.gz-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ========== KPI STATS ========== */
.gz-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.gz-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}
.gz-stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gz-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.gz-stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.gz-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== TABLES ========== */
.gz-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.gz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.gz-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.gz-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.gz-table tbody tr {
  transition: background var(--transition);
}
.gz-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.5);
}
.gz-table tbody tr:last-child td {
  border-bottom: none;
}

.gz-table .text-right { text-align: right; }
.gz-table .text-center { text-align: center; }

/* ========== BADGES / STATUS ========== */
.gz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.gz-badge-vigente {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.gz-badge-aceptada {
  background: rgba(0, 194, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 194, 255, 0.25);
}
.gz-badge-rechazada {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.gz-badge-vencida {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.gz-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ========== CODE BADGE ========== */
.gz-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
}
.gz-code-badge:hover {
  background: rgba(0, 194, 255, 0.08);
  border-color: var(--accent);
}
.gz-code-badge .copy-icon {
  opacity: 0.5;
  transition: opacity var(--transition);
}
.gz-code-badge:hover .copy-icon { opacity: 1; }

/* ========== TOAST NOTIFICATIONS ========== */
.gz-toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gz-toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease-out;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
}
.gz-toast-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}
.gz-toast-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.gz-toast-info {
  background: rgba(0, 194, 255, 0.15);
  border: 1px solid rgba(0, 194, 255, 0.3);
  color: var(--accent);
}

/* ========== LOGIN PAGE ========== */
.gz-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gz-login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.5s ease-out;
}

.gz-login-header {
  text-align: center;
  margin-bottom: 32px;
}
.gz-login-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 16px;
}
.gz-login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.gz-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gz-login-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.85rem;
  display: none;
  animation: slideDown 0.3s ease;
}

/* ========== DASHBOARD ========== */
.gz-page {
  padding-top: 88px;
  padding-bottom: 40px;
  min-height: 100vh;
}

.gz-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.gz-page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.gz-page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Search & Filters */
.gz-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.gz-search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.gz-search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.gz-search-box input {
  padding-left: 42px;
}

.gz-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gz-filter-pill {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.gz-filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gz-filter-pill.active {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

/* ========== QUOTATION BUILDER ========== */
.gz-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.gz-builder-form {
  position: sticky;
  top: 88px;
}

.gz-builder-section {
  margin-bottom: 24px;
}

.gz-builder-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gz-item-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  transition: all var(--transition);
  animation: fadeInUp 0.3s ease-out;
}
.gz-item-row:hover {
  border-color: var(--border-light);
}

.gz-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gz-item-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(0, 194, 255, 0.1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.gz-item-fields {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
}

.gz-item-total {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-align: right;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  margin-top: 8px;
}

.gz-remove-item {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: none;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}
.gz-remove-item:hover {
  background: var(--danger);
  color: #fff;
}

/* ========== CONDITION TAGS ========== */
.gz-condition-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease-out;
}

.gz-condition-item input {
  flex: 1;
}

/* ========== TOTALS PANEL ========== */
.gz-totals {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
}

.gz-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
}

.gz-totals-row.subtotal {
  color: var(--text-secondary);
}

.gz-totals-row.igv {
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.gz-totals-row.total {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  padding-top: 12px;
}

/* ========== PREVIEW DOCUMENT (IMPRESIONANTE & PREMIUM) ========== */
.gz-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(0, 194, 255, 0.05);
}

.gz-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 24px;
  gap: 20px;
}

.gz-preview-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gz-preview-logo img {
  max-height: 55px;
  max-width: 200px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.gz-preview-logo span { color: var(--accent); }

.gz-preview-meta {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: rgba(30, 41, 59, 0.4);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.gz-preview-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gz-preview-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gz-preview-client {
  background: linear-gradient(135deg, rgba(0, 194, 255, 0.08) 0%, rgba(17, 24, 39, 0.6) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gz-preview-client-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.gz-preview-client-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.gz-preview-client-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Preview Table */
.gz-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.gz-preview-table th {
  background: var(--bg-card);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.gz-preview-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  vertical-align: top;
}
.gz-preview-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.3);
}
.gz-preview-table .text-right { text-align: right; }
.gz-preview-table .text-center { text-align: center; }
.gz-preview-table .item-desc {
  white-space: pre-line;
  max-width: 350px;
}

/* Preview Totals */
.gz-preview-totals {
  float: right;
  width: 280px;
  margin-bottom: 20px;
}
.gz-preview-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.gz-preview-totals-row.grand-total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  margin-top: 4px;
}

/* Preview Conditions */
.gz-preview-conditions {
  clear: both;
  padding-top: 24px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.gz-preview-conditions h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gz-preview-conditions ul {
  list-style: none;
  padding: 0;
}
.gz-preview-conditions li {
  position: relative;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.gz-preview-conditions li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* Preview Bank Info */
.gz-preview-bank {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 16px;
}
.gz-preview-bank h4 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.gz-preview-bank p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.gz-preview-bank strong { color: var(--text-primary); }

/* ========== CLIENT PORTAL ========== */
.gz-verify-page {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gz-verify-hero {
  text-align: center;
  padding: 80px 24px 40px;
  max-width: 600px;
}

.gz-verify-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.gz-verify-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 440px;
  margin: 0 auto;
}

.gz-code-input-wrap {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 32px auto 0;
}

.gz-code-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  transition: all var(--transition);
  outline: none;
}
.gz-code-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 194, 255, 0.15), var(--shadow-glow);
}
.gz-code-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
}

/* Client Document View */
.gz-document {
  width: 100%;
  max-width: 800px;
  margin: 40px auto;
  animation: fadeInUp 0.5s ease-out;
}

.gz-document-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 0.85rem;
  font-weight: 700;
}
.gz-document-status.vigente {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.gz-document-status.aceptada {
  background: rgba(0, 194, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 194, 255, 0.2);
}
.gz-document-status.vencida {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.gz-document-status.rechazada {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.gz-document-body {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.gz-document-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ========== LOADING / EMPTY STATES ========== */
.gz-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

.gz-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.gz-empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}
.gz-empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ========== MODAL ========== */
.gz-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
}

.gz-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease-out;
}

.gz-modal h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.gz-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .gz-builder-layout {
    grid-template-columns: 1fr;
  }
  .gz-builder-form {
    position: static;
  }
  .gz-item-fields {
    grid-template-columns: 1fr;
  }
  .gz-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .gz-preview-header {
    flex-direction: column;
    gap: 16px;
  }
  .gz-preview-meta {
    text-align: left;
  }
  .gz-preview-totals {
    float: none;
    width: 100%;
  }
  .gz-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gz-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .gz-search-box {
    min-width: unset;
  }
  .gz-code-input-wrap {
    flex-direction: column;
  }
  .gz-document-body {
    padding: 24px;
  }
  .gz-preview {
    padding: 20px;
  }
  .gz-verify-hero h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gz-stats-grid {
    grid-template-columns: 1fr;
  }
  .gz-login-card {
    padding: 28px 20px;
  }
  .gz-preview {
    padding: 16px;
  }
  .gz-document-body {
    padding: 16px;
  }
}

/* ========== PRINT STYLES (IMPRESIONANTE & EXECUTIVE PDF) ========== */
@media print {
  @page {
    size: A4;
    margin: 8mm 12mm;
  }

  :root {
    --bg-base: #ffffff;
    --bg-surface: #ffffff;
    --bg-card: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
  }

  * {
    color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 9pt;
    line-height: 1.35;
    padding: 0;
    margin: 0;
  }

  .gz-navbar,
  .gz-document-actions,
  .gz-document-status,
  .no-print {
    display: none !important;
  }

  .gz-document {
    max-width: 100%;
    margin: 0;
    box-shadow: none !important;
  }

  .gz-document-body, .gz-preview {
    background: #ffffff !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .gz-preview-header {
    border-bottom: 2.5px solid var(--accent) !important;
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
  }

  .gz-preview-logo img {
    max-height: 55px !important;
    max-width: 200px !important;
    object-fit: contain;
  }

  .gz-preview-meta {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px 14px !important;
    border-radius: 6px !important;
  }

  .gz-preview-client {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 4px solid var(--accent) !important;
    padding: 10px 16px !important;
    margin-bottom: 16px !important;
    border-radius: 6px !important;
  }

  .gz-preview-client-label {
    color: var(--accent) !important;
    font-size: 7.5pt !important;
    font-weight: 800 !important;
  }

  .gz-preview-table {
    font-size: 8.5pt !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 16px !important;
  }

  .gz-preview-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    padding: 8px 10px !important;
    font-size: 7.5pt !important;
    border-bottom: 2px solid #cbd5e1 !important;
  }

  .gz-preview-table td {
    padding: 8px 10px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #334155 !important;
  }

  .gz-preview-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
  }

  .gz-preview-totals {
    float: right;
    width: 240px;
    margin-top: 4px;
    font-size: 9pt !important;
  }

  .gz-preview-totals-row.grand-total {
    border-top: 2px solid var(--accent) !important;
    font-size: 11pt !important;
    color: var(--accent) !important;
  }

  .gz-preview-bank {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    font-size: 8pt !important;
    margin-top: 12px !important;
    page-break-inside: avoid !important;
  }

  .gz-preview-conditions {
    font-size: 8pt !important;
    margin-top: 12px !important;
    page-break-inside: avoid !important;
  }

  .gz-verify-page {
    padding: 0 !important;
  }
}
