/* Rapimueble Sales — Identidad corporativa */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --rm-blue: #005696;
  --rm-blue-dark: #003d6b;
  --rm-blue-light: #e8f4fc;
  --rm-yellow: #ffeb00;
  --rm-yellow-dark: #e6d400;
  --rm-yellow-soft: #fffce8;
  --rm-red: #e30613;
  --rm-red-dark: #b8050f;

  --color-primary: var(--rm-blue);
  --color-primary-dark: var(--rm-blue-dark);
  --color-accent: var(--rm-blue);
  --color-highlight: var(--rm-yellow);
  --color-success: #1b8a4a;
  --color-warning: #e67e00;
  --color-error: var(--rm-red);
  --color-bg: #f4f7fa;
  --color-surface: #ffffff;
  --color-surface-2: #f0f4f8;
  --color-border: #dce4ec;
  --color-text: #1a2b3c;
  --color-muted: #5c6f82;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 86, 150, 0.08);
  --shadow: 0 4px 20px rgba(0, 61, 107, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 61, 107, 0.15);
  --topbar-h: 56px;
  --dock-w: 76px;
  --dock-bottom-h: 72px;
  --touch-min: 48px;
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --color-bg: #0f1923;
  --color-surface: #1a2836;
  --color-surface-2: #243447;
  --color-border: #334155;
  --color-text: #f0f4f8;
  --color-muted: #94a3b8;
  --rm-blue-light: #1e3a5f;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--rm-blue-dark); }

/* ——— Login ——— */
.layout-auth {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .layout-auth { grid-template-columns: 1fr; }
  .auth-hero { display: none !important; }
}

.auth-hero {
  position: relative;
  background: linear-gradient(155deg, var(--rm-blue-dark) 0%, var(--rm-blue) 42%, #0070b8 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
  overflow: hidden;
}
/* Decoración de marca (sin foto — evita recortes raros en panel vertical) */
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 15% 88%, rgba(255, 235, 0, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 70% 45% at 92% 12%, rgba(255, 255, 255, 0.1) 0%, transparent 52%),
    radial-gradient(circle at 50% 120%, rgba(0, 0, 0, 0.12) 0%, transparent 45%);
  pointer-events: none;
}
.auth-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--rm-yellow);
  z-index: 2;
}
.auth-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  max-width: 420px;
}
.auth-hero-content img {
  max-width: 260px;
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
.auth-hero-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  line-height: 1.2;
}
.auth-hero-content p {
  font-size: 1.05rem;
  opacity: 0.92;
  margin: 0;
}
.auth-hero-tagline {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.35rem 1rem;
  background: var(--rm-yellow);
  color: var(--rm-blue-dark);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 999px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--color-surface);
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card .auth-logo-img {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto 1.5rem;
}
.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--rm-blue);
  text-align: center;
  margin: 0 0 0.25rem;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: var(--color-muted);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}
.auth-form label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  min-height: var(--touch-min);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--color-surface);
  color: var(--color-text);
}
.auth-form input:focus {
  outline: none;
  border-color: var(--rm-blue);
  box-shadow: 0 0 0 3px rgba(0, 86, 150, 0.15);
}
.auth-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}

/* ——— Topbar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 1rem;
  min-height: var(--topbar-h);
  background: var(--color-surface);
  border-bottom: 3px solid var(--rm-yellow);
  box-shadow: var(--shadow-sm);
}
.topbar-start {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.topbar-brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}
.topbar-brand-link:hover { opacity: 0.9; text-decoration: none; }
.topbar-logo {
  height: 32px;
  width: auto;
  max-width: 120px;
  display: block;
  object-fit: contain;
}
.topbar-tienda {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rm-blue);
  background: var(--rm-blue-light);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
  line-height: 1.3;
  flex-shrink: 1;
  min-width: 0;
}
.topbar-sesion {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}
.topbar-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ——— App shell + dock lateral ——— */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
.app-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 61, 107, 0.45);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.app-backdrop:not([hidden]) { display: block; }

.app-dock {
  width: var(--dock-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.65rem 0.5rem;
  gap: 0.25rem;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  z-index: 95;
  overflow-y: auto;
  overflow-x: hidden;
}
.dock-section { display: flex; flex-direction: column; gap: 0.2rem; }
.dock-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.35rem 0.25rem;
}
.dock-spacer { flex: 1; min-height: 0.5rem; }
.dock-form { margin: 0; padding: 0; }

.dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  min-height: 58px;
  padding: 0.45rem 0.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background var(--transition), color var(--transition), transform 0.1s;
}
.dock-item:hover {
  background: var(--rm-blue-light);
  color: var(--rm-blue);
  text-decoration: none;
}
.dock-item--active {
  background: var(--rm-blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 86, 150, 0.35);
}
.dock-item--active .dock-svg { stroke: #fff; }
.dock-item--active path[fill="currentColor"] { fill: #fff; }
.dock-item--highlight:not(.dock-item--active) {
  background: var(--rm-yellow-soft);
  color: var(--rm-blue-dark);
}
.dock-item--cta {
  background: var(--rm-yellow);
  color: var(--rm-blue-dark);
  font-weight: 800;
}
.dock-item--cta:hover { background: var(--rm-yellow-dark); color: var(--rm-blue-dark); }
.dock-item--danger:hover { background: #fef2f2; color: var(--rm-red); }
.dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.dock-svg { display: block; }
.dock-label {
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dock-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rm-yellow);
  color: var(--rm-blue-dark);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.dock-item--active .dock-badge {
  background: #fff;
  color: var(--rm-blue);
}

.topbar-menu { display: none; }
.topbar-client-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.85rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.topbar-client-chip:hover {
  border-color: var(--rm-blue);
  background: var(--rm-blue-light);
  text-decoration: none;
  color: inherit;
}
.topbar-client-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-client-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
}
.wishlist-total-label { font-weight: 800; }
.topbar .topbar-sesion { display: none; }

.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  max-width: none;
  overflow-x: hidden;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  color: var(--rm-blue);
  line-height: 1.2;
}
.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Stat cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}
.stat-card--accent {
  background: linear-gradient(135deg, var(--rm-blue) 0%, var(--rm-blue-dark) 100%);
  border: none;
  color: #fff;
}
.stat-card--accent .stat-label { color: rgba(255,255,255,.85); }
.stat-card--accent .stat-value { color: #fff; }
.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin: 0 0 0.25rem;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--rm-blue);
  margin: 0;
  line-height: 1.2;
}

/* Client hero (atención) */
.client-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--rm-blue-light) 0%, var(--color-surface) 55%);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}
.client-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--rm-blue);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.client-hero-body { flex: 1; min-width: 200px; }
.client-hero-body h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  color: var(--rm-blue);
}
.client-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nota-card {
  padding: 0.85rem 1rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--rm-blue);
  margin-bottom: 0.65rem;
}
.nota-card-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.nota-card-body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text);
  word-break: break-word;
}

/* Formulario notas rápidas */
.form-nota-rapida textarea {
  width: 100%;
  min-height: 6.5rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  background: var(--color-surface);
  color: var(--color-text);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-nota-rapida textarea::placeholder {
  color: var(--color-muted);
  opacity: 0.85;
}
.form-nota-rapida textarea:focus {
  outline: none;
  border-color: var(--rm-blue);
  box-shadow: 0 0 0 3px rgba(0, 86, 150, 0.12);
}
.form-nota-rapida .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
}
.form-nota-rapida .form-check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--rm-blue);
  cursor: pointer;
}

/* Wishlist summary card */
.wl-summary-card {
  background: linear-gradient(180deg, var(--rm-yellow-soft) 0%, var(--color-surface) 100%);
  border: 2px solid var(--rm-yellow);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.wl-summary-card .stat-value { font-size: 1.75rem; }

/* Session cards grid on dashboard */
.sesion-card-grid {
  display: grid;
  gap: 0.75rem;
}
.sesion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.15rem 1.25rem;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.sesion-card:hover {
  border-color: var(--rm-blue);
  box-shadow: var(--shadow-sm);
}

/* Collapsible panel */
.panel-collapsible summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--rm-blue);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.panel-collapsible summary::-webkit-details-marker { display: none; }
.panel-collapsible summary::before {
  content: '▸';
  transition: transform var(--transition);
}
.panel-collapsible[open] summary::before { transform: rotate(90deg); }

/* Drawer actions as icon row */
.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.drawer-actions .btn { font-size: 0.8rem; padding: 0.55rem 0.65rem; }

@media (max-width: 1024px) {
  .topbar-menu { display: flex; }
  .topbar-tienda { max-width: 7rem; }
  .topbar-client-meta { display: none; }
  .app-dock {
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
  }
  .app-dock.dock-open { transform: translateX(0); }
  .main-content {
    padding-bottom: calc(var(--dock-bottom-h) + 1rem);
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0.35rem 0.65rem;
    gap: 0.4rem;
  }
  .topbar-logo { height: 26px; max-width: 96px; }
  .topbar-tienda { max-width: 5.5rem; font-size: 0.65rem; }
  .topbar-user { display: none; }
  .wishlist-total-label { display: none; }
  .app-body { flex-direction: column; }
  .app-dock {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: var(--dock-bottom-h);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.35rem 0.5rem;
    border-right: none;
    border-top: 3px solid var(--rm-yellow);
    transform: none;
    -webkit-overflow-scrolling: touch;
  }
  .app-dock.dock-open { transform: none; }
  .dock-section {
    flex-direction: row;
    gap: 0.15rem;
  }
  .dock-divider, .dock-spacer { display: none; }
  .dock-section--end { margin-left: auto; }
  .dock-item {
    min-width: 56px;
    min-height: 52px;
    flex-shrink: 0;
  }
  .dock-label { font-size: 0.55rem; }
  .app-backdrop { display: none !important; }
  .topbar-menu { display: none; }
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--touch-min);
  padding: 0.6rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--rm-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 86, 150, 0.35);
}
.btn-primary:hover {
  background: var(--rm-blue-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 86, 150, 0.4);
}
.btn-accent {
  background: var(--rm-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 86, 150, 0.35);
}
.btn-accent:hover { background: var(--rm-blue-dark); color: #fff; }
.btn-highlight {
  background: var(--rm-yellow);
  color: var(--rm-blue-dark);
  box-shadow: 0 2px 8px rgba(255, 235, 0, 0.5);
}
.btn-highlight:hover {
  background: var(--rm-yellow-dark);
  color: var(--rm-blue-dark);
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--rm-blue);
  color: var(--rm-blue);
  background: var(--rm-blue-light);
}
.btn-success { background: var(--color-success); color: #fff; }
.btn-danger { background: var(--rm-red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0.4rem 1rem; font-size: 0.875rem; }
.btn-lg {
  min-height: 56px;
  font-size: 1.1rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
}
.btn-icon {
  background: var(--color-surface-2);
  border: none;
  color: var(--color-text);
  font-size: 1.2rem;
  cursor: pointer;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--rm-blue-light); }
.btn-wishlist {
  background: var(--rm-blue);
  color: #fff;
  border-radius: var(--radius-sm);
  gap: 0.5rem;
}
.btn-wishlist:hover { background: var(--rm-blue-dark); color: #fff; }
.wishlist-count {
  background: var(--rm-yellow);
  color: var(--rm-blue-dark);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
}
.topbar .btn-outline {
  background: transparent;
  border: 2px solid var(--color-border);
  color: var(--color-text);
}
.topbar .btn-outline:hover {
  border-color: var(--rm-blue);
  color: var(--rm-blue);
}

/* ——— Badges ——— */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-activa { background: #d4edda; color: #155724; }
.badge-pausada { background: #fff3cd; color: #856404; }
.badge-oferta { background: var(--rm-red); color: #fff; }
.badge-novedad { background: var(--rm-blue); color: #fff; }
.badge-exposicion { background: var(--rm-yellow); color: var(--rm-blue-dark); }

/* ——— Alerts ——— */
.alert {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 600;
  border-left: 4px solid;
}
.alert-error { background: #fef2f2; color: var(--rm-red); border-color: var(--rm-red); }
.alert-success { background: #ecfdf5; color: var(--color-success); border-color: var(--color-success); }
.alert-info { background: var(--rm-blue-light); color: var(--rm-blue); border-color: var(--rm-blue); }

/* ——— Cards ——— */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card h2, .card h3 {
  margin-top: 0;
  color: var(--rm-blue);
  font-weight: 800;
}
.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--rm-yellow-soft);
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }

/* ——— Dashboard ——— */
.dashboard-hero {
  position: relative;
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--rm-blue) 0%, var(--rm-blue-dark) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  color: #fff;
  overflow: hidden;
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: var(--rm-yellow);
  opacity: 0.12;
  transform: rotate(-12deg);
  border-radius: 50%;
}
.dashboard-hero h1 {
  position: relative;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
}
.dashboard-hero p {
  position: relative;
  opacity: 0.9;
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
}
.dashboard-hero .btn-lg { position: relative; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.35rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}
.quick-action-card:hover {
  border-color: var(--rm-blue);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.quick-action-card .qa-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--rm-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.quick-action-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--rm-blue);
}
.quick-action-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.sesion-list { list-style: none; padding: 0; margin: 0; }
.sesion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
  flex-wrap: wrap;
  transition: background var(--transition);
}
.sesion-item:last-child { border-bottom: none; }
.sesion-item:hover { background: var(--rm-blue-light); }

/* ——— Forms ——— */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  min-height: var(--touch-min);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--rm-blue);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ——— Catálogo ——— */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .catalog-layout { grid-template-columns: 1fr; } }

.filters-panel {
  background: var(--color-surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
}
.filters-panel h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--rm-blue);
  font-weight: 800;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--rm-blue);
  text-decoration: none;
  color: inherit;
}
.product-card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--color-surface-2);
}
.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.product-card:hover img { transform: scale(1.05); }
.product-card-badges {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.product-card-body { padding: 1rem; }
.product-card-body strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}
.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--rm-blue);
}
.product-price-old {
  text-decoration: line-through;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: 0.35rem;
}
.product-ref {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

/* Detalle producto */
.product-detail-gallery {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface-2);
  box-shadow: var(--shadow);
}
.product-detail-gallery img {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* ——— Drawer wishlist ——— */
.drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: min(440px, 100vw);
  height: 100vh;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { right: 0; z-index: 250; }
.drawer-header {
  padding: 1.25rem;
  border-bottom: 3px solid var(--rm-yellow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--rm-blue);
  color: #fff;
}
.drawer-header h3 { margin: 0; color: #fff; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem; }
.drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.wishlist-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}
.wishlist-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.wishlist-totals strong { color: var(--rm-blue); font-size: 1.5rem; font-weight: 800; }

/* ——— Modal / Toast ——— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 61, 107, 0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--rm-yellow);
}
.modal h3 { margin-top: 0; color: var(--rm-blue); }

.toast-container { position: fixed; top: calc(var(--topbar-h) + 12px); right: 12px; z-index: 400; }
.toast {
  background: var(--color-text);
  color: #fff;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.toast.success { background: var(--color-success); }
.toast.error { background: var(--rm-red); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ——— Stepper, config, calendar ——— */
.stepper { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stepper-step {
  flex: 1;
  min-width: 72px;
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-bottom: 3px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.stepper-step.active {
  border-color: var(--rm-blue);
  color: var(--rm-blue);
  background: var(--rm-blue-light);
}
.stepper-step.done { border-color: var(--color-success); color: var(--color-success); }

.config-option {
  display: inline-block;
  margin: 0.35rem;
  padding: 0.75rem 1.15rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: var(--touch-min);
  font-weight: 600;
  transition: all var(--transition);
}
.config-option:hover { border-color: var(--rm-blue); }
.config-option.selected {
  border-color: var(--rm-blue);
  background: var(--rm-blue-light);
  color: var(--rm-blue-dark);
}
.config-price-preview {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--rm-blue-dark);
  padding: 1.25rem;
  background: var(--rm-blue-light);
  border-radius: var(--radius);
  text-align: center;
  border: 2px solid var(--rm-blue);
}
.config-price-preview strong { color: var(--rm-blue); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-size: 0.75rem; }
.calendar-day {
  min-height: 64px;
  border: 1px solid var(--color-border);
  padding: 4px;
  border-radius: 4px;
  background: var(--color-surface);
}
.calendar-event {
  background: var(--rm-blue);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 3px;
  margin-top: 2px;
  font-weight: 700;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.admin-nav a {
  padding: 0.55rem 1.1rem;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: var(--color-muted);
  text-decoration: none;
}
.admin-nav a:hover { color: var(--rm-blue); background: var(--rm-blue-light); }
.admin-nav a.active { background: var(--rm-blue); color: #fff; }

.presentation-mode { background: #fff; }
.presentation-mode .app-shell,
.presentation-mode .topbar,
.presentation-mode .drawer,
.presentation-mode .app-dock { display: none !important; }
.presentation-slide {
  text-align: center;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.presentation-slide .presentation-logo {
  max-width: 200px;
  margin-bottom: 2rem;
}
.presentation-slide img.product-show {
  max-width: 100%;
  max-height: 45vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.presentation-price {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--rm-blue);
}

.comparator-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.comparator-table th,
.comparator-table td {
  border: 1px solid var(--color-border);
  padding: 0.65rem;
  text-align: center;
}
.comparator-table th {
  background: var(--rm-blue);
  color: #fff;
  font-weight: 700;
}

.text-muted { color: var(--color-muted); }
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* Range slider accent */
input[type="range"] { accent-color: var(--rm-blue); }

/* Confirmación pedido post-POS */
.pedido-confirmacion {
  max-width: 520px;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem 1.5rem;
}
.pedido-confirmacion-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  font-size: 2.25rem;
  line-height: 72px;
  font-weight: 800;
}
.pedido-confirmacion h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--rm-blue);
}
.pedido-confirmacion-numero {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}
.pedido-confirmacion-dl {
  text-align: left;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.95rem;
}
.pedido-confirmacion-dl dt {
  color: var(--color-muted);
  font-weight: 600;
}
.pedido-confirmacion-dl dd {
  margin: 0;
  font-weight: 600;
}
.pedido-confirmacion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}
