/* ============================================================
   Reportify — style.css
   Design system: Premium Corporate / Navy + Gold accents
   Base respetada: no se rompe nada, solo mejora colores
   ============================================================ */

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink:     #0A1A2F;        /* Navy profundo - más premium */
  --paper:   #F8FAFE;        /* Blanco azulado suave - más limpio */
  --acid:    #D4AF37;        /* ORO/Dorado - premium corporativo */
  --slate:   #1E2A3E;        /* Navy intermedio para dark cards */
  --muted:   #5B6E8C;        /* Gris azulado - más elegante */
  --border:  #E2E8F0;        /* Borde más suave moderno */
  --red:     #E53E3E;        /* Rojo corporativo */
  --success: #38A169;        /* Verde éxito */
  --font-s:  'Syne', sans-serif;
  --font-i:  'Inter', sans-serif;
  --font-m:  'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: linear-gradient(135deg, var(--paper) 0%, #F0F4FA 100%);
  color: var(--ink);
  font-family: var(--font-i);
  -webkit-font-smoothing: antialiased;
}

/* ── NAVBAR ───────────────────────────────────────────────── */
.navbar {
  background: var(--ink);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--acid) 0%, #B8941E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-m);
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
}

.version-badge {
  font-family: var(--font-m);
  font-size: 10px;
  color: #8B9BB0;
  padding: 2px 6px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.btn-nav-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--acid) 0%, #B8941E 100%);
  color: var(--ink);
  font-family: var(--font-s);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.btn-nav-primary:hover { 
  opacity: 0.85;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-nav-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #A0B0C8;
  font-family: var(--font-s);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-nav-secondary:hover {
  border-color: var(--acid);
  color: var(--acid);
  background: rgba(212, 175, 55, 0.05);
}

/* ── PAGE HEADERS ─────────────────────────────────────────── */
.header-tag {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--acid);
  text-transform: uppercase;
}

.text-accent-line {
  position: relative;
  display: inline-block;
  color: var(--ink);
}
.text-accent-line::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--acid) 0%, rgba(212, 175, 55, 0.3) 100%);
  z-index: -1;
  opacity: 0.5;
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #FFFFFF;
}

.card-icon {
  color: var(--acid);
  font-size: 13px;
}

.card-title {
  font-family: var(--font-s);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
}

.card-body {
  padding: 20px;
}

/* Dark card (sidebar) */
.card-dark {
  background: linear-gradient(135deg, var(--slate) 0%, #16202E 100%);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
}

.card-header-dark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  background: rgba(0,0,0,0.2);
}

.card-icon-dark { color: var(--acid); font-size: 13px; }
.card-title-dark {
  font-family: var(--font-s);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--acid);
}
.card-body-dark { padding: 20px; }

/* ── FORM FIELDS ─────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 5px; }

.field-label {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-i);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all 0.15s ease;
}
.field-input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.field-input::placeholder { color: #B0C0D0; }

.field-label-dark {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8B9BB0;
}

.field-input-dark {
  width: 100%;
  padding: 10px 12px;
  background: rgba(10, 26, 47, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  font-family: var(--font-i);
  font-size: 13px;
  color: #E0E8F5;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
.field-input-dark:focus { border-color: var(--acid); }
.field-input-dark::placeholder { color: #5B6E8C; }

/* ── PRODUCTS TABLE ──────────────────────────────────────── */
.products-table-header {
  display: grid;
  grid-template-columns: 1fr 70px 110px 100px 36px;
  gap: 6px;
  padding: 0 0 8px 0;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 8px;
}
.products-table-header span {
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.col-qty, .col-price, .col-sub { text-align: right; }

.product-row {
  display: grid;
  grid-template-columns: 1fr 70px 110px 100px 36px;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.product-row input {
  width: 100%;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-i);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: all 0.15s ease;
}
.product-row input:focus { border-color: var(--acid); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1); background: white; }
.product-row input[type="number"] { text-align: right; }

.product-subtotal {
  font-family: var(--font-m);
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  padding-right: 4px;
}

.btn-delete-row {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #A0B0C8;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}
.btn-delete-row:hover { background: var(--red); border-color: var(--red); color: white; }

.btn-add-product {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--font-i);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}
.btn-add-product:hover {
  border-color: var(--acid);
  color: var(--acid);
  background: rgba(212, 175, 55, 0.05);
}

/* ── SUMMARY ─────────────────────────────────────────────── */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary-label { font-size: 13px; color: #8B9BB0; }
.summary-value { font-family: var(--font-m); font-size: 13px; color: #A0B0C8; }
.summary-divider { border-top: 1px solid rgba(212, 175, 55, 0.2); margin: 4px 0; }
.summary-row-total { display: flex; justify-content: space-between; align-items: center; }
.summary-total-label {
  font-family: var(--font-s);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: white;
}
.summary-total-value {
  font-family: var(--font-m);
  font-size: 22px;
  font-weight: 600;
  color: var(--acid);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--ink) 0%, #0F2A44 100%);
  color: var(--acid);
  font-family: var(--font-s);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary:hover { 
  opacity: 0.95;
  transform: translateY(-1px);
  border-color: var(--acid);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  color: #A0B0C8;
  font-family: var(--font-s);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover { border-color: var(--acid); color: var(--acid); }

.btn-danger-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  color: #E53E3E;
  font-family: var(--font-i);
  font-size: 12px;
  border: 1px solid #E53E3E44;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-danger-sm:hover { background: rgba(229, 62, 62, 0.1); border-color: var(--red); }

/* ── HISTORY CARDS ───────────────────────────────────────── */
.count-badge {
  font-family: var(--font-m);
  font-size: 12px;
  color: var(--acid);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  padding: 4px 12px;
}

.history-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  transition: all 0.2s ease;
  cursor: default;
}
.history-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.3);
}

.history-index {
  font-family: var(--font-m);
  font-size: 28px;
  color: rgba(212, 175, 55, 0.3);
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

.history-info { min-width: 0; }
.history-client {
  font-family: var(--font-s);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.history-meta span {
  font-family: var(--font-m);
  font-size: 11px;
  color: var(--muted);
}
.history-meta .sep { color: var(--border); }

.history-total {
  font-family: var(--font-m);
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.btn-history-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--ink) 0%, #0F2A44 100%);
  color: var(--acid);
  font-family: var(--font-i);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-history-pdf:hover { 
  opacity: 0.9;
  border-color: var(--acid);
}

.btn-history-del {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  color: #E53E3E;
  font-family: var(--font-i);
  font-size: 12px;
  border: 1px solid #E53E3E44;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-history-del:hover { background: rgba(229, 62, 62, 0.1); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  border: 2px dashed var(--border);
  border-radius: 16px;
}
.empty-icon {
  font-size: 48px;
  color: rgba(212, 175, 55, 0.4);
  margin-bottom: 16px;
}
.empty-title {
  font-family: var(--font-s);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.empty-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--ink);
  color: white;
  font-family: var(--font-i);
  font-size: 13px;
  border-left: 3px solid var(--acid);
  border-radius: 8px;
  min-width: 240px;
  max-width: 320px;
  animation: toast-in 0.25s ease forwards;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--red); }
.toast.info    { border-color: var(--acid); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}
.toast.removing { animation: toast-out 0.25s ease forwards; }

/* ── LOADING OVERLAY ─────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 47, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 16px;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-text {
  font-family: var(--font-m);
  font-size: 13px;
  color: var(--acid);
  letter-spacing: 0.08em;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .products-table-header { grid-template-columns: 1fr 50px 80px 70px 30px; }
  .product-row           { grid-template-columns: 1fr 50px 80px 70px 30px; }
  .history-card          { grid-template-columns: 1fr; gap: 12px; }
  .history-index         { display: none; }
  .history-actions       { flex-direction: row; }
  .btn-nav-primary span, .btn-nav-secondary span { display: none; }
}


