@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0d17; --panel: #10152a; --panel2: #161d36; --panel3: #1c2442; --border: #232c4d; --text: #e7eaf6; --muted: #8a93ad;
  --primary: #6d5efc; --primary2: #9a8cff; --accent: #14b8a6; --warn: #f59e0b; --danger: #ef4444; --ok: #22c55e;
  --canvas: #0b1022; --dot: #1f2848; --shadow: 0 18px 50px rgba(0,0,0,.45); --ring: 0 0 0 3px rgba(109,94,252,.35);
  --grad: linear-gradient(135deg, #6d5efc 0%, #8b5cf6 45%, #14b8a6 100%);
  --top: 56px; --side: 244px; --r: 14px; --ease: cubic-bezier(.2,.8,.2,1);
}
:root[data-theme="light"] {
  --bg: #f4f6fb; --panel: #ffffff; --panel2: #f1f3fa; --panel3: #e8ebf5; --border: #e0e4ef; --text: #141a2e; --muted: #64708b;
  --canvas: #f6f7fc; --dot: #d6dbea; --shadow: 0 18px 50px rgba(20,30,60,.12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.3px; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
small, .muted { color: var(--muted); }
.ic { flex: none; display: inline-block; vertical-align: middle; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Topbar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: .6px; font-weight: 700; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 6px 18px rgba(109,94,252,.4); }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.big { font-size: 22px; } .brand.big .brand-mark { width: 42px; height: 42px; font-size: 20px; }
.welcome { margin: 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.welcome b { color: var(--text); }
.top-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { position: relative; background: transparent; border: 0; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--panel2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 22px; border: 1px solid var(--border); background: var(--panel2); cursor: pointer; }
.user-chip .avatar { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); padding: 12px 10px; overflow-y: auto; background: var(--panel);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; z-index: 20; transition: transform .25s var(--ease); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); padding: 14px 12px 6px; opacity: .8; }
.sidebar nav a { position: relative; padding: 8px 12px; border-radius: 10px; display: flex; align-items: center; gap: 11px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s, transform .15s; }
.sidebar nav a:hover { background: var(--panel2); color: var(--text); }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(109,94,252,.22), rgba(109,94,252,.06)); color: var(--text); }
.sidebar nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.sidebar nav a.active .ic { color: var(--primary2); }
.sidebar nav a .ext { margin-left: auto; opacity: .5; }
.nav-cta { background: var(--grad) !important; color: #fff !important; box-shadow: 0 8px 22px rgba(109,94,252,.35); margin: 4px 0; }
.nav-cta .ic { color: #fff !important; }
.badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.nav-cta .badge { background: #fff; color: var(--primary); }
.dot-warn { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.profile { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel2); margin-top: 8px; cursor: pointer; }
.profile small { display: block; font-size: 11px; }
.profile b { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Main ---------- */
.view { position: fixed; top: var(--top); left: var(--side); right: 0; bottom: 0; overflow: auto; padding: 22px 26px; animation: fade .25s var(--ease); }
.view.full { padding: 0; overflow: hidden; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .spacer { flex: 1; }
.page-head .sub { color: var(--muted); font-size: 13px; width: 100%; margin-top: -4px; }
.hint { color: var(--muted); font-size: 12.5px; margin: -6px 0 14px; }
.center { text-align: center; }

.btn { border: 1px solid var(--border); background: var(--panel2); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; transition: transform .12s, filter .15s, background .15s, box-shadow .15s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible, .input:focus { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(109,94,252,.3); }
.btn-grad { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(109,94,252,.3); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #1b1300; }
.btn-danger { background: transparent; border-color: rgba(239,68,68,.5); color: var(--danger); }
.btn-danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 11px 16px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 6px; width: 32px; height: 32px; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.input, select.input, textarea.input { width: 100%; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 74px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-ic .input { padding-left: 38px; }
.input-ic .eye { position: absolute; right: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; display: grid; }
.search { max-width: 260px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; transition: border-color .2s, transform .2s; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.tag-ok { background: rgba(34,197,94,.14); color: var(--ok); }
.tag-bad { background: rgba(239,68,68,.14); color: var(--danger); }
.tag-wait { background: rgba(245,158,11,.14); color: var(--warn); }
.tag-info { background: rgba(20,184,166,.14); color: var(--accent); }
.tag-violet { background: rgba(109,94,252,.16); color: var(--primary2); }
.tag-soon { background: var(--grad); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px; font-size: 12px; border: 1px solid var(--border); background: var(--panel2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .n { opacity: .7; }
.label-pill { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; color: #fff; margin: 1px 2px 1px 0; }
.empty { text-align: center; color: var(--muted); padding: 44px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 40px; height: 40px; opacity: .4; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; gap: 14px; align-items: center; }
.stat .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat b { font-size: 24px; display: block; line-height: 1.2; }
.stat small { font-size: 12px; }
.bars { display: flex; gap: 12px; align-items: flex-end; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.bars .bar i { display: block; width: 100%; max-width: 44px; background: var(--grad); border-radius: 8px 8px 3px 3px; min-height: 3px; transition: height .5s var(--ease); }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel2); }
.steps li .ic.done { color: var(--ok); }

/* Lists */
.counters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.list-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; cursor: pointer; position: relative; transition: background .15s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--panel2); }
.list.compact .list-row { padding: 6px 16px; }
.list-row .name { font-weight: 600; }
.list-row .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.list-row .grow { flex: 1; min-width: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.table tr:hover td { background: var(--panel2); }

/* Dropdown */
.menu { position: fixed; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 80; min-width: 200px; animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.menu button .ic { color: var(--muted); }
.menu button:hover { background: var(--panel2); }
.menu button.danger, .menu button.danger .ic { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(5,8,18,.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .2s var(--ease); }
.modal.wide { width: min(1000px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.modal-head .mi { width: 32px; height: 32px; border-radius: 9px; background: rgba(109,94,252,.16); color: var(--primary2); display: grid; place-items: center; }
.modal-head .x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.modal-head .x:hover { background: var(--panel2); color: var(--text); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.switch { position: relative; width: 40px; height: 22px; flex: none !important; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 20px; background: var(--border); cursor: pointer; transition: .2s; }
.switch i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.toggle-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel2); margin-bottom: 12px; }
.toggle-card div { flex: 1; } .toggle-card small { display: block; }
.soon-modal { text-align: center; padding: 10px 6px 4px; }
.soon-modal .orb { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 16px 40px rgba(109,94,252,.45); animation: float 3s ease-in-out infinite; }
.soon-modal .orb .ic { width: 40px; height: 40px; }
@keyframes float { 50% { transform: translateY(-6px); } }
.soon-modal h3 { font-size: 20px; margin: 6px 0; }
.soon-modal p { color: var(--muted); margin: 0 auto 10px; max-width: 380px; }
.progress { height: 6px; border-radius: 6px; background: var(--panel3); overflow: hidden; margin: 14px auto 4px; max-width: 280px; }
.progress i { display: block; height: 100%; width: 72%; background: var(--grad); border-radius: 6px; }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--border); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow); max-width: 360px; animation: slideIn .25s var(--ease); font-size: 13px; }
.toast .ic { color: var(--primary2); }
.toast.ok .ic { color: var(--ok); } .toast.err .ic { color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Auth ---------- */
.auth-body { overflow: auto; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { position: relative; padding: 48px; display: flex; flex-direction: column; gap: 26px; justify-content: center; overflow: hidden;
  background: radial-gradient(900px 500px at 10% 10%, rgba(109,94,252,.35), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(20,184,166,.28), transparent 60%), var(--bg); }
.auth-hero h1 { font-size: 38px; line-height: 1.15; max-width: 520px; letter-spacing: -.8px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 15px; }
.auth-points .ic { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--panel2); color: var(--primary2); border: 1px solid var(--border); }
.auth-hero small { position: absolute; bottom: 20px; }
.auth-panel { display: grid; place-items: center; padding: 32px 18px; background: var(--panel); }
.auth-card { width: min(420px, 100%); }
.auth-tabs { display: flex; padding: 4px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--border); margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 9px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); }
.auth-tabs button.active { background: var(--panel); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.google-wrap { display: flex; justify-content: center; min-height: 44px; }
.google-btn { padding: 11px; background: var(--panel); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.strength { height: 4px; border-radius: 4px; background: var(--panel3); margin-top: 6px; overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.match { display: block; margin-top: 5px; font-size: 12px; }
.match.ok { color: var(--ok); } .match.bad { color: var(--danger); }
.auth-error { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(239,68,68,.12); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); font-size: 13px; }

/* ---------- Conexiones ---------- */
.channels { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.channel { border: 1px solid var(--border); background: var(--panel); border-radius: 10px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; display: flex; gap: 7px; align-items: center; color: var(--muted); cursor: pointer; transition: all .15s; }
.channel:hover { border-color: var(--primary); color: var(--text); }
.channel.on { color: var(--text); border-color: var(--accent); background: rgba(20,184,166,.08); }
.channel .tag { margin-left: 2px; }
.banner { border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; background: linear-gradient(110deg, rgba(109,94,252,.25), rgba(20,184,166,.18)); border: 1px solid var(--border); display: flex; gap: 16px; align-items: center; }
.banner .bi { width: 46px; height: 46px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.banner b { font-size: 15px; }
.conn-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.conn-card:hover { border-color: var(--panel3); transform: translateY(-2px); box-shadow: var(--shadow); }
.conn-card .title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.conn-card .title .ci { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(34,197,94,.14); color: var(--ok); }
.conn-card.cloud .title .ci { background: rgba(109,94,252,.16); color: var(--primary2); }
.conn-card .actions { margin-left: auto; display: flex; gap: 2px; }
.conn-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.conn-meta span { display: flex; align-items: center; gap: 6px; }
.conn-add { border: 2px dashed var(--border); border-radius: var(--r); display: grid; place-items: center; min-height: 170px; cursor: pointer; color: var(--muted); text-align: center; transition: all .2s; }
.conn-add:hover { border-color: var(--primary); color: var(--text); background: rgba(109,94,252,.05); }
.conn-add .plus { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; margin: 0 auto 8px; }
.qr-box { display: grid; place-items: center; gap: 12px; text-align: center; padding: 6px; }
.qr-box img { width: 280px; height: 280px; background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.qr-steps { text-align: left; font-size: 13px; color: var(--muted); margin: 0; padding-left: 18px; }
.qr-done { width: 72px; height: 72px; border-radius: 50%; background: rgba(34,197,94,.15); color: var(--ok); display: grid; place-items: center; }
.qr-done .ic { width: 38px; height: 38px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Kanban / Calendario ---------- */
.kanban { display: flex; gap: 14px; height: calc(100% - 56px); overflow-x: auto; }
.kcol { flex: 0 0 270px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; }
.kcol h3 { margin: 0; font-size: 13px; padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kcol h3 .kd { width: 8px; height: 8px; border-radius: 50%; }
.kcol .kitems { padding: 10px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kcol.drag-over { outline: 2px dashed var(--primary); }
.kcard { background: var(--panel2); border: 1px solid var(--border); border-radius: 11px; padding: 10px; cursor: grab; transition: transform .15s, box-shadow .15s; }
.kcard:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.cal .day { min-height: 96px; background: var(--panel); border: 1px solid var(--border); border-radius: 11px; padding: 7px; cursor: pointer; font-size: 12px; transition: border-color .15s; }
.cal .day:hover { border-color: var(--primary); }
.cal .day.out { opacity: .4; } .cal .day.today { border-color: var(--primary); box-shadow: var(--ring); }
.cal .ev { background: var(--primary); color: #fff; border-radius: 6px; padding: 1px 6px; margin-top: 3px; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Configuración ---------- */
.settings { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.settings-nav { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 6px; position: sticky; top: 0; }
.settings-nav button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; text-align: left; }
.settings-nav button:hover { background: var(--panel2); color: var(--text); }
.settings-nav button.active { background: rgba(109,94,252,.16); color: var(--text); }
.settings-nav button.active .ic { color: var(--primary2); }
.settings-section { max-width: 760px; }
.settings-section .card { margin-bottom: 14px; }
.settings-section h2 { display: flex; align-items: center; gap: 8px; }
.danger-zone { border-color: rgba(239,68,68,.4) !important; }

/* ---------- Editor de flujos ---------- */
.editor { position: relative; height: 100%; }
#drawflow { position: absolute; inset: 0; background: var(--canvas); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.ed-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 10; pointer-events: none; }
.ed-top > * { pointer-events: auto; }
.ed-fab { width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: #fff; border: 0; cursor: pointer; box-shadow: 0 10px 26px rgba(109,94,252,.45); display: grid; place-items: center; transition: transform .2s var(--ease); }
.ed-fab.open { transform: rotate(45deg); }
.ed-name { margin: 0 auto; background: var(--panel); border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.ed-name.dirty { border-color: var(--warn); color: var(--warn); }
.palette { position: absolute; top: 66px; left: 12px; width: 312px; max-height: calc(100% - 84px); overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); z-index: 11; padding: 14px; animation: pop .18s var(--ease); }
.palette h4 { margin: 12px 0 8px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.palette h4:first-of-type { margin-top: 4px; }
.pal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pal-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 9px 4px; border-radius: 11px; cursor: grab; font-size: 11.5px; text-align: center; border: 1px solid transparent; transition: all .15s; line-height: 1.25; }
.pal-item:hover { border-color: var(--border); background: var(--panel2); transform: translateY(-1px); }
.pal-item .pi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.pal-item .tag { font-size: 8.5px; padding: 1px 5px; }
.ed-zoom { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; z-index: 10; }
.ed-zoom button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.ed-zoom button:hover { color: var(--text); }

.drawflow .drawflow-node { background: transparent; border: 0; padding: 0; width: auto; min-width: 230px; box-shadow: none; color: var(--text); }
.drawflow .drawflow-node.selected { background: transparent; }
.drawflow .drawflow-node.selected .fnode { outline: 2px solid var(--primary2); outline-offset: 2px; }
.drawflow .drawflow-node .input, .drawflow .drawflow-node .output { width: 16px; height: 16px; border: 3px solid var(--canvas); background: var(--accent); }
.drawflow .drawflow-node .output { background: var(--warn); }
.drawflow .drawflow-node .outputs { display: flex; flex-direction: column; gap: 10px; }
.drawflow .connection .main-path { stroke: var(--accent); stroke-width: 2.5px; stroke-dasharray: 7 6; animation: dash 1s linear infinite; }
.drawflow .connection .main-path:hover, .drawflow .connection .main-path.selected { stroke: var(--danger); }
@keyframes dash { to { stroke-dashoffset: -13; } }
.drawflow-delete { background: var(--danger); border: 2px solid #fff; color: #fff; line-height: 26px; }
.fnode { width: 270px; background: var(--panel); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0,0,0,.35); transition: outline .2s; }
.fnode.running { outline: 3px solid var(--ok) !important; outline-offset: 2px; }
.fnode .fh { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; font-weight: 650; font-size: 14px; }
.fnode .fh .acts { margin-left: auto; display: flex; gap: 2px; }
.fnode .fh .acts span { cursor: pointer; opacity: .8; padding: 3px; border-radius: 6px; display: grid; }
.fnode .fh .acts span:hover { opacity: 1; background: rgba(255,255,255,.18); }
.fnode .fsub { font-size: 9.5px; font-weight: 700; letter-spacing: .6px; padding: 3px 12px; background: rgba(0,0,0,.18); color: rgba(255,255,255,.85); text-transform: uppercase; }
.fnode .fb { padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.fnode .fi { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 6px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.fnode .fi .ic { width: 14px; height: 14px; color: var(--muted); }
.fnode .fi.opt { justify-content: space-between; }
.fnode .fi.wbtn { justify-content: center; color: #53bdeb; font-weight: 600; background: var(--panel3); }
.fnode .fhint { font-size: 11px; color: var(--muted); text-align: center; }
.fnode.inicio { width: 300px; border: 0; background: linear-gradient(135deg, #0f9f7a, #0d8a8a); color: #fff; }
.fnode.inicio .fb { font-size: 14px; padding: 2px 14px 14px; }

/* Simulador */
.sim { position: absolute; right: 12px; top: 66px; bottom: 12px; width: 350px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; z-index: 12; display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden; animation: slideIn .25s var(--ease); }
.sim-head { padding: 10px 12px; background: #0b3d36; color: #fff; display: flex; align-items: center; gap: 10px; }
.sim-head .grow { flex: 1; line-height: 1.25; }
.sim-head .icon-btn { color: #ccfbf1; }
.sim .msgs { background: var(--canvas); }
.typing { font-size: 12px; color: var(--muted); padding: 0 16px 6px; min-height: 18px; background: var(--canvas); }

/* Burbujas (compartidas) */
.msgs { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 72%; padding: 7px 11px 5px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; font-size: 13.5px; background: var(--panel); border: 1px solid var(--border); align-self: flex-start; animation: msgIn .2s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
.msg.me { align-self: flex-end; background: #134e48; border-color: #134e48; color: #ecfffb; }
:root[data-theme="light"] .msg.me { background: #d9fdd3; border-color: #c6f3bd; color: #0b3a2c; }
.msg .meta { display: flex; gap: 4px; justify-content: flex-end; align-items: center; font-size: 10.5px; opacity: .65; margin-top: 2px; }
.msg .meta .ic { width: 13px; height: 13px; }
.msg .who { font-size: 10.5px; font-weight: 700; opacity: .75; display: flex; gap: 4px; align-items: center; margin-bottom: 2px; }
.msg .who .ic { width: 12px; height: 12px; }
.msg.sys { align-self: center; background: transparent; border: 1px dashed var(--border); color: var(--muted); font-size: 12px; }
.msg img { max-width: 220px; border-radius: 8px; display: block; }
.wa-btns { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.wa-btns span { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 6px; border-radius: 8px; background: rgba(255,255,255,.08); color: #53bdeb; font-weight: 600; font-size: 13px; cursor: pointer; }
:root[data-theme="light"] .wa-btns span { background: rgba(0,0,0,.05); color: #027eb5; }
.day-sep { align-self: center; font-size: 11px; padding: 3px 10px; border-radius: 8px; background: var(--panel2); color: var(--muted); margin: 6px 0; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--panel); align-items: center; }

/* Bloques del nodo contenido */
.blocks-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.blk { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.blk-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.blk-head .acts { margin-left: auto; display: flex; gap: 2px; }
.blk-head .acts button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 3px; border-radius: 6px; display: grid; }
.blk-head .acts button:hover { background: var(--panel3); color: var(--text); }
.varchips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; font-size: 12px; color: var(--muted); }
.varchips code { background: rgba(20,184,166,.12); color: var(--accent); border: 1px solid rgba(20,184,166,.35); border-radius: 6px; padding: 1px 7px; font-size: 11px; cursor: pointer; }
.split { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.preview { background: var(--canvas); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow: auto; border: 1px solid var(--border); }
.info-box { display: flex; gap: 10px; padding: 11px 13px; border-radius: 11px; background: rgba(109,94,252,.1); border: 1px solid rgba(109,94,252,.3); font-size: 12.5px; margin-bottom: 12px; color: var(--text); }
.info-box .ic { color: var(--primary2); margin-top: 1px; }
.info-box.warn { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.35); }
.info-box.warn .ic { color: var(--warn); }
.counter { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }

/* ---------- Super Chat ---------- */
.sc { position: fixed; inset: 0; display: grid; grid-template-columns: 210px 360px 1fr 280px 330px; background: var(--bg); }
.sc.no-quick { grid-template-columns: 210px 360px 1fr 330px; }
.sc.no-quick .sc-quick { display: none; }
.sc > section { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); }
.sc-filters { padding: 12px 10px; gap: 4px; overflow: auto; }
.sc-filters .sc-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 2px 6px 10px; }
.sc-filters .grp { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .7px; padding: 12px 6px 6px; display: flex; gap: 6px; align-items: center; }
.sc-filters button.f { display: flex; gap: 9px; align-items: center; width: 100%; padding: 7px 9px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px; text-align: left; transition: background .15s; }
.sc-filters button.f:hover { background: var(--panel2); color: var(--text); }
.sc-filters button.f.active { background: rgba(109,94,252,.16); color: var(--text); }
.sc-filters button.f .n { margin-left: auto; font-size: 11px; opacity: .7; }
.sc-filters .lbl-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.sc-filters .foot { margin-top: auto; display: flex; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.sc-list .mods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); }
.sc-list .mods a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: var(--panel2); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); transition: all .15s; }
.sc-list .mods a:hover { color: var(--text); background: var(--panel3); }
.sc-list .tools { padding: 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.sc-tabs { display: flex; border-bottom: 1px solid var(--border); }
.sc-tabs button { flex: 1; padding: 10px 4px; border: 0; background: transparent; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; transition: all .15s; }
.sc-tabs button.active { color: var(--text); border-bottom-color: var(--primary); }
.sc-count { padding: 7px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.sc-items { overflow: auto; flex: 1; }
.sc-item { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; position: relative; }
.sc-item:hover { background: var(--panel2); }
.sc-item.active { background: rgba(109,94,252,.12); }
.sc-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
.sc-item .grow { flex: 1; min-width: 0; }
.sc-item .top { display: flex; gap: 6px; align-items: center; }
.sc-item .top b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sc-item .top small { flex: none; font-size: 11px; }
.sc-item .last { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; }
.sc-item .last .ic { width: 14px; height: 14px; flex: none; }
.sc-item .last .ic.read { color: #53bdeb; }
.sc-item .av-wrap { position: relative; flex: none; }
.sc-item .conn-badge { position: absolute; left: -2px; bottom: -6px; font-size: 8.5px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: var(--warn); color: #1b1300; max-width: 46px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sc-item .unread { flex: none; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ok); color: #04210f; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.sc-item .flags { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }
.sc-main { background: var(--chat-bg, var(--canvas)) !important; background-attachment: local; }
.sc-main .welcome-pane { margin: auto; text-align: center; color: var(--muted); }
.sc-main .welcome-pane .brand { justify-content: center; margin-bottom: 10px; }
.sc-main .welcome-pane h3 { color: var(--text); margin: 6px 0 2px; font-size: 18px; }
.sc-chat-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.sc-chat-head .who { flex: 1; min-width: 160px; line-height: 1.25; }
.sc-chat-head .who small { display: flex; gap: 6px; align-items: center; }
.sc-chat-head .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-paused { padding: 7px 14px; font-size: 12.5px; background: rgba(245,158,11,.12); color: var(--warn); display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); }
.sc-composer { border-top: 1px solid var(--border); background: var(--panel); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sc-composer .bar { display: flex; gap: 8px; align-items: flex-end; }
.sc-composer textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; }
.sc-composer .send { width: 42px; height: 42px; border-radius: 50%; padding: 0; justify-content: center; }
.flow-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; align-items: center; }
.flow-chips .chip { flex: none; }
.slash-pop { position: absolute; bottom: 100%; left: 12px; right: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 220px; overflow: auto; padding: 4px; }
.slash-pop div { padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.slash-pop div:hover, .slash-pop div.sel { background: var(--panel2); }
.slash-pop b { color: var(--primary2); margin-right: 6px; }
.sc-quick .qh, .sc-info .qh { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.sc-quick .qh .ic, .sc-info .qh .ic { color: var(--primary2); }
.sc-quick .qbody { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; }
.qr-item { border: 1px solid var(--border); background: var(--panel2); border-radius: 10px; padding: 9px 10px; cursor: pointer; font-size: 12.5px; transition: border-color .15s; position: relative; }
.qr-item:hover { border-color: var(--primary); }
.qr-item b { color: var(--primary2); font-size: 12px; display: block; }
.qr-item .acts { position: absolute; top: 6px; right: 6px; display: none; gap: 2px; }
.qr-item:hover .acts { display: flex; }
.sc-info .ibody { overflow: auto; flex: 1; }
.isec { border-bottom: 1px solid var(--border); padding: 12px 14px; }
.isec > .ih { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; margin-bottom: 10px; cursor: pointer; }
.isec > .ih .ic:first-child { color: var(--primary2); width: 16px; height: 16px; }
.isec > .ih .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.isec.collapsed > .ih .chev { transform: rotate(-90deg); }
.isec.collapsed > .ib { display: none; }
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ticket-grid > div { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px; font-size: 12px; }
.ticket-grid > div.full { grid-column: span 2; }
.ticket-grid small { display: flex; gap: 5px; align-items: center; font-size: 10.5px; }
.ticket-grid small .ic { width: 12px; height: 12px; }
.contact-hero { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--border); }
.contact-hero .avatar { width: 46px; height: 46px; font-size: 18px; }
.contact-hero b { font-size: 15px; display: block; }
.contact-hero a { color: var(--primary2); font-size: 13px; }
.sched-item { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 6px 8px; background: var(--panel2); border-radius: 8px; margin-bottom: 6px; }
.sched-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item { font-size: 12.5px; padding: 8px 10px; background: var(--panel2); border-radius: 9px; margin-bottom: 6px; border-left: 3px solid var(--warn); white-space: pre-wrap; }
.note-item small { display: block; margin-top: 3px; font-size: 10.5px; }

@media (max-width: 1400px) { .sc { grid-template-columns: 190px 330px 1fr 320px; } .sc .sc-quick { display: none; } }
@media (max-width: 1100px) { .sc { grid-template-columns: 330px 1fr; } .sc .sc-filters, .sc .sc-info { display: none; } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .view { left: 0; padding: 16px; }
  .welcome, .user-chip span { display: none; }
  .split, .settings { grid-template-columns: 1fr; }
  .sim { left: 12px; width: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-hero { display: none; }
}
@media (max-width: 760px) {
  .sc { grid-template-columns: 1fr; }
  .sc.has-chat .sc-list, .sc:not(.has-chat) .sc-main { display: none; }
}

/* Logo oficial */
.brand-logo { height: 34px; width: auto; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.35)); }
.brand-lockup { width: 300px; max-width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 26px rgba(250,190,40,.18)); }
.auth-mobile-logo { display: none; width: 200px; margin: 0 auto 18px; }
:root[data-theme="light"] .brand-logo { filter: brightness(0); }
:root[data-theme="light"] .brand-lockup { background: #000; border-radius: 18px; padding: 14px 18px; box-sizing: border-box; }
@media (max-width: 900px) { .auth-mobile-logo { display: block; } }

/* Super Chat: adjuntos locales, arrastrar y soltar, flujos en respuestas */
.sc-main.drop-on, #main.drop-on { outline: 2px dashed var(--accent); outline-offset: -8px; }
.msg.has-media { max-width: min(340px, 78%); }
.att-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow: auto; }
.att-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--panel2); }
.att-thumb { width: 74px; height: 74px; flex: none; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--panel); color: var(--muted); }
.att-thumb img, .att-thumb video { width: 100%; height: 100%; object-fit: cover; }
.att-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.att-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta small { color: var(--muted); font-size: 11.5px; }
.up-bar.ok i { background: var(--ok); width: 100% !important; }
.up-bar.err i { background: var(--danger); width: 100% !important; }
.slash-pop h6 { margin: 6px 6px 3px; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.slash-pop { max-height: 320px; overflow: auto; }
.slash-pop .sp-flow { display: flex; align-items: center; gap: 7px; }
.slash-pop .sp-flow small { margin-left: auto; color: var(--muted); }
.q-tabs { display: flex; gap: 4px; padding: 8px 10px 0; }
.q-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 12.5px; }
.q-tabs button.on { background: var(--panel2); color: var(--text); border-color: var(--accent); }
.q-tabs button span { font-size: 10.5px; background: var(--panel2); border-radius: 6px; padding: 1px 5px; }
.q-flow { display: flex; align-items: center; gap: 9px; }
.q-flow > div { flex: 1; min-width: 0; }
.q-flow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-flow small { color: var(--muted); }
.qf-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); flex: none; }
