:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --ink: #14131a;
  --ink-2: #4e4c58;
  --muted: #8b8994;
  --line: #e8e5dd;
  --brand: #4f46e5;
  --brand-soft: #eceafd;
  --celeste: #6cb4ee;
  --sol: #ffc53d;
  --ok: #16a37f;
  --ok-soft: #e3f6ef;
  --danger: #e5484d;
  --grad: linear-gradient(135deg, #6cb4ee 0%, #4f46e5 100%);
  --shadow: 0 1px 2px rgba(20, 19, 26, 0.04), 0 8px 24px -12px rgba(20, 19, 26, 0.12);
  --shadow-lg: 0 24px 60px -24px rgba(40, 30, 120, 0.35);
  --r: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e13; --surface: #15161d; --surface-2: #1c1d26; --ink: #f3f3f6; --ink-2: #b9b8c4;
    --muted: #7d7c89; --line: #262734; --brand: #8b84ff; --brand-soft: #23214a; --ok: #3ccf9f; --ok-soft: #12302a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e13; --surface: #15161d; --surface-2: #1c1d26; --ink: #f3f3f6; --ink-2: #b9b8c4;
  --muted: #7d7c89; --line: #262734; --brand: #8b84ff; --brand-soft: #23214a; --ok: #3ccf9f; --ok-soft: #12302a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { flex-shrink: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 8px 20px -8px rgba(20,19,26,.5); }
.btn-brand { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(79,70,229,.7); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-weight: 500; font-size: 13.5px; }
.btn-link:hover { color: var(--ink); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -10%, #8fc6f3 0%, transparent 55%),
              radial-gradient(900px 600px at 110% 110%, #6d5cff 0%, transparent 55%),
              linear-gradient(160deg, #4b6fe0, #3b2fb8);
  color: #fff;
}
.login-hero h1 { font-size: clamp(36px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 18px; font-weight: 800; }
.login-hero p { font-size: 18px; opacity: .85; max-width: 440px; margin: 0; }
.sol { position: absolute; width: 380px; height: 380px; right: -90px; top: -90px; border-radius: 50%;
  background: radial-gradient(circle, #ffd66b 0%, #ffc53d 45%, transparent 70%); opacity: .55; filter: blur(4px); animation: flota 9s ease-in-out infinite; }
.burbujas { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 40px 0; }
.burbuja { padding: 11px 15px; border-radius: 18px; font-size: 14.5px; width: fit-content; max-width: 85%;
  backdrop-filter: blur(10px); animation: entra .6s cubic-bezier(.2,.8,.2,1) both; }
.burbuja.c { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); border-bottom-left-radius: 6px; }
.burbuja.b { background: #fff; color: #1b1a22; align-self: flex-end; border-bottom-right-radius: 6px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.4); }
.burbuja:nth-child(2) { animation-delay: .5s } .burbuja:nth-child(3) { animation-delay: 1.1s } .burbuja:nth-child(4) { animation-delay: 1.7s }
.canales-hero { display: flex; gap: 10px; align-items: center; font-size: 13.5px; opacity: .9; }
.canales-hero .ico-canal { width: 30px; height: 30px; border-radius: 9px; }

.login-form { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 28px; letter-spacing: -0.02em; margin: 24px 0 6px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-card .btn { width: 100%; padding: 14px; }
.login-card .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.login-card .or::before, .login-card .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.nota { margin-top: 20px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start;
  background: var(--surface-2); padding: 10px 12px; border-radius: 12px; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-weight: 400; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }

/* ---------- Layout app ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: var(--surface);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; padding: 4px 8px 20px; }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(79,70,229,.6); }
.logo span b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2);
  text-decoration: none; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.on { background: var(--ink); color: var(--bg); }
.nav-item .badge { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.nav-item.on .badge { background: rgba(255,255,255,.18); color: inherit; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--grad); flex-shrink: 0; }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who small { color: var(--muted); font-size: 12px; }

.main { min-width: 0; padding: 28px clamp(16px, 4vw, 48px) 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.03em; font-weight: 800; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.pill.off { background: var(--surface-2); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 20%, transparent); animation: late 2s infinite; }
.pill.off .dot { animation: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -0.01em; }
.card .hint { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }

/* ---------- Inicio ---------- */
.kpi { display: flex; flex-direction: column; gap: 14px; }
.kpi .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi b { font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.kpi small { color: var(--muted); font-weight: 500; }
.hero-card {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(500px 260px at 100% 0%, rgba(255,197,61,.55), transparent 60%), var(--grad);
}
.hero-card h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.02em; }
.hero-card p { margin: 0 0 20px; opacity: .9; max-width: 440px; }
.hero-card .btn { background: #fff; color: #1b1a22; }
.pasos { display: flex; flex-direction: column; gap: 4px; }
.paso { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; text-decoration: none; transition: background .15s; }
.paso:hover { background: var(--surface-2); }
.paso .check { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; flex-shrink: 0; }
.paso.ok .check { background: var(--ok); border: 0; color: #fff; }
.paso.ok .t { color: var(--muted); text-decoration: line-through; }
.paso .t { font-weight: 600; }
.paso small { display: block; color: var(--muted); font-weight: 400; }
.paso .flecha { margin-left: auto; color: var(--muted); }

/* ---------- Mi local ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.savebar {
  position: sticky; bottom: 16px; margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 20px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: var(--shadow-lg);
}
.savebar span { color: var(--muted); font-size: 13.5px; }

/* ---------- Canales ---------- */
.ico-canal { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; }
.wa { background: linear-gradient(140deg, #45e27a, #12a150); }
.ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.fb { background: linear-gradient(140deg, #3ab0ff, #6b4cff 60%, #ff5c87); }
.canal { display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.canal::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.canal.wa-c { --c: linear-gradient(90deg, #45e27a, #12a150); }
.canal.ig-c { --c: linear-gradient(90deg, #fdbb2d, #d6249f, #285aeb); }
.canal.fb-c { --c: linear-gradient(90deg, #3ab0ff, #6b4cff, #ff5c87); }
.canal-head { display: flex; align-items: center; gap: 14px; }
.canal-head h3 { margin: 0; font-size: 17px; }
.canal-head small { color: var(--muted); }
.canal-body { color: var(--ink-2); font-size: 14px; flex: 1; }
.cuenta { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.cuenta img, .cuenta .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.cuenta b { display: block; font-size: 14px; }
.cuenta small { color: var(--muted); font-size: 12.5px; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--sol); color: #3d2a00; margin-left: 6px; vertical-align: 1px; }
.canal-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.estado-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: 13.5px; }
.copy { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-family: ui-monospace, monospace; font-size: 13px; }
.copy code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aviso { display: flex; gap: 14px; align-items: flex-start; background: var(--brand-soft); border: 0; box-shadow: none; }
.aviso .ico { color: var(--brand); margin-top: 2px; }
.aviso p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,10,20,.45); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .2s; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: 24px; padding: 26px; box-shadow: var(--shadow-lg); animation: sube .3s cubic-bezier(.2,.8,.2,1); }
.modal h3 { margin: 14px 0 6px; font-size: 20px; letter-spacing: -0.02em; }
.modal p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.modal .acciones { display: flex; flex-direction: column; gap: 10px; }
.modal details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.modal summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.modal details .field { margin-top: 12px; }

/* ---------- Probar (celular) ---------- */
.probar { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
.phone {
  width: 360px; height: 720px; border-radius: 48px; padding: 12px; background: #0b0b10;
  box-shadow: 0 0 0 2px #2a2a33, var(--shadow-lg), 0 50px 100px -40px rgba(79,70,229,.45); position: relative;
}
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #000; z-index: 3; }
.screen { height: 100%; border-radius: 38px; overflow: hidden; display: flex; flex-direction: column; background: var(--chat-bg); }
.chat-head { padding: 52px 16px 12px; display: flex; align-items: center; gap: 10px; background: var(--chat-head); color: var(--chat-head-ink); }
.chat-head .avatar { width: 36px; height: 36px; font-size: 16px; }
.chat-head b { display: block; font-size: 15px; line-height: 1.2; }
.chat-head small { font-size: 12px; opacity: .75; }
.chat { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: none; }
.msg { max-width: 80%; padding: 8px 12px; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; animation: pop .25s cubic-bezier(.2,.8,.2,1); }
.msg.bot { align-self: flex-start; background: var(--bot-bg); color: var(--bot-ink); border-radius: var(--bot-r); }
.msg.yo { align-self: flex-end; background: var(--yo-bg); color: var(--yo-ink); border-radius: var(--yo-r); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .4; animation: tipea 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s } .typing i:nth-child(3) { animation-delay: .3s }
.chat-input { display: flex; gap: 8px; padding: 10px 10px 22px; background: var(--chat-foot); align-items: center; }
.chat-input input { flex: 1; border: 0; outline: none; padding: 11px 16px; border-radius: 999px; background: var(--in-bg); color: var(--in-ink); font-size: 14.5px; }
.chat-input button { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--send-bg); color: #fff; }

.skin-wa { --chat-bg: #efe7dd; --chat-head: #075e54; --chat-head-ink: #fff; --bot-bg: #fff; --bot-ink: #111; --yo-bg: #d9fdd3; --yo-ink: #111;
  --bot-r: 4px 14px 14px 14px; --yo-r: 14px 4px 14px 14px; --chat-foot: #f0f0f0; --in-bg: #fff; --in-ink: #111; --send-bg: #00a884; }
.skin-wa .chat { background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.skin-ig { --chat-bg: #fff; --chat-head: #fff; --chat-head-ink: #111; --bot-bg: #efefef; --bot-ink: #111; --yo-bg: linear-gradient(135deg,#7b3cff,#c13584 60%,#f56040); --yo-ink: #fff;
  --bot-r: 20px; --yo-r: 20px; --chat-foot: #fff; --in-bg: #f2f2f2; --in-ink: #111; --send-bg: #3797f0; }
.skin-ig .chat-head { border-bottom: 1px solid #eee; }
.skin-fb { --chat-bg: #fff; --chat-head: #fff; --chat-head-ink: #111; --bot-bg: #f0f0f0; --bot-ink: #111; --yo-bg: linear-gradient(160deg,#0a7cff,#a334fa 80%); --yo-ink: #fff;
  --bot-r: 18px; --yo-r: 18px; --chat-foot: #fff; --in-bg: #f0f2f5; --in-ink: #111; --send-bg: #0a7cff; }
.skin-fb .chat-head { border-bottom: 1px solid #eee; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; transition: all .15s; text-align: left; }
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }

/* ---------- Conversaciones ---------- */
.inbox { display: grid; grid-template-columns: 340px 1fr; padding: 0; overflow: hidden; height: calc(100dvh - 170px); min-height: 480px; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.inbox-item { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .15s; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.on { background: var(--brand-soft); }
.inbox-item .av { position: relative; }
.inbox-item .av .mini { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--surface); }
.inbox-item .txt { min-width: 0; flex: 1; }
.inbox-item b { font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.inbox-item b time { font-weight: 500; font-size: 12px; color: var(--muted); }
.inbox-item p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.thread-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.thread-body .msg { --bot-bg: var(--surface); --bot-ink: var(--ink); --yo-bg: var(--surface-2); --yo-ink: var(--ink); --bot-r: 16px 16px 16px 4px; --yo-r: 16px 16px 4px 16px; border: 1px solid var(--line); }
.thread-body .msg.bot { align-self: flex-end; background: var(--brand); color: #fff; border: 0; border-radius: 16px 16px 4px 16px; }
.thread-body .msg.yo { align-self: flex-start; background: var(--surface); border-radius: 16px 16px 16px 4px; }
.vacio { display: grid; place-items: center; text-align: center; padding: 48px 20px; color: var(--muted); height: 100%; }
.vacio .emoji { font-size: 44px; margin-bottom: 10px; }
.vacio b { color: var(--ink); display: block; font-size: 16px; margin-bottom: 4px; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; transition: all .3s cubic-bezier(.2,.8,.2,1); z-index: 99; box-shadow: var(--shadow-lg); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animaciones ---------- */
@keyframes entra { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes flota { 50% { transform: translate(-20px, 20px) scale(1.05); } }
@keyframes late { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent); } }
@keyframes tipea { 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sube { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.vista { animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
.menu-btn { display: none; }
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .probar { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 20px; min-height: 420px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 270px; left: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .app.menu .sidebar { transform: none; }
  .menu-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
  .main { padding: 18px 16px 60px; }
  .g-2, .g-3, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.abierto .inbox-list { display: none; }
  .inbox:not(.abierto) .thread { display: none; }
  .thread-body { min-height: 60dvh; }
  .phone { width: min(360px, 100%); height: 640px; }
}
@media (max-width: 480px) { .g-4 { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 26px; } .savebar { border-radius: 20px; } }

/* ---------- Productos (Mi local) ---------- */
.productos { display: flex; flex-direction: column; gap: 8px; }
.prod { display: grid; grid-template-columns: 1.4fr 140px 1.6fr 32px; gap: 8px; align-items: center; animation: pop .25s; }
.prod .btn-link { display: grid; place-items: center; height: 40px; }
.prod .btn-link:hover { color: var(--danger); }
.precio { position: relative; }
.precio i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }
.precio .input { padding-left: 26px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .prod { grid-template-columns: 1fr 120px 32px; } .prod input[name=p_desc] { grid-column: 1 / 3; grid-row: 2; } }

/* ---------- Cobros (Canales) ---------- */
.seccion { font-size: 18px; letter-spacing: -0.02em; margin: 34px 0 14px; }
.mp { background: linear-gradient(140deg, #3ec6ff, #0a84d6); }
.canal.mp-c { --c: linear-gradient(90deg, #3ec6ff, #0a84d6); }
.flujo { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flujo li { counter-increment: paso; background: var(--surface-2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.flujo li::before { content: counter(paso); width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-bottom: 6px; }
.flujo b { font-size: 14px; } .flujo span { color: var(--muted); font-size: 13px; }
@media (max-width: 1100px) { .flujo { grid-template-columns: 1fr 1fr; } }

/* ---------- Pedidos ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pedidos { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.pedido { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.pedido-head { display: flex; align-items: center; gap: 12px; }
.pedido-head .grow { flex: 1; min-width: 0; }
.pedido-head small { display: block; color: var(--muted); font-size: 12.5px; }
.pedido-items { display: flex; flex-direction: column; gap: 6px; font-size: 14px; padding: 12px 14px; background: var(--surface-2); border-radius: 14px; }
.pedido-items div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.pedido-items .sutil { color: var(--muted); }
.pedido-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: auto; }
.pedido-foot .total { font-size: 22px; letter-spacing: -0.02em; display: block; }
.pedido-foot small { color: var(--muted); font-size: 12.5px; }
.pedido-acc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-warn { background: #fff3d6; color: #9a6500; }
.st-brand { background: var(--brand-soft); color: var(--brand); }
.st-ok { background: var(--ok-soft); color: var(--ok); }
.st-off { background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-warn { background: #3a2c0a; color: #fab219; } }
:root[data-theme="dark"] .st-warn { background: #3a2c0a; color: #fab219; }

/* ---------- Métricas ---------- */
:root { --s1: #2a78d6; --s1-hover: #1c5cab; --grid: #e1e0d9; --axis: #c3c2b7; --axis-ink: #898781; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s1-hover: #6da7ec; --grid: #2c2c2a; --axis: #383835; } }
:root[data-theme="dark"] { --s1: #3987e5; --s1-hover: #6da7ec; --grid: #2c2c2a; --axis: #383835; }
.kpi b { font-variant-numeric: tabular-nums; }
.mini-kpis { margin-top: 18px; }
.mini { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px; }
.mini b { font-size: 22px; letter-spacing: -0.02em; }
.mini span { color: var(--muted); font-size: 13.5px; }
.mini small { display: block; font-size: 11.5px; }

.cols-chart { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: var(--alto) auto; margin-top: 8px; }
.ejes { grid-row: 1; grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.tick { height: 0; border-top: 1px solid var(--grid); position: relative; }
.tick:last-child { border-top-color: var(--axis); }
.tick span { position: absolute; left: 0; top: -9px; font-size: 11.5px; color: var(--axis-ink); background: var(--surface); padding-right: 6px; font-variant-numeric: tabular-nums; }
.cols { grid-row: 1; grid-column: 2; display: flex; align-items: flex-end; gap: 2px; height: var(--alto); }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.col .barra { width: 100%; max-width: 26px; min-height: 0; background: var(--s1); border-radius: 4px 4px 0 0; transition: background .15s, height .5s cubic-bezier(.2,.8,.2,1); }
.col:hover .barra { background: var(--s1-hover); }
.xs { grid-column: 2; display: flex; gap: 2px; margin-top: 6px; }
.xs span { flex: 1; font-size: 11.5px; color: var(--axis-ink); text-align: center; white-space: nowrap; overflow: visible; }

.hbars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar .lbl { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 12px; }
.hbar .barra { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; transition: background .15s; }
.hbar:hover .barra { background: var(--s1-hover); }
.hbar .val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

.tabla { margin-top: 14px; font-size: 13px; }
.tabla summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.tabla table { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tabla th, .tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tabla th { color: var(--muted); font-weight: 600; }
.estados-lista { display: flex; flex-direction: column; gap: 10px; }
.estados-lista div { display: flex; justify-content: space-between; align-items: center; }

.tip { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 10px; box-shadow: var(--shadow-lg); white-space: nowrap; }
.tip.on { opacity: 1; }

.msg a { color: inherit; text-decoration: underline; word-break: break-all; }
.mini-kpis { grid-template-columns: repeat(3, 1fr); }
.hbar { grid-template-columns: minmax(96px, 34%) 1fr auto; }
@media (max-width: 1100px) { .met-grid { grid-template-columns: 1fr; } .met-grid .span-2 { grid-column: auto; } }
@media (max-width: 640px) { .mini-kpis { grid-template-columns: 1fr; } }

/* ===================== Admin, cuenta, switches y mensajes ricos ===================== */
.st-danger { background: #fde4e4; color: var(--danger); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-danger { background: #3a1416; } }
:root[data-theme="dark"] .st-danger { background: #3a1416; }
.mini.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.mini.col span { font-size: 13px; }
.mini.col small { display: inline; }
.rojo { color: var(--danger); }

.tabla-admin { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla-admin th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tabla-admin td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla-admin tr:last-child td { border-bottom: 0; }
.tabla-admin td small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.tabla-admin .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla-admin .acc { white-space: nowrap; display: flex; gap: 6px; align-items: flex-start; }
.mas { position: relative; padding-top: 7px; }
.mas[open] > div { position: absolute; right: 0; top: 30px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.mas select { margin-left: 6px; }
.canales-mini { display: flex; gap: 4px; flex-wrap: wrap; }
.cm { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: var(--ok-soft); color: var(--ok); }
.cm.demo { background: var(--surface-2); color: var(--muted); }
.cm.mal { background: #fde4e4; color: var(--danger); }
.fila-simple { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fila-simple:last-child { border-bottom: 0; }
.fila-simple small { color: var(--muted); }
.lista-ev { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.ev { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.ev b { font-weight: 600; display: block; }
.ev small { color: var(--muted); font-size: 12px; }
.ev .area { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 7px; border-radius: 7px; background: var(--surface); height: fit-content; }
.ev-alerta .area { background: #fff3d6; color: #9a6500; }
.ev-error .area { background: #fde4e4; color: var(--danger); }
.uso { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.uso > div { height: 100%; background: var(--brand); border-radius: 99px; }
.uso > .casi { background: #e8a100; }
.uso > .lleno { background: var(--danger); }
.plan-card { display: flex; flex-direction: column; gap: 6px; }
.plan-card p { margin: 0; }
.precio-plan { font-size: 28px; letter-spacing: -0.03em; }
.precio-plan small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan-card.actual { border: 2px solid var(--brand); }
.plan-card .btn { margin-top: auto; }

/* Banners del panel */
.banners { display: flex; flex-direction: column; gap: 10px; margin: -12px 0 22px; }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: 16px; background: var(--brand-soft); font-size: 14px; }
.banner.warn { background: #fff3d6; color: #5c3d00; }
.banner.danger { background: #fde4e4; color: #7a1c1f; }
.banner.admin { background: var(--ink); color: var(--bg); }
.banner .btn { padding: 7px 14px; font-size: 13px; }
.pill.warn { background: #fff3d6; color: #9a6500; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .sw { width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .sw { background: var(--ok); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--brand); outline-offset: 2px; }
.bot-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bot-card h3 { margin: 0; }
.bot-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Mensajes ricos (prueba y conversaciones) */
.msg.rico { padding: 0; background: none !important; max-width: 86%; }
.ticket { background: var(--bot-bg, var(--surface)); color: var(--bot-ink, var(--ink)); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; min-width: 210px; border: 1px dashed color-mix(in srgb, currentColor 25%, transparent); }
.ticket .t-head { font-weight: 800; margin-bottom: 6px; }
.ticket .t-row { display: flex; justify-content: space-between; gap: 10px; }
.ticket .t-total { display: flex; justify-content: space-between; font-weight: 800; border-top: 1px dashed color-mix(in srgb, currentColor 25%, transparent); margin-top: 6px; padding-top: 6px; }
.ticket .t-pagar { display: block; text-align: center; margin-top: 10px; padding: 8px; border-radius: 10px; background: #009ee3; color: #fff; font-weight: 700; text-decoration: none; }
.tarjetas { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tarjeta { flex: 0 0 150px; background: var(--bot-bg, var(--surface)); color: var(--bot-ink, var(--ink)); border-radius: 14px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; border: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.tarjeta b { font-size: 13.5px; }
.tarjeta small { opacity: .7; }
.tarjeta button { margin-top: auto; border: 0; border-radius: 9px; padding: 6px; font-weight: 700; cursor: pointer; background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; font: inherit; }
.opciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; max-width: 86%; }
.opciones button { border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); background: var(--surface); color: var(--brand); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.opciones button:disabled { opacity: .5; cursor: default; }
.archivo, .ubic { background: var(--bot-bg, var(--surface)); color: var(--bot-ink, var(--ink)); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; text-decoration: none; }
.msg.sistema { align-self: center; background: var(--surface-2) !important; color: var(--muted) !important; font-size: 12.5px; border-radius: 10px; max-width: 92%; text-align: center; }
.msg.humano { position: relative; }
.msg.humano::after { content: "👤 vos"; display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; text-align: right; }
.responder { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.responder input { flex: 1; }
.tomada { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: #fff3d6; color: #9a6500; margin-left: 6px; }

/* Menú y mapa */
.menu-box { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.menu-box img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.menu-box .doc { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); font-size: 26px; }
.menu-box .grow { flex: 1; min-width: 160px; }
.mapa { width: 100%; height: 240px; border: 0; border-radius: 14px; margin-top: 12px; background: var(--surface-2); }
.preview-prod { max-height: 320px; overflow-y: auto; margin: 12px 0; }
.login-alt { display: flex; flex-direction: column; gap: 10px; }
.btn-google { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.chat .opciones, .thread-body .opciones { align-self: flex-start; }
.chat .msg.rico, .thread-body .msg.rico { align-self: flex-start; }
.grow { flex: 1; min-width: 0; }
.msg.rico, .msg.rico * { white-space: normal; }
.tabla-admin .acc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; min-width: 190px; }
.banners + .vista .inbox { height: calc(100dvh - 250px); }
