/* 1) Tus tokens */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
  animation: none !important;
}

:root {

  scrollbar-gutter: stable;


  --thumbs-height: 520px


  --bg: #F1F5F9;   /* gris azulado suave */
--surface: #FFFFFF;
--surface-2: #EAEFF5;
  --border: #E5E7EB;
  --border2: rgb(167, 167, 167);

  --text: #111827;
  --text-muted: #6B7280;

  --primary: #2563EB;
  --primary-hover: #1D4ED8;

  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --info: #0EA5E9;

  --row-hover: #F9FAFB;

  --input-bg: #FFFFFF;
  --input-border: #D1D5DB;
  --focus: rgba(37, 99, 235, 0.25);

  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

/* 2) Mapeo a Bootstrap (LIGHT) */
:root {
  --bs-body-bg: #ebeef3;
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--text-muted);

  --bs-border-color: var(--border);

  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-2);
  --bs-body-bg-rgb: 248, 249, 250; /* opcional, para utilities */

  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-hover);

  --bs-primary: var(--primary);
  --bs-success: var(--success);
  --bs-warning: var(--warning);
  --bs-danger: var(--danger);
  --bs-info: var(--info);

  --bs-focus-ring-color: var(--focus);

  /* Cards/Dropdowns/Modals usan esto bastante */
  --bs-card-bg: var(--surface);
  --bs-dropdown-bg: var(--surface);
  --bs-modal-bg: var(--surface);

  --bs-box-shadow: var(--shadow);
  --bs-box-shadow-sm: 0 6px 18px rgba(17, 24, 39, 0.06);
  --bs-table-hover-bg: rgba(96, 165, 250, 0.08);
}

/* 3) Dark theme tokens */
:root[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111827;
  --surface-2: #0d1427;
  --border: #243041;
  --border2: #243041;

  --text: #E5E7EB;
  --text-muted: #9CA3AF;

  --primary: #60A5FA;
  --primary-hover: #3B82F6;

  --success: #22C55E;
  --warning: #FBBF24;
  --danger: #F87171;
  --info: #38BDF8;

  --row-hover: #131f36;

  --input-bg: #0F172A;
  --input-border: #2B3A52;
  --focus: rgba(96, 165, 250, 0.25);

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* 4) Mapeo a Bootstrap (DARK) */
:root[data-theme="dark"] {
  color-scheme: dark; /* para scrollbars/forms nativos */

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--text-muted);

  --bs-border-color: var(--border);

  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-2);

  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-hover);

  --bs-primary: var(--primary);
  --bs-success: var(--success);
  --bs-warning: var(--warning);
  --bs-danger: var(--danger);
  --bs-info: var(--info);

  --bs-focus-ring-color: var(--focus);

  --bs-card-bg: var(--surface);
  --bs-dropdown-bg: var(--surface);
  --bs-modal-bg: var(--surface);

  --bs-box-shadow: var(--shadow);
  --bs-box-shadow-sm: var(--shadow);
}

:root[data-theme="dark"] .table {
  --bs-table-bg: var(--surface);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--row-hover);
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-hover-bg: rgba(96, 165, 250, 0.08);
  --bs-table-hover-color: var(--text);
}

:root[data-theme="dark"] .table thead th {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

:root[data-theme="dark"] .table {
  border-radius: 12px;
  overflow: hidden;
}

/* Base alert en dark: usa variables de Bootstrap */
:root[data-theme="dark"] .alert {
  background-color: var(--bs-alert-bg) !important;
  color: var(--bs-alert-color) !important;
  border-color: var(--bs-alert-border-color) !important;
}

/* Defaults por si alguna alerta no matchea variante */
:root[data-theme="dark"] .alert {
  --bs-alert-bg: var(--surface-2);
  --bs-alert-color: var(--text);
  --bs-alert-border-color: var(--border);
}

/* Variantes */
:root[data-theme="dark"] .alert-success {
  --bs-alert-bg: rgba(34, 197, 94, 0.12);
  --bs-alert-color: var(--text);
  --bs-alert-border-color: rgba(34, 197, 94, 0.35);
}

:root[data-theme="dark"] .alert-info {
  --bs-alert-bg: rgba(56, 189, 248, 0.12);
  --bs-alert-color: var(--text);
  --bs-alert-border-color: rgba(56, 189, 248, 0.35);
}

:root[data-theme="dark"] .alert-warning {
  --bs-alert-bg: rgba(251, 191, 36, 0.12);
  --bs-alert-color: var(--text);
  --bs-alert-border-color: rgba(251, 191, 36, 0.35);
}

:root[data-theme="dark"] .alert-danger,
:root[data-theme="dark"] .alert-error { /* Django a veces manda "error" */
  --bs-alert-bg: rgba(248, 113, 113, 0.12);
  --bs-alert-color: var(--text);
  --bs-alert-border-color: rgba(248, 113, 113, 0.35);
}

:root:not([data-theme="dark"]) .table {
  --bs-table-hover-bg: rgba(0, 0, 0, 0.1);
}


.table tbody tr {
  transition: background-color 180ms ease, transform 120ms ease;
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

hr{
    border-color: var(--border2);
}

#themeToggle i {
  transition: transform 180ms ease, opacity 180ms ease;
}

.theme-icon-anim {
  transform: rotate(20deg) scale(1.08);
  opacity: 0.9;
}

/* --- Navbar (DealerHub) --- */
.navbar-dh {
  background: var(--surface);
  border-color: var(--border);
}

.navbar-dh .navbar-brand,
.navbar-dh .navbar-brand:hover,
.navbar-dh .navbar-brand:focus {
  color: var(--text) !important;
}

.navbar-page-title {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.navbar-dh .ms-auto {
  gap: 0.5rem;
}

.header-action-form {
  margin: 0;
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.375rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.header-icon-btn:hover,
.header-icon-btn:focus {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--primary);
  text-decoration: none;
}

.header-icon-btn.active {
  color: var(--primary);
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--bs-border-color));
}

:root[data-theme="dark"] .navbar-page-title

/* --- Cards / grilla --- */
.card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.card-header,
.card-footer {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}



body {
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.navbar-dh { 
    background: var(--surface); 
}

/* Cards/panels */
.card, .navbar, .dropdown-menu {
  border-color: var(--bs-border-color);
}

/* Tables */
.table {
  --bs-table-bg: var(--surface);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--row-hover);
  color: var(--bs-body-color);
}

/* Inputs: que se vean bien en dark */
.form-control, .form-select {
  background-color: var(--input-bg);
  color: var(--text);
  border-color: var(--input-border);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .25rem var(--focus);
}

#icono1{
    margin-right: 0.7rem;
}

.alerta{
    width: fit-content;
    margin: auto;
}

/* #main{}*/

/*body{
    background-color: #e4e4e4;
}
    */

/* RANDOM */

.restaurarYVolverContainer{
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}



/* NOTAS */
.notes-list .note-item {
  background: var(--surface);
}

.note-actions {
  flex-shrink: 0;
}

.note-item { padding: .75rem !important; }

.note-view{
  margin-top: .35rem;
  white-space: normal;      /* <- clave: evita pre-wrap si te estira */
  word-break: break-word;
  line-height: 1.25;
}

.note-view p { margin: 0; } /* por si se renderiza como <p> en algún lado */

.note-badge{
  background-color: var(--surface-2);
  color: var(--text);
}


.margin-8rem{
  margin-left: 8rem;
  margin-right: 8rem;
}



/* CARRUSEL DE FOTOS EN EDIT VEHICLE */

.thumb-wrap {
  position: relative;
}

.thumb-hit {
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .75rem;
  overflow: hidden;
  background: transparent;
  text-align: left;
}

/* cuadradas y un toque más grandes */
.thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;          /* cuadrado */
  object-fit: cover;
  display: block;
}

.thumb-trash-form {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}

.thumb-trash {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* estilo “flotante” */
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}

.thumb-trash:hover {
  background: rgba(220,53,69,.85); /* rojo bootstrap danger */
  border-color: rgba(220,53,69,.85);
}

.width32{
  width: 32px;
}

.height31{
  height: 31px;
}

.maxWidth420{
  max-width: 380px;
}

/* CONFIRM MODAL */

.greenIcon{
  color:  #c3ffe3;
}

.confirm-modal {
  background: #1b212b;
  color: #f5f7fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.confirm-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.1rem 0.9rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
}

.confirm-modal-body {
  padding: 2.2rem 1.4rem 1.4rem;
  text-align: center;
  font-weight: 500;
}

.confirm-modal-body p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
  font-size: 0.96rem;
}

.confirm-modal-footer {
  padding: 0.7rem 1.2rem 1.2rem 1.2rem;
  gap: 0.5rem;
  display: flex;
  justify-content: center;
  border-top: none;
}

.confirm-modal-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 53, 69, 0.14);
  color: #ff6b7a;
  flex-shrink: 0;
}

.confirm-modal .modal-title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.confirm-modal .btn {
  border-radius: 10px;
  font-weight: 600;
}

.confirm-modal .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

.confirm-modal .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.modal-backdrop.show {
  opacity: 0.85;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background-color: rgba(0, 0, 0, 0.8);
}

.confirm-modal-button{
  height: 44px;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 1rem;
  border-radius: 12px;
}

.cancel-button{
  background-color: rgba(70, 70, 70, 0.685);
  border-color: rgba(70,70,70,0.685);
}

/* TOAST DE NOTIFICACIONES */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 32px;
  z-index: 1090;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.dealer-toast {
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.dealer-toast-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1rem 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(29, 38, 57, 0.98), rgba(19, 27, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.dealer-toast-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.dealer-toast-content {
  flex: 1;
  min-width: 0;
}

.dealer-toast-title {
  color: #f5f7fb;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.dealer-toast-text {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  line-height: 1.35;
}

.dealer-toast-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dealer-toast-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.18s ease;
  flex: 0 0 auto;
}

.dealer-toast-action--primary {
  color: #071714;
  background: #2fd39b;
  border: 1px solid #2fd39b;
}

.dealer-toast-action--primary:hover,
.dealer-toast-action--primary:focus {
  color: #071714;
  background: #49e3ae;
  border-color: #49e3ae;
}

.dealer-toast-action--secondary {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.dealer-toast-action--secondary:hover,
.dealer-toast-action--secondary:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);
}

.dealer-toast-close {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.46);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.18s ease;
  flex-shrink: 0;
}

.dealer-toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.dealer-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toastProgress 3.5s linear forwards;
}

.dealer-toast--success .dealer-toast-icon {
  background: rgba(32, 201, 151, 0.14);
  color: #2fd39b;
}
.dealer-toast--success .dealer-toast-progress {
  background: linear-gradient(90deg, #1dbb73, #2fd39b);
}

.dealer-toast--error .dealer-toast-icon,
.dealer-toast--danger .dealer-toast-icon {
  background: rgba(255, 82, 105, 0.14);
  color: #ff6577;
}
.dealer-toast--error .dealer-toast-progress,
.dealer-toast--danger .dealer-toast-progress {
  background: linear-gradient(90deg, #ff4f64, #ff7b88);
}

.dealer-toast--warning .dealer-toast-icon {
  background: rgba(255, 193, 7, 0.16);
  color: #ffd25f;
}
.dealer-toast--warning .dealer-toast-progress {
  background: linear-gradient(90deg, #ffc107, #ffd25f);
}

.dealer-toast--info .dealer-toast-icon {
  background: rgba(56, 132, 255, 0.14);
  color: #67a3ff;
}
.dealer-toast--info .dealer-toast-progress {
  background: linear-gradient(90deg, #3b82f6, #67a3ff);
}

.dealer-toast.toast-showing,
.dealer-toast.toast-show {
  animation: toastIn 0.28s ease-out;
}

.dealer-toast.toast-hiding {
  animation: toastOut 0.22s ease-in forwards;
}

.dealer-toast--deleted .dealer-toast-icon {
  background: rgba(255, 82, 105, 0.14);
  color: #ff6577;
}

.dealer-toast--deleted .dealer-toast-progress {
  background: linear-gradient(90deg, #ff4f64, #ff7b88);
}

@media (max-width: 380px) {
  .dealer-toast-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dealer-toast-action {
    width: 100%;
  }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px) translateX(6px);
  }
}

.dealer-toast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.dealer-toast--success .dealer-toast-icon {
  background: rgba(28, 200, 138, 0.14);
  color: #3ddc97;
}

.dealer-toast--error .dealer-toast-icon,
.dealer-toast--danger .dealer-toast-icon {
  background: rgba(255, 82, 105, 0.14);
  color: #ff6577;
}

.dealer-toast--warning .dealer-toast-icon {
  background: rgba(255, 193, 7, 0.16);
  color: #ffd25f;
}

.dealer-toast--info .dealer-toast-icon {
  background: rgba(56, 132, 255, 0.14);
  color: #67a3ff;
}




/* GALERÍA DE FOTOS EN TEMPLATE VEHICLE_EDIT */
.vehicle-photo-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.vehicle-photo-layout.has-photos .vehicle-gallery-current {
  order: 1;
}

.vehicle-photo-layout.has-photos .photo-upload-form {
  order: 2;
}

.vehicle-photo-layout.is-empty .photo-upload-form {
  order: 1;
}

.vehicle-photo-layout.is-empty .vehicle-gallery-empty {
  order: 2;
}

.photo-upload-form {
  display: grid;
  gap: 1rem;
}

.photo-upload-form.is-compact {
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
}

.photo-upload-heading {
  display: grid;
  gap: 0.15rem;
}

.vehicle-photo-main-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.vehicle-photo-main-heading > div {
  min-width: 0;
}

.photo-upload-dropzone {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 2px dashed color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: 1rem;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary) 7%, var(--surface)),
      color-mix(in srgb, var(--surface-2) 72%, var(--surface))
    );
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.photo-upload-form.is-compact .photo-upload-dropzone {
  min-height: 108px;
  justify-content: flex-start;
  padding: 1rem 1.25rem;
  border-width: 1px;
}

.photo-upload-form.is-compact .photo-upload-dropzone-icon {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.1rem;
}

.photo-upload-dropzone:hover,
.photo-upload-dropzone:focus-visible,
.photo-upload-dropzone.is-dragover {
  border-color: var(--primary);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary) 14%, var(--surface)),
      color-mix(in srgb, var(--primary) 6%, var(--surface-2))
    );
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.photo-upload-dropzone.is-dragover {
  transform: translateY(-2px);
}

.photo-upload-dropzone-icon {
  flex: 0 0 auto;
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
  font-size: 1.35rem;
}

.photo-upload-dropzone-copy {
  display: grid;
  gap: 0.3rem;
}

.photo-upload-dropzone-copy strong {
  font-size: 1rem;
}

.photo-upload-dropzone-copy span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.photo-upload-pending {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--primary) 3%, var(--surface-2));
}

.photo-upload-pending-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.photo-upload-count,
.vehicle-gallery-current-count {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.photo-upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.photo-upload-preview-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.photo-upload-preview-media {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 1.6rem;
}

.photo-upload-preview-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-upload-preview-media.is-placeholder {
  background: color-mix(in srgb, var(--surface-2) 82%, var(--border));
}

.photo-upload-preview-remove {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.24);
  transition: background-color 150ms ease, transform 150ms ease;
}

.photo-upload-preview-remove:hover,
.photo-upload-preview-remove:focus-visible {
  background: #dc3545;
  transform: scale(1.06);
  outline: none;
}

.photo-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.photo-upload-error {
  margin-top: -0.35rem;
}

.vehicle-gallery-current {
  min-width: 0;
}

.vehicle-gallery-empty {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-2);
}

.vehicle-gallery-empty-icon {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
  font-size: 1.15rem;
}

#sortable-gallery .thumb-wrap {
  cursor: grab;
}

#sortable-gallery .thumb-wrap:active {
  cursor: grabbing;
}

.sortable-ghost {
  opacity: 0.45;
}

.sortable-chosen {
  filter: drop-shadow(0 0 2px white);
}

.sortable-drag {
  opacity: 0.95;
}

/*** ***/

.image-order-footer {
  margin-top: 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.image-order-footer.is-idle {
  display: none;
}

.image-order-footer.is-active {
  display: flex;
}

#image-order-status,
#image-order-actions {
  transition: opacity 0.18s ease;
}

@media (max-width: 575.98px) {
  .image-order-footer.is-active {
    align-items: stretch;
    flex-direction: column;
  }

  .image-order-footer #image-order-actions {
    justify-content: stretch !important;
  }

  .image-order-footer #image-order-actions .btn {
    flex: 1 1 0;
  }
}

/*     SCROLL BAR CARRUSEL DE FOTOS MINIATURAS DERECHA     */

/* Scrollbar SOLO para la columna de miniaturas */
.thumbs-scroll{
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: rgba(255,255,255,.22) transparent;
  max-height: var(--thumbs-h);
  overflow: auto;
  padding-right: 4px;
}

.sideGallery-wrapper{
  padding-right: 0;
}

.main-photo-card{
  height: var(--thumbs-h);
}

.main-photo-card .photo-frame{
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-photo-card img{
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* Chromium (Chrome/Edge/Opera) */
.thumbs-scroll::-webkit-scrollbar{
  width: 10px;
}

.thumbs-scroll::-webkit-scrollbar-track{
  background: transparent;
}

.thumbs-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  border: 3px solid transparent;         /* “padding” interno */
  background-clip: content-box;
}

.thumbs-scroll::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.28);
  background-clip: content-box;
}

/* Opcional: que no aparezcan flechitas raras */
.thumbs-scroll::-webkit-scrollbar-button{
  height: 0;
  width: 0;
}

/* PROBAR LUEGO

.thumbs-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  transition: background .15s ease;
}
.thumbs-scroll:hover::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.22);
}

*/

:root{
  --thumbs-h: 520px;
}

/* Foto grande */
.main-photo-card{
  height: var(--thumbs-h);
  border-radius: 0.85rem;
  overflow: hidden;
}

.photo-frame{
  height: 100%;
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

#mainPhoto{
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display:block;
}

/* Scroll minis */
.thumbs-scroll{
  max-height: var(--thumbs-h);
  overflow:auto;
  padding-right: 6px;
}

/* Mini card cuadrada */
.thumb-wrap{ position: relative; }

.thumb-hit{
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .85rem;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  display:block;
}

.thumb-img{
  width:100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display:block;
}

.thumb-hit::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: .85rem;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0); /* estado inicial */
  transition: box-shadow 250ms ease;
}

.thumb-hit.thumb-active::after{
  content: "";
  position: absolute;
  inset: 0;                      /* cubre todo el botón */
  border-radius: .85rem;
  box-shadow: inset 0 0 0 3px rgba(13,110,253,.95);
  pointer-events: none;          /* no bloquea clicks */
  transition: box-shadow 250ms ease;
}

/* Hover: borde gris sutil (solo si NO está activa) */
.thumb-hit:not(.thumb-active):hover::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: .85rem;
  transition: box-shadow 250ms ease;
  box-shadow: inset 0 0 2px 3px rgba(150, 150, 150, 0.85);
  pointer-events: none;
}

/* Active visible SIEMPRE (no depende del focus) */
.thumb-active{
  box-shadow: inset 0 0 0 15px var(--primary-hover);
  outline: none;
}

/* Trash overlay */
.thumb-trash-form{
  position:absolute;
  top: 8px;
  right: 8px;
  margin:0;
}

.thumb-trash{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.18);
  color:#fff;
}
.thumb-trash:hover{
  background: rgba(220,53,69,.85);
  border-color: rgba(220,53,69,.85);
}

/* Scrollbar linda (solo en la columna) */
.thumbs-scroll{
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
.thumbs-scroll::-webkit-scrollbar{ width: 10px; }
.thumbs-scroll::-webkit-scrollbar-track{ background: transparent; }
.thumbs-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.thumbs-scroll::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.28);
  background-clip: content-box;
  
}

/* === Expenses add row layout === */
.expense-form{
  display: flex;
  flex-direction: column;
  gap: .5rem;              /* similar a g-2 en vertical */
}

/* En mobile: todo apilado */
.expense-field,
.expense-action{
  width: 100%;
}

/* En md+: una sola fila, proporción título > monto, botón fijo al final */
@media (min-width: 768px){
  .expense-form{
    flex-direction: row;
    align-items: flex-end;
    gap: .75rem;           /* similar a g-2 horizontal */
  }

  /* CRÍTICO en flex: permite que los inputs se achiquen y no empujen overflow */
  .expense-field{
    min-width: 0;
  }

  .expense-title{
    flex: 1.4 1 0;         /* más ancho */
  }

  .expense-amount{
    flex: 1 1 0;           /* un poco menos ancho */
  }

  .expense-action{
    flex: 0 0 auto;        /* no crece, no se achica */
  }
}

/* Botón cuadrado fijo, no depende de columnas */
.plusButton{
  width: 38px;
  height: 38px;
  padding: 0 !important;   /* pisa padding de Bootstrap */
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Por si FontAwesome mete baseline raro */
.plusButton i{
  line-height: 1;
}

/* Fuerza el form a ocupar el ancho disponible SIEMPRE */
#gastoss .expense-form,
#gastos .expense-form,
.expense-form{
  width: 100%;
}

/* Si el form está dentro de un flex parent, esto evita que se encoja */
#gastoss .expense-form,
#gastos .expense-form,
.expense-form{
  flex: 1 1 auto;
  min-width: 0;
}

/* Layout */
.expense-form{
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: stretch;   /* clave: que los hijos estiren */
}

/* Campos estiran */
.expense-field,
.expense-action{
  width: 100%;
}

.expense-field{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Desktop */
@media (min-width: 768px){
  .expense-form{
    flex-direction: row;
    align-items: flex-end;
    gap: .75rem;
  }

  .expense-title{  flex: 1.4 1 0; }
  .expense-amount{ flex: 1.0 1 0; }

  .expense-action{
    flex: 0 0 auto;
    width: auto;          /* en desktop, el botón no ocupa 100% */
    display: flex;
    align-items: flex-end;
  }
}

.btnWhite{
  filter: invert(1) grayscale(100%);
  opacity: .85;
  transition: 0.5s ease;
}

.btnWhite:hover{
  filter: invert(1) grayscale(100%);
  opacity: 1;
  scale: 1.05;
}

/* VEHICLE EDIT PANELS */
.vehicle-edit-shell {
  padding-bottom: 2rem;
}

.vehicle-edit-stack {
  display: grid;
  gap: 1.5rem;
}

.vehicle-edit-panel {
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.vehicle-edit-panel-heading {
  margin-bottom: 1.5rem;
}

.vehicle-edit-panel .form-control,
.vehicle-edit-panel .form-select,
.vehicle-edit-panel .input-group-text {
  border-radius: 0.5rem;
}

.vehicle-edit-panel textarea.form-control {
  min-height: 8.5rem;
}

@media (max-width: 575.98px) {
  .photo-upload-dropzone {
    min-height: 185px;
    flex-direction: column;
    padding: 1.25rem 1rem;
    text-align: center;
  }

  .photo-upload-form.is-compact .photo-upload-dropzone {
    min-height: 130px;
    justify-content: center;
    padding: 1rem;
  }

  .vehicle-gallery-empty {
    align-items: flex-start;
  }

  .photo-upload-pending-heading {
    align-items: flex-start;
  }

  .vehicle-photo-main-heading {
    align-items: flex-start;
  }

  .photo-upload-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-upload-actions {
    flex-direction: column-reverse;
  }

  .photo-upload-actions .btn {
    width: 100%;
  }
}

.vehicle-edit-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.vehicle-edit-summary-panel .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.margen-wrapper{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.vehicle-edit-history-panel .list-group-item {
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 85%, transparent);
}

.vehicle-edit-notes-panel .note-item {
  border-radius: 0.9rem !important;
  border-color: color-mix(in srgb, var(--border) 85%, transparent) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

@media (max-width: 1399.98px) {
  .vehicle-edit-shell .main-photo-card,
  .vehicle-edit-shell .thumbs-scroll {
    max-height: 460px;
    height: 460px;
  }
}

@media (max-width: 991.98px) {
  .vehicle-edit-shell .main-photo-card,
  .vehicle-edit-shell .thumbs-scroll {
    max-height: none;
    height: auto;
  }

  .vehicle-edit-history-panel .card-header .d-flex {
    align-items: flex-start !important;
    flex-direction: column;
  }
}

/* VEHICLE EDIT */
.page-vehicle-edit #main {
  padding-top: 2rem !important;
  padding-bottom: 3rem !important;
}

.page-vehicle-edit main {
  padding-left: 1rem;
  padding-right: 2rem;
}

.page-vehicle-edit .sidebarSticky {
  padding-left: 1rem;
}

.page-vehicle-edit .card {
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.page-vehicle-edit .form-control,
.page-vehicle-edit .form-select,
.page-vehicle-edit .input-group-text {
  min-height: 3rem;
  border-radius: 0.8rem;
}

.page-vehicle-edit textarea.form-control {
  min-height: 8.5rem;
}

.page-vehicle-edit .list-group-item {
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 85%, transparent);
}

.page-vehicle-edit .note-item {
  border-radius: 0.9rem !important;
  border-color: color-mix(in srgb, var(--border) 85%, transparent) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

:root[data-theme="dark"] {
.botonFiltroTodos{
  color: gray !important;
  min-width: 90px;
  background-color: rgba(37, 99, 235, 0.1) !important;
}

.botonFiltroTodos:hover{
  color: whitesmoke !important;
  background-color: rgba(37, 99, 235, 1) !important;
}

.botonFiltroTodos.active{
  background-color: rgba(255,255,255,.2) !important;
  color: unset !important;
  background-color: var(--primary-hover) !important;
}
}


:root:not([data-theme="dark"]) {

.botonFiltroTodos{
  color: unset !important;
  min-width: 90px;
  background-color: rgba(37, 99, 235, 0.1) !important;
}

.botonFiltroTodos:hover{
  color: whitesmoke !important;
  background-color: rgba(37, 99, 235, 1) !important;
}

.botonFiltroTodos.active{
  background-color: rgba(255,255,255,.2) !important;
  background-color: var(--primary-hover) !important;
  color: whitesmoke !important;
}

}

.sinActividadRegistrada{
  padding: 1.2rem 1rem;
}

.emptyTableContainer{
  width: 100%;
  display: inline-flex;
  flex-flow:column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 5rem 0;
}

.emptyTableTitle{
  font-weight: 700;
  font-size: 1.4rem;
}

.buttonCargarPrimerVehiculo{
  margin-top: 1.2rem;
}

.volkarLogo{
  height: 40px;
}

.logo-darkmode {
  display: none;
}

.logo-lightmode {
  display: inline-block;
}

[data-theme="dark"] .logo-lightmode {
  display: none;
}

[data-theme="dark"] .logo-darkmode {
  display: inline-block;
}

.catalog-public-btn {
  font-weight: 600;
  border-color: #2563eb;
  color: rgb(80, 80, 80);
}

[data-theme="dark"] .catalog-public-btn {
  color: #dbeafe;
}
.catalog-public-btn:hover {
  background: #2563eb;
  color: #fff;
}


input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}





@media (min-width: 1200px) {
  .page-vehicle-edit main {
    padding-left: 1.5rem;
    padding-right: 2.75rem;
  }

  .page-vehicle-edit .sidebarSticky {
    padding-left: 1.75rem;
  }
}

@media (max-width: 991.98px) {
  .page-vehicle-edit main,
  .page-vehicle-edit .sidebarSticky {
    padding-left: 0;
    padding-right: 0;
  }
}
