/* =========================================================
   Casa Nova · Estilos
   ========================================================= */
:root {
  --bg: #f7f4ef;
  --card: #ffffff;
  --ink: #1f2421;
  --ink-2: #5d6661;
  --line: #e7e2da;
  --accent: #2f5d50;
  --accent-2: #c0622f;
  --accent-soft: #e6efeb;
  --ok: #1f9d6b;
  --warn: #d48a1a;
  --info: #2f6fd4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 30, 20, .05), 0 8px 24px rgba(30, 30, 20, .06);
  --shadow-lg: 0 24px 60px rgba(20, 20, 10, .18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-2); font-weight: 400; }
.small { font-size: 13px; margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1, h2 { font-family: 'Fraunces', Georgia, serif; letter-spacing: -.01em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px; transition: .2s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #244a40; transform: translateY(-1px); }
.btn-primary:disabled { background: #a9b8b2; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-google { background: #fff; border: 1px solid #dadce0; color: #3c4043; font-weight: 500; font-size: 14px; padding: 9px 16px; }
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; transition: .2s; }
.icon-btn:hover { background: #f0ece6; }
.icon-btn.danger:hover { background: #fde8e4; }
.link { color: var(--ink-2); text-decoration: underline; font-size: 13px; margin-left: 8px; }

/* ---------- Barra demo + topbar ---------- */
.demo-bar { background: var(--ink); color: #f1ede6; text-align: center; font-size: 13px; padding: 7px; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(247, 244, 239, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; color: var(--ink); }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: 'Inter'; font-size: 14px; font-weight: 800; }
.search { flex: 1; max-width: 480px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; }
.search input { border: 0; outline: 0; background: transparent; padding: 11px 0; width: 100%; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.cart-btn { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; transition: .2s; }
.cart-btn b { background: var(--accent-2); border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; padding: 0 6px; }
.cart-btn.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.12); } }

.avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.lg { width: 42px; height: 42px; font-size: 15px; }
.user-chip { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 500; font-size: 14px; user-select: none; }
.user-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 250px; padding: 8px; z-index: 50; }
.user-chip.open .user-menu { display: block; }
.um-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.um-head small, .du-info small { display: block; color: var(--ink-2); }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 14px; }
.user-menu a:hover, .user-menu button:hover { background: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; background: radial-gradient(circle at 85% 20%, #e9d8c5 0, transparent 45%), radial-gradient(circle at 10% 90%, #d7e6df 0, transparent 40%); }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; background: #fff; border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--accent-2); margin-bottom: 18px; }
.hero h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.05; margin-bottom: 18px; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p { font-size: 18px; color: var(--ink-2); max-width: 520px; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-cta.center { justify-content: center; }
.hero-badges { display: grid; gap: 14px; }
.badge-card { display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.8); border: 1px solid var(--line); padding: 18px 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.badge-card span { font-size: 28px; }
.badge-card small { display: block; color: var(--ink-2); }

/* ---------- Catálogo ---------- */
.catalog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 32px 0 20px; flex-wrap: wrap; }
.catalog-head h2 { font-size: 32px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 500; font-size: 14px; transition: .2s; }
.chip small { color: var(--ink-2); margin-left: 2px; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.active small { color: #bbb; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; padding-bottom: 64px; }
.card { position: relative; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: .25s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card:hover .thumb span { transform: scale(1.1) rotate(-3deg); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 17px; margin: 2px 0 8px; }
.cat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent-2); }
.meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.meta span { font-size: 12px; background: var(--bg); padding: 4px 9px; border-radius: 999px; color: var(--ink-2); font-weight: 500; }
.meta .inst { background: #fff3e6; color: #a5531f; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.card-foot small { display: block; font-size: 12px; color: var(--ink-2); }
.price { font-size: 20px; font-weight: 800; }
.tag-new { position: absolute; top: 12px; left: 12px; background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.tag-new.inline { position: static; margin-left: 6px; font-size: 10px; padding: 2px 8px; }

/* Imagen producto */
.thumb { position: relative; aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.thumb span { font-size: 72px; transition: .35s; filter: drop-shadow(0 8px 12px rgba(0,0,0,.12)); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform .35s ease; }
.thumb img + span { display: none; }
.card:hover .thumb img { transform: scale(1.05); }
.cat-muebles { background: linear-gradient(135deg, #f5e6d6, #e6c9ad); }
.cat-cocinas { background: linear-gradient(135deg, #e2ede8, #bcd6ca); }
.cat-banos   { background: linear-gradient(135deg, #e1ecf5, #bcd3e8); }
.thumb-lg { aspect-ratio: 1; border-radius: var(--radius); }
.thumb-lg span { font-size: 140px; }
.thumb-sm { width: 56px; height: 56px; aspect-ratio: auto; border-radius: 12px; }
.thumb-sm span { font-size: 28px; }
.thumb-xs { width: 40px; height: 40px; aspect-ratio: auto; border-radius: 10px; }
.thumb-xs span { font-size: 20px; filter: none; }
.empty { text-align: center; color: var(--ink-2); padding: 48px 16px; grid-column: 1 / -1; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-2); font-size: 14px; }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; background: rgba(20, 22, 20, .5); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; z-index: 60; padding: 40px 16px; overflow-y: auto; }
.modal.open { display: flex; animation: fade .2s; }
.modal-card { position: relative; background: #fff; border-radius: 22px; padding: 32px; width: 100%; box-shadow: var(--shadow-lg); animation: pop .25s; }
.modal-lg { max-width: 920px; }
.modal-xl { max-width: 1060px; }
.modal-x { position: absolute; top: 16px; right: 16px; z-index: 2; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }

.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.pd-info h2 { font-size: 32px; margin: 4px 0 6px; }
.stars { color: #e2a33a; margin-bottom: 12px; }
.stars small { color: var(--ink-2); }
.pd-info p { color: var(--ink-2); }
.price-xl { font-size: 34px; font-weight: 800; margin: 16px 0; }
.pd-list { list-style: none; display: grid; gap: 10px; margin-bottom: 18px; font-size: 14px; }
.pd-list li { background: var(--bg); padding: 10px 14px; border-radius: 12px; }
.quick-cp { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.quick-cp label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 8px; }
.quick-cp input { width: 110px; }
.quick-cp span { font-size: 14px; }

/* ---------- Formularios ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
label input, label select, label textarea, .quick-cp input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 15px; color: var(--ink); outline: none; transition: .2s; font-weight: 400;
}
.quick-cp input { display: inline-block; margin: 0; }
label input:focus, label select:focus, label textarea:focus, .quick-cp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 13px; color: var(--ink-2); margin: -4px 0 20px; }
.hint a { text-decoration: underline; }

/* ---------- Carrito ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(20,22,20,.4); opacity: 0; pointer-events: none; transition: .3s; z-index: 55; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 56; transform: translateX(100%); transition: .35s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: none; box-shadow: var(--shadow-lg); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer-foot { padding: 20px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.ci { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.ci-info { flex: 1; }
.ci-info small { display: block; color: var(--ink-2); font-size: 13px; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty button:not(.link) { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); font-weight: 700; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.sum-row small { color: var(--ink-2); }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 20px; }
.drawer-foot .btn { margin-top: 14px; }
.free { color: var(--ok); }

/* ---------- Checkout ---------- */
.modal-card > h2 { font-size: 30px; margin-bottom: 22px; }
.checkout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; }
.co-form h4, .co-summary h4 { font-size: 16px; margin-bottom: 14px; }
.card-fake { background: linear-gradient(135deg, #f7f4ef, #efe9df); padding: 16px 16px 2px; border-radius: 14px; margin-bottom: 18px; }
.co-summary { background: var(--bg); border-radius: 18px; padding: 22px; align-self: start; position: sticky; top: 0; }
.co-items { margin-bottom: 12px; display: grid; gap: 10px; }
.co-it { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.co-it span { flex: 1; }
.eta { display: flex; gap: 14px; background: #fff; border-radius: 14px; padding: 14px; margin-top: 14px; font-size: 14px; }
.eta-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.eta-ship .eta-ic { background: var(--accent-soft); }
.eta-inst .eta-ic { background: #fff3e6; }
.eta small { display: block; color: var(--ink-2); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.eta b { display: block; font-size: 16px; }
.eta span { color: var(--ink-2); font-size: 13px; }
.eta ul { margin: 8px 0 0 16px; font-size: 13px; color: var(--ink-2); }

.success { text-align: center; padding: 20px 0; }
.success-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 40px; display: grid; place-items: center; margin: 0 auto 18px; animation: pop .4s; }
.success h2 { font-size: 34px; margin-bottom: 8px; }
.success p { color: var(--ink-2); }
.success-grid { display: flex; justify-content: center; gap: 14px; margin: 26px 0 8px; flex-wrap: wrap; }
.success-grid div { background: var(--bg); padding: 14px 22px; border-radius: 14px; }
.success-grid small { display: block; color: var(--ink-2); font-size: 12px; }

/* ---------- Spinner y toasts ---------- */
.spinner { width: 36px; height: 36px; border: 3px solid #e3e3e3; border-top-color: #4285f4; border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: #fff; display: inline-block; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .25s; transition: .3s; }
.toast.err { background: #b3372a; }
.toast.info { background: var(--info); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Login Google falso ---------- */
.g-overlay { position: fixed; inset: 0; background: rgba(32,33,36,.6); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.g-card { position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 10px; font-family: 'Roboto', Arial, sans-serif; overflow: hidden; animation: pop .25s; }
.g-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid #dadce0; font-size: 14px; color: #3c4043; }
.g-body { padding: 28px 32px 22px; text-align: center; }
.g-body h2 { font-family: 'Inter', Arial, sans-serif; font-size: 24px; font-weight: 400; color: #202124; }
.g-sub { color: #202124; margin: 6px 0 22px; font-size: 15px; }
.g-sub b { color: #1a73e8; font-weight: 500; }
.g-list { list-style: none; text-align: left; border-top: 1px solid #dadce0; }
.g-list li { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid #dadce0; cursor: pointer; transition: .15s; }
.g-list li:hover { background: #f7f8f8; }
.g-list b { font-weight: 500; font-size: 14px; color: #3c4043; display: block; }
.g-list small { color: #5f6368; font-size: 12px; }
.g-av { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.g-av-o { background: #f1f3f4; }
.g-foot { font-size: 12px; color: #5f6368; margin-top: 18px; }
.g-close { position: absolute; top: 10px; right: 12px; color: #5f6368; width: 30px; height: 30px; border-radius: 50%; }
.g-close:hover { background: #f1f3f4; }
.g-loading { padding: 30px 0; }
.g-loading p { margin-top: 16px; color: #3c4043; font-size: 14px; }
.g-form { text-align: left; }
.g-form input { display: block; width: 100%; padding: 13px 14px; border: 1px solid #dadce0; border-radius: 6px; margin-bottom: 12px; outline: none; font-size: 15px; }
.g-form input:focus { border: 2px solid #1a73e8; padding: 12px 13px; }
.g-form .btn { background: #1a73e8; border-radius: 6px; margin-top: 6px; }

/* =========================================================
   DASHBOARD
   ========================================================= */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 80% 10%, #e9d8c5, transparent 45%), radial-gradient(circle at 10% 90%, #d7e6df, transparent 40%); }
.gate-card { background: #fff; padding: 44px; border-radius: 24px; box-shadow: var(--shadow-lg); text-align: center; max-width: 440px; display: grid; gap: 18px; justify-items: center; }
.gate-card h2 { font-size: 30px; }
.gate-card p { color: var(--ink-2); }

.dash { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #e9e5de; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.side .logo { color: #fff; padding: 0 8px; }
.side .logo-mark { background: var(--accent-2); }
.side-nav { display: grid; gap: 4px; }
.side-nav a, .side-store { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; color: #c8c3ba; font-weight: 500; transition: .2s; }
.side-nav a:hover, .side-store:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent-2); }
.side-store { margin-top: auto; border: 1px solid rgba(255,255,255,.12); }

.dash-main { padding: 28px 36px 48px; min-width: 0; }
.dash-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.dash-top h1 { font-size: 32px; }
.dash-user { display: flex; align-items: center; gap: 12px; }
.du-info { text-align: right; font-size: 14px; }
.view { animation: fade .3s; }

.panel { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.panel h3 { font-size: 17px; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.kpi-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 22px; }
.kpi:nth-child(2) .kpi-ic { background: #e6eefc; }
.kpi:nth-child(3) .kpi-ic { background: #fff3e6; }
.kpi:nth-child(4) .kpi-ic { background: #f3eafc; }
.kpi small { color: var(--ink-2); font-size: 13px; display: block; }
.kpi b { font-size: 24px; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--bg); }
.thumbs { display: flex; gap: 4px; align-items: center; }
.thumbs .thumb-xs { width: 34px; height: 34px; }
.thumbs .more { font-size: 12px; color: var(--ink-2); margin-left: 4px; }

.status { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 100%; }
.st-confirmed, .st-preparing { background: #f2f0ec; color: #5d5a52; }
.st-shipped, .st-out { background: #e6eefc; color: #2457a8; }
.st-delivered, .st-installed { background: #e2f5ec; color: #17784f; }
.st-install_sched { background: #fff3e6; color: #a5531f; }

.next { background: linear-gradient(135deg, var(--accent), #234a3f); color: #fff; }
.next small { opacity: .75; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.next h3 { font-family: 'Fraunces', serif; font-size: 26px; margin: 4px 0; }
.next p { opacity: .8; font-size: 14px; }
.next .pbar { background: rgba(255,255,255,.2); margin: 16px 0; }
.next .pbar i { background: #f0b27f; }
.next .btn { background: #fff; color: var(--accent); }
.pbar { height: 8px; background: #efebe4; border-radius: 99px; overflow: hidden; margin: 14px 0; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #4c8f7c); border-radius: 99px; transition: width .6s; }

.bar-row { display: grid; grid-template-columns: 110px 1fr 80px; gap: 10px; align-items: center; font-size: 14px; margin-bottom: 12px; }
.bar-row b { text-align: right; }
.bar { height: 10px; background: #f2efe9; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }

/* Pedidos */
.orders { display: grid; gap: 18px; }
.order { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.order-head small { display: block; color: var(--ink-2); font-size: 13px; }
.order-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.order-items { display: grid; gap: 10px; }
.oi { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.oi small { display: block; color: var(--ink-2); }
.order-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.order-dates div { background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.order-dates small { display: block; color: var(--ink-2); font-size: 12px; }
.order-dates b { font-size: 14px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }

/* Seguimiento */
.track { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.track-list { display: grid; gap: 6px; position: sticky; top: 20px; }
.track-list h3 { margin-bottom: 8px; }
.tl-item { display: grid; gap: 6px; padding: 12px; border-radius: 12px; color: var(--ink); border: 1.5px solid transparent; font-size: 14px; }
.tl-item small { display: block; color: var(--ink-2); font-size: 12px; }
.tl-item:hover { background: var(--bg); }
.tl-item.active { border-color: var(--accent); background: var(--accent-soft); }
.track-main { display: grid; gap: 20px; min-width: 0; }
.track-main .cols { margin-bottom: 0; }
.th-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.th-top small { color: var(--ink-2); font-size: 13px; }
.th-top h2 { font-size: 30px; margin: 4px 0; }
.th-top p { color: var(--ink-2); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #b3372a; background: #fde8e4; padding: 6px 12px; border-radius: 999px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #e0412f; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(1.4); } }

.route { position: relative; margin: 36px 10px 10px; padding-top: 30px; }
.route-line { height: 6px; background: repeating-linear-gradient(90deg, #ddd6cb 0 10px, transparent 10px 18px); border-radius: 99px; position: relative; }
.route-line i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 99px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.truck { position: absolute; top: 0; font-size: 30px; transform: translateX(-50%) scaleX(-1); transition: left 1s cubic-bezier(.2,.8,.2,1); animation: drive 1s ease-in-out infinite; }
@keyframes drive { 50% { margin-top: -2px; } }
.route-pts { display: flex; justify-content: space-between; margin-top: 14px; }
.route-pts div { display: grid; justify-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); opacity: .55; width: 120px; text-align: center; }
.route-pts div:first-child { justify-items: start; text-align: left; }
.route-pts div:last-child { justify-items: end; text-align: right; }
.route-pts div.on { opacity: 1; color: var(--ink); }
.route-pts span { font-size: 22px; }

.stepper { display: flex; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; overflow-x: auto; }
.step { flex: 1; min-width: 90px; display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; }
.step::before { content: ''; position: absolute; top: 18px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--accent); }
.dot { width: 38px; height: 38px; border-radius: 50%; background: #f2efe9; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--ink-2); z-index: 1; border: 3px solid #fff; }
.step.done .dot { background: var(--accent-soft); }
.step.current .dot { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.step small { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.step.current small { color: var(--ink); font-weight: 700; }

.events { list-style: none; display: grid; }
.events li { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.events li:not(:last-child)::after { content: ''; position: absolute; left: 17px; top: 48px; bottom: -6px; width: 2px; background: var(--line); }
.events li > span { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; flex-shrink: 0; }
.events li.now > span { background: var(--accent-soft); box-shadow: 0 0 0 4px #f1f6f4; }
.events small { display: block; color: var(--ink-2); font-size: 13px; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14px; }
.dl dt { color: var(--ink-2); }
.driver { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px; background: #e6eefc; border-radius: 12px; font-size: 14px; }
.driver span { font-size: 26px; }
.driver small { display: block; color: var(--ink-2); }
.inst-panel { border-top: 4px solid var(--accent-2); }

/* Añadir producto */
.add { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.add-form h3 { margin: 4px 0 16px; }
.add-form h3:not(:first-child) { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.add-preview { position: sticky; top: 20px; display: grid; gap: 10px; max-width: 340px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 16px; }
.emoji-pick button { width: 42px; height: 42px; border-radius: 10px; font-size: 22px; border: 1.5px solid var(--line); background: #fff; transition: .15s; }
.emoji-pick button.on { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.08); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--ink); font-size: 15px; font-weight: 500; }
.switch input { display: none; }
.switch span { width: 44px; height: 26px; background: #d8d2c8; border-radius: 99px; position: relative; transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 21px; }
.add-form .btn-lg { margin-top: 10px; }

.upload-box { border: 2px dashed var(--line); border-radius: 14px; padding: 16px; margin: -6px 0 14px; background: var(--bg); cursor: pointer; transition: .2s; }
.upload-box:hover, .upload-box.drag { border-color: var(--accent); background: var(--accent-soft); }
.up-empty { display: flex; align-items: center; gap: 14px; padding: 6px 4px; }
.up-ic { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow); flex-shrink: 0; }
.up-empty b, .up-info b { display: block; font-size: 14px; color: var(--ink); }
.up-empty small, .up-info small { display: block; font-size: 12px; color: var(--ink-2); }
.up-preview { display: flex; align-items: center; gap: 14px; }
.up-preview img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: #fff; flex-shrink: 0; }

/* ---------- Panel del propietario (Admin) ---------- */
.demo-bar a { color: #f0b27f; font-weight: 600; margin-left: 6px; text-decoration: underline; }
.admin-mark { background: var(--accent-2) !important; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff3e6; color: #a5531f; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.side-admin { background: #171a18; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8c887f; padding: 0 10px; margin: -18px 0 -8px; font-weight: 600; }
.nav-count { margin-left: auto; background: var(--accent-2); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.nav-count:empty { display: none; }

.kpis-5 { grid-template-columns: repeat(5, 1fr); }
.kpi.clickable { cursor: pointer; transition: .2s; }
.kpi.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi:nth-child(5) .kpi-ic { background: #e2f5ec; }
.kpi em.up { display: inline-block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ok); background: #e2f5ec; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 8px; height: 180px; align-items: end; padding-top: 12px; }
.chart-col { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar { flex: 1; width: 100%; background: #f2efe9; border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.chart-bar i { display: block; width: 100%; min-height: 4px; background: linear-gradient(180deg, var(--accent), #204238); border-radius: 8px; transition: height .5s; }
.chart-col:hover .chart-bar i { background: var(--accent-2); }
.chart-col small { font-size: 11px; color: var(--ink-2); }

.top-list { display: grid; gap: 12px; }
.top-it { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.top-it > div { flex: 1; min-width: 0; }
.top-it small { display: block; color: var(--ink-2); font-size: 12px; }
.rank { width: 22px; font-weight: 800; color: var(--ink-2); text-align: center; }

.cust { display: flex; align-items: center; gap: 10px; }
.cust small { display: block; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.cust.lg { gap: 14px; font-size: 15px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.nowrap { white-space: nowrap; }
.nowrap .icon-btn { display: inline-grid; }

.filters { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.search.sm { max-width: 280px; background: var(--bg); }
.search.sm input { padding: 8px 0; font-size: 14px; }

.back { display: inline-block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.back:hover { color: var(--ink); }
.od-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.od-head h2 { font-size: 28px; margin: 2px 0 8px; }
.od-total { text-align: right; }
.od-total small { display: block; color: var(--ink-2); font-size: 12px; }
.od-total b { font-size: 28px; display: block; }
.paid { display: inline-block; font-size: 12px; font-weight: 700; color: var(--ok); background: #e2f5ec; padding: 3px 10px; border-radius: 999px; margin-top: 4px; }
.small-n { font-size: 13px; }

.status-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.sp { display: grid; justify-items: center; gap: 6px; padding: 14px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); transition: .2s; text-align: center; }
.sp span { font-size: 22px; }
.sp small { font-size: 12px; color: var(--ink-2); line-height: 1.25; }
.sp:hover { border-color: var(--accent); transform: translateY(-2px); }
.sp.done { background: var(--accent-soft); border-color: #c2dad1; }
.sp.current { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(47, 93, 80, .28); }
.sp.current small { color: #fff; font-weight: 600; }
.od-sums { max-width: 340px; margin: 16px 0 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis, .kpis-5 { grid-template-columns: repeat(2, 1fr); }
  .cols, .track, .add, .order-body { grid-template-columns: 1fr; }
  .track-list { position: static; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .track-list h3 { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .hero-inner, .pd, .checkout { grid-template-columns: 1fr; }
  .topbar .search { display: none; }
  .cart-btn span, .user-name { display: none; }
  .dash { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; z-index: 20; overflow-x: auto; gap: 12px; }
  .side .logo, .side-label { display: none; }
  .side-nav { display: flex; }
  .side-nav a span, .side-store span { display: none; }
  .side-store { margin: 0 0 0 auto; }
  .dash-main { padding: 20px 16px 40px; }
  .du-info { display: none; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .modal-card { padding: 24px 18px; }
}
@media (max-width: 520px) {
  .kpis, .kpis-5, .f2, .order-dates { grid-template-columns: 1fr; }
  .btn-google span { display: none; }
}
