/* CRM Das Nações · estilos (modo día / noche) */
:root {
  --brand: #12312b; --brand-2: #1f4a41; --gold: #d9b56a; --gold-2: #b48a2c;
  --bg: #f4f1ea; --panel: #ffffff; --panel-2: #faf8f4; --line: #ebe7de; --line-2: #f3f1ec;
  --text: #1d2421; --muted: #6c736e; --muted-2: #8c918d;
  --chat-bg: #efeae2; --dots: rgba(0,0,0,.035);
  --in: #ffffff; --out: #d9fdd3; --note: #fff7d6; --note-line: #f0dc8c; --note-text: #6b5a14;
  --green: #25a35a; --blue: #2f6fd6; --red: #c92a2a; --orange: #e08a00; --purple: #6741d9;
  --chip: #f2f0eb; --hover: #f6f4ef; --sel: #eef5f1; --shadow: 0 8px 28px rgba(40,35,20,.12);
  --input: #ffffff; --rail: #12312b; --rail-icon: #9fb7b0;
  --wa: #25a35a; --ig: #d6336c; --mail: #2f6fd6;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1513; --panel: #111b18; --panel-2: #0f1816; --line: #22302c; --line-2: #1a2522;
  --text: #e7ece9; --muted: #9aa8a2; --muted-2: #7c8a84;
  --chat-bg: #0b1210; --dots: rgba(255,255,255,.035);
  --in: #1c2724; --out: #144d37; --note: #3a3216; --note-line: #5c4f1c; --note-text: #f0dfa0;
  --chip: #1d2926; --hover: #17221f; --sel: #183029; --shadow: 0 8px 28px rgba(0,0,0,.45);
  --input: #18231f; --rail: #0a1210; --rail-icon: #7f9a93;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0d1513; --panel: #111b18; --panel-2: #0f1816; --line: #22302c; --line-2: #1a2522;
    --text: #e7ece9; --muted: #9aa8a2; --muted-2: #7c8a84;
    --chat-bg: #0b1210; --dots: rgba(255,255,255,.035);
    --in: #1c2724; --out: #144d37; --note: #3a3216; --note-line: #5c4f1c; --note-text: #f0dfa0;
    --chip: #1d2926; --hover: #17221f; --sel: #183029; --shadow: 0 8px 28px rgba(0,0,0,.45);
    --input: #18231f; --rail: #0a1210; --rail-icon: #7f9a93;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Botones / inputs ---------- */
a.btn { text-decoration: none; color: inherit; }
a.btn.pr { color: #fff; } a.btn.gd { color: #12312b; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.pr { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn.pr { background: #2f6f61; border-color: #2f6f61; }
.btn.gd { background: var(--gold); border-color: var(--gold); color: #12312b; }
.btn.gr { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--input); border-radius: 9px; padding: 8px 11px; outline: none; }
.input:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(217,181,106,.25); }
label.fl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 16px; background: var(--chip); color: var(--muted); border: 0; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .chip.on { background: #2f6f61; }
.chip .c { background: var(--green); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; }
.chip.on .c { background: var(--gold); color: #12312b; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px; margin: 3px 3px 0 0; }
.tag button { border: 0; background: none; cursor: pointer; padding: 0; color: inherit; opacity: .6; }
.flag { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; letter-spacing: .02em; min-width: 22px; height: 14px; padding: 0 3px; border-radius: 3px; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.5); vertical-align: middle; }
.chb { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; flex: none; }
.chb.wa { background: var(--wa); } .chb.ig { background: var(--ig); } .chb.mail { background: var(--mail); }
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; }
.ub { background: var(--green); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-2); font-weight: 700; margin-bottom: 8px; }
:root[data-theme="dark"] .lbl { color: var(--gold); }

/* ---------- Login ---------- */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; background: var(--brand); padding: 20px; }
.login .box { background: var(--panel); border-radius: 16px; padding: 30px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login img { height: 64px; display: block; margin: 0 auto 6px; }
.login h1 { font-size: 18px; text-align: center; margin: 6px 0 18px; }
.login .err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- Shell ---------- */
.shell { display: flex; height: 100vh; height: 100dvh; }
.rail { width: 64px; background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; flex: none; }
.rail .logo { width: 44px; margin-bottom: 10px; }
.rail a, .rail button { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--rail-icon); position: relative; border: 0; background: transparent; cursor: pointer; text-decoration: none; }
.rail a.on, .rail a:hover, .rail button:hover { background: #1f4a41; color: #fff; }
.rail .bd { position: absolute; top: 2px; right: 1px; background: var(--green); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 8px; padding: 1px 5px; }
.rail .sp { flex: 1; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.page { flex: 1; overflow: auto; padding: 20px 24px; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-h h2 { margin: 0; font-size: 21px; }
.bottom-nav { display: none; }

/* ---------- Chats ---------- */
.chats { display: flex; flex: 1; height: 100%; min-height: 0; }
.clist { width: 360px; flex: none; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.clist .top { padding: 14px 14px 8px; }
.clist .top h3 { margin: 0; font-size: 19px; display: flex; align-items: center; justify-content: space-between; }
.search { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 9px; padding: 7px 10px; margin-top: 10px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; }
.tabs { display: flex; gap: 5px; padding: 2px 14px 8px; flex-wrap: wrap; }
.chfilter { display: flex; gap: 6px; padding: 0 14px 8px; }
.chfilter .chip { padding: 3px 8px; }
.items { flex: 1; overflow-y: auto; }
.item { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; position: relative; }
.item:hover { background: var(--hover); }
.item.sel { background: var(--sel); }
.item .avw { position: relative; align-self: flex-start; width: 34px; height: 34px; flex: none; }
.item .avw .chb { position: absolute; right: -4px; bottom: -4px; border: 2px solid var(--panel); }
.item .nm { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.item .ms { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--muted-2); flex: none; }
.item .rt.un { color: var(--green); font-weight: 600; }
.item.unread .nm { font-weight: 700; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.conv { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--chat-bg); }
.ch { background: var(--panel); padding: 9px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); min-height: 60px; }
.ch .nm { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ch .sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.ch .act { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ch select.input { width: auto; padding: 6px 8px; font-size: 12.5px; font-weight: 600; }
.timer { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 10px; display: inline-flex; gap: 4px; align-items: center; }
.timer.sm { font-size: 10px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.timer.big { font-size: 12.5px; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.timer.big .tl { font-weight: 500; opacity: .85; }
.timer.ok { background: rgba(37,163,90,.14); color: var(--green); }
.timer.warn { background: rgba(224,138,0,.15); color: var(--orange); }
.timer.off { background: rgba(201,42,42,.12); color: var(--red); }
.msgs { flex: 1; overflow-y: auto; padding: 14px 6%; display: flex; flex-direction: column; gap: 4px; background-image: radial-gradient(var(--dots) 1px, transparent 1px); background-size: 14px 14px; }
.day { align-self: center; background: var(--panel); font-size: 11.5px; color: var(--muted); padding: 4px 10px; border-radius: 7px; box-shadow: 0 1px 1px rgba(0,0,0,.06); margin: 8px 0; }
.b { max-width: 65%; padding: 6px 9px 5px; border-radius: 9px; font-size: 14px; line-height: 1.38; box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.b .txt { white-space: pre-wrap; }
.b.in { background: var(--in); align-self: flex-start; border-top-left-radius: 2px; }
.b.out { background: var(--out); align-self: flex-end; border-top-right-radius: 2px; }
.b.note { background: var(--note); color: var(--note-text); border: 1px dashed var(--note-line); align-self: flex-end; }
.b .who { font-size: 11px; font-weight: 700; margin-bottom: 2px; color: var(--green); }
.b.note.summ { align-self: center; max-width: min(460px, 92%); border-style: solid; border-left: 4px solid var(--gold, #c9a227); }
.b.note .who { color: var(--note-text); }
.b .meta { font-size: 10.5px; color: var(--muted-2); float: right; margin: 6px 0 -2px 10px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.b img.media { max-width: 280px; max-height: 320px; border-radius: 6px; display: block; cursor: zoom-in; }
.b audio, .b video { max-width: 280px; display: block; }
.b .doc { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; background: rgba(0,0,0,.05); text-decoration: none; color: inherit; }
.b.failed { outline: 1px solid var(--red); }
.react { position: absolute; bottom: -12px; left: 10px; background: var(--panel); border-radius: 10px; padding: 0 5px; font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.b.has-react { margin-bottom: 12px; }
.sys { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--panel); padding: 3px 10px; border-radius: 7px; margin: 4px 0; opacity: .9; }
.comp { background: var(--panel-2); padding: 8px 12px; display: flex; align-items: flex-end; gap: 6px; border-top: 1px solid var(--line); position: relative; }
.comp textarea { flex: 1; border: 0; background: var(--input); border-radius: 10px; padding: 10px 12px; resize: none; max-height: 140px; min-height: 42px; outline: none; line-height: 1.35; }
.comp.note-mode textarea { background: var(--note); color: var(--note-text); }
.comp .send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.banner { background: var(--note); color: var(--note-text); border-top: 1px solid var(--note-line); padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.popup { position: absolute; bottom: 58px; left: 12px; right: 12px; max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 300px; overflow: auto; z-index: 20; }
.popup .opt { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.popup .opt:hover, .popup .opt.act { background: var(--hover); }
.popup .opt b { font-size: 12.5px; }
.popup .opt div { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side { width: 340px; flex: none; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border: 0; }
.side section { margin-bottom: 16px; }
.side .media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.side .media-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.inline-edit { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 6px; text-align: right; font-weight: 600; }
.inline-edit:hover { border-color: var(--line); }
.inline-edit:focus { border-color: var(--gold-2); background: var(--input); outline: none; text-align: left; }

/* ---------- Tablas ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--hover); }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .input { width: auto; min-width: 140px; }

/* ---------- Bases ---------- */
.grid { display: grid; gap: 14px; }
.g3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.base-card .big { font-size: 28px; font-weight: 700; margin-top: 8px; }
.bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
:root[data-theme="dark"] .bar i { background: #3f8f7d; }
.steps { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.steps span { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 16px; background: var(--chip); color: var(--muted); }
.steps span.on { background: var(--brand); color: #fff; }
label.drop { display: block; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 40px; text-align: center; color: var(--muted); cursor: pointer; background: var(--panel); }
.drop.over { border-color: var(--gold-2); background: var(--hover); }
.map-table select { min-width: 150px; }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .d { font-size: 12px; color: var(--muted); }
.issue { font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }

/* ---------- Reportes ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.vbars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.vbars .col i { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
:root[data-theme="dark"] .vbars .col i { background: #3f8f7d; }
.vbars .col span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,17,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 20px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #12312b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--red); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 150; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; }
.perm-ok { color: var(--green); font-weight: 700; }
.perm-no { color: var(--muted-2); }
code.k { background: var(--chip); padding: 2px 6px; border-radius: 5px; font-size: 12px; word-break: break-all; }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .rail { display: none; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; color: var(--muted); text-decoration: none; font-size: 10.5px; position: relative; }
  .bottom-nav a.on { color: var(--green); }
  .bottom-nav .bd { position: absolute; top: 3px; left: 55%; background: var(--green); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 8px; padding: 0 5px; }
  .main { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .page { padding: 14px; }
  .clist { width: 100%; border-right: 0; }
  .chats.open .clist { display: none; }
  .chats:not(.open) .conv { display: none; }
  .side { position: fixed; inset: 0; width: auto; z-index: 60; }
  .msgs { padding: 10px 10px; }
  .b { max-width: 85%; }
  .ch .act .hide-m { display: none; }
  .main.in-chat { padding-bottom: 0; }
  .main.in-chat + .bottom-nav { display: none; }
}
@media (min-width: 861px) { .only-m { display: none !important; } }
@media (max-width: 1200px) and (min-width: 861px) { .side { position: fixed; right: 0; top: 0; bottom: 0; z-index: 60; box-shadow: var(--shadow); } }
:root[data-theme="dark"] .login img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .login img { filter: brightness(0) invert(1); } }
#app { height: 100%; }

/* ---------- Embudo ---------- */
.kanban { flex: 1; display: flex; gap: 10px; overflow-x: auto; min-height: 0; padding-bottom: 6px; }
.kcol { width: 250px; flex: none; background: var(--chip); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; min-height: 0; }
.kcol.over { outline: 2px dashed var(--gold-2); }
.khead { border-top: 3px solid; padding: 6px 4px 8px; }
.kcards { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: grab; font-size: 13px; }
.kcard.drag { opacity: .5; }
@media (max-width: 860px) { .kanban { flex-direction: column; overflow: visible; } .kcol { width: auto; } }

.clist { position: relative; }
.resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 5; }
.resizer:hover, .resizer.on { background: linear-gradient(90deg, transparent 3px, var(--gold-2) 3px, var(--gold-2) 5px, transparent 5px); }
@media (max-width: 860px) { .resizer { display: none; } .clist { width: 100% !important; } }

/* ---------- Campañas ---------- */
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calh { font-size: 11px; font-weight: 700; color: var(--muted-2); text-align: center; text-transform: uppercase; }
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-height: 86px; padding: 5px; display: flex; flex-direction: column; gap: 3px; }
.calc.out { background: transparent; border-color: transparent; }
.calev { display: block; color: #fff; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 2px 5px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmock { width: 260px; max-width: 100%; border-radius: 30px; background: #111; padding: 9px; }
.pmock-in { background: var(--chat-bg); border-radius: 22px; overflow: hidden; min-height: 380px; display: flex; flex-direction: column; }
.pmock-h { background: #12312b; color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.pmock-b { padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.pmock-btn { background: var(--panel); border-radius: 8px; text-align: center; color: #0a84ff; font-size: 12.5px; padding: 7px; }

/* ---------- Ficha del huésped ---------- */
.cside { padding: 14px 16px 28px; }
.cside-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cside-head { text-align: center; padding: 6px 0 16px; }
.cside-name { font-weight: 700; font-size: 17px; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cside-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sec { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 6px; margin-bottom: 12px; }
.sec-t { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-2); font-weight: 700; margin-bottom: 8px; }
:root[data-theme="dark"] .sec-t { color: var(--gold); }
.f { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 8px; min-height: 36px; border-bottom: 1px solid var(--line-2); }
.sec .f:last-child { border-bottom: 0; }
.f > label, .f > span:first-child { font-size: 12px; color: var(--muted); line-height: 1.25; }
.fi { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 13px; font-weight: 500; color: var(--text); min-width: 0; }
.fi:hover { border-color: var(--line); background: var(--input); }
.fi:focus { border-color: var(--gold-2); background: var(--input); outline: none; box-shadow: 0 0 0 3px rgba(217,181,106,.2); }
.fi.ok, .input.ok { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(37,163,90,.18); }
.fi::placeholder { color: var(--muted-2); }
select.fi { cursor: pointer; }
.money { display: flex; align-items: center; gap: 4px; }
.money span { font-size: 12px; color: var(--muted); padding-left: 8px; }
.f.sw { cursor: pointer; grid-template-columns: 1fr auto; }
.switch { appearance: none; width: 36px; height: 20px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch:checked { background: var(--green); }
.switch:checked::after { left: 18px; }
.tagbox { display: flex; flex-wrap: wrap; gap: 2px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(10,20,17,.35); z-index: 90; display: flex; justify-content: flex-end; }
.drawer { width: 400px; max-width: 100%; height: 100%; background: var(--panel); overflow-y: auto; box-shadow: var(--shadow); animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- Ajustes ---------- */
.settings { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.snav { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; position: sticky; top: 0; }
.snav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.snav a:hover { background: var(--hover); }
.snav a.on { background: var(--sel); color: var(--green); font-weight: 600; }
.sbody { min-width: 0; max-width: 980px; }
.strow { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--panel); }
.strow.drag { opacity: .5; }
.strow .grip { cursor: grab; color: var(--muted-2); padding: 0 4px; user-select: none; }
.strow .input { min-width: 0; }
@media (max-width: 860px) { .settings { grid-template-columns: 1fr; } .snav { position: static; flex-direction: row; overflow-x: auto; } .snav a { white-space: nowrap; } .strow { flex-wrap: wrap; } }

.rail button.on { background: #1f4a41; color: #fff; }
.gearmenu { position: fixed; left: 72px; bottom: 16px; width: 260px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 120; padding: 6px; animation: slidein .15s ease-out; }
.gearmenu .gm-h { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.gearmenu a, .gearmenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; border: 0; background: none; cursor: pointer; text-align: left; }
.gearmenu a:hover, .gearmenu button:hover { background: var(--hover); }
.gearmenu .gm-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* Aro de 24 h */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .rbg { stroke: var(--line); }
.ring .rfg { stroke: var(--green); transition: stroke-dashoffset 1s linear, stroke .3s; }
.ring.warn .rfg { stroke: var(--orange); }
.ring.off .rfg { stroke: var(--red); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.ring.big b { font-size: 11.5px; }
.ring.sm b { font-size: 9px; color: var(--muted); }
.ring.off b { color: var(--red); }
.ring.big { margin-left: 4px; cursor: help; }
.ring.big.off .rbg { stroke: var(--red); opacity: .35; }
.ring.sm.off .rbg { stroke: var(--red); opacity: .35; }

.botpill { border: 0; cursor: pointer; background: var(--chip); color: var(--muted); padding: 5px 10px; font-size: 12px; margin-left: 8px; }
.botpill.on { background: rgba(47,111,214,.12); color: var(--blue); }

/* Barra superior con ilustración de Canasvieiras */
.tbx { height: 64px; flex: none; position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 0 18px; color: #fff; background: linear-gradient(100deg, #0f3a2e 0%, #17493c 45%, #21624f 100%); }
.tbx .art { position: absolute; left: 300px; top: 0; height: 100%; width: calc(100% - 820px); min-width: 260px; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 85%, transparent); }
.tbx > *:not(.art) { position: relative; }
.tbx .brand b { font-size: 15.5px; display: block; letter-spacing: -.01em; }
.tbx .brand small { opacity: .75; font-size: 11.5px; }
.tbx .sp { flex: 1; }
.tbx .chip { display: flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 11px; font-weight: 700; font-size: 13px; background: #fff; color: #0f3a2e; box-shadow: 0 2px 8px rgba(0,0,0,.18); text-decoration: none; white-space: nowrap; }
.tbx a.chip:hover { background: #f1f7f4; }
.tbx .chip .n { background: #25a35a; color: #fff; border-radius: 9px; padding: 1px 7px; font-size: 11.5px; }
.tbx .me { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px; border-radius: 24px; background: #0c2f25; border: 1px solid rgba(255,255,255,.22); color: #fff; text-decoration: none; }
.tbx .me b { font-size: 13px; display: block; line-height: 1.1; }
.tbx .me small { opacity: .75; font-size: 10.5px; }
.tbx .av { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
@media (max-width: 1100px) { .tbx .art, .tbx #tbWx { display: none; } }
@media (max-width: 860px) { .tbx { height: 52px; padding: 0 12px; } .tbx .brand b { font-size: 14px; white-space: nowrap; } .tbx .me div, .tbx .brand small { display: none; } .tbx .me { padding: 3px; } .col:has(.main.in-chat) .tbx { display: none; } }

/* Lista: tarjetas con franja de color por etapa */
#items { background: var(--bg); padding: 4px 0 8px; }
.item { margin: 6px 10px; border: 1px solid var(--line) !important; border-radius: 14px; background: var(--panel); padding: 10px 12px 10px 14px; overflow: hidden; }
.item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc, var(--line)); }
.item:hover { border-color: var(--acc, var(--line)) !important; }
.item.sel { background: var(--sel); border-color: var(--green) !important; box-shadow: 0 0 0 2px rgba(37,163,90,.18); }

/* Inicio sin chat abierto */
.home { margin: auto; width: min(640px, 92%); text-align: center; padding: 20px 0; }
.home .ill { height: 120px; margin: 0 auto 6px; display: block; }
.home h2 { margin: 4px 0 2px; font-size: 22px; }
.home > p { color: var(--muted); margin: 0 0 18px; }
.home .kp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.home .k { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: left; text-decoration: none; color: var(--text); transition: transform .12s, box-shadow .12s; }
.home .k:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.home .k b { font-size: 26px; display: block; }
.home .k span { font-size: 12px; color: var(--muted); }
.home .k.g b { color: var(--green); } .home .k.o b { color: var(--orange); } .home .k.y b { color: #b8892b; }
.home .arr { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 6px; text-align: left; }
.home .arr h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.home .arr a { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text); text-decoration: none; }
.home .arr a:hover b:first-child { text-decoration: underline; }
.home .arr .ag { color: var(--orange); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 1000px) { .home .kp { grid-template-columns: repeat(2, 1fr); } }

/* Reserva tipo ticket */
.rsv .sec-t { display: flex; align-items: center; justify-content: space-between; }
.rsv .lnk { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11.5px; display: inline-flex; gap: 4px; align-items: center; text-transform: none; letter-spacing: 0; }
.rsv .lnk:hover { color: var(--text); }
.tix { background: linear-gradient(135deg, #0f3a2e, #21624f); color: #fff; border-radius: 14px; padding: 12px 14px; margin: 4px 0 10px; }
.tix small { opacity: .7; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.tix .row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 8px; gap: 6px; }
.tix .d b { font-size: 26px; display: block; line-height: 1; }
.tix .d span { font-size: 11.5px; opacity: .8; text-transform: capitalize; }
.tix .d.r { text-align: right; }
.tix .mid { flex: 1; text-align: center; font-size: 12px; opacity: .92; }
.tix .mid i { display: block; border-top: 2px dashed rgba(255,255,255,.4); margin: 4px 8px; }
.tix .ft { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed rgba(255,255,255,.3); padding-top: 9px; }
.tix .ft span { background: rgba(255,255,255,.14); border-radius: 9px; padding: 4px 9px; font-size: 12px; font-weight: 600; }
.tix .ft span.v { margin-left: auto; background: #c49a3a; }
