/* ── Admin CSS — Tema CAT Industrial ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --color-primary:   #F9C500;
  --color-secondary: #1A1A1A;
  --color-accent:    #F9C500;
  --color-bg:        #0A0A0A;
  --color-text:      #F0F0F0;

  /* Surface tokens */
  --s-0: #0A0A0A;   /* page bg */
  --s-1: #111111;   /* sidebar, cards */
  --s-2: #191919;   /* inputs, nested */
  --s-3: #222222;   /* borders */
  --s-4: #2E2E2E;   /* hover borders */

  /* Text tokens */
  --t-1: #FFFFFF;
  --t-2: #AAAAAA;
  --t-3: #666666;

  /* Yellow glow */
  --yellow-glow: rgba(249, 197, 0, 0.18);
  --yellow-ring:  rgba(249, 197, 0, 0.40);
}

html, body { height: 100%; }

/* ── Input fields ─────────────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  background: var(--s-2);
  border: 1px solid var(--s-3);
  color: var(--t-1);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--yellow-ring);
}
.input-field::placeholder { color: var(--t-3); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: var(--color-primary);
  color: #000000;
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn-primary:hover {
  background: #FFD000;
  box-shadow: 0 4px 16px rgba(249,197,0,0.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: var(--s-2);
  color: var(--t-2);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.5rem;
  border: 1px solid var(--s-3);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-secondary:hover {
  background: var(--s-3);
  color: var(--t-1);
  border-color: var(--s-4);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: rgba(239,68,68,0.12);
  color: #f87171;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(239,68,68,0.25);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.22);
  border-color: rgba(239,68,68,0.45);
}

/* ── Sidebar nav items ────────────────────────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--t-2);
  text-decoration: none;
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover {
  background: var(--s-2);
  color: var(--t-1);
}
.nav-item.active {
  background: var(--yellow-glow);
  color: var(--color-primary);
  font-weight: 700;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 2px 2px 0;
}

/* ── Stat cards ───────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--s-1);
  border: 1px solid var(--s-3);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  border-color: var(--s-4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--t-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--t-1);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* ── Chart cards ──────────────────────────────────────────────────────────── */
.chart-card {
  background: var(--s-1);
  border: 1px solid var(--s-3);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-ingresado  { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-en_proceso { background: rgba(249,197,0,0.12);  color: #F9C500; border: 1px solid rgba(249,197,0,0.25); }
.badge-terminado  { background: rgba(34,197,94,0.1);   color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-anulado    { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-requiere_repuestos { background: rgba(168,85,247,0.1); color: #c084fc; border: 1px solid rgba(168,85,247,0.2); }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash-msg {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
}
.flash-success { background: rgba(34,197,94,0.08);   border: 1px solid rgba(34,197,94,0.25);   color: #4ade80; }
.flash-danger  { background: rgba(239,68,68,0.08);   border: 1px solid rgba(239,68,68,0.25);   color: #f87171; }
.flash-warning { background: rgba(249,197,0,0.08);   border: 1px solid rgba(249,197,0,0.25);   color: #F9C500; }
.flash-info    { background: rgba(59,130,246,0.08);  border: 1px solid rgba(59,130,246,0.25);  color: #60a5fa; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--s-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
table th { font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Section dividers in sidebar ─────────────────────────────────────────── */
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--t-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.75rem 0.25rem;
}

/* ── Wizard step indicator ────────────────────────────────────────────────── */
.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t-3);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid var(--s-3);
  transition: all 0.2s;
}
.wizard-step.active {
  background: var(--color-primary);
  color: #000;
  border-color: var(--color-primary);
}
.wizard-step.done {
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  border-color: rgba(34,197,94,0.25);
}

/* ── Light mode ───────────────────────────────────────────────────────────── */
body.light-mode { background: #F3F4F6 !important; color: #111827 !important; }
body.light-mode #sidebar { background: #FFFFFF !important; border-right-color: #E5E7EB !important; }
body.light-mode header { background: #FFFFFF !important; border-bottom-color: #E5E7EB !important; }
body.light-mode .nav-section-label { color: #9CA3AF !important; }
body.light-mode .nav-item { color: #6B7280 !important; }
body.light-mode .nav-item:hover { background: #F3F4F6 !important; color: #111827 !important; }
body.light-mode .nav-item.active { background: rgba(249,197,0,0.18) !important; color: #92700A !important; }
body.light-mode .nav-item.active::before { background: var(--color-primary) !important; }
body.light-mode .bg-gray-900 { background-color: #FFFFFF !important; }
body.light-mode .bg-gray-800 { background-color: #F9FAFB !important; }
body.light-mode .bg-gray-700 { background-color: #F3F4F6 !important; }
body.light-mode .border-gray-800,
body.light-mode .border-gray-700 { border-color: #E5E7EB !important; }
body.light-mode .divide-gray-800\/40 > * + * { border-color: #E5E7EB !important; }
body.light-mode .text-white { color: #111827 !important; }
body.light-mode .text-gray-300,
body.light-mode .text-gray-200 { color: #374151 !important; }
body.light-mode .text-gray-400 { color: #6B7280 !important; }
body.light-mode .text-gray-500 { color: #9CA3AF !important; }
body.light-mode .input-field {
  background: #F9FAFB !important;
  border-color: #D1D5DB !important;
  color: #111827 !important;
}
body.light-mode .input-field::placeholder { color: #9CA3AF !important; }
body.light-mode .stat-card { background: #FFFFFF !important; border-color: #E5E7EB !important; }
body.light-mode .chart-card { background: #FFFFFF !important; border-color: #E5E7EB !important; }
body.light-mode .btn-secondary {
  background: #F3F4F6 !important;
  border-color: #D1D5DB !important;
  color: #374151 !important;
}
body.light-mode .btn-secondary:hover { background: #E5E7EB !important; color: #111827 !important; }
body.light-mode h2, body.light-mode h3 { color: #111827 !important; }
body.light-mode .stat-value { color: #111827 !important; }
body.light-mode .stat-label { color: #6B7280 !important; }
body.light-mode .flash-success { background: rgba(34,197,94,0.06) !important; }
body.light-mode .flash-danger  { background: rgba(239,68,68,0.06) !important; }
body.light-mode .flash-warning { background: rgba(249,197,0,0.06) !important; }
body.light-mode .flash-info    { background: rgba(59,130,246,0.06) !important; }
body.light-mode ::-webkit-scrollbar-thumb { background: #D1D5DB !important; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: var(--color-primary) !important; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  aside, header, .floating-total, .no-print { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  main { overflow: visible !important; }
  .bg-gray-900, .bg-gray-800, .bg-gray-950,
  [class*="bg-gray"] { background: white !important; }
  .text-white, .text-gray-100, .text-gray-200, .text-gray-300 { color: #111 !important; }
  .border-gray-800, .border-gray-700 { border-color: #e5e7eb !important; }
  .rounded-2xl, .rounded-xl, .rounded-lg { border-radius: 0 !important; }
  table { page-break-inside: avoid; }
  tr { page-break-inside: avoid; }
}
