/**
 * Andesine Tienda - Estilos elegantes (referencia: dashboard ProDesign / Account Settings)
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ad-text: #0b1f14;
  --ad-text-strong: #05100a;
  --ad-muted: #51686c;
  --ad-card-bg: #fff;
  --ad-surface: #f4f8f9;
  --ad-surface-2: #eef2f5;
  --ad-border: rgba(19, 60, 67, 0.12);
  --ad-soft: #133c43;
  --ad-soft-2: #0f2f36;
  --ad-accent: #133c43;
  --ad-accent-2: #0f2f36;
  --ad-accent-light: rgba(19, 60, 67, 0.08);
  --ad-ok: #2fbf71;
  --ad-warn: #ffb703;
  --ad-bad: #ef476f;
  --ad-radius: 12px;
  --ad-radius-sm: 8px;
  --ad-shadow: 0 4px 20px rgba(5, 38, 43, 0.06);
  --ad-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --sidebar-bg: #fff;
  --sidebar-width: 280px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  color: var(--ad-text);
  background: var(--ad-surface-2);
  -webkit-font-smoothing: antialiased;
}

/* ----- Login / Recuperar contraseña: degradado animado + card ----- */
.andesine-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(-45deg, #0f2f36, #133c43, #1a4d56, #0f2f36);
  background-size: 400% 400%;
  animation: andesine-gradient-move 12s ease infinite;
  font-family: 'Inter', system-ui, sans-serif;
}
@keyframes andesine-gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.andesine-login-box {
  background: var(--ad-card-bg);
  padding: 2.25rem;
  border-radius: var(--ad-radius);
  box-shadow: 0 8px 32px rgba(5, 38, 43, 0.15);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--ad-border);
}
.andesine-login-logo { margin-bottom: 1.5rem; text-align: center; }
.andesine-login-logo img { max-width: 180px; height: auto; display: block; margin: 0 auto; }
.andesine-login-box h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ad-text-strong);
  text-align: center;
}
.andesine-login-desc {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-muted);
  line-height: 1.45;
  text-align: center;
}
.andesine-login-page-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ad-border);
  text-align: center;
}
.andesine-login-footer-title {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ad-muted);
}
.andesine-login-footer-credit {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ad-muted);
}
.andesine-login-footer-link {
  color: var(--ad-accent);
  text-decoration: none;
  font-weight: 600;
}
.andesine-login-footer-link:hover { text-decoration: underline; color: var(--ad-accent-2); }
.andesine-alert { padding: 0.85rem 1rem; border-radius: var(--ad-radius-sm); margin-bottom: 1rem; font-weight: 500; font-size: 0.9rem; }
.andesine-alert-error { background: rgba(239, 71, 111, 0.12); color: #7c1e32; border: 1px solid rgba(239, 71, 111, 0.25); }
.andesine-alert-ok { background: rgba(47, 191, 113, 0.12); color: #0e6a3a; border: 1px solid rgba(47, 191, 113, 0.25); }
.andesine-form label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.9rem; color: var(--ad-text-strong); }
.andesine-form input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  margin-bottom: 1rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.andesine-form input:focus {
  outline: none;
  border-color: var(--ad-accent);
}
.andesine-password-wrap {
  position: relative;
  margin-bottom: 1rem;
}
.andesine-password-wrap input {
  margin-bottom: 0;
  padding-right: 2.75rem;
}
.andesine-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ad-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ad-radius-sm);
  transition: color 0.2s, background 0.2s;
}
.andesine-password-toggle:hover {
  color: var(--ad-accent);
  background: var(--ad-accent-light);
}
.andesine-login-options { margin-bottom: 1.25rem; text-align: right; }
.andesine-login-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-accent);
  text-decoration: none;
}
.andesine-login-link:hover { text-decoration: underline; color: var(--ad-accent-2); }
.andesine-login-footer { margin-top: 1.25rem; text-align: center; }
.andesine-login-footer .andesine-login-link { font-size: 0.9rem; }
.andesine-btn { padding: 0.7rem 1.25rem; border-radius: var(--ad-radius-sm); cursor: pointer; font-weight: 600; border: none; font-size: 0.95rem; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.andesine-btn-primary { background: var(--ad-accent); color: #fff; width: 100%; }
.andesine-btn-primary:hover { background: var(--ad-accent-2); }

/* ----- Welcome overlay (login exitoso): blanco desde centro, logo + Bienvenido ----- */
.andesine-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.01s, visibility 0.01s;
}
.andesine-welcome-overlay.is-active {
  opacity: 1;
  visibility: visible;
}
.andesine-welcome-overlay-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vmax;
  height: 100vmax;
  margin-left: -50vmax;
  margin-top: -50vmax;
  background: #fff;
  border-radius: 50%;
  transform: scale(0);
}
.andesine-welcome-overlay.is-active .andesine-welcome-overlay-bg {
  animation: andesine-welcome-bg-expand 0.4s ease-out forwards;
}
@keyframes andesine-welcome-bg-expand {
  to { transform: scale(1); }
}
.andesine-welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.andesine-welcome-logo {
  opacity: 0;
  margin-bottom: 0;
}
.andesine-welcome-overlay.is-active .andesine-welcome-logo {
  animation: andesine-welcome-logo-fade 0.25s ease-out 0.2s forwards,
             andesine-welcome-logo-up 0.3s ease-out 0.45s forwards;
}
@keyframes andesine-welcome-logo-fade {
  to { opacity: 1; }
}
@keyframes andesine-welcome-logo-up {
  to { transform: translateY(-1.75rem); margin-bottom: 0; }
}
.andesine-welcome-logo img {
  max-width: 160px;
  height: auto;
  display: block;
}
.andesine-welcome-title,
.andesine-welcome-name {
  opacity: 0;
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-welcome-overlay.is-active .andesine-welcome-title,
.andesine-welcome-overlay.is-active .andesine-welcome-name {
  animation: andesine-welcome-text-fade 0.3s ease-out 0.5s forwards;
}
.andesine-welcome-title {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}
.andesine-welcome-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ad-muted);
}

@keyframes andesine-welcome-text-fade {
  to { opacity: 1; }
}

/* ----- Layout: sidebar + main (sidebar y header fijos al scroll) ----- */
.andesine-app { display: flex; min-height: 100vh; }
.andesine-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--ad-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--ad-shadow-sm);
  z-index: 102;
}
.andesine-sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--ad-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.andesine-sidebar-brand img { max-height: 44px; width: auto; max-width: 100%; display: block; object-fit: contain; }
.andesine-sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}
.andesine-sidebar-menu-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ad-muted);
  padding: 0 1rem 0.5rem;
  margin-bottom: 0.25rem;
}
/* Separador visual para secciones adicionales */
.andesine-sidebar-menu-label:not(:first-child) {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ad-border);
}
.andesine-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  margin-bottom: 2px;
  color: var(--ad-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--ad-radius-sm);
  transition: background 0.15s, color 0.15s;
}
.andesine-sidebar-nav a:hover {
  background: var(--ad-accent-light);
  color: var(--ad-soft);
}
.andesine-sidebar-nav a.active {
  background: var(--ad-accent-light);
  color: var(--ad-accent);
  font-weight: 600;
}
.andesine-sidebar-nav .icon { width: 20px; height: 20px; opacity: 0.85; flex-shrink: 0; }

/* Sidebar: grupo con hijos (ej. Productos > Listado, Categorías). Colapsado por defecto; al hacer clic en el padre va a la primera opción y se abre. */
.andesine-sidebar-group {
  margin-bottom: 2px;
}
.andesine-sidebar-group-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ad-muted);
  border-radius: var(--ad-radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.andesine-sidebar-group-label:hover {
  background: var(--ad-accent-light);
  color: var(--ad-soft);
}
.andesine-sidebar-group-children {
  display: none;
  flex-direction: column;
  padding-left: 0.5rem;
  margin-left: 1.35rem;
  border-left: 1px solid var(--ad-border);
}
.andesine-sidebar-group.is-open .andesine-sidebar-group-children {
  display: flex;
}
.andesine-sidebar-child {
  display: block;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ad-muted);
  text-decoration: none;
  border-radius: var(--ad-radius-sm);
  transition: background 0.15s, color 0.15s;
}
.andesine-sidebar-child:hover {
  background: var(--ad-accent-light);
  color: var(--ad-soft);
}
.andesine-sidebar-child.active {
  background: var(--ad-accent-light);
  color: var(--ad-accent);
  font-weight: 600;
}

.andesine-sidebar-info {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--ad-border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ad-muted);
  text-decoration: none;
  display: block;
  transition: color 0.15s, background 0.15s;
}
.andesine-sidebar-info:hover { color: var(--ad-soft); background: var(--ad-accent-light); }
.andesine-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
}
.andesine-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--ad-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  box-shadow: var(--ad-shadow-sm);
  z-index: 101;
}
.andesine-search-wrap { flex: 1; max-width: 480px; min-width: 0; }
.andesine-global-search-wrap { position: relative; }
.andesine-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.andesine-search-dropdown.is-open { display: block; }
.andesine-search-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}
.andesine-search-dropdown-list li { margin: 0; }
.andesine-search-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--ad-accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.andesine-search-dropdown-item:hover {
  background: var(--ad-accent-light);
  color: var(--ad-accent-2);
}
.andesine-search-dropdown-sub {
  color: var(--ad-muted);
  font-size: 0.85rem;
  font-weight: 400;
  margin-left: 0.35rem;
}
.andesine-search-dropdown-empty {
  margin: 0;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--ad-muted);
}
.andesine-search-wrap input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  border: 1px solid var(--ad-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--ad-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2351686c' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 14px center;
}
.andesine-user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  border-radius: var(--ad-radius-sm);
  position: relative;
  margin-left: auto;
}
.andesine-user-menu:hover { background: var(--ad-surface); }
.andesine-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ad-soft);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.andesine-user-name { font-weight: 700; font-size: 0.9rem; color: var(--ad-text-strong); }
.andesine-user-email { font-size: 0.8rem; font-weight: 400; color: var(--ad-muted); }
.andesine-content {
  flex: 0 0 auto;
  margin-top: var(--header-h);
  padding: 1.5rem;
  overflow: visible;
  min-height: 0;
}
.andesine-content h1 { font-size: 1.5rem; font-weight: 700; color: var(--ad-text-strong); margin: 0 0 1rem; }
.andesine-content p { font-weight: 500; color: var(--ad-text); margin: 0 0 0.5rem; }
.andesine-content p strong { font-weight: 700; }

/* ----- Cards & tables ----- */
.andesine-card {
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  padding: 1.5rem;
  box-shadow: var(--ad-shadow);
  margin-bottom: 1.25rem;
}
/* Card con tabla: la tabla no estira, altura = contenido (1 fila = poca altura) */
.andesine-card .andesine-table-wrap {
  flex: none;
}
.andesine-card-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-table-wrap {
  overflow-x: auto;
  min-height: 0;
  height: auto;
}
.andesine-table-empty {
  margin: 0;
  padding: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-muted);
  text-align: center;
}

/* Barra de búsqueda sobre la tabla */
.andesine-table-toolbar {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}
.andesine-table-search {
  display: flex;
  align-items: center;
  max-width: 420px;
  min-width: 0;
}
.andesine-table-search .andesine-search-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.9rem 0.6rem 2.5rem;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-text);
  background: var(--ad-card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2351686c' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  background-size: 18px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.andesine-table-search .andesine-search-input::placeholder {
  color: var(--ad-muted);
}
.andesine-table-search .andesine-search-input:focus {
  outline: none;
  border-color: var(--ad-accent);
  box-shadow: 0 0 0 3px var(--ad-accent-light);
}
.andesine-table-search .andesine-search-btn {
  margin-left: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  background: var(--ad-surface);
  color: var(--ad-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.andesine-table-search .andesine-search-btn:hover {
  background: var(--ad-accent-light);
  color: var(--ad-accent);
}
.andesine-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Pie de tabla: info + paginador */
.andesine-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ad-border);
}
.andesine-table-info {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ad-muted);
}

/* Paginador: Primera | 1, 2, 3 … | Última */
.andesine-paginator {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.andesine-paginator-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.andesine-paginator-list li {
  margin: 0;
  padding: 0;
}
.andesine-paginator-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-accent);
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.andesine-paginator-btn:hover {
  background: var(--ad-accent-light);
  border-color: var(--ad-accent);
  color: var(--ad-accent-2);
}
.andesine-paginator-btn.is-active {
  background: var(--ad-accent);
  border-color: var(--ad-accent);
  color: #fff;
  pointer-events: none;
}
.andesine-paginator-btn.is-active:hover {
  background: var(--ad-accent);
  color: #fff;
}
.andesine-paginator-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  color: var(--ad-muted);
}
.andesine-paginator-btn-icon {
  min-width: 2.25rem;
  padding: 0;
}
.andesine-paginator-btn-icon .andesine-paginator-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.andesine-paginator-btn-icon .andesine-paginator-icon svg {
  display: block;
}
.andesine-paginator-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-muted);
}

.andesine-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-weight: 500;
}
.andesine-table th, .andesine-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--ad-border);
}
.andesine-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ad-muted);
  background: var(--ad-surface);
}
.andesine-table td { font-weight: 500; color: var(--ad-text); }
.andesine-table tr:hover td { background: var(--ad-accent-light); }
/* Tooltip visible al pasar el cursor (columna usuario vinculado, etc.) */
.andesine-tooltip-trigger {
  position: relative;
  cursor: default;
}
.andesine-tooltip-trigger[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  background: var(--ad-soft-2);
  border-radius: var(--ad-radius-sm);
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}
.andesine-tooltip-trigger[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ad-soft-2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1001;
}
.andesine-tooltip-trigger[data-tooltip]:hover::after,
.andesine-tooltip-trigger[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}
.andesine-actions-cell { white-space: nowrap; }
.andesine-dropdown { position: relative; display: inline-block; }
.andesine-dropdown-toggle {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ad-text);
  transition: background 0.15s, border-color 0.15s;
}
.andesine-dropdown-toggle:hover {
  background: var(--ad-surface);
  border-color: var(--ad-soft);
}
/* Botón solo icono (tres puntos): fondo igual al de la fila, sin borde azul */
.andesine-dropdown-toggle-icon {
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: 1px solid var(--ad-border);
  color: var(--ad-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ad-radius-sm);
  outline: none;
}
.andesine-dropdown-toggle-icon:hover {
  background: var(--ad-accent-light);
  border-color: var(--ad-border);
  color: var(--ad-text);
}
.andesine-dropdown-toggle-icon:focus {
  outline: none;
  border-color: var(--ad-muted);
}
.andesine-table tr:hover .andesine-dropdown-toggle-icon {
  background: transparent;
}
.andesine-table tr:hover .andesine-dropdown-toggle-icon:hover {
  background: rgba(19, 60, 67, 0.12);
}
.andesine-dropdown-toggle-icon svg {
  display: block;
}
/* Menú desplegable: referencia Share/Rename/Archive/Delete - ancho según contenido + hover con bordes redondeados */
.andesine-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  min-width: 200px;
  width: max-content;
  max-width: 280px;
  box-sizing: border-box;
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  padding: 0.5rem 0.25rem;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.andesine-dropdown.open .andesine-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.andesine-dropdown-menu .andesine-dropdown-item,
.andesine-dropdown-menu .andesine-dropdown-item-form,
.andesine-dropdown-menu a.andesine-dropdown-item {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
}
.andesine-dropdown-item,
.andesine-dropdown-item-form .andesine-dropdown-item {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem 0.75rem 1.5rem !important;
  margin: 0 0.15rem;
  border: none;
  border-radius: var(--ad-radius-sm);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--ad-text-strong);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  text-align: left;
  box-sizing: border-box;
}
.andesine-dropdown-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ad-muted);
  vertical-align: middle;
}
.andesine-dropdown-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.andesine-dropdown-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}
.andesine-dropdown-menu > *:not(:first-child) {
  margin-top: 0.2rem;
}
/* Hover: gris suave a ancho completo con bordes redondeados (referencia) */
.andesine-dropdown-item:hover,
.andesine-dropdown-item-form .andesine-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.06);
}
.andesine-dropdown-item:hover .andesine-dropdown-icon,
.andesine-dropdown-item-form .andesine-dropdown-item:hover .andesine-dropdown-icon {
  color: var(--ad-soft);
}
/* Eliminar: icono y texto rojos, hover gris claro igual que el resto */
.andesine-dropdown-item-danger .andesine-dropdown-icon-danger,
.andesine-dropdown-item-danger .andesine-dropdown-label {
  color: var(--ad-bad) !important;
}
.andesine-dropdown-item-danger:hover {
  background: rgba(0, 0, 0, 0.06);
}
.andesine-dropdown-item-danger:hover .andesine-dropdown-icon-danger,
.andesine-dropdown-item-danger:hover .andesine-dropdown-label {
  color: var(--ad-bad) !important;
}

/* ----- Modales: panel derecho ----- */
.andesine-modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 38, 43, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 9998; display: none;
}
.andesine-modal-backdrop.is-open { display: block; }
.andesine-modal-panel {
  position: fixed; top: 0; right: 0; width: min(520px, 96vw); height: 100%; background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12); z-index: 9999; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s ease;
}
.andesine-modal-panel.is-open { transform: translateX(0); }
.andesine-modal-panel .panel-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--ad-border); display: flex; justify-content: space-between; align-items: center;
}
.andesine-modal-panel .panel-header h2 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--ad-text-strong); }
.andesine-modal-panel .panel-close { padding: 0.4rem; border: none; background: none; cursor: pointer; border-radius: 8px; }
.andesine-modal-panel .panel-close:hover { background: var(--ad-surface); }
.andesine-modal-panel .panel-body { flex: 1; padding: 1.25rem; overflow: auto; }

/* Panel Ver venta: secciones y estructura */
.panel-venta-ver { font-size: 0.9rem; }
.panel-venta-section { margin-bottom: 1.25rem; }
.panel-venta-section:last-child { margin-bottom: 0; }
.panel-venta-section-title {
  margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ad-muted);
}
.panel-venta-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; align-items: baseline; }
.panel-venta-dl dt { color: var(--ad-muted); font-weight: 500; }
.panel-venta-dl dd { margin: 0; }
.panel-venta-table-wrap { overflow-x: auto; margin: 0.5rem 0; border: 1px solid var(--ad-border); border-radius: var(--ad-radius-sm); }
.panel-venta-table-wrap .andesine-table { margin: 0; font-size: 0.85rem; }
.panel-venta-table-wrap .andesine-table th, .panel-venta-table-wrap .andesine-table td { padding: 0.5rem 0.75rem; }
.panel-venta-totales { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--ad-border); }
.panel-venta-totales dd { font-weight: 600; }
.panel-venta-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* ----- Modales: sistema general (animación fade + slide desde arriba) ----- */
/* Usar .is-visible para mostrar el overlay (display:flex) y .is-open para animar el contenido.
   Los helpers andesineModalOpen/andesineModalClose aplican ambas clases con rAF para que la animación se vea. */

/* Modal confirmación */
.andesine-modal-confirm {
  position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(5, 38, 43, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.andesine-modal-confirm.is-visible { display: flex; }
.andesine-modal-confirm .dialog {
  background: #fff; border-radius: var(--ad-radius); padding: 1.5rem; max-width: 400px; box-shadow: var(--ad-shadow);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.andesine-modal-confirm.is-open .dialog {
  opacity: 1;
  transform: translateY(0);
}
.andesine-modal-confirm .dialog-buttons { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

/* Modal formularios (editar / ver / añadir): mismo patrón */
.andesine-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
/* Cuando el modal está visible: el propio contenedor es el overlay (fondo oscuro) */
.andesine-modal.is-visible {
  display: flex;
  background: rgba(5, 38, 43, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* Backdrop: cubre toda la ventana para clic (cerrar); mismo estilo por si acaso */
.andesine-modal .andesine-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: transparent;
  cursor: pointer;
}
.andesine-modal .andesine-modal-dialog {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  background: var(--ad-card-bg);
  border-radius: var(--ad-radius);
  box-shadow: 0 24px 48px rgba(5, 38, 43, 0.12);
  border: 1px solid var(--ad-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.andesine-modal .andesine-modal-dialog-wide {
  max-width: 560px;
}
.andesine-modal.is-open .andesine-modal-dialog {
  opacity: 1;
  transform: translateY(0);
}
.andesine-modal .andesine-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ad-border);
  flex-shrink: 0;
}
.andesine-modal .andesine-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ad-text-strong);
  letter-spacing: -0.02em;
}
.andesine-modal .andesine-modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  border-radius: var(--ad-radius-sm);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ad-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.andesine-modal .andesine-modal-close:hover {
  background: var(--ad-surface);
  color: var(--ad-text);
}
.andesine-modal .andesine-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.andesine-modal .andesine-modal-body form.andesine-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.andesine-modal .andesine-modal-desc {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-muted);
  line-height: 1.45;
}
.andesine-modal .andesine-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ad-border);
  background: var(--ad-surface);
  flex-shrink: 0;
  margin-top: 1.25rem;
}
.andesine-form-group {
  margin-bottom: 1.1rem;
}
.andesine-form-group:last-of-type { margin-bottom: 0; }
.andesine-form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-text-strong);
}
.andesine-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-text);
  background: #fff;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.andesine-input:focus {
  outline: none;
  border-color: var(--ad-accent);
  box-shadow: 0 0 0 3px var(--ad-accent-light);
}
.andesine-input::placeholder { color: var(--ad-muted); }
.andesine-textarea {
  min-height: 4rem;
  resize: vertical;
}
.andesine-form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-text);
  cursor: pointer;
}
.andesine-form-check input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--ad-accent);
}
.andesine-btn-ghost {
  background: transparent;
  border: 1px solid var(--ad-border);
  color: var(--ad-text);
}
.andesine-btn-ghost:hover {
  background: var(--ad-surface);
  border-color: var(--ad-soft);
}

/* Formulario por secciones (ej. producto-editar) */
.andesine-form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ad-border);
}
.andesine-form-section:last-of-type { border-bottom: none; }
.andesine-form-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.andesine-form-row .andesine-form-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.andesine-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ad-border);
}
.andesine-required {
  color: var(--ad-bad);
  font-weight: 600;
}
.andesine-form-hint {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ad-muted);
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Buscador de accesorios para producto */
.andesine-search-accessories-wrap {
  position: relative;
  width: 100%;
}
.andesine-search-accessories-wrap .andesine-input {
  width: 100%;
}
.andesine-search-accessories-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  margin-top: 0.25rem;
  background: #fff;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
}
.andesine-search-accessories-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--ad-text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ad-border);
  cursor: pointer;
  transition: background 0.15s;
}
.andesine-search-accessories-item:last-child { border-bottom: none; }
.andesine-search-accessories-item:hover {
  background: var(--ad-surface);
}
.andesine-accessory-result-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
}
.andesine-accessory-result-badge-accesorio {
  background: #e8f4fd;
  color: #0a6ebd;
}
.andesine-accessory-result-badge-categoria {
  background: #eef5ea;
  color: #2d7a3e;
}

.andesine-accessories-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0;
}
.andesine-accessory-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  font-size: 0.85rem;
  background: var(--ad-surface);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
}
.andesine-accessory-chip-accesorio .andesine-accessory-chip-badge {
  background: #e8f4fd;
  color: #0a6ebd;
}
.andesine-accessory-chip-categoria .andesine-accessory-chip-badge {
  background: #eef5ea;
  color: #2d7a3e;
}
.andesine-accessory-chip-badge {
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
}
.andesine-accessory-chip-name {
  color: var(--ad-text-strong);
}
.andesine-accessory-chip-remove {
  padding: 0 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ad-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
}
.andesine-accessory-chip-remove:hover {
  color: var(--ad-bad);
  background: rgba(0,0,0,0.05);
}
.andesine-form-file-wrap {
  width: 100%;
}
.andesine-form-file-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: var(--ad-text);
  background: #fff;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  cursor: pointer;
}
.andesine-form-file-input::file-selector-button {
  padding: 0.4rem 0.75rem;
  margin-right: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ad-accent);
  background: var(--ad-surface);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  cursor: pointer;
}
.andesine-form-file-input::file-selector-button:hover {
  background: var(--ad-accent-light);
}
select.andesine-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2351686c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
.andesine-repeater-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.andesine-repeater-row .andesine-input {
  flex: 1;
  min-width: 120px;
}
.andesine-repeater-row .andesine-repeater-remove {
  flex-shrink: 0;
  padding: 0.5rem 0.65rem;
}
.andesine-galeria-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--ad-muted);
}

/* ----- Utilidades ----- */
.andesine-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--ad-border);
  background: rgba(19, 60, 67, 0.08);
  color: var(--ad-soft);
}
.andesine-badge.ok { background: rgba(47, 191, 113, 0.12); color: #0e6a3a; border-color: rgba(47, 191, 113, 0.25); }
.andesine-badge.warn { background: rgba(255, 183, 3, 0.12); color: #8a6200; border-color: rgba(255, 183, 3, 0.25); }
.andesine-badge.bad { background: rgba(239, 71, 111, 0.12); color: #7c1e32; border-color: rgba(239, 71, 111, 0.25); }

/* ----- Información del sistema ----- */
.andesine-info-block { margin-bottom: 1.5rem; }
.andesine-info-block-title { font-size: 1rem; font-weight: 700; color: var(--ad-text-strong); margin: 0 0 0.75rem; }
.andesine-info-list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
.andesine-info-list dt { font-weight: 600; font-size: 0.9rem; color: var(--ad-muted); grid-column: 1; }
.andesine-info-list dd { margin: 0; font-weight: 500; grid-column: 2; }
.andesine-btn-whatsapp { background: #25d366; color: #fff !important; display: inline-flex; align-items: center; gap: 0.5rem; }
.andesine-btn-whatsapp:hover { background: #20bd5a; color: #fff; }

/* ----- Secciones (productos, clientes, etc.): título + descripción + acciones ----- */
.andesine-section-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.andesine-section-header h1 { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--ad-text-strong); }
.andesine-section-desc { margin: 0.25rem 0 0; font-size: 0.95rem; font-weight: 500; color: var(--ad-muted); }
.andesine-section-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.andesine-btn-export { background: #fff; border: 1px solid var(--ad-border); color: var(--ad-text); }
.andesine-btn-export:hover { background: var(--ad-surface); }
.andesine-btn-add { background: var(--ad-accent); color: #fff; display: inline-flex; align-items: center; gap: 0.5rem; }
.andesine-btn-add:hover { background: var(--ad-accent-2); color: #fff; }

/* ----- Dashboard: 4 tarjetas (ventas, cotizaciones, productos, clientes) ----- */
.andesine-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.andesine-dash-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.35rem;
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.andesine-dash-card:hover {
  box-shadow: var(--ad-shadow);
  border-color: var(--ad-accent);
}
.andesine-dashboard-simple {
  padding: 0.5rem 0;
}
.andesine-dashboard-simple p {
  margin: 0;
  font-weight: 500;
  color: var(--ad-muted);
}

/* Dashboard admin: ventas recientes (tarjeta blanca) */
.andesine-dash-ventas-recientes-card {
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow-sm);
  padding: 1.25rem;
  margin-top: 1.5rem;
  overflow: hidden;
}
.andesine-dash-section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ad-text-strong);
}
.andesine-dash-ventas-recientes-card .andesine-table { font-size: 0.9rem; }
.andesine-dash-ventas-recientes-card .andesine-table th,
.andesine-dash-ventas-recientes-card .andesine-table td { padding: 0.5rem 0.75rem; }
.andesine-dash-table-empty {
  margin: 0;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--ad-muted);
}

/* Gráficos: una fila, período izq, agente der */
.andesine-dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .andesine-dash-charts-row {
    grid-template-columns: 1fr;
  }
}
.andesine-dash-chart-card {
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow-sm);
  padding: 1.25rem;
}
.andesine-dash-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.andesine-dash-chart-header .andesine-dash-section-title { margin: 0; }
.andesine-dash-select {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  min-width: 100px;
}
.andesine-dash-chart-subtitle {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ad-muted);
}
.andesine-dash-chart-volver {
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  color: var(--ad-soft);
  background: transparent;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.andesine-dash-chart-volver:hover {
  background: var(--ad-accent-light);
  color: var(--ad-accent);
}
.andesine-dash-chart-canvas-wrap {
  position: relative;
  height: 240px;
}
.andesine-dash-cotizaciones-card .andesine-table { font-size: 0.9rem; }
.andesine-dash-cotizaciones-card .andesine-table th,
.andesine-dash-cotizaciones-card .andesine-table td { padding: 0.5rem 0.75rem; }
.andesine-table-cell-total { white-space: nowrap; }
.andesine-dash-ver-todas {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ad-soft);
  text-decoration: none;
}
.andesine-dash-ver-todas:hover { color: var(--ad-accent); text-decoration: underline; }

/* Dashboard cliente: tablas compras e informes recientes (una debajo de la otra) */
.andesine-dash-cliente-tablas {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Dashboard cliente: saludo + layout 2 columnas (izq: tarjetas/mensaje, der: perfil) */
.andesine-dashboard-cliente {
  padding-bottom: 0.5rem;
}
.andesine-dashboard-cliente-saludo {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-dashboard-cliente-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .andesine-dashboard-cliente-layout {
    grid-template-columns: 1fr;
  }
}
.andesine-dashboard-cliente-left {
  min-width: 0;
}
.andesine-dashboard-cliente-left .andesine-dashboard-cards {
  margin-bottom: 1rem;
}
.andesine-dashboard-cliente-al-dia {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-ok);
}
.andesine-dashboard-cliente-right {
  position: sticky;
  top: 1rem;
}
/* Tarjeta de perfil (cliente) */
.andesine-perfil-card {
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow-sm);
  padding: 1.5rem;
  text-align: center;
}
.andesine-perfil-foto {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  overflow: hidden;
  background: var(--ad-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.andesine-perfil-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.andesine-perfil-iniciales {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ad-accent);
  letter-spacing: 0.02em;
}
.andesine-perfil-nombre {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-perfil-datos {
  margin: 0;
  text-align: left;
  font-size: 0.9rem;
}
.andesine-perfil-datos dt {
  margin-top: 0.65rem;
  margin-bottom: 0.2rem;
  font-weight: 600;
  color: var(--ad-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.andesine-perfil-datos dt:first-of-type { margin-top: 0; }
.andesine-perfil-datos dd {
  margin: 0;
  font-weight: 500;
  color: var(--ad-text);
}
.andesine-dash-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.andesine-dash-card-icon svg { width: 24px; height: 24px; }
.andesine-dash-icon-cart { background: rgba(19, 60, 67, 0.1); color: var(--ad-accent); }
.andesine-dash-icon-file { background: rgba(19, 60, 67, 0.1); color: var(--ad-accent); }
.andesine-dash-icon-box { background: rgba(19, 60, 67, 0.1); color: var(--ad-accent); }
.andesine-dash-icon-users { background: rgba(19, 60, 67, 0.1); color: var(--ad-accent); }
.andesine-dash-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ad-text-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.andesine-dash-card-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ad-muted);
  line-height: 1.3;
}

/* ----- Configuración: sub-sidebar + contenido ----- */
.andesine-config-layout {
  display: flex;
  gap: 2rem;
  min-height: 0;
  align-items: flex-start;
}
.andesine-config-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  padding: 1rem 0;
  box-shadow: var(--ad-shadow-sm);
}
.andesine-config-sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.5rem; }
.andesine-config-sidebar a {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: var(--ad-radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ad-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.andesine-config-sidebar a:hover { background: var(--ad-accent-light); color: var(--ad-soft); }
.andesine-config-sidebar a.active { background: var(--ad-accent-light); color: var(--ad-accent); font-weight: 600; }
.andesine-config-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--ad-border);
}
.andesine-config-tab {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.andesine-config-tab:hover { color: var(--ad-text); }
.andesine-config-tab.active {
  color: var(--ad-accent);
  border-bottom-color: var(--ad-accent);
}
.andesine-config-tab-panel {
  display: none;
}
.andesine-config-tab-panel.active {
  display: block;
}
.andesine-config-menu-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ad-muted);
  padding: 0 1rem 0.6rem;
  margin-bottom: 0.25rem;
}
.andesine-config-body { flex: 1; min-width: 0; }
.andesine-config-page-title {
  margin: 0 0 1.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ad-text-strong);
  letter-spacing: -0.02em;
}
.andesine-config-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ad-border);
}
.andesine-config-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.andesine-config-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-config-section-desc {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ad-muted);
  line-height: 1.5;
}
.andesine-config-logo-block {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.andesine-config-logo-preview {
  width: 200px;
  flex-shrink: 0;
  padding: 1.25rem;
  background: var(--ad-surface);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius);
  text-align: center;
}
.andesine-config-logo-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.andesine-config-form {
  flex: 1;
  min-width: 280px;
  max-width: 360px;
}
.andesine-config-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-text-strong);
}
.andesine-config-file-wrap {
  margin-bottom: 1rem;
}
.andesine-config-file-wrap input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ad-text);
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  cursor: pointer;
}
.andesine-config-file-wrap input[type="file"]::file-selector-button {
  padding: 0.4rem 0.75rem;
  margin-right: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ad-accent);
  background: var(--ad-accent-light);
  border: none;
  border-radius: var(--ad-radius-sm);
  cursor: pointer;
}
.andesine-config-hint {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ad-muted);
  margin-top: 0.35rem;
}
/* Mi perfil: formulario más ancho y bloques */
.andesine-config-form-perfil {
  max-width: 520px;
}
.andesine-config-perfil-foto-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.andesine-config-perfil-foto-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ad-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.andesine-config-perfil-foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.andesine-config-perfil-iniciales {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ad-accent);
  letter-spacing: 0.02em;
}
.andesine-config-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .andesine-config-form-row { grid-template-columns: 1fr; }
}
.andesine-config-form-group {
  margin-bottom: 1.25rem;
}
.andesine-config-form-group .andesine-input,
.andesine-config-form-group .andesine-config-file-input {
  width: 100%;
}
.andesine-config-readonly {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ad-text);
  padding: 0.5rem 0;
}
.andesine-config-divider {
  border: none;
  border-top: 1px solid var(--ad-border);
  margin: 1.5rem 0;
}
.andesine-config-subsection-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ad-text-strong);
}
.andesine-config-form-actions {
  margin-top: 1.5rem;
}
.andesine-config-file-input {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ad-text);
  background: var(--ad-card-bg);
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  cursor: pointer;
  display: block;
}
.andesine-alert-ok { background: rgba(47, 191, 113, 0.12); color: #0e6a3a; border: 1px solid rgba(47, 191, 113, 0.25); }

/* ----- Galería de imágenes (productos/accesorios) ----- */
.andesine-galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.andesine-galeria-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--ad-radius);
  overflow: hidden;
  border: 2px solid var(--ad-border);
  background: var(--ad-surface);
  transition: border-color 0.2s ease;
}
.andesine-galeria-item.is-principal {
  border-color: var(--ad-accent);
  box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.15);
}
.andesine-galeria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.andesine-galeria-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.andesine-galeria-item:hover .andesine-galeria-item-overlay {
  opacity: 1;
}
.andesine-galeria-item.is-principal .andesine-galeria-item-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(47, 191, 113, 0.9), transparent);
}
.andesine-galeria-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255,255,255,0.95);
  color: var(--ad-accent);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.andesine-galeria-badge::before {
  content: '★';
  font-size: 1rem;
}

/* ----- Toast (mensaje arriba, desaparece) ----- */
.andesine-toast-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  padding: 1rem;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.andesine-toast {
  padding: 0.85rem 1.5rem;
  border-radius: var(--ad-radius);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--ad-shadow);
  white-space: normal;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.andesine-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.andesine-toast-ok {
  background: #fff;
  color: #0e6a3a;
  border: 1px solid rgba(47, 191, 113, 0.35);
  box-shadow: 0 4px 20px rgba(47, 191, 113, 0.2);
}
.andesine-toast-error {
  background: #fff;
  color: #7c1e32;
  border: 1px solid rgba(239, 71, 111, 0.35);
  box-shadow: 0 4px 20px rgba(239, 71, 111, 0.15);
}

/* ----- Panel responsive: menú hamburguesa (tablet/móvil; escritorio sin cambios) ----- */
.andesine-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 38, 43, 0.45);
  z-index: 998;
}
.andesine-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-right: 0.5rem;
  border: 1px solid var(--ad-border);
  border-radius: var(--ad-radius-sm);
  background: var(--ad-card-bg);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.andesine-nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--ad-soft);
  border-radius: 1px;
}
@media (max-width: 1024px) {
  .andesine-nav-toggle { display: inline-flex; }
  /* Backdrop por debajo del sidebar y del header: antes z-index 998 tapaba el menú */
  .andesine-sidebar-backdrop {
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 100;
  }
  .andesine-app.andesine-nav-open .andesine-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
  }
  .andesine-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 32px rgba(5, 38, 43, 0.12);
    z-index: 105;
  }
  .andesine-app.andesine-nav-open .andesine-sidebar {
    transform: translateX(0);
  }
  .andesine-main {
    margin-left: 0;
  }
  .andesine-header {
    left: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    z-index: 110;
  }
  .andesine-content {
    padding: 1rem 0.75rem 2rem;
  }
  .andesine-global-search-wrap {
    max-width: none;
    min-width: 0;
  }
  /* Tablas: scroll horizontal cómodo en táctil */
  .andesine-table-wrap {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .andesine-table {
    min-width: 520px;
  }
  .andesine-section-header {
    flex-direction: column;
    align-items: stretch;
  }
  .andesine-section-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .andesine-section-actions .andesine-btn-add,
  .andesine-section-actions .andesine-btn-export {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }
  .andesine-config-layout {
    flex-direction: column;
    gap: 1.25rem;
  }
  .andesine-config-sidebar {
    width: 100%;
    max-width: none;
  }
  .andesine-config-sidebar nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.35rem;
    padding: 0 0.5rem;
  }
  .andesine-config-sidebar nav a {
    text-align: center;
    font-size: 0.88rem;
    padding: 0.55rem 0.65rem;
  }
}
body.andesine-nav-open-body {
  overflow: hidden;
}
@media (max-width: 600px) {
  .andesine-search-wrap { min-width: 0; }
  .andesine-header .andesine-user-menu .andesine-user-email {
    display: none;
  }
  .andesine-card { padding: 1rem; }
  .andesine-form-row {
    flex-direction: column;
    gap: 0;
  }
  .andesine-form-row .andesine-form-group { width: 100%; }
  .andesine-table th,
  .andesine-table td {
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
  }
  .andesine-table {
    min-width: 440px;
  }
  .andesine-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .andesine-table-search {
    max-width: none;
    width: 100%;
  }
  .andesine-table-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .andesine-table-info {
    text-align: center;
  }
  .andesine-paginator {
    justify-content: center;
    width: 100%;
  }
  .andesine-paginator-list {
    justify-content: center;
  }
  /* Área táctil mínima en acciones de fila */
  .andesine-dropdown-toggle-icon {
    min-width: 44px;
    min-height: 44px;
    padding: 0.65rem;
    box-sizing: border-box;
  }
  .andesine-info-list {
    grid-template-columns: 1fr;
  }
  .andesine-info-list dt {
    grid-column: 1;
    margin-top: 0.5rem;
  }
  .andesine-info-list dt:first-child {
    margin-top: 0;
  }
  .andesine-info-list dd {
    grid-column: 1;
    margin: 0 0 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--ad-border);
  }
  .andesine-info-list dd:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .andesine-dashboard-cards {
    grid-template-columns: 1fr;
  }
  .andesine-dash-chart-canvas-wrap {
    height: 200px;
  }
}
