/* ============================================
   ADMINIX CAR — Design system (negro + naranja)
   ============================================ */

:root {
  --bg-deep: #070708;
  --bg: #0c0c0e;
  --bg-elevated: #141417;
  --bg-soft: #1a1a1f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 140, 40, 0.35);

  --orange: #ff7a18;
  --orange-hot: #ff9a3c;
  --orange-deep: #e85d04;
  --orange-glow: rgba(255, 122, 24, 0.45);

  --text: #f4f1ec;
  --text-muted: #9a958c;
  --danger: #ff4d4d;
  --success: #3dcf8e;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font: "Outfit", system-ui, sans-serif;
  --display: "Space Grotesk", "Outfit", sans-serif;
  --sidebar-w: 272px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ---------- Auth / Login ---------- */

.auth-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 122, 24, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(255, 122, 24, 0.08), transparent 50%),
    linear-gradient(160deg, #050505 0%, #0d0d10 45%, #090909 100%);
}

.auth-body.login-page {
  background: #050505;
}

.auth-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: -24px;
  background: url("../img/login-bg.png") center center / cover no-repeat;
  filter: blur(6px);
  transform: scale(1.06);
}

.login-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.48) 45%, rgba(0, 0, 0, 0.62) 100%),
    radial-gradient(900px 500px at 15% 10%, rgba(255, 122, 24, 0.1), transparent 55%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: floatOrb 12s var(--ease) infinite alternate;
}

.orb-a {
  width: 340px;
  height: 340px;
  background: var(--orange-glow);
  top: -80px;
  left: -60px;
}

.orb-b {
  width: 280px;
  height: 280px;
  background: rgba(255, 154, 60, 0.25);
  bottom: -40px;
  right: 8%;
  animation-delay: -4s;
}

.grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.5;
}

@keyframes floatOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, 24px, 0) scale(1.08); }
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.login-shell {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.auth-hero {
  animation: riseIn 0.8s var(--ease) both;
}

.hero-logo {
  display: block;
  width: min(100%, 460px);
  height: auto;
  border-radius: 20px;
  background: #fff;
  padding: 1.25rem 1.5rem;
  box-shadow:
    0 0 0 1px rgba(255, 122, 24, 0.2),
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(255, 122, 24, 0.12);
}

.hero-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-brand span,
.brand-name span,
.sidebar-title span {
  color: var(--orange);
}

.hero-copy {
  margin: 1.35rem 0 0;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-visual {
  margin-top: 2.5rem;
  color: var(--orange-hot);
  opacity: 0.85;
  animation: slideCar 1.1s var(--ease) 0.2s both;
}

.car-silhouette {
  width: min(100%, 520px);
  filter: drop-shadow(0 0 28px var(--orange-glow));
}

@keyframes slideCar {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 0.85; transform: translateX(0); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-panel {
  width: min(100%, 440px);
  background: linear-gradient(180deg, rgba(26, 26, 31, 0.92), rgba(16, 16, 18, 0.96));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 2rem 1.75rem 1.5rem;
  backdrop-filter: blur(18px);
  animation: riseIn 0.75s var(--ease) 0.1s both;
}

.install-panel {
  width: min(100%, 520px);
}

.login-panel {
  justify-self: end;
}

.panel-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.panel-header p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.brand-block {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--orange);
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 122, 24, 0.1);
  border: 1px solid rgba(255, 122, 24, 0.25);
}

.brand-mark.sm {
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
}

.brand-mark svg {
  width: 70%;
  height: 70%;
}

.brand-name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.auth-form {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.form-section-title {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrap input {
  padding-left: 2.65rem;
  padding-right: 2.75rem;
}

.field input::placeholder {
  color: #6d6860;
}

.field input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.18);
  background: rgba(0, 0, 0, 0.5);
}

.toggle-pass {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.toggle-pass:hover {
  color: var(--orange);
  background: rgba(255, 122, 24, 0.08);
}

.toggle-pass svg {
  width: 18px;
  height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #120800;
  box-shadow: 0 10px 28px rgba(255, 122, 24, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(255, 122, 24, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 122, 24, 0.4);
  background: rgba(255, 122, 24, 0.06);
}

.alert {
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.alert-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.35);
  color: #ffb4b4;
}

.alert-success {
  background: rgba(61, 207, 142, 0.1);
  border: 1px solid rgba(61, 207, 142, 0.35);
  color: #9df0c7;
}

.auth-footer-note,
.install-hint {
  margin: 1.35rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.install-hint code {
  color: var(--orange-hot);
}

/* ---------- App shell (negro + naranja + blanco) ---------- */

.app-body {
  --app-bg: #f4f4f5;
  --app-surface: #ffffff;
  --app-surface-soft: #fafafa;
  --app-border: #e6e6e8;
  --app-text: #121214;
  --app-muted: #6b6b73;
  --app-sidebar: #0c0c0e;
  --app-sidebar-text: #f4f1ec;
  --app-sidebar-muted: #9a958c;

  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  background: var(--app-bg);
  color: var(--app-text);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.35rem 1rem;
  background: linear-gradient(180deg, #141417 0%, var(--app-sidebar) 100%);
  border-right: 1px solid rgba(255, 122, 24, 0.2);
  color: var(--app-sidebar-text);
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 0.5rem;
}

.sidebar-title {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.sidebar-brand small {
  color: var(--app-sidebar-muted);
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  color: var(--app-sidebar-muted);
  transition: background 0.2s, color 0.2s;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #120800;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  font-weight: 600;
}

.nav-item.disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.soon {
  margin-left: auto;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(255, 122, 24, 0.12);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
}

.sidebar-foot {
  display: grid;
  gap: 0.85rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 122, 24, 0.18);
  color: var(--orange-hot);
  font-weight: 700;
}

.user-chip strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
}

.user-chip small {
  color: var(--app-sidebar-muted);
  font-size: 0.78rem;
}

.sidebar .btn-ghost {
  color: var(--app-sidebar-muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar .btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 122, 24, 0.45);
  background: rgba(255, 122, 24, 0.1);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
}

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.75rem 0.5rem;
}

.topbar-text h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  color: var(--app-text);
}

.topbar-text p {
  margin: 0.35rem 0 0;
  color: var(--app-muted);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--app-text);
  border-radius: 2px;
}

.content {
  padding: 1rem 1.75rem 2rem;
  display: grid;
  gap: 1.5rem;
}

.welcome-banner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(255, 122, 24, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 122, 24, 0.12), #fff 42%),
    var(--app-surface);
  padding: 1.75rem;
  box-shadow: 0 10px 28px rgba(18, 18, 20, 0.06);
  animation: riseIn 0.7s var(--ease) both;
}

.welcome-banner .eyebrow {
  margin: 0;
  color: var(--orange-deep);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.welcome-banner h2 {
  margin: 0.45rem 0 0.55rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: var(--app-text);
}

.welcome-banner p:last-child {
  margin: 0;
  max-width: 54ch;
  color: var(--app-muted);
  line-height: 1.55;
}

.welcome-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -40px;
  top: -60px;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.28), transparent 70%);
  pointer-events: none;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.module-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  gap: 0.65rem;
  box-shadow: 0 8px 22px rgba(18, 18, 20, 0.04);
  animation: riseIn 0.7s var(--ease) both;
}

.module-card:nth-child(2) { animation-delay: 0.05s; }
.module-card:nth-child(3) { animation-delay: 0.1s; }
.module-card:nth-child(4) { animation-delay: 0.15s; }

.module-card.ready {
  border-color: rgba(255, 122, 24, 0.45);
  box-shadow: 0 8px 22px rgba(255, 122, 24, 0.08);
}

.module-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--orange-deep);
  background: rgba(255, 122, 24, 0.12);
}

.module-icon svg {
  width: 22px;
  height: 22px;
}

.module-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--app-text);
}

.module-card p {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.badge {
  justify-self: start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #f0f0f2;
  color: var(--app-muted);
}

.badge-ok {
  background: rgba(61, 207, 142, 0.14);
  color: #1a9f66;
}

.sidebar-backdrop {
  display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .auth-hero {
    text-align: center;
  }

  .hero-logo {
    margin-inline: auto;
  }

  .hero-copy {
    margin-inline: auto;
  }

  .hero-visual {
    display: flex;
    justify-content: center;
  }

  .login-panel {
    justify-self: center;
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, var(--sidebar-w));
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 25;
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }
}

@media (max-width: 560px) {
  .field-row,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .content,
  .topbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ---------- Inventario automotor ---------- */

.topbar {
  flex-wrap: wrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.flash {
  margin: 1rem 1.75rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.flash-success {
  background: rgba(61, 207, 142, 0.14);
  border: 1px solid rgba(61, 207, 142, 0.35);
  color: #1a9f66;
}

.flash-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #c62828;
}

.app-body .alert {
  margin-top: 0;
}

.app-body .alert-error {
  background: rgba(255, 77, 77, 0.08);
  border: 1px solid rgba(255, 77, 77, 0.28);
  color: #b71c1c;
}

.error-list {
  margin: 0;
  padding-left: 1.1rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.85rem;
  align-items: end;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  padding: 1rem;
}

.filter-bar .field label,
.inv-form .field label,
.mini-form .field label,
.estado-form label {
  color: var(--app-muted);
}

.filter-bar input,
.filter-bar select,
.inv-form input,
.inv-form select,
.inv-form textarea,
.mini-form input,
.mini-form select,
.estado-form select {
  width: 100%;
  border: 1px solid var(--app-border);
  background: #fff;
  color: var(--app-text);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus,
.inv-form input:focus,
.inv-form select:focus,
.inv-form textarea:focus,
.mini-form input:focus,
.estado-form select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.15);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.inv-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  min-width: 120px;
}

.stat-card span {
  display: block;
  color: var(--app-muted);
  font-size: 0.8rem;
}

.stat-card strong {
  font-size: 1.35rem;
  color: var(--app-text);
}

.empty-state {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--app-border);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
}

.empty-state h2 {
  margin: 0 0 0.4rem;
}

.empty-state p {
  color: var(--app-muted);
  margin: 0 0 1.2rem;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.vehicle-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(18, 18, 20, 0.04);
}

.vehicle-photo {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: #ececee;
}

.vehicle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-photo .badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--app-muted);
  font-weight: 600;
}

.photo-placeholder.large {
  min-height: 280px;
  border-radius: var(--radius);
  background: #ececee;
  border: 1px solid var(--app-border);
}

.vehicle-body {
  padding: 1rem;
  display: grid;
  gap: 0.45rem;
}

.vehicle-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.vehicle-body h3 a:hover {
  color: var(--orange-deep);
}

.vehicle-meta {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.vehicle-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.vehicle-prices span {
  display: block;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.vehicle-prices strong {
  font-size: 0.98rem;
}

.vehicle-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-sm {
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.btn-danger-ghost {
  background: transparent;
  color: #c62828;
  border: 1px solid rgba(198, 40, 40, 0.25);
}

.btn-danger-ghost:hover {
  background: rgba(198, 40, 40, 0.06);
}

.text-ok { color: #1a9f66; }
.text-danger { color: #c62828; }
.muted { color: var(--app-muted); }
.link-orange { color: var(--orange-deep); font-weight: 600; }

.badge-warn {
  background: rgba(255, 170, 0, 0.16);
  color: #b36b00;
}

.badge-info {
  background: rgba(33, 150, 243, 0.14);
  color: #1565c0;
}

.badge-sold {
  background: rgba(255, 122, 24, 0.16);
  color: var(--orange-deep);
}

.badge-done {
  background: rgba(61, 207, 142, 0.14);
  color: #1a9f66;
}

.badge-muted {
  background: #f0f0f2;
  color: #6b6b73;
}

.form-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.form-card h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.15rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.field-hint {
  margin: 0.75rem 0 0;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.form-actions {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.gallery-edit {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.gallery-item {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.gallery-item .badge {
  margin: 0.5rem;
}

.gallery-item-actions {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem;
}

.inline-form { display: inline; }

.ficha-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
}

.ficha-main-photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--app-border);
  background: #fff;
}

.ficha-main-photo img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.ficha-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.ficha-thumbs .thumb {
  border: 2px solid transparent;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  width: 72px;
  height: 54px;
  cursor: pointer;
  background: none;
}

.ficha-thumbs .thumb.active,
.ficha-thumbs .thumb:hover {
  border-color: var(--orange);
}

.ficha-thumbs .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ficha-summary {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.ficha-summary h2 {
  margin: 0.7rem 0 0.5rem;
  font-family: var(--display);
}

.ficha-summary .desc {
  color: var(--app-muted);
  line-height: 1.5;
  margin: 0 0 1rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.kpi {
  background: #f7f7f8;
  border-radius: 12px;
  padding: 0.75rem;
}

.kpi span {
  display: block;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.kpi strong {
  font-size: 1.05rem;
}

.estado-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
}

.inline-actions select {
  flex: 1;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.data-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.data-list > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #f0f0f2;
}

.data-list dt {
  color: var(--app-muted);
  font-size: 0.88rem;
}

.data-list dd {
  margin: 0;
  font-weight: 600;
}

.tabs-panel {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.6rem;
  background: #f7f7f8;
  border-bottom: 1px solid var(--app-border);
  flex-wrap: wrap;
}

.tab {
  border: 0;
  background: transparent;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--app-muted);
  font-weight: 600;
}

.tab.active {
  background: #fff;
  color: var(--app-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-panel {
  display: none;
  padding: 1rem;
}

.tab-panel.active {
  display: block;
}

.mini-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.mini-form .field-span {
  grid-column: span 2;
}

.mini-form .btn {
  height: 46px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid #f0f0f2;
  font-size: 0.92rem;
}

.data-table th {
  color: var(--app-muted);
  font-weight: 600;
}

.timeline {
  display: grid;
  gap: 0.9rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 0.75rem;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.15);
}

.timeline-item p {
  margin: 0.2rem 0;
  color: var(--app-text);
}

.timeline-item small {
  color: var(--app-muted);
}

@media (max-width: 1100px) {
  .vehicle-grid,
  .form-grid,
  .gallery-edit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar,
  .ficha-hero,
  .info-grid,
  .mini-form {
    grid-template-columns: 1fr 1fr;
  }

  .mini-form .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .vehicle-grid,
  .form-grid,
  .gallery-edit,
  .filter-bar,
  .ficha-hero,
  .info-grid,
  .mini-form,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    margin-left: 0;
    width: 100%;
  }

  .mini-form .field-span {
    grid-column: auto;
  }

  .data-list > div {
    grid-template-columns: 1fr;
  }
}

/* ---------- Gastos / alistamiento ---------- */

.filter-bar-3 {
  grid-template-columns: 1.3fr 1fr 1fr auto;
}

.table-actions {
  display: flex;
  gap: 0.75rem;
  white-space: nowrap;
}

.field-span-2 {
  grid-column: span 2;
}

.field-check {
  display: flex;
  align-items: end;
}

.check-label {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  color: var(--app-text) !important;
  font-weight: 600;
  cursor: pointer;
}

.check-label input {
  width: auto !important;
  accent-color: var(--orange);
}

.total-line {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 122, 24, 0.1);
  color: var(--app-text);
}

.total-line strong {
  color: var(--orange-deep);
  font-size: 1.15rem;
}

.gasto-hero {
  align-items: start;
}

.sub-title {
  margin: 1.1rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tab-toolbar {
  margin-bottom: 0.85rem;
}

.flujo-steps h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.1rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: #fafafa;
  color: var(--app-muted);
}

.step.done {
  border-color: rgba(255, 122, 24, 0.35);
  background: rgba(255, 122, 24, 0.08);
  color: var(--app-text);
}

.step.current {
  box-shadow: 0 0 0 2px rgba(255, 122, 24, 0.35);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--app-border);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step.done .step-num,
.step.current .step-num {
  background: var(--orange);
  border-color: var(--orange);
  color: #120800;
}

.mini-form-2 {
  grid-template-columns: 1fr auto;
}

@media (max-width: 1100px) {
  .filter-bar-3,
  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .filter-bar-3,
  .steps,
  .mini-form-2 {
    grid-template-columns: 1fr;
  }
}
