/* =====================================================================
   Vintage Watches Valencia · Panel de gestión (CRM/SO)
   Estilo: Apple / Linear · oscuro premium · colores de marca
   ===================================================================== */

:root {
  /* ----- TEMA OSCURO (por defecto) ----- */
  --bg:         #0b0b0c;        /* fondo base casi negro */
  --bg-sidebar: #101012;
  --surface:    #161618;        /* cards */
  --surface-2:  #1c1c1f;        /* cards elevadas / hover */
  --surface-3:  #232327;
  --line:       #26262a;
  --line-soft:  #1d1d20;

  --text:       #f4f4f5;
  --text-2:     #a1a1aa;        /* secundario */
  --text-3:     #6b6b73;        /* terciario */

  --accent:     #D9101C;        /* rojo logo (igual en ambos temas) */
  --accent-2:   #ee1f2b;
  --accent-dim: rgba(217,16,28,.12);

  --green:      #34c759;        /* disponible (Apple green) */
  --green-dim:  rgba(52,199,89,.14);
  --amber:      #ff9f0a;        /* reservado */
  --amber-dim:  rgba(255,159,10,.14);
  --gray:       #8e8e93;        /* vendido */
  --gray-dim:   rgba(142,142,147,.14);
  --blue:       #0a84ff;

  --on-accent:  #ffffff;        /* texto sobre rojo */
  --switch-off: #3a3a40;        /* fondo switch apagado */
  --scroll-thumb: #2a2a2e;
  --shadow-card:  0 1px 0 rgba(255,255,255,.02);
  --shadow-pop:   0 16px 40px rgba(0,0,0,.5);
  --shadow-modal: 0 30px 90px rgba(0,0,0,.6);
  --metric-glow:  radial-gradient(120% 120% at 100% 0%, rgba(217,16,28,.06) 0%, transparent 55%);

  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;

  --radius:   14px;
  --radius-s: 10px;
  --sidebar-w: 252px;
}

/* ----- TEMA CLARO ----- */
body.theme-light {
  --bg:         #f5f5f7;        /* gris Apple muy claro */
  --bg-sidebar: #ffffff;
  --surface:    #ffffff;
  --surface-2:  #f5f5f7;
  --surface-3:  #ececef;
  --line:       #e3e3e8;
  --line-soft:  #ededf1;

  --text:       #1d1d1f;        /* casi negro Apple */
  --text-2:     #6e6e73;
  --text-3:     #a1a1a6;

  --accent-dim: rgba(217,16,28,.09);
  --green-dim:  rgba(52,199,89,.13);
  --amber-dim:  rgba(255,159,10,.15);
  --gray-dim:   rgba(142,142,147,.16);

  --switch-off: #d8d8dd;
  --scroll-thumb: #cfcfd5;
  --shadow-card:  0 1px 2px rgba(0,0,0,.04);
  --shadow-pop:   0 16px 40px rgba(0,0,0,.12);
  --shadow-modal: 0 30px 80px rgba(0,0,0,.18);
  --metric-glow:  radial-gradient(120% 120% at 100% 0%, rgba(217,16,28,.05) 0%, transparent 55%);
}

/* Transición suave al cambiar de tema */
body, .sidebar, .topbar, .card, .metric, .surface, .stock-table, .stock-row,
.modal, .chip, .field input, .field select, .field textarea, .toggle-row,
.nav-link, .lead-card, .btn, .status-badge, .sidebar__user, .demo-banner {
  transition: background-color .35s ease, border-color .35s ease, color .25s ease, box-shadow .35s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

::selection { background: var(--accent); color: #fff; }

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 3px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 6px;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 10px 22px;
}
.sidebar__logo {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar__brand-text { line-height: 1.2; }
.sidebar__brand-name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.sidebar__brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .02em; }

.sidebar__section {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 16px 12px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--text); }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -16px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.nav-link .badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 19px; height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.nav-link .badge.muted { background: var(--surface-3); color: var(--text-2); }

.sidebar__spacer { flex: 1; }

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-soft);
  margin-top: 8px;
}
.sidebar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7a0c12);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar__user-info { line-height: 1.25; min-width: 0; }
.sidebar__user-name { font-size: 13px; font-weight: 600; }
.sidebar__user-role { font-size: 11px; color: var(--text-3); }

/* ---------- MAIN ---------- */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  flex-shrink: 0;
}
.topbar__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.topbar__search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 8px 13px;
  width: 280px;
  transition: border-color .2s;
}
.topbar__search:focus-within { border-color: var(--accent); }

/* Toggle de tema (sol / luna) */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  position: relative;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--line); }
.theme-toggle svg {
  position: absolute;
  width: 18px; height: 18px;
  stroke: var(--text-2);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.4,1.2);
}
/* Oscuro → muestra sol (para ir a claro) */
.ic-sun  { opacity: 1; transform: rotate(0) scale(1); }
.ic-moon { opacity: 0; transform: rotate(-90deg) scale(.4); }
/* Claro → muestra luna */
body.theme-light .ic-sun  { opacity: 0; transform: rotate(90deg) scale(.4); }
body.theme-light .ic-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle:hover svg { stroke: var(--accent); }
.topbar__search svg { width: 15px; height: 15px; stroke: var(--text-3); fill: none; stroke-width: 2; }
.topbar__search input {
  background: none; border: 0; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
}
.topbar__search input::placeholder { color: var(--text-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -.01em;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn--sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn--danger-ghost { background: transparent; border: 1px solid transparent; color: var(--text-3); }
.btn--danger-ghost:hover { color: var(--accent); background: var(--accent-dim); }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* Vista oculta/visible */
.view { display: none; animation: viewin .35s cubic-bezier(.2,.8,.2,1); }
.view.active { display: block; }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.greeting { margin-bottom: 28px; }
.greeting h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.greeting p { color: var(--text-3); font-size: 14px; margin-top: 3px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.metric {
  background: var(--surface);
  background-image: var(--metric-glow);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.metric:hover { border-color: var(--line); transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.metric__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.metric__icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.metric__icon svg { width: 19px; height: 19px; stroke-width: 2; fill: none; }
.metric__icon.red   { background: var(--accent-dim); } .metric__icon.red svg   { stroke: var(--accent); }
.metric__icon.green { background: var(--green-dim);  } .metric__icon.green svg { stroke: var(--green); }
.metric__icon.amber { background: var(--amber-dim);  } .metric__icon.amber svg { stroke: var(--amber); }
.metric__icon.blue  { background: rgba(10,132,255,.14); } .metric__icon.blue svg { stroke: var(--blue); }
.metric__delta { font-size: 12px; font-weight: 600; color: var(--green); }
.metric__delta.down { color: var(--accent); }
.metric__value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.metric__value .unit { font-size: 18px; color: var(--text-3); font-weight: 700; }
.metric__label { color: var(--text-2); font-size: 13px; margin-top: 7px; }

.panel-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.card__title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card__link { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.card__body { padding: 8px; }

/* Lista de actividad / entradas recientes */
.activity-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 12px;
  border-radius: var(--radius-s);
  transition: background .15s;
}
.activity-item:hover { background: var(--surface-2); }
.activity-thumb {
  width: 42px; height: 42px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}
.activity-main { flex: 1; min-width: 0; }
.activity-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.activity-price { font-size: 13.5px; font-weight: 700; }
.activity-time { font-size: 11px; color: var(--text-3); margin-top: 2px; text-align: right; }

/* Quick actions */
.quick-actions { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.quick-action {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  transition: background .15s, transform .15s;
  text-align: left;
  width: 100%;
}
.quick-action:hover { background: var(--surface-3); transform: translateX(3px); }
.quick-action__icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent-dim);
  display: grid; place-items: center;
}
.quick-action__icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2; }
.quick-action__text { flex: 1; }
.quick-action__title { font-size: 13.5px; font-weight: 600; }
.quick-action__sub { font-size: 12px; color: var(--text-3); }
.quick-action__arrow { color: var(--text-3); }

/* =====================================================================
   INVENTARIO · control de stock
   ===================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar__filters { display: flex; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.toolbar__right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.toolbar__count { font-size: 13px; color: var(--text-3); }
.toolbar__count b { color: var(--text); }

/* Tabla de stock */
.stock-table {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.stock-row {
  display: grid;
  grid-template-columns: 56px 1.8fr 1fr .8fr 1fr 130px 84px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.stock-row:last-child { border-bottom: 0; }
.stock-row:hover { background: var(--surface-2); }
.stock-row--head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-sidebar);
}
.stock-row--head:hover { background: var(--bg-sidebar); }
.stock-thumb {
  width: 44px; height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-3);
}
.stock-model { min-width: 0; }
.stock-model .brand { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.stock-model .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-ref { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.stock-year { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.stock-price { font-size: 14px; font-weight: 700; }
.stock-price.request { color: var(--text-3); font-weight: 500; font-style: italic; font-size: 12.5px; }

/* Badge de estado (también funciona como dropdown trigger) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
  user-select: none;
}
.status-badge:hover { filter: brightness(1.2); }
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-badge.disponible { background: var(--green-dim); color: var(--green); }
.status-badge.disponible .dot { background: var(--green); }
.status-badge.reservado { background: var(--amber-dim); color: var(--amber); }
.status-badge.reservado .dot { background: var(--amber); }
.status-badge.vendido { background: var(--gray-dim); color: var(--gray); }
.status-badge.vendido .dot { background: var(--gray); }

.stock-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--accent-dim); color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-3);
}
.empty-state svg { width: 46px; height: 46px; stroke: var(--text-3); fill: none; stroke-width: 1.5; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* =====================================================================
   MODAL · alta / edición de reloj
   ===================================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-modal);
  transform: scale(.96) translateY(12px);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line-soft);
}
.modal__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.modal__sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.modal__close {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all .15s;
}
.modal__close:hover { background: var(--surface-3); color: var(--text); }
.modal__close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.modal__body { padding: 24px 26px; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 26px;
  border-top: 1px solid var(--line-soft);
}

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.field input, .field select, .field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 11px 13px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field textarea { resize: vertical; min-height: 76px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.field-section {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
}

/* Dropzone de fotos */
.dropzone {
  grid-column: 1 / -1;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-s);
  padding: 26px;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-dim); }
.dropzone svg { width: 30px; height: 30px; stroke: var(--text-3); fill: none; stroke-width: 1.6; margin-bottom: 10px; }
.dropzone p { font-size: 13px; color: var(--text-2); }
.dropzone p b { color: var(--accent); }
.dropzone .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.photo-previews { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 10px; }
.photo-preview {
  width: 70px; height: 70px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
  position: relative;
}

/* Switch toggle estilo Apple */
.toggle-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.toggle-row__text { line-height: 1.35; }
.toggle-row__title { font-size: 13.5px; font-weight: 600; }
.toggle-row__sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.switch {
  position: relative;
  width: 46px; height: 27px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 27px;
  transition: background .25s ease;
  cursor: pointer;
}
.switch__slider::before {
  content: '';
  position: absolute;
  width: 21px; height: 21px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s cubic-bezier(.2,.8,.4,1.4);
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
.switch input:checked + .switch__slider { background: var(--green); }
.switch input:checked + .switch__slider::before { transform: translateX(19px); }

/* Indicador "publicado" en tabla de stock */
.pub-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.pub-dot .d { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); }
.pub-dot.on { color: var(--green); }
.pub-dot.on .d { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }

/* Toggle estado pill en form */
.status-picker { display: flex; gap: 8px; }
.status-opt {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: all .15s;
}
.status-opt:hover { border-color: var(--line); color: var(--text); }
.status-opt.sel-disponible { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.status-opt.sel-reservado { background: var(--amber-dim); border-color: var(--amber); color: var(--amber); }
.status-opt.sel-vendido { background: var(--gray-dim); border-color: var(--gray); color: var(--gray); }

/* =====================================================================
   TOAST
   ===================================================================== */
.toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-s);
  padding: 13px 18px;
  min-width: 280px;
  box-shadow: var(--shadow-pop);
  transform: translateX(120%);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.toast.show { transform: translateX(0); }
.toast.error { border-left-color: var(--accent); }
.toast__icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--green-dim);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.toast.error .toast__icon { background: var(--accent-dim); }
.toast__icon svg { width: 15px; height: 15px; stroke: var(--green); fill: none; stroke-width: 2.5; }
.toast.error .toast__icon svg { stroke: var(--accent); }
.toast__text { font-size: 13.5px; font-weight: 500; }

/* Dropdown contextual de estado */
.status-menu {
  position: fixed;
  z-index: 150;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px;
  box-shadow: var(--shadow-pop);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.status-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.status-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: background .12s;
}
.status-menu button:hover { background: var(--surface-3); color: var(--text); }
.status-menu button .dot { width: 8px; height: 8px; border-radius: 50%; }

/* =====================================================================
   PLACEHOLDER views (leads, ventas, ajustes)
   ===================================================================== */
.placeholder-view {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
}
.placeholder-view__inner { max-width: 420px; }
.placeholder-view svg { width: 52px; height: 52px; stroke: var(--text-3); fill: none; stroke-width: 1.4; margin-bottom: 18px; }
.placeholder-view h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.placeholder-view p { color: var(--text-3); font-size: 14px; line-height: 1.6; }

/* Leads list */
.leads-list { display: flex; flex-direction: column; gap: 12px; }
.lead-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color .2s;
}
.lead-card:hover { border-color: var(--line); }
.lead-card.nuevo { border-left: 3px solid var(--accent); }
.lead-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--text-2);
}
.lead-info .lead-name { font-size: 14.5px; font-weight: 600; }
.lead-info .lead-msg { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.lead-info .lead-meta { font-size: 11.5px; color: var(--text-3); margin-top: 5px; font-family: var(--mono); }
.lead-tag {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 12px;
  text-transform: uppercase; letter-spacing: .04em;
}
.lead-tag.consulta { background: rgba(10,132,255,.14); color: var(--blue); }
.lead-tag.venta { background: var(--amber-dim); color: var(--amber); }
.lead-tag.reserva { background: var(--green-dim); color: var(--green); }

/* Demo banner */
.demo-banner {
  background: var(--accent-dim);
  border: 1px solid rgba(217,16,28,.25);
  border-radius: var(--radius-s);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 22px;
}
.demo-banner svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2; flex-shrink: 0; }
.demo-banner b { color: var(--text); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .app { grid-template-columns: 1fr; }
  .stock-row { grid-template-columns: 44px 1.5fr 110px 70px; }
  .stock-row .stock-ref, .stock-row .stock-year-col { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar__search { width: 160px; }
}
