:root {
  --g950: #0b1120;
  --g900: #0f172a;
  --g800: #1e293b;
  --g700: #334155;
  --g600: #475569;
  --naranja: #f97316;
  --naranja-h: #ea580c;
  --acero: #4682b4;
  --acero-l: #6ea8d8;
  --texto: #f1f5f9;
  --suave: #94a3b8;
  color-scheme: dark;
}

html { -webkit-tap-highlight-color: transparent; }
body { background: var(--g900); }

.card {
  background: var(--g800);
  border: 1px solid var(--g700);
  border-radius: 0.875rem;
}

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--suave);
  margin-bottom: 0.35rem;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--g900);
  border: 1px solid var(--g600);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  color: var(--texto);
  font-size: 1rem;
  line-height: 1.4;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--acero-l);
  box-shadow: 0 0 0 3px rgba(70, 130, 180, .3);
}
.input::placeholder, .textarea::placeholder { color: #64748b; }
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
.input.uppercase { text-transform: uppercase; }
.textarea { min-height: 4.5rem; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.6rem;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; }
.btn-primary { background: var(--naranja); color: #111827; }
.btn-primary:hover:not(:disabled) { background: var(--naranja-h); }
.btn-steel { background: var(--acero); color: #fff; }
.btn-steel:hover:not(:disabled) { background: #3a6d97; }
.btn-ghost { background: transparent; border-color: var(--g600); color: var(--texto); }
.btn-ghost:hover:not(:disabled) { background: var(--g700); }
.btn-danger { background: transparent; border-color: rgba(248, 113, 113, .5); color: #fca5a5; }
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, .12); }
.btn-wa { background: #16a34a; color: #fff; }
.btn-wa:hover { background: #15803d; }
.btn-sm { padding: 0.4rem 0.65rem; font-size: 0.8rem; }
.btn-icon { padding: 0.45rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.6rem;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.925rem;
}
.nav-link svg { width: 1.25rem; height: 1.25rem; }
.nav-link:hover { background: var(--g800); color: #fff; }
.nav-link.active { background: rgba(249, 115, 22, .14); color: var(--naranja); }

.bottom-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.25rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--suave);
  min-width: 0;
}
.bottom-link svg { width: 1.4rem; height: 1.4rem; }
.bottom-link.active { color: var(--naranja); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: var(--acero);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 9999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.estado-agendado { background: rgba(148, 163, 184, .15); color: #cbd5e1; border-color: rgba(148, 163, 184, .35); }
.estado-revision { background: rgba(96, 165, 250, .15); color: #93c5fd; border-color: rgba(96, 165, 250, .4); }
.estado-repuestos { background: rgba(250, 204, 21, .14); color: #fde047; border-color: rgba(250, 204, 21, .4); }
.estado-reparacion { background: rgba(249, 115, 22, .16); color: #fdba74; border-color: rgba(249, 115, 22, .45); }
.estado-listo { background: rgba(34, 197, 94, .15); color: #86efac; border-color: rgba(34, 197, 94, .45); }
.estado-entregado { background: rgba(20, 184, 166, .12); color: #5eead4; border-color: rgba(20, 184, 166, .35); }
.badge-ok { background: rgba(34, 197, 94, .15); color: #86efac; }
.badge-off { background: rgba(248, 113, 113, .15); color: #fca5a5; }
.badge-steel { background: rgba(70, 130, 180, .2); color: var(--acero-l); }
.badge-orange { background: rgba(249, 115, 22, .16); color: #fdba74; }

.tabs { display: inline-flex; background: var(--g950); border: 1px solid var(--g700); border-radius: 0.7rem; padding: 0.2rem; }
.tab { padding: 0.45rem 1rem; border-radius: 0.55rem; font-weight: 600; font-size: 0.875rem; color: var(--suave); }
.tab.active { background: var(--g700); color: #fff; }
.tab.active.tab-in { background: rgba(34, 197, 94, .18); color: #86efac; }
.tab.active.tab-out { background: rgba(248, 113, 113, .18); color: #fca5a5; }

.spinner {
  border: 3px solid rgba(148, 163, 184, .25);
  border-top-color: var(--naranja);
  border-radius: 9999px;
  animation: girar .8s linear infinite;
}
.spinner-sm { width: 1rem; height: 1rem; border-width: 2px; }
@keyframes girar { to { transform: rotate(360deg); } }

.toast {
  pointer-events: auto;
  min-width: 16rem;
  max-width: 24rem;
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  background: var(--g800);
  border: 1px solid var(--g600);
  border-left-width: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .4);
  font-size: 0.9rem;
  animation: entrar .2s ease-out;
}
.toast-ok { border-left-color: #22c55e; }
.toast-error { border-left-color: #f87171; }
.toast-info { border-left-color: var(--acero-l); }
.toast.salir { opacity: 0; transform: translateY(-6px); transition: all .2s; }
@keyframes entrar { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(2, 6, 23, .72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fundido .15s ease-out;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 1.5rem; } }
.modal-panel {
  width: 100%;
  max-width: 40rem;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--g800);
  border: 1px solid var(--g700);
  border-radius: 1rem 1rem 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 640px) { .modal-panel { border-radius: 1rem; } }
@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: 0.65rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .pista { width: 2.6rem; height: 1.5rem; border-radius: 9999px; background: var(--g600); position: relative; transition: background .15s; flex: none; }
.switch .pista::after { content: ''; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 9999px; background: #fff; transition: transform .15s; }
.switch input:checked + .pista { background: var(--naranja); }
.switch input:checked + .pista::after { transform: translateX(1.1rem); }
.switch input:focus-visible + .pista { box-shadow: 0 0 0 3px rgba(70, 130, 180, .45); }

.check { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 0.55rem; border: 1px solid var(--g700); background: var(--g900); cursor: pointer; font-size: 0.875rem; }
.check:hover { border-color: var(--g600); }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--naranja); flex: none; }

.radio-card { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.65rem 0.75rem; border-radius: 0.6rem; border: 1px solid var(--g600); cursor: pointer; font-size: 0.875rem; }
.radio-card input { margin-top: 0.2rem; accent-color: var(--naranja); }
.radio-card:has(input:checked) { border-color: var(--naranja); background: rgba(249, 115, 22, .08); }

.desglose { background: var(--g950); border: 1px dashed var(--g600); border-radius: 0.7rem; padding: 0.85rem 1rem; }

.slot-vacio { border: 1px dashed var(--g600); border-radius: 0.7rem; color: #64748b; }
.slot-vacio.clickable { cursor: pointer; }
.slot-vacio.clickable:hover { border-color: var(--naranja); color: var(--naranja); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--suave); }
.empty svg { width: 2.75rem; height: 2.75rem; margin: 0 auto 0.75rem; opacity: .6; }

.monto-in { color: #86efac; }
.monto-out { color: #fca5a5; }
.num { font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--g700); border-radius: 9999px; border: 2px solid var(--g900); }
::-webkit-scrollbar-track { background: transparent; }

.input.w-auto, .select.w-auto { width: auto; }
.input.pl-9 { padding-left: 2.25rem; }
.input.pl-10 { padding-left: 2.6rem; }
.input.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.select.py-1 { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.select.text-sm { font-size: 0.85rem; }
