/* Basado en el diseño de las demos de Dokko y NexoFlow. La marca se elige con html[data-brand]. */
:root { --ink: #0B1F33; --blue: #2F6BFF; --blue-soft: #e8efff; --wa: #25D366; --line: #e3e8f0; --paper: #F7F9FC; --muted: #5b6b80; --radius-btn: 999px; --font: Poppins, "Segoe UI", sans-serif; --head-bg: var(--ink); --head-fg: #fff; --btn-fg: #fff; }
html[data-brand="nexoflow"] { --ink: #020617; --blue: #0891b2; --blue-soft: #ecfeff; --wa: #06b6d4; --line: #e2e8f0; --paper: #f8fafc; --muted: #64748b; --radius-btn: 10px; --font: Figtree, "Segoe UI", sans-serif; --head-bg: #fff; --head-fg: #020617; --btn-fg: #042f2e; }
html { color: var(--ink); background: var(--paper); font-family: var(--font); }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--ink) 0 45%, var(--paper) 45%); }
html[data-brand="nexoflow"] .login { background: linear-gradient(180deg, #ecfeff, var(--paper)); }
.panel { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; gap: 10px; box-shadow: 0 30px 60px -30px rgba(11,31,51,.45); }
.tabs { display: flex; gap: 6px; background: var(--paper); border-radius: 999px; padding: 4px; }
.tabs button { flex: 1; border: 0; background: transparent; border-radius: 999px; min-height: 38px; font-weight: 700; cursor: pointer; }
.tabs button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); color: var(--blue); }
h1 { margin: 0; letter-spacing: -0.03em; }
h2 { margin: 0 0 8px; letter-spacing: -0.02em; }
h3 { margin: 0 0 6px; }
.kicker { color: var(--blue); font-weight: 800; margin: 0; }
html[data-brand="nexoflow"] .kicker { color: #0891b2; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.6; }
.err { background: #fff1f2; color: #9f1239; border-radius: 10px; padding: 8px 10px; margin: 0; }
.ok { background: #ecfdf5; color: #065f46; border-radius: 10px; padding: 8px 10px; margin: 0; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; min-height: 0; }
input, textarea, select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
.btn { background: var(--blue); color: #fff; border: 0; border-radius: var(--radius-btn); min-height: 44px; padding: 0 18px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
html[data-brand="nexoflow"] .btn { background: #06b6d4; color: #042f2e; font-weight: 800; }
.btn.wa { background: #1a7f37; color: #fff; }
.btn.danger { background: #be123c; color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.ghost { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-btn); min-height: 40px; padding: 0 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; color: var(--ink); }
.ghost.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
header#top { display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--head-bg); color: var(--head-fg); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
header#top .logo { color: var(--head-fg); font-weight: 800; font-size: 20px; text-decoration: none; }
header#top .ghost { background: transparent; color: var(--head-fg); border-color: rgba(127,127,127,.35); }
.grow { flex: 1; }
.pill { background: rgba(37,211,102,.16); color: #b9f5cf; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.off { background: rgba(251,146,60,.18); color: #fed7aa; }
.pill.link { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
html[data-brand="nexoflow"] .pill { background: #ecfeff; color: #0e7490; }
html[data-brand="nexoflow"] .pill.off { background: #fff7ed; color: #9a3412; }
html[data-brand="nexoflow"] .pill.link { background: #f1f5f9; color: #020617; }
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 60px); }
nav#nav { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: #fff; border-right: 1px solid var(--line); }
nav#nav button { text-align: left; border: 0; background: transparent; border-radius: 10px; min-height: 40px; padding: 0 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }
nav#nav button.on { background: var(--blue-soft); color: var(--blue); }
nav#nav button .lock { margin-left: auto; font-size: 12px; opacity: .6; }
nav#nav .sep { height: 1px; background: var(--line); margin: 6px 0; }
main { padding: 14px; min-width: 0; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.box + .grid, .box + .box, .grid + .box, .grid + .grid, .kpis + .box { margin-top: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.go { text-align: left; cursor: pointer; }
.warn { background: #fff7ed; border-radius: 12px; padding: 10px; }
.info { background: var(--blue-soft); border-radius: 12px; padding: 10px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.kpi b { display: block; font-size: 28px; }
.kpis > .box, .grid > .box { margin-top: 0; }
.inbox { display: grid; grid-template-columns: 270px 1fr 280px; gap: 12px; min-height: 70vh; }
.col { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.chat { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 12px; cursor: pointer; }
.chat.on { background: var(--blue-soft); }
.chat .ch { font-size: 11px; font-weight: 700; color: #1a7f37; }
.chat .prev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 12px; flex: 1; min-height: 300px; max-height: 60vh; overflow-y: auto; background: #f4f7f2; }
html[data-brand="nexoflow"] .msgs { background: #f8fafc; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.05); white-space: pre-wrap; word-wrap: break-word; }
.bubble.out { margin-left: auto; background: #d9fdd3; }
.bubble.bot { margin-left: auto; background: #e8efff; }
html[data-brand="nexoflow"] .bubble.out { background: #cffafe; }
.bubble small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.bubble.failed { outline: 1px solid #fda4af; }
.composer { display: grid; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.composer .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px 0; background: #fff; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.side { padding: 14px; display: grid; gap: 8px; align-content: start; }
.board { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 280px; }
.lane.over { outline: 2px dashed var(--blue); }
.lane .lh { display: flex; justify-content: space-between; font-weight: 800; gap: 6px; }
.lane[data-stage="Ganado"] .lh { color: #15803d; }
.lane[data-stage="Perdido"] .lh { color: #be123c; }
.deal { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; cursor: grab; }
.deal.dragging { opacity: .5; }
.deal .move { display: flex; gap: 4px; margin-top: 6px; }
.deal .move button { border: 1px solid var(--line); background: #fff; border-radius: 8px; min-height: 30px; padding: 0 10px; cursor: pointer; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > button, .row > .btn, .row > .ghost { flex: 0 0 auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); }
.tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; background: var(--blue-soft); color: var(--blue); margin: 1px 2px 1px 0; }
.tag.plan { background: #fff1e6; color: #9a3412; }
.tag.green { background: #dcfce7; color: #166534; }
.tag.red { background: #ffe4e6; color: #9f1239; }
.tag.gray { background: #f1f5f9; color: #475569; }
.toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 50; max-width: 90vw; }
html[data-brand="nexoflow"] .toast { background: #0e7490; }
.toast.bad { background: #9f1239; }
.drawer-bg { position: fixed; inset: 0; background: rgba(2,6,23,.4); z-index: 20; display: flex; justify-content: flex-end; }
.drawer { width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--paper); padding: 16px; display: grid; gap: 12px; align-content: start; }
.bar { height: 10px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); }
.code { font-family: ui-monospace, Menlo, monospace; background: #f1f5f9; padding: 6px 8px; border-radius: 8px; word-break: break-all; font-size: 13px; }
.locked { text-align: center; padding: 30px 16px; }
@media (max-width: 1100px) { .inbox { grid-template-columns: 240px 1fr; } .inbox .side { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  nav#nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
  nav#nav button { white-space: nowrap; }
  nav#nav .sep { display: none; }
  .inbox { grid-template-columns: 1fr; }
  .inbox .col:first-child { max-height: 260px; }
  .board { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; }
  .lane { scroll-snap-align: start; }
  header#top { position: static; gap: 6px; padding: 8px 10px; }
  header#top .ghost { min-height: 34px; padding: 0 10px; font-size: 13px; }
  header#top .logo { font-size: 18px; }
  .hide-sm { display: none; }
}
