/* --- Solo ocultar el texto del título --- */
#site-name {
  display: none !important;
}

/* --- Asegurar que el contenedor principal SIGUE visible (repara la regla anterior) --- */
.grow.min-w-0.h-\[54px\] {
  display: flex !important;   /* vuelve a mostrarlo */
  align-items: center !important;
}

/* --- Hacer que el contenedor del logo ocupe el ancho disponible --- */
.border-b .shrink-0 {
  flex: 1 1 auto !important;
  width: 100% !important;
}

/* El enlace y la imagen ocupan todo el ancho */
.border-b .shrink-0 a {
  display: block !important;
  width: 100% !important;
}

.border-b .shrink-0 img {
  display: block !important;
  width: 100% !important;
  max-height: 54px !important;   /* altura del header */
  height: 54px !important;       /* asegura altura consistente */
  object-fit: contain !important; /* rellena ancho sin deformarse */
}

/* Opcional: elimina espacios residuales del bloque de texto vacío */
.flex.flex-col.gap-0\.5.grow.justify-center.min-w-0 {
  margin-left: 0 !important;
}





/* ===== Paleta slate azulada (sidebar claro) ===== */

/* Modo claro */
:root {
  --sb-bg-light: #f7f8fb;        /* fondo sidebar */
  --sb-border-light: #e5e9f0;    /* borde derecho */
  --sb-text-light: #0f172a;      /* texto principal */
  --sb-muted-light: #475569;     /* texto secundario */
  --sb-hover-light: #eef2f7;     /* item hover */
  --sb-active-light: #e6ecf5;    /* item activo/focus */

  /* Header (logo) aún más claro que el sidebar */
  --sb-header-bg-light: #ffffff;
  --sb-header-border-light: #e6eaf1;
}

/* Modo oscuro */
.dark {
  --sb-bg-dark: #2b3442;         /* fondo sidebar (aclarado) */
  --sb-border-dark: #3b4758;     /* borde derecho */
  --sb-text-dark: #e6eaf1;       /* texto principal */
  --sb-muted-dark: #b8c1ce;      /* texto secundario */
  --sb-hover-dark: #3a4554;      /* item hover */
  --sb-active-dark: #465264;     /* item activo/focus */

  /* Header (logo) MÁS claro que el resto del sidebar */
  --sb-header-bg-dark: #404c60;      /* más claro que #2b3442 */
  --sb-header-border-dark: #4a5568;
}

/* ===== Sidebar (se mantiene aclarado) ===== */
#nav-sidebar {
  background-color: var(--sb-bg-light) !important;
  border-right: 1px solid var(--sb-border-light) !important;
  color: var(--sb-text-light) !important;
}
.dark #nav-sidebar {
  background-color: var(--sb-bg-dark) !important;
  border-right-color: var(--sb-border-dark) !important;
  color: var(--sb-text-dark) !important;
}

#nav-sidebar-inner {
  background: transparent !important;
  color: inherit !important;
}

/* Enlaces del menú */
#nav-sidebar a { color: inherit !important; border-radius: 10px !important; }
#nav-sidebar a:hover {
  background-color: var(--sb-hover-light) !important;
}
.dark #nav-sidebar a:hover {
  background-color: var(--sb-hover-dark) !important;
}

/* Activo / focus */
#nav-sidebar a:focus-visible,
#nav-sidebar a[aria-current="page"],
#nav-sidebar .active > a {
  background-color: var(--sb-active-light) !important;
  outline: 2px solid transparent;
}
.dark #nav-sidebar a:focus-visible,
.dark #nav-sidebar a[aria-current="page"],
.dark #nav-sidebar .active > a {
  background-color: var(--sb-active-dark) !important;
}

/* Títulos de sección del sidebar */
#nav-sidebar h2 a,
#nav-sidebar h2 {
  color: var(--sb-muted-light) !important;
  font-weight: 600 !important;
}
.dark #nav-sidebar h2 a,
.dark #nav-sidebar h2 {
  color: var(--sb-muted-dark) !important;
}

/* Scrollbar discreto */
#nav-sidebar .simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
  background: #cbd5e1 !important;
}
.dark #nav-sidebar .simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
  background: #64748b !important;
}

/* ===== SOLO la franja superior (logo) MÁS clara ===== */
/* Selecciona el primer bloque header dentro del sidebar (tu HTML lo tiene con .border-b) */
#nav-sidebar-inner > .border-b {
  background: var(--sb-header-bg-light) !important;
  border-bottom-color: var(--sb-header-border-light) !important;
  box-shadow: 0 1px 0 var(--sb-header-border-light) inset !important;
}
.dark #nav-sidebar-inner > .border-b {
  background: var(--sb-header-bg-dark) !important;   /* MÁS claro que el resto */
  border-bottom-color: var(--sb-header-border-dark) !important;
  box-shadow: 0 1px 0 var(--sb-header-border-dark) inset !important;
}

/* Fondo del contenedor del logo transparente para no ensuciar */
#nav-sidebar-inner > .border-b .bg-transparent { background: transparent !important; }

/* Iconos del header */
#nav-sidebar-inner > .border-b .material-symbols-outlined { opacity: 0.9; }
#nav-sidebar-inner > .border-b .material-symbols-outlined:hover { opacity: 1; }

/* (Opcional) Efecto premium en header oscuro */
/*
.dark #nav-sidebar-inner > .border-b {
  background: linear-gradient(180deg, #46536a 0%, #404c60 100%) !important;
}
*/


/* Escala visual sin encoger el ancho útil del layout */
:root {
  --admin-scale: 0.90;
}

/* En el changelist, usar todo el ancho disponible del panel */
body.change-list #content.container {
  max-width: 100% !important;
}

body.change-list #content,
body.change-list #content-main,
body.change-list #changelist,
body.change-list #changelist .changelist-form-container,
body.change-list #changelist #changelist-form,
body.change-list #changelist #result_list {
  width: 100% !important;
  max-width: 100% !important;
}

/* Compactar tablas del changelist sin reducir el contenedor */
body.change-list #result_list thead th,
body.change-list #result_list tbody td {
  font-size: calc(0.875rem * var(--admin-scale)) !important;
  line-height: 1.2 !important;
  padding-top: .35rem !important;
  padding-bottom: .35rem !important;
}

/* ===== Product image columns/thumbnails in changelists ===== */
:root {
  --sd-image-col-min-width: 72px; /* punto unico para ajustar ancho minimo de columnas de imagen */
}

body.change-list #result_list th.column-producto_thumb,
body.change-list #result_list td.field-producto_thumb,
body.change-list #result_list th.column-imagen_thumb,
body.change-list #result_list td.field-imagen_thumb,
body.change-list #result_list th.column-producto_imagen_preview,
body.change-list #result_list td.field-producto_imagen_preview {
  min-width: var(--sd-image-col-min-width) !important;
}

.sd-product-thumb {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain !important; /* evita recorte al hacer zoom */
  background: #f8fafc;
}

.sd-product-thumb--40 {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.sd-product-thumb--44 {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

/* ===== Branding en login / logout ===== */

.sd-auth-login-shell {
  margin-top: -0.9rem;
}

.sd-auth-brand {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.sd-auth-brand--login {
  margin-bottom: 1cm;
}

.sd-auth-brand--logout {
  margin-bottom: 1.5rem;
}

.sd-auth-brand__logo {
  width: min(320px, 100%);
  max-height: 96px;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid #d9e0ea;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
  padding: 10px 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dark .sd-auth-brand__logo {
  border-color: #3f4b5d;
  background: linear-gradient(180deg, #4b5769 0%, #3f4b5d 100%);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.32);
}

/* Campos de autenticacion siempre legibles (no solo en focus) */
.sd-auth-field-wrap {
  margin-bottom: 0.95rem;
}

.sd-auth-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: #0f172a;
}

.dark .sd-auth-label {
  color: #e2e8f0;
}

.sd-auth-login-shell input[type="text"],
.sd-auth-login-shell input[type="password"],
.sd-auth-login-shell input[type="email"],
.sd-auth-login-shell input[type="number"] {
  width: 100%;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 0.62rem 0.8rem !important;
  line-height: 1.25rem !important;
}

.sd-auth-login-shell input::placeholder {
  color: #64748b;
}

.sd-auth-login-shell input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
  outline: none !important;
}

.dark .sd-auth-login-shell input[type="text"],
.dark .sd-auth-login-shell input[type="password"],
.dark .sd-auth-login-shell input[type="email"],
.dark .sd-auth-login-shell input[type="number"] {
  border-color: #475569 !important;
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

.dark .sd-auth-login-shell input::placeholder {
  color: #94a3b8;
}

.sd-auth-error {
  margin-top: 0.35rem;
  color: #b91c1c;
  font-size: 0.86rem;
}

/* ===== Import/Export (Unfold polish) ===== */
.sd-export-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  margin-left: .85rem !important;
  font-weight: 700 !important;
  padding: .48rem .8rem !important;
  border-radius: 10px !important;
  border: 1px solid #4f46e5 !important;
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%) !important;
  color: #eef2ff !important;
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.35) !important;
}

.sd-export-btn:hover {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
}

.sd-export-btn:focus-visible {
  outline: 2px solid #a5b4fc !important;
  outline-offset: 2px !important;
}

.sd-export-btn .material-symbols-outlined {
  font-size: 1.08rem !important;
  line-height: 1 !important;
}

.sd-export-page {
  max-width: 980px;
  margin: 1rem auto 0;
}

.sd-export-card {
  border: 1px solid var(--hairline-color, #d9e0ea);
  background: var(--card-bg, #ffffff);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(2, 6, 23, 0.08);
  overflow: hidden;
}

.dark .sd-export-card {
  border-color: #3f4b5d;
  background: #1f2937;
  box-shadow: 0 16px 38px rgba(2, 6, 23, 0.35);
}

.sd-export-header {
  padding: 1rem 1.1rem .8rem;
  border-bottom: 1px solid var(--hairline-color, #d9e0ea);
}

.dark .sd-export-header {
  border-bottom-color: #3f4b5d;
}

.sd-export-header h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
}

.sd-export-header p {
  margin: .35rem 0 0;
  color: var(--body-quiet-color, #64748b);
}

.sd-export-form {
  padding: .72rem .9rem .85rem;
}

.sd-export-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: .5rem .75rem;
  border: 1px solid var(--hairline-color, #d9e0ea);
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.06);
  padding: .55rem .65rem;
  margin-bottom: .65rem;
}

.dark .sd-export-options {
  border-color: #374151;
  background: rgba(79, 70, 229, 0.13);
}

.sd-export-alert,
.sd-export-error {
  border-radius: 10px;
  padding: .65rem .8rem;
  margin-bottom: .9rem;
}

.sd-export-alert {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}

.sd-export-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.dark .sd-export-alert {
  border-color: #334155;
  background: #0f172a;
  color: #cbd5e1;
}

.dark .sd-export-error {
  border-color: #7f1d1d;
  background: #450a0a;
  color: #fecaca;
}

.sd-export-fieldset {
  border-radius: 12px;
  border: 1px solid var(--hairline-color, #d9e0ea);
  padding: .55rem .7rem !important;
  margin: 0 !important;
  max-height: 45vh;
  overflow: auto;
}

.dark .sd-export-fieldset {
  border-color: #3f4b5d;
}

.sd-export-row { padding: .32rem 0 !important; }

.sd-export-meta-row {
  display: grid !important;
  grid-template-columns: 115px minmax(170px, 1fr);
  align-items: center;
  gap: .35rem .5rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--hairline-color, #d9e0ea);
  border-radius: 10px;
  padding: .4rem .5rem !important;
}

.dark .sd-export-meta-row {
  border-color: #3f4b5d;
  background: #0f172a;
}

.sd-export-meta-row > label {
  margin: 0 !important;
  font-weight: 600;
}

.sd-export-meta-row select,
.sd-export-meta-row input[type="text"] {
  max-width: 100%;
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
}

.sd-export-meta-row .help {
  grid-column: 1 / -1;
  margin: .2rem 0 0 !important;
}

.sd-export-field-label {
  margin: 0 0 .25rem;
  font-weight: 600;
}

.sd-export-select-all {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .2rem;
}

.sd-export-intro-row {
  border-bottom: 1px solid var(--hairline-color, #d9e0ea);
  margin-bottom: .2rem;
  padding-bottom: .45rem !important;
}

.dark .sd-export-intro-row {
  border-bottom-color: #374151;
}

.sd-export-check-row {
  display: flex !important;
  align-items: center;
  gap: .45rem;
}

.sd-export-check-row input[type="checkbox"] {
  margin: 0 !important;
}

.sd-export-check-row label {
  margin: 0 !important;
  line-height: 1.25 !important;
  cursor: pointer;
}

.sd-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  margin-top: .75rem !important;
}

.sd-export-submit {
  min-width: 130px;
}

/* ===== User password action (Unfold) ===== */
.sd-user-pass-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .34rem .62rem;
  border-radius: 9px;
  border: 1px solid #2563eb;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #eff6ff !important;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

.sd-user-pass-btn:hover {
  border-color: #3b82f6;
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  color: #ffffff !important;
}

.sd-user-pass-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
