/* Cresco · panel de ventas. Tokens de color con modo claro y oscuro. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f1f0eb;
  --surface-3: #e8e7e0;
  --text: #191c18;
  --text-2: #4a5047;
  --muted: #7a8076;
  --line: #e4e3dc;
  --line-strong: #d3d2c9;
  --accent: #2f6b2b;
  --accent-strong: #24561f;
  --accent-text: #ffffff;
  --accent-soft: #e6f0e1;
  --accent-ink: #24561f;
  --bubble-in: #ffffff;
  --bubble-bot: #e9f2e4;
  --bubble-human: #dde9f6;
  --warn-bg: #fff3d6;
  --warn-ink: #7a5300;
  --err-bg: #fde7e4;
  --err-ink: #a3261b;
  --ok-bg: #e3f3e6;
  --ok-ink: #1e6b33;
  --hot: #e2552d;
  --warm: #e2a01b;
  --cold: #6b8aa8;
  --shadow-sm: 0 1px 2px rgba(25, 28, 24, 0.06);
  --shadow: 0 1px 2px rgba(25, 28, 24, 0.05), 0 8px 24px rgba(25, 28, 24, 0.07);
  --shadow-lg: 0 24px 64px rgba(25, 28, 24, 0.22);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --nav-w: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111410;
    --surface: #191d18;
    --surface-2: #20251f;
    --surface-3: #2a3029;
    --text: #e9ede6;
    --text-2: #c2c9bf;
    --muted: #8d968a;
    --line: #2a3029;
    --line-strong: #363d35;
    --accent: #7fc46e;
    --accent-strong: #95d285;
    --accent-text: #0e1a0c;
    --accent-soft: #233320;
    --accent-ink: #a6dc97;
    --bubble-in: #20251f;
    --bubble-bot: #243421;
    --bubble-human: #1f2d3b;
    --warn-bg: #3a2f14;
    --warn-ink: #f1cf86;
    --err-bg: #3d1d1a;
    --err-ink: #ff9a8f;
    --ok-bg: #1d3323;
    --ok-ink: #8fdba3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { display: inline-flex; flex: none; }
.ic svg { display: block; }

/* ---------- controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 9px 15px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.danger, .link.danger { color: var(--err-ink); }
.btn.danger { border-color: color-mix(in srgb, var(--err-ink) 40%, transparent); }
.btn:disabled, .icon-btn:disabled, .send-btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent-ink); }

input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-error { color: var(--err-ink); background: var(--err-bg); padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; }
.notice { background: var(--warn-bg); color: var(--warn-ink); padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; }
.mini-select { width: auto; padding: 5px 28px 5px 10px; font-size: 13px; border-radius: 999px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count:not(:empty) { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 12px; }
.chip.add { border-style: dashed; color: var(--muted); }
.chip-x { border: 0; background: none; color: inherit; padding: 0 0 0 2px; cursor: pointer; display: inline-flex; opacity: .7; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.pill.xs { font-size: 11px; padding: 1px 7px; }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.pill.recompra { background: var(--accent-soft); color: var(--accent-ink); }
.pill .dot, .score-box .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.score-caliente { color: var(--hot); } .pill.score-caliente { background: color-mix(in srgb, var(--hot) 13%, transparent); }
.score-tibio { color: var(--warm); } .pill.score-tibio { background: color-mix(in srgb, var(--warm) 15%, transparent); color: color-mix(in srgb, var(--warm) 75%, var(--text)); }
.score-frio { color: var(--cold); } .pill.score-frio { background: color-mix(in srgb, var(--cold) 15%, transparent); }

/* colores de etiquetas */
.tag-green { --tag: #2f8a3e; } .tag-blue { --tag: #2f6fbf; } .tag-amber { --tag: #c4860c; }
.tag-red { --tag: #c4402f; } .tag-purple { --tag: #7b4bb8; } .tag-gray { --tag: #6b7280; }
.pill[class*="tag-"], .chip[class*="tag-"].on { background: color-mix(in srgb, var(--tag) 14%, transparent); color: color-mix(in srgb, var(--tag) 80%, var(--text)); border-color: transparent; }
.chip[class*="tag-"]:not(.on) { border-color: color-mix(in srgb, var(--tag) 40%, transparent); }

/* avatar con canal */
.avatar {
  position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--av) 16%, var(--surface)); color: var(--av); font-weight: 700; letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: color-mix(in srgb, var(--av) 50%, white); background: color-mix(in srgb, var(--av) 30%, var(--surface)); } }
.av-channel {
  position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; border: 2px solid var(--surface);
}
.av-channel.whatsapp { background: #25a35a; } .av-channel.instagram { background: #d6249f; } .av-channel.messenger { background: #0a7cff; }

/* ---------- inicio de sesión ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 400px; display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; gap: 12px; align-items: center; }
.login-brand img { border-radius: 12px; }
.login-brand div { display: grid; line-height: 1.2; }
.login-brand strong { font-size: 17px; }
.login-brand span { font-size: 13px; color: var(--muted); }
.login-card h1 { font-size: 22px; margin-top: 4px; }

/* ---------- estructura general ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); height: 100dvh; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 15px; }
.nav-brand img { border-radius: 9px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14.5px; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hot); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav-logout { margin-top: auto; }
.view { min-width: 0; min-height: 0; overflow: hidden; }

.page { height: 100%; overflow-y: auto; padding: 28px 32px 48px; }
.page.narrow > * { max-width: 860px; margin-inline: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin-top: 4px; font-size: 14px; max-width: 640px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel > h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.panel > h2 .ic { color: var(--accent-ink); }

.empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state .ic { color: var(--line-strong); margin-bottom: 4px; }
.empty-state h3 { color: var(--text); font-size: 16px; }
.empty-state p { max-width: 320px; font-size: 14px; }

.spinner { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- bandeja ---------- */
.inbox { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) auto; height: 100%; }
.list-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border-right: 1px solid var(--line); }
.pane-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 16px 12px; }
.search-box { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); background: var(--surface); }
.search-input { border: 0 !important; box-shadow: none !important; background: transparent; padding: 9px 0; }
.filters { padding: 0 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.sub-filters { display: flex; gap: 6px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.conv-list { list-style: none; margin: 0; padding: 6px 8px; overflow-y: auto; flex: 1; }
.conv-link { display: flex; gap: 12px; padding: 11px 10px; border-radius: 12px; color: inherit; }
.conv-link:hover { background: var(--surface-2); }
.conv.active .conv-link { background: var(--accent-soft); }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.needs .conv-name::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hot); margin-left: 7px; vertical-align: middle; }
.conv-time { font-size: 12px; color: var(--muted); flex: none; }
.conv-preview { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); container-type: inline-size; }
/* Cuando el chat queda angosto (por ejemplo con la ficha abierta) la barra de botones se compacta en una sola fila */
@container (max-width: 720px) {
  .chat-pane .chat-actions { flex-wrap: nowrap; gap: 0; }
  .chat-pane .chat-actions .btn-label { display: none; }
  .chat-pane .chat-actions .btn.sm { padding: 7px 9px; }
  .chat-pane .chat-actions .icon-btn { width: 34px; height: 34px; }
}
.chat-pane > .empty-state { margin: auto; }
.chat-loading { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-who { display: grid; min-width: 0; margin-right: auto; line-height: 1.3; }
.chat-who strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who > span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode { font-weight: 650; }
.mode.human { color: var(--warn-ink); } .mode.bot { color: var(--accent-ink); }
.chat-actions { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; flex: none; }
.back { display: none; }

.handoff { display: flex; gap: 10px; align-items: flex-start; margin: 12px 16px 0; padding: 10px 14px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.ai-strip { display: flex; gap: 10px; align-items: flex-start; margin: 10px 16px 0; padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.ai-strip > .ic { color: var(--accent-ink); margin-top: 2px; }
.ai-text { flex: 1; }
.ai-next { color: var(--muted); }

.messages { list-style: none; margin: 0; padding: 16px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.day-sep { align-self: center; margin: 10px 0 6px; }
.day-sep span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 3px 12px; border-radius: 999px; }
.msg { max-width: min(76%, 580px); padding: 8px 12px 6px; border-radius: 16px; box-shadow: var(--shadow-sm); }
.msg.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 5px; }
.msg.out { align-self: flex-end; border-bottom-right-radius: 5px; }
.msg.bot { background: var(--bubble-bot); }
.msg.human { background: var(--bubble-human); }
.msg-quote { font-size: 12.5px; color: var(--text-2); border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--text) 5%, transparent); padding: 4px 8px; border-radius: 6px; margin: 2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.msg-media { display: block; margin: -2px -6px 6px; }
.msg-media img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; }
.msg-audio { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--muted); }
.msg-audio audio { height: 34px; max-width: 240px; }
.msg-body:empty { display: none; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.msg-who { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; }

.composer { position: relative; display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.composer .notice { width: 100%; }
.reply { flex: 1; min-width: 0; resize: none; max-height: 180px; border-radius: 20px; padding: 9px 16px; background: var(--surface-2); border-color: transparent; }
.icon-btn.suggest { color: var(--accent-ink); }
.icon-btn.busy .ic { animation: spin 1s linear infinite; }
.send-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; cursor: pointer; }
.send-btn:hover { background: var(--accent-strong); }
.qr-pop { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px); max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 5; }
.qr-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; }
.qr-item:hover, .qr-item:focus { background: var(--surface-2); outline: none; }
.qr-item strong { color: var(--accent-ink); font-size: 13px; }
.qr-item span { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-empty { padding: 8px 10px; }

/* ficha */
.card-pane { width: 340px; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); }
.card-head { position: relative; display: grid; justify-items: center; gap: 4px; padding: 24px 20px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 18px; margin-top: 6px; }
.card-close { position: absolute; top: 10px; right: 10px; }
.card-pills { display: flex; gap: 6px; margin: 6px 0 4px; }
.stage-field { width: 100%; text-align: left; margin-top: 8px; }
.card-section { padding: 16px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.card-section h3 { display: flex; align-items: center; gap: 7px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-form { display: grid; gap: 10px; }
.card-form .btn { justify-self: start; }
.ai-card { display: grid; gap: 6px; font-size: 14px; }
.ai-card .ai-next { color: var(--text-2); }
.ltv { display: flex; justify-content: space-between; align-items: baseline; }
.ltv strong { font-size: 20px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-list li { display: grid; gap: 3px; }
.mini-list a { display: grid; color: inherit; }
.order { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order .link { justify-self: start; }
.mini-task { display: flex !important; gap: 10px; align-items: flex-start; }
.mini-task div { display: grid; }
.mini-task.late .muted { color: var(--err-ink); }
.origin { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.origin > div { display: grid; gap: 2px; }
.danger-zone { padding: 18px 20px 28px; display: grid; gap: 6px; }

.check {
  width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--accent-text); margin-top: 1px; padding: 0;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); }

/* ---------- embudo ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; min-height: 160px; display: grid; gap: 8px; align-content: start; transition: background .15s, border-color .15s; }
.col.drop { background: var(--accent-soft); border-color: var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; }
.col-title { font-weight: 700; font-size: 14px; }
.col-head::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--stage, var(--muted)); }
.col-count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 0 8px; border-radius: 999px; }
.col-value { margin-left: auto; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.stage-nuevo { --stage: #8a94a6; } .stage-interesado { --stage: #2f6fbf; } .stage-cotizo { --stage: #c4860c; }
.stage-compro { --stage: #2f8a3e; } .stage-recompra { --stage: #7b4bb8; } .stage-perdido { --stage: #b0b3ad; }
.col-cards { display: grid; gap: 8px; }
.col.compact .kcard-product, .col.compact .kcard-next { display: none; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; display: grid; gap: 7px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: var(--shadow); }
.kcard.dragging { opacity: .5; transform: rotate(1.5deg); }
.kcard-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kcard-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.kdot { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); margin-left: auto; flex: none; }
.kcard-product { font-size: 13px; color: var(--text-2); }
.kcard-next { font-size: 12.5px; color: var(--muted); display: flex; gap: 5px; align-items: flex-start; }
.kcard-next .ic { color: var(--accent-ink); margin-top: 2px; }
.kcard-foot { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kcard-value { font-size: 12.5px; font-weight: 700; color: var(--ok-ink); }
.kcard-time { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.mover { display: none; font-size: 13px; padding: 5px 10px; }

/* ---------- tareas ---------- */
.task-groups { display: grid; gap: 22px; margin-top: 18px; }
.task-group h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.task-group.late h2 { color: var(--err-ink); }
.task-group .count { font-size: 12px; background: var(--surface-2); color: var(--text-2); padding: 0 8px; border-radius: 999px; }
.task-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.task { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task.done .task-title span:last-child { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.task-title { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.task-notes { font-size: 13.5px; color: var(--text-2); }
.task-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.task-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.task.late .task-meta > span:first-child { color: var(--err-ink); font-weight: 600; }
.task-actions { display: flex; gap: 2px; }

/* ---------- reportes ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi-ic { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.panel.wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-cell { width: 22%; min-width: 80px; }
.bar { display: block; height: 8px; border-radius: 999px; background: var(--accent); min-width: 2px; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rank-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 90px 1fr 36px; align-items: center; gap: 10px; font-size: 14px; }
.funnel-row strong { text-align: right; }
.funnel-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.funnel-bar { display: block; height: 100%; border-radius: 999px; background: var(--stage); }
.score-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.score-box { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border-radius: var(--r); background: color-mix(in srgb, currentColor 9%, transparent); }
.score-box strong { font-size: 24px; color: var(--text); }
.score-box span:last-child { font-size: 13px; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats > * { display: grid; gap: 2px; padding: 12px; border-radius: var(--r); background: var(--surface-2); color: var(--text); }
.mini-stats strong { font-size: 22px; }
.mini-stat:hover, a.score-box:hover, a.link-kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.mini-stat, a.score-box, a.link-kpi { transition: box-shadow .15s, transform .15s; text-decoration: none; }
.mini-stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- ajustes ---------- */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 0; display: grid; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.settings-nav a:hover { background: var(--surface); }
.settings-body { display: grid; gap: 16px; max-width: 860px; min-width: 0; }
.settings-body .panel { scroll-margin-top: 12px; }
.qr-list { display: grid; gap: 10px; margin-top: 12px; }
.qr-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: start; }
.qr-short-wrap { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; padding-left: 10px; background: var(--surface); }
.qr-short-wrap span { color: var(--accent-ink); font-weight: 700; }
.qr-short-wrap input { border: 0; box-shadow: none !important; padding-left: 4px; }
.row-actions { display: flex; gap: 4px; align-items: center; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }
.inline-form select { width: auto; }
.days { width: 80px; margin-right: 8px; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.status-list, .session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.status-list li, .session-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.session-list li > div { display: grid; flex: 1; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.status-dot.on { background: #2f9e44; box-shadow: 0 0 0 3px color-mix(in srgb, #2f9e44 20%, transparent); }
h3.sub { font-size: 14px; margin: 22px 0 10px; }

/* ---------- ventanas ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(15, 18, 14, 0.45); opacity: 0; transition: opacity .2s; }
.overlay.show { opacity: 1; }
.modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .2s; }
.modal.wide { max-width: 640px; }
.overlay.show .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 4px 22px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 8px 22px 22px; }
.product-search { position: relative; display: grid; gap: 6px; }
.product-results { display: flex; flex-wrap: wrap; gap: 6px; }
.product-pick { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.product-pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.sale-lines { display: grid; gap: 8px; }
.sale-line { display: grid; grid-template-columns: 1fr 70px 100px auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.sale-line-name { display: grid; min-width: 0; }
.sale-line-name strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-line-name span { font-size: 12px; }
.sale-line input { padding: 6px 8px; }
.paylink-sum { display: grid; align-content: end; gap: 2px; text-align: right; }
.paylink-total { font-size: 24px; }
.paylinks { display: grid; gap: 8px; }
.sale-total { font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 60; max-width: min(520px, calc(100% - 32px)); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550; opacity: 0; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--err-ink); color: #fff; }

/* ---------- pantallas medianas ---------- */
@media (max-width: 1280px) {
  .inbox { grid-template-columns: minmax(280px, 340px) 1fr; }
  .card-pane { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(380px, 100%); box-shadow: var(--shadow-lg); }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 72px 1fr; }
  .nav { align-items: center; padding: 14px 8px; }
  .nav-brand span, .nav-label { display: none; }
  .nav-brand { padding-bottom: 14px; }
  .nav-item { justify-content: center; padding: 11px; }
  .nav-badge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; font-size: 10.5px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
}

/* ---------- celular ---------- */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .nav {
    grid-row: 2; flex-direction: row; justify-content: space-around; align-items: stretch; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
  }
  .nav-brand, .nav-logout { display: none; }
  .nav-item { flex-direction: column; gap: 2px; padding: 6px 4px; flex: 1; font-size: 11px; }
  .nav-label { display: block; }
  .nav-item.active { background: none; }
  .nav-badge { top: 0; right: calc(50% - 22px); }
  .view { grid-row: 1; }
  .page { padding: calc(18px + env(safe-area-inset-top)) 16px 32px; }
  h1 { font-size: 22px; }

  .inbox { grid-template-columns: minmax(0, 1fr); position: relative; }
  .list-pane, .chat-pane { min-width: 0; }
  .filters { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x; padding-right: 16px; }
  .filters .chip { flex: none; }
  .inbox .list-pane, .inbox .chat-pane { grid-column: 1; grid-row: 1; min-height: 0; }
  .inbox.show-chat .list-pane { display: none; }
  .inbox:not(.show-chat) .chat-pane { display: none; }
  .pane-head { padding-top: calc(16px + env(safe-area-inset-top)); }
  .chat-head { padding: calc(8px + env(safe-area-inset-top)) 8px 8px; gap: 8px; }
  .back { display: inline-grid; }
  .btn-label { display: none; }
  .chat-actions { gap: 0; flex-wrap: nowrap; }
  .chat-actions .hide-sm { display: none; }
  .chat-who > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-actions .btn.sm { padding: 7px 9px; }
  .messages { padding: 12px; }
  .msg { max-width: 86%; }
  .card-pane { width: 100%; }

  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .mover { display: block; }
  .qr-row { grid-template-columns: 1fr; }
  .sale-line { grid-template-columns: 1fr 60px 84px auto; padding: 8px; }
  .kpi-value { font-size: 24px; }
  .report-grid { grid-template-columns: 1fr; }
  .modal { max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .overlay { padding: 0; place-items: end stretch; }
}
@media (hover: none) {
  .kcard { cursor: pointer; }
  .mover { display: block; }
}

/* ---------- Difusiones ---------- */
.bc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bc-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md, 12px); background: var(--surface); min-width: 0; }
.bc-item.clickable { cursor: pointer; }
.bc-item.clickable:hover { background: var(--surface-2); }
.bc-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.bc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bc-title strong { overflow-wrap: anywhere; }
.bc-body { font-size: 14px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.panel > h2 .bc-new { margin-left: auto; }
.bc-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bc-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.bc-preview { display: grid; gap: 6px; }
.bc-bubble { justify-self: start; max-width: 100%; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: var(--ok-bg); color: var(--text); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bc-audience { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.bc-count { font-size: 18px; }
.bc-detail { display: grid; gap: 14px; }
.bc-errors { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; max-height: 220px; overflow-y: auto; }
.err-text { color: var(--err-ink); }

/* ---------- reportes con botones, calificación y comentarios como tickets ---------- */
.seg-tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 18px; background: var(--surface-2); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.seg-tab { padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.seg-tab:hover { color: var(--text); }
.seg-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.center-pad { display: grid; place-items: center; padding: 48px; }
.chips.spaced { margin-bottom: 16px; }
a.chip { text-decoration: none; }
.pad-top { padding-top: 14px; }
.panel > h2 .panel-more { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
a.score-box { text-decoration: none; cursor: pointer; }
.box-go { font-size: 12px; font-weight: 600; opacity: .75; }
a.link-kpi { color: inherit; text-decoration: none; cursor: pointer; }
a.funnel-row { color: inherit; text-decoration: none; border-radius: 8px; }
a.funnel-row:hover { background: var(--surface-2); }
.score-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.score-board.single { grid-template-columns: minmax(0, 560px); }
.sc-caliente { --stage: var(--hot); } .sc-tibio { --stage: var(--warm); } .sc-frio { --stage: var(--cold); }
.kcard.lead { color: inherit; text-decoration: none; cursor: pointer; }
.tickets { display: grid; gap: 10px; }
.ticket { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.ticket.failed { border-left-color: var(--err-ink); }
.ticket-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.ticket-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ticket-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ticket-text { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1100px) { .score-board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .ticket { flex-wrap: wrap; } .ticket-actions { width: 100%; justify-content: flex-start; } }

/* ---------- Mi bot: asistente, prueba y datos ---------- */
.mibot-body { min-width: 0; }
.assist-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.assist-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: min(72dvh, 760px); }
.test-main { max-width: 760px; }
.assist-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.assist-head .btn { margin-left: auto; }
.assist-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--accent-ink); }
.assist-badge.test { color: var(--text-2); }
.assist-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }
.assist-messages { flex: 1; }
.assist-composer { border-top: 1px solid var(--line); }
.assist-intro { list-style: none; align-self: stretch; display: grid; gap: 8px; padding: 14px 16px; margin-bottom: 6px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.assist-intro .chips { margin-top: 4px; }
.assist-side { display: grid; gap: 12px; position: sticky; top: 0; }
.assist-note { padding: 0 4px; }
.proposals { display: grid; gap: 10px; }
.proposals-title { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--accent-ink); }
.proposal { display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.proposal header { display: grid; gap: 2px; }
.proposal-value { width: 100%; font-size: 14px; }
.proposal-before summary, .privacy summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.proposal-before p { margin-top: 6px; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.proposal-product { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.proposal-product dt { color: var(--muted); }
.proposal-product dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.test-handoff { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12.5px; }
.msg.typing { padding: 10px 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.correct-quote { padding: 10px 12px; background: var(--bubble-bot); border-radius: var(--r); display: grid; gap: 4px; }
.correct-quote p { white-space: pre-wrap; font-size: 14px; }
.mibot-data { display: grid; gap: 18px; max-width: 880px; }
.hours-control { display: grid; gap: 10px; }
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-check { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.day-check input { margin: 0; }
.hours-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.hours-range select { width: auto; }
.products-tools { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.products-tools .search-box { flex: 1; margin: 0; }
.change-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.change-list li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.privacy ul, .privacy-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check-row input { width: auto; margin: 0; }
@media (max-width: 1100px) {
  .assist-layout { grid-template-columns: minmax(0, 1fr); }
  .assist-side { position: static; order: -1; }
}
@media (max-width: 760px) {
  .assist-main { height: calc(100dvh - 300px); min-height: 360px; border-radius: var(--r); }
  .assist-head { padding: 10px 12px; }
  .nav-item { font-size: 10.5px; }
}

/* ---------- Ajustes → Conexiones ---------- */
.conn { display: grid; gap: 10px; }
.conn-group { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.conn-group > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.conn-group > summary::-webkit-details-marker { display: none; }
.conn-group > summary strong { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.conn-group[open] > summary { margin-bottom: 10px; }
.conn-keys { display: grid; gap: 12px; margin: 10px 0; }
.conn-key { display: grid; gap: 6px; }
.conn-key-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conn-key-input { display: flex; gap: 6px; }
.conn-key-input input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.conn-shown { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; overflow-wrap: anywhere; }
.conn-webhook { display: grid; gap: 8px; padding: 12px; margin: 6px 0 10px; border-radius: var(--r-sm); background: var(--accent-soft); }

/* ---------- registro ---------- */
.login-alt { text-align: center; font-size: 14px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-ok { color: var(--ok-ink); background: var(--ok-bg); padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }

/* ---------- panel maestro ---------- */
.master-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.master-kpis .kpi-value { font-size: 22px; }
.kpi.warn { border-color: var(--warn-ink); background: var(--warn-bg); }
.master-table tr.clickable { cursor: pointer; }
.master-table tr.clickable:hover, .master-table tr.clickable:focus { background: var(--surface-2); outline: none; }
.conn-dots { display: inline-flex; gap: 3px; }
.cdot { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.cdot.ok, .cdot.plataforma { background: var(--ok-bg); color: var(--ok-ink); }
.cdot.error { background: var(--err-bg); color: var(--err-ink); }
.cdot.incompleta { background: var(--warn-bg); color: var(--warn-ink); }
.master-detail { display: grid; gap: 14px; }
.master-detail h3 { font-size: 14px; margin: 12px 0 6px; }
.master-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.master-head .form-actions { margin-left: auto; }
.master-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.master-errors { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; color: var(--err-ink); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding: 6px; background: var(--surface-2); border-radius: var(--r-sm); }
.bar { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; }
.bar span { flex: 1; border-radius: 2px 2px 0 0; min-height: 1px; }
.bar-in { background: var(--accent); }
.bar-out { background: var(--cold); }
.user-row { display: flex !important; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-shown.big { font-size: 18px; letter-spacing: .04em; padding: 8px 12px; }
@media (max-width: 760px) { .master-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- asistente de conexión ---------- */
.wizard .page-head .link { margin-bottom: 6px; }
.wizard-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 6px; overflow-x: auto; }
.wizard-steps li button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.wizard-steps li.on button { border-color: var(--accent); color: var(--text); font-weight: 650; }
.wizard-steps li.done .wz-n { background: var(--ok-bg); color: var(--ok-ink); }
.wz-n { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); font-size: 11.5px; font-weight: 700; }
.wizard-body { display: grid; gap: 14px; max-width: 760px; }
.wizard-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.form-actions.left { justify-content: flex-start; }
.wizard-nav { border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 760px) { .wz-t { display: none; } .wizard-steps li.on .wz-t { display: inline; } }
button.seg-tab { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
button.seg-tab.on { background: var(--surface); }
@media (max-width: 760px) {
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 1 0 auto; min-width: 46px; }
  .nav-label { white-space: nowrap; }
}

/* ---------- equipo: asignación ---------- */
.pill.assignee { background: var(--bubble-human); color: var(--text); gap: 3px; }
.assign-select { max-width: 150px; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team-who { display: grid; gap: 2px; min-width: 0; }
.team-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.check-row.perm { font-weight: 500; font-size: 14px; }
.sub-h { font-size: 15px; margin-top: 10px; }

/* ---------- publicaciones ---------- */
.post-list { display: grid; gap: 10px; }
.post-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.post-thumb { width: 72px; height: 72px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.post-thumb.text { font-size: 22px; font-weight: 700; }
.post-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-caption { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-results { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.post-actions { display: flex; flex-direction: column; gap: 4px; }
.post-preview { display: grid; gap: 6px; justify-items: start; }
.post-preview img, .post-preview video { max-width: 100%; max-height: 260px; border-radius: 10px; }
@media (max-width: 760px) { .post-card { flex-wrap: wrap; } .post-actions { flex-direction: row; width: 100%; } }
.msg.note { align-self: center; max-width: min(86%, 560px); background: var(--warn-bg); color: var(--warn-ink); border: 1px dashed color-mix(in srgb, var(--warn-ink) 40%, transparent); }
.note-head { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; margin-bottom: 2px; }
.icon-btn.on { background: var(--warn-bg); color: var(--warn-ink); }

.health-row { display: inline-flex; align-items: center; gap: 6px; }
.health { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok-ink); }
.health.amarillo { background: var(--warm); }
.health.rojo { background: var(--err-ink); }
.master-audit summary { cursor: pointer; font-weight: 650; font-size: 14px; }

/* ================= Agenda, caja y ajustes del negocio (módulos; antes app de K Nails) ================= */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 11px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.small button { padding: 4px 10px; font-size: 13px; }
.ok-notice { background: var(--ok-bg); color: var(--ok-ink); }

/* colores de manicuristas */
.c-rose { --c: #d0567f; } .c-plum { --c: #8e4fa8; } .c-peach { --c: #e08a5b; } .c-mint { --c: #3aa38a; }
.c-sky { --c: #4a8fd6; } .c-lilac { --c: #a083d6; } .c-sand { --c: #b8955a; } .c-coral { --c: #e0635a; } .c-none { --c: var(--accent); }
.color-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
/* ---------- agenda ---------- */
.agenda { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.agenda-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px 12px; flex-wrap: wrap; }
.agenda-nav { display: flex; align-items: center; gap: 4px; }
.agenda-title { font-size: 20px; flex: 1; min-width: 180px; }
.agenda-tools { display: flex; align-items: center; gap: 8px; }
.date-pick { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--text-2); cursor: pointer; }
.date-pick:hover { background: var(--surface-2); }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; }
.agenda-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 24px 16px; gap: 8px; }
.ag-summary { padding-left: 2px; }
.ag-scroll { flex: 1; min-height: 0; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overscroll-behavior: contain; }
.ag-grid { --head: 44px; position: relative; display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(150px, 1fr)); grid-template-rows: var(--head) auto; min-width: min-content; }
.ag-corner, .ag-chair { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); height: var(--head); }
.ag-corner { left: 0; z-index: 4; }
.ag-chair { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 650; font-size: 14px; border-left: 1px solid var(--line); }
.ag-chair .ic { color: var(--accent-ink); }
.ag-chair .count:not(:empty) { font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.ag-times { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.ag-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ag-times span:first-child { transform: none; }
.ag-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.ag-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.ag-line.half { border-top-style: dashed; opacity: .6; }
.ag-col:hover { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.ag-appt {
  position: absolute; left: 4px; right: 4px; z-index: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden;
  padding: 5px 8px; border-radius: 9px; cursor: grab; user-select: none; touch-action: pan-y; font-size: 12.5px; line-height: 1.3;
  background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--text); border-left: 4px solid var(--c); box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.ag-appt:hover { box-shadow: var(--shadow); }
.ag-appt strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-appt span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-appt .ag-svc { white-space: normal; color: var(--muted); }
.ag-appt.dragging, .ag-appt.lifted { z-index: 5; box-shadow: var(--shadow-lg); cursor: grabbing; opacity: .95; touch-action: none; }
.ag-appt.st-confirmada { border-left-style: double; border-left-width: 6px; }
.ag-appt.st-llego { outline: 2px solid var(--c); outline-offset: -2px; }
.ag-appt.st-terminada { opacity: .7; }
.ag-appt.st-cancelada, .ag-appt.st-no_vino { opacity: .45; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.ag-appt.st-cancelada strong, .ag-appt.st-no_vino strong { text-decoration: line-through; }
.ag-paid { position: absolute; top: 4px; right: 5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-ink); color: #fff; }
.ag-now { position: absolute; left: 58px; right: 0; height: 2px; background: var(--hot); z-index: 2; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--hot); }

.week { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; }
.week-day { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.week-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.week-day.closed { background: var(--surface-2); }
.week-head { display: grid; justify-items: center; gap: 0; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--text); cursor: pointer; border-radius: var(--r) var(--r) 0 0; }
.week-head:hover { background: var(--surface-2); }
.week-head > span:first-child { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
.week-head strong { font-size: 20px; }
.week-head .count { font-size: 11.5px; color: var(--accent-ink); font-weight: 600; min-height: 16px; }
.week-list { display: grid; gap: 6px; padding: 8px; align-content: start; overflow-y: auto; }
.week-appt { display: grid; gap: 1px; text-align: left; padding: 6px 8px; border: 0; border-left: 3px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.week-appt span { color: var(--muted); font-size: 11.5px; }
.week-appt.st-cancelada, .week-appt.st-no_vino { opacity: .5; text-decoration: line-through; }
.week-add { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; border: 1px dashed var(--line-strong); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.week-add:hover { color: var(--accent-ink); border-color: var(--accent); }

/* detalle y formulario de cita */
.appt-detail { display: grid; gap: 16px; }
.appt-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appt-who > div { display: grid; margin-right: auto; }
.appt-who strong { font-size: 18px; }
.appt-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.appt-facts li { display: flex; gap: 8px; align-items: flex-start; }
.appt-facts .ic { color: var(--accent-ink); margin-top: 2px; }
.svc-pick { display: grid; gap: 10px; max-height: 260px; overflow-y: auto; padding: 2px; }
.svc-group { display: grid; gap: 6px; }
.svc-cat { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chip.svc { display: inline-grid; justify-items: start; gap: 0; border-radius: 12px; padding: 6px 12px; white-space: normal; text-align: left; }
.chip.svc.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.svc-meta { font-size: 11.5px; font-weight: 500; opacity: .8; }
.client-box { display: grid; gap: 8px; }
.client-results { display: grid; gap: 4px; }
.client-results:empty { display: none; }
.client-opt { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; color: inherit; cursor: pointer; text-align: left; }
.client-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.client-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); flex-wrap: wrap; }
.client-chosen .link { margin-left: auto; }

/* ---------- clientas ---------- */
.split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); height: 100%; }
.split-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.pane-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 16px 12px; }
.search-box { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); background: var(--surface); }
.search-input { border: 0 !important; box-shadow: none !important; background: transparent; padding: 9px 0; }
.client-list { list-style: none; margin: 0; padding: 4px 8px; overflow-y: auto; flex: 1; }
.client-row { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; color: inherit; }
.client-row > div { display: grid; min-width: 0; }
.client-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-row:hover { background: var(--surface-2); }
.client-list li.active .client-row { background: var(--accent-soft); }
.client-detail { min-width: 0; min-height: 0; overflow: hidden; }
.client-detail > .page > * + * { margin-top: 14px; }
.back-link { display: none; align-items: center; gap: 4px; font-weight: 600; }
.client-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.client-head > div:nth-child(2) { flex: 1; min-width: 180px; }
.client-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.small-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.small-kpis .kpi-value { font-size: 22px; }
.stamps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.stamp { aspect-ratio: 1; max-width: 52px; display: grid; place-items: center; border-radius: 50%; border: 2px dashed var(--line-strong); font-size: 12px; font-weight: 700; color: var(--muted); }
.stamp.done { background: var(--accent); border: 2px solid var(--accent); color: var(--accent-text); }
.stamp.reward { border-color: var(--accent); color: var(--accent-ink); }
.stamp.reward.done { color: var(--accent-text); }
.stamp.next { box-shadow: 0 0 0 3px var(--accent-soft); border-style: solid; border-color: var(--accent); }
.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history li > div { display: grid; flex: 1; min-width: 0; }
.history li.canceled { opacity: .5; }
.history-amount { font-weight: 700; color: var(--text); background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.history-amount:hover { background: var(--surface-2); }
.pill.st-confirmada, .pill.st-llego { background: var(--accent-soft); color: var(--accent-ink); }
.pill.st-terminada { background: var(--ok-bg); color: var(--ok-ink); }
.pill.st-cancelada, .pill.st-no_vino { background: var(--err-bg); color: var(--err-ink); }

/* ---------- caja ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); grid-template-rows: minmax(0, 1fr); gap: 16px; height: 100%; overflow: hidden; padding: 20px 24px 0; }
.pos-main, .pos-right { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 40px; }
.pos-main { display: grid; gap: 16px; align-content: start; }
.pos-left { display: grid; gap: 14px; min-width: 0; }
.pos-sales { min-width: 0; }
.pos-right .cart { overflow-x: hidden; }
.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.session-bar.open { background: var(--ok-bg); border-color: transparent; }
.session-bar.open strong { color: var(--ok-ink); }
.pending-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pending-item { display: grid; gap: 2px; text-align: left; min-width: 170px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.pending-item:hover, .pending-item.on { border-color: var(--accent); background: var(--accent-soft); }
.pending-item.arrived { border-left: 4px solid var(--accent); }
.catalog-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.catalog-head .search-box { margin: 0; flex: 1; min-width: 160px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.catalog-item { display: grid; gap: 4px; align-content: start; text-align: left; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font: inherit; color: inherit; cursor: pointer; transition: transform .05s, border-color .15s; }
.catalog-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.catalog-item:active { transform: scale(.98); }
.catalog-item strong { font-size: 14px; line-height: 1.25; }
.catalog-item > span { font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.cart { display: grid; gap: 14px; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-head h2 { display: flex; align-items: center; gap: 8px; }
.cart-lines { display: grid; gap: 6px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 88px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.cart-name { display: grid; min-width: 0; }
.cart-name strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 2px; }
.qty span { min-width: 18px; text-align: center; font-weight: 700; }
.qty .icon-btn { width: 30px; height: 30px; }
.cart-line .price { padding: 6px 8px; text-align: right; }
.cart-empty { padding: 18px 4px; text-align: center; }
.cart-summary { display: grid; gap: 10px; }
.loyal-banner { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; font-size: 14px; }
.disc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.disc-row .field-label { min-width: 74px; }
.disc-row input, input.pct { width: 110px; }
.totals { display: grid; gap: 4px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.t-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.t-line.big { font-size: 22px; color: var(--text); margin-top: 4px; }
.pay { display: grid; gap: 8px; }
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); width: 100%; }
.methods button { min-width: 0; padding: 9px 8px; }
.methods button.on { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.cash { display: grid; gap: 8px; }
.change { font-size: 16px; color: var(--ok-ink); }
.charge { padding: 14px; font-size: 16px; border-radius: 12px; }
.cut-grid { display: grid; gap: 2px; }
.cut-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cut-row span:last-child { font-weight: 600; text-align: right; }
.cut-row.strong { font-size: 16px; font-weight: 700; border-bottom: 0; }

/* ---------- reportes ---------- */
.days-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.day-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.day-bar { width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: var(--accent); }
.day-label { font-size: 10.5px; color: var(--muted); }

/* ---------- ajustes ---------- */
.branch-card { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.branch-card.off, .edit-row.off, .chair-row.off { opacity: .55; }
.hours-row { display: grid; grid-template-columns: 96px 110px 138px 14px 138px; justify-content: start; gap: 8px; align-items: center; font-size: 14px; }
.hours-row input[type="time"] { padding: 6px 8px; }
.switch.small { font-size: 13px; font-weight: 500; gap: 6px; }
.switch.small .switch-ui { width: 34px; height: 20px; }
.switch.small .switch-ui::after { width: 14px; height: 14px; }
.switch.small input:checked + .switch-ui::after { transform: translateX(14px); }
.chair-list { display: grid; gap: 6px; }
.chair-row { display: flex; align-items: center; gap: 8px; }
.chair-row input { flex: 1; }
.chair-row .ic { color: var(--accent-ink); }
.edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.edit-row > input { flex: 1; min-width: 120px; }
.edit-row select { width: auto; }
.svc-row > input:first-child { flex: 2; min-width: 160px; }
.with-unit { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.with-unit input { width: 90px; }
.rule-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.rule-row input { width: 72px; }
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
input.color { width: 64px; height: 40px; padding: 3px; }

/* ---------- pantallas medianas ---------- */

@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
}
@media (max-width: 900px) {
  /* Celular / pantalla angosta: una sola columna que se desplaza completa (catálogo, venta, ventas de hoy) */
  .pos { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; overflow-y: auto; padding-bottom: 40px; }
  .pos-main { display: contents; }
  .pos-main, .pos-right { overflow: visible; padding-bottom: 0; min-height: auto; }
  .pos-left { order: 1; }
  .pos-right { order: 2; }
  .pos-sales { order: 3; }
}
@media (max-width: 760px) {
  .agenda-head { padding: calc(12px + env(safe-area-inset-top)) 16px 8px; gap: 8px; }
  .agenda-title { order: -1; flex-basis: 100%; font-size: 18px; }
  .agenda-tools { margin-left: auto; }
  .agenda-body { padding: 0 8px 8px; }
  .ag-grid { grid-template-columns: 46px repeat(var(--cols), minmax(132px, 1fr)); }
  .ag-now { left: 46px; }
  .week { grid-template-columns: 1fr; }
  .week-day { min-height: auto; }
  .week-head { grid-template-columns: auto auto 1fr; justify-items: start; align-items: baseline; gap: 8px; }
  .week-head .count { justify-self: end; }
  .pos { padding: calc(14px + env(safe-area-inset-top)) 12px 24px; gap: 12px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hours-row { display: flex; flex-wrap: wrap; gap: 6px 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .hours-row > span:first-child { width: 84px; font-weight: 600; }
  .hours-row input[type="time"] { flex: 1; min-width: 110px; }
}

/* ---------- ticket de caja (impresión de 80 mm) ---------- */
#print-area { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  .pticket { width: 72mm; margin: 0 auto; padding: 3mm 0 6mm; color: #000; font: 12px/1.35 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
  .pt-logo { display: block; max-width: 36mm; max-height: 20mm; margin: 0 auto 2mm; filter: grayscale(1); }
  .pt-center { text-align: center; }
  .pt-logo { display: block; max-width: 70%; margin: 0 auto 2mm; }
  .pt-big { font-size: 15px; font-weight: 700; }
  .pt-small { font-size: 10px; }
  .pt-pre { white-space: pre-wrap; }
  .pt-note { margin-top: 2mm; font-weight: 700; }
  .pt-sep { border-top: 1px dashed #000; margin: 2mm 0; }
  .pt-row { display: flex; justify-content: space-between; gap: 4mm; }
  .pt-item { margin-bottom: 1mm; }
}

/* utilidades de las vistas de negocio */
.stack { display: grid; gap: 10px; }
.form-actions.spread { justify-content: space-between; flex-wrap: wrap; }
.ok-text { color: var(--ok-ink); }
.push { margin-left: auto; }
.panel h2 .push { font-weight: 500; }
.mod-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mod-row:last-child { border-bottom: 0; }
.mod-row > div { display: grid; gap: 2px; }
.pay-bar { display: block; height: 8px; border-radius: 999px; background: var(--accent); min-width: 2px; }

/* ver contraseña */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
button.kpi { font: inherit; text-align: left; color: inherit; cursor: pointer; width: 100%; }
button.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
button.kpi { transition: box-shadow .15s, transform .15s; }
.mod-row { align-items: flex-start; }
.mod-row strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-row.locked strong { color: var(--text-2); }
.mod-includes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 2px; }

/* La casilla invisible de cada interruptor queda dentro de su interruptor (antes se salía y hacía desplazable
   toda la página: al llegar al final se recorría el panel completo, menú incluido). */
.switch { position: relative; }
/* El panel ocupa la pantalla: solo se desplaza el contenido de cada sección, nunca la página entera */
html:has(#shell:not([hidden])), html:has(#shell:not([hidden])) body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.page, .settings-nav, .ag-scroll, .week, .pos { overscroll-behavior: contain; }

/* gastos y sueldos */
.fin-range { flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.fin-range input[type="date"] { width: auto; }
.fin-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 8px; }
.fin-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.fin-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fin-bars span { width: 40%; max-width: 22px; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.fin-in, .fin-key.in { background: var(--accent); }
.fin-out, .fin-key.out { background: var(--hot); opacity: .75; }
.fin-profit { font-size: 11px; font-weight: 700; color: var(--ok-ink); white-space: nowrap; }
.fin-profit.neg { color: var(--err-ink); }
.fin-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.fin-legend { margin-top: 8px; }

/* importar lista de precios */
.pl-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-thumbs:empty { display: none; }
.pl-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.pl-table input, .pl-table select { width: 100%; min-width: 64px; padding: 6px 8px; }
.pl-table td:nth-child(2) { min-width: 180px; }
.pl-table tr.pl-off { opacity: .45; }
.pl-note { color: var(--warn-ink); }
.products-tools { flex-wrap: wrap; }
.pl-empty { display: grid; gap: 6px; justify-items: start; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--r); margin-bottom: 10px; }
.pl-empty p { margin: 0; }
.catalog-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.chair-row .chair-who { width: auto; max-width: 46%; }
.ag-chair .ag-who { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ag-chair { flex-wrap: wrap; text-align: center; }
.comm-btn { white-space: nowrap; }
.table td.num .cell-sub { text-align: right; }
.rule-row .with-unit input[aria-label="Desde"] { width: 110px; }

/* Ajustes: una sección a la vez */
.settings-nav a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.settings-pick { display: none; margin-bottom: 14px; font-weight: 600; }
@media (max-width: 1100px) { .settings-pick { display: block; width: 100%; } }

/* Logo del ticket en Ajustes */
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-prev { max-width: 200px; max-height: 110px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
