/* ============ Componentes base ============ */
.hidden { display: none !important; }
.muted { color: var(--ash); }
.faint { color: var(--mist); }
.small { font-size: 13px; }
.caption { font-size: 11px; letter-spacing: -0.003em; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: var(--slate-depth); color: var(--paper);
  font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--steel-edge); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--signal); color: #fff; }
.btn.primary:hover { background: var(--signal-hover); }
.btn.outline { background: transparent; border-color: var(--steel-edge); }
.btn.outline:hover { background: var(--slate-depth); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--slate-depth); }
.btn.danger { background: transparent; border-color: rgba(255, 93, 115, .4); color: var(--danger); }
.btn.danger:hover { background: rgba(255, 93, 115, .1); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon-only { width: 36px; height: 36px; padding: 0; }
.btn.icon-only.sm { width: 32px; height: 32px; }
.btn.block { width: 100%; }

.input, .select, .textarea {
  width: 100%; background: var(--midnight); border: 1px solid var(--steel-edge); border-radius: var(--r-btn);
  height: 40px; padding: 0 12px; font-size: 15px; color: var(--paper);
  transition: border-color .15s, background .15s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--mist); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--graphite); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--signal); }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a1abbd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: var(--slate-depth); }
.input.sm, .select.sm { height: 32px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--ash); }
.hint { font-size: 12px; color: var(--mist); }
.error-text { color: var(--danger); font-size: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--slate-depth); color: var(--ash); font-size: 12px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
}
.pill.outline { background: transparent; border-color: var(--steel-edge); }
.pill.active { background: var(--paper); color: var(--midnight); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mist); }
.pill .dot.ok { background: var(--ok); }
.pill .dot.warn { background: var(--amber); }
.pill .dot.bad { background: var(--danger); }
button.pill { cursor: pointer; }
button.pill:hover { color: var(--paper); }

.card { background: var(--slate-depth); border: 1px solid var(--steel-edge); border-radius: var(--r-card); padding: 24px; }
.card.flat { background: transparent; }
.card h3 { margin: 0 0 4px; font-size: 19px; font-weight: 600; letter-spacing: -0.009em; }
.card .sub { color: var(--ash); font-size: 14px; margin: 0 0 16px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--steel-edge); color: var(--pale-mist);
  display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.group { background: var(--graphite); }

.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--paper); color: var(--midnight);
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.badge.dim { background: var(--steel-edge); color: var(--ash); }

.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--steel-edge); border-radius: 12px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ash); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--signal); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--midnight); border: 1px solid var(--steel-edge); border-radius: 14px; }
.tabs button { flex: 1; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--ash); font-weight: 500; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.tabs button:hover { color: var(--paper); }
.tabs button.active { background: var(--slate-depth); color: var(--paper); }
.tabs .count { font-size: 11px; color: var(--mist); }
.tabs button.active .count { color: var(--ash); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--mist); padding: 10px 12px; border-bottom: 1px solid var(--steel-edge); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--steel-edge); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; color: var(--ash); padding: 48px 24px; }
.empty .icon { width: 36px; height: 36px; color: var(--mist); margin-bottom: 12px; }
.empty h4 { margin: 0 0 4px; color: var(--paper); font-size: 16px; font-weight: 600; }
.empty p { margin: 0 0 16px; font-size: 14px; }

.kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--steel-edge); border-radius: 6px; color: var(--ash); }
.divider { height: 1px; background: var(--steel-edge); margin: 16px 0; border: 0; }
code, .code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }
pre.code { background: var(--midnight); border: 1px solid var(--steel-edge); border-radius: var(--r-btn); padding: 14px 16px; overflow-x: auto; margin: 0; color: var(--pale-mist); line-height: 1.55; }

/* Menús emergentes */
.menu {
  position: fixed; z-index: 60; min-width: 200px; max-width: 320px; background: var(--slate-depth); border: 1px solid var(--steel-edge);
  border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop); max-height: 70vh; overflow-y: auto;
}
.menu button, .menu .item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--paper); font-size: 14px; text-align: left; cursor: pointer;
}
.menu button:hover { background: var(--steel-edge); }
.menu button.danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--steel-edge); margin: 6px 4px; }
.menu .head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--mist); text-transform: uppercase; letter-spacing: .04em; }
.menu button .check { margin-left: auto; color: var(--ash); }

/* Modales */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 15, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--slate-depth); border: 1px solid var(--steel-edge); border-radius: var(--r-card); box-shadow: var(--shadow-pop); animation: pop .18s; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 600; flex: 1; letter-spacing: -0.009em; }
.modal-body { padding: 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Avisos */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 360px; background: var(--paper); color: var(--midnight); border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop); animation: pop .18s; display: flex; align-items: center; gap: 12px; }
.toast.error { background: var(--danger); color: #fff; }
.toast .btn { height: 28px; font-size: 13px; background: var(--midnight); color: #fff; }
.toast.msg { cursor: pointer; background: var(--slate-depth); color: var(--paper); border: 1px solid var(--steel-edge); }
.toast.msg b { display: block; font-size: 13px; }
.toast.msg span { color: var(--ash); font-size: 13px; }

.spinner { width: 18px; height: 18px; border: 2px solid var(--steel-edge); border-top-color: var(--paper); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { height: 100%; display: grid; place-items: center; }

/* ============ Autenticación ============ */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--midnight); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-card h1 { margin: 0; font-size: 27px; font-weight: 600; letter-spacing: -0.016em; line-height: 1.2; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; margin-bottom: 8px; }
.auth-card .brand img { width: 34px; height: 34px; }
.auth-side { position: relative; overflow: hidden; border-left: 1px solid var(--steel-edge); display: flex; align-items: flex-end; padding: 56px; background: #060b14; }
.auth-side .orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.auth-side .orb.a { width: 520px; height: 520px; background: radial-gradient(circle, var(--violet), transparent 70%); top: -120px; right: -120px; }
.auth-side .orb.b { width: 420px; height: 420px; background: radial-gradient(circle, var(--signal), transparent 70%); bottom: -160px; left: -80px; opacity: .4; }
.auth-side .orb.c { width: 300px; height: 300px; background: radial-gradient(circle, var(--amber), transparent 70%); top: 38%; left: 38%; opacity: .12; }
.auth-side blockquote { position: relative; margin: 0; max-width: 460px; }
.auth-side blockquote p { font-size: 27px; line-height: 1.2; letter-spacing: -0.016em; font-weight: 600; margin: 0 0 16px; }
.auth-side blockquote span { color: var(--ash); font-size: 14px; }
.otp { display: flex; gap: 8px; justify-content: center; }
input.otp-box { flex: 0 0 46px; width: 46px; height: 54px; text-align: center; font-size: 22px; font-weight: 600; padding: 0; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ============ Shell ============ */
.app { height: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; border-right: 1px solid var(--steel-edge); background: #070d18; }
.rail .logo { width: 40px; height: 40px; margin-bottom: 14px; display: block; }
.rail .logo img { width: 100%; height: 100%; display: block; }
.rail a.nav, .rail button.nav {
  position: relative; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--ash);
  background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.rail .nav:hover { background: var(--slate-depth); color: var(--paper); }
.rail .nav.active { background: var(--slate-depth); color: var(--paper); }
.rail .nav.active::before { content: ''; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--paper); }
.rail .nav .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; font-size: 10px; }
.rail .spacer { flex: 1; }
.org-chip { width: 44px; height: 44px; border-radius: 14px; background: var(--steel-edge); display: grid; place-items: center; font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid var(--graphite); color: var(--paper); }
.org-chip:hover { border-color: var(--ash); }
.main { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.banner { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--slate-depth); border-bottom: 1px solid var(--steel-edge); font-size: 13px; }
.banner.warn { background: rgba(246, 176, 60, .12); color: var(--amber); }
.banner.bad { background: rgba(255, 93, 115, .12); color: var(--danger); }
.page { flex: 1; overflow-y: auto; padding: 32px; }
.page-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 27px; font-weight: 600; letter-spacing: -0.016em; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--ash); font-size: 14px; }

@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 60px; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 0 8px; border-right: 0; border-top: 1px solid var(--steel-edge); }
  .rail .logo, .rail .spacer { display: none; }
  .rail .nav.active::before { display: none; }
  .rail a.nav, .rail button.nav, .org-chip { width: 44px; height: 44px; }
  .page { padding: 20px 16px; }
}

/* ============ Bandeja ============ */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.inbox.with-panel { grid-template-columns: 360px minmax(0, 1fr) 320px; }
.list-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--steel-edge); background: var(--midnight); }
.list-head { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.list-head h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.009em; flex: 1; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mist); pointer-events: none; }
.search .input { padding-left: 38px; height: 38px; background: var(--slate-depth); border-color: transparent; }
.search .input:focus { border-color: var(--signal); }
.filters { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid rgba(27, 39, 61, .6); position: relative; }
.chat-item:hover { background: rgba(19, 29, 47, .6); }
.chat-item.active { background: var(--slate-depth); }
.chat-item .top { display: flex; align-items: baseline; gap: 8px; }
.chat-item .name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; }
.chat-item.unread .name { color: var(--paper); }
.chat-item .time { font-size: 12px; color: var(--mist); flex: none; }
.chat-item.unread .time { color: var(--paper); }
.chat-item .preview { display: flex; align-items: center; gap: 4px; color: var(--ash); font-size: 14px; margin-top: 1px; }
.chat-item .preview .text { flex: 1; min-width: 0; }
.chat-item .meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chat-item .typing { color: var(--ash); font-style: italic; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: var(--r-pill); background: var(--slate-depth); border: 1px solid var(--steel-edge); font-size: 11px; font-weight: 500; color: var(--ash); white-space: nowrap; }
.tag .swatch { width: 6px; height: 6px; border-radius: 50%; }
.tick { width: 15px; height: 15px; color: var(--mist); flex: none; }
.tick.read { color: var(--paper); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-dot.open { background: var(--ok); }
.status-dot.pending { background: var(--amber); }
.status-dot.resolved { background: var(--mist); }

.convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #070d18; position: relative; }
.convo-empty { flex: 1; display: grid; place-items: center; color: var(--ash); text-align: center; padding: 24px; }
.convo-empty img { width: 64px; height: 64px; opacity: .9; margin-bottom: 16px; }
.convo-empty h3 { margin: 0 0 4px; color: var(--paper); font-size: 19px; }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--steel-edge); background: var(--midnight); min-height: 65px; }
.convo-head .title { min-width: 0; flex: 1; }
.convo-head .title b { font-size: 15px; font-weight: 600; display: block; }
.convo-head .title span { font-size: 13px; color: var(--ash); }
.msgs { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 3px; }
.day-sep { align-self: center; font-size: 12px; color: var(--ash); background: var(--slate-depth); padding: 3px 12px; border-radius: var(--r-pill); margin: 12px 0 8px; }
.msg-row { display: flex; position: relative; }
.msg-row.me { justify-content: flex-end; }
.msg-row.sys { justify-content: center; }
.bubble { max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: 16px; background: var(--slate-depth); border: 1px solid var(--steel-edge); position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-row.me .bubble { background: #1b2a4a; border-color: #243660; border-bottom-right-radius: 5px; }
.msg-row:not(.me) .bubble { border-bottom-left-radius: 5px; }
.bubble .who { font-size: 12px; font-weight: 600; color: var(--ash); margin-bottom: 2px; }
.bubble .body { white-space: pre-wrap; font-size: 15px; line-height: 1.4; }
.bubble .foot { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 2px; font-size: 11px; color: var(--mist); }
.bubble .by { margin-right: auto; font-size: 11px; color: var(--mist); }
.bubble.deleted .body { color: var(--mist); font-style: italic; }
.msg-row .bubble.note, .msg-row.me .bubble.note { background: rgba(246, 176, 60, .08); border: 1px dashed rgba(246, 176, 60, .45); max-width: min(560px, 78%); }
.bubble.note .who { color: var(--amber); display: flex; align-items: center; gap: 6px; }
.bubble.automated { border-style: dashed; }
.bubble img.media, .bubble video.media { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; cursor: zoom-in; margin-bottom: 4px; }
.bubble audio { width: 260px; max-width: 100%; height: 40px; margin-bottom: 4px; }
.bubble .sticker { width: 140px; height: 140px; object-fit: contain; }
.file-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(9, 16, 28, .5); border-radius: 10px; text-decoration: none; margin-bottom: 4px; }
.file-card .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--steel-edge); display: grid; place-items: center; }
.file-card small { display: block; color: var(--ash); }
.rich-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: rgba(9, 16, 28, .5); border-radius: 12px; margin-bottom: 4px; min-width: 220px; }
.rich-card .head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.rich-card .opt { padding: 6px 10px; border: 1px solid var(--steel-edge); border-radius: 10px; font-size: 14px; }
.rich-card a { color: var(--pale-mist); font-size: 13px; }
.quote { border-left: 3px solid var(--ash); background: rgba(9, 16, 28, .45); border-radius: 8px; padding: 5px 9px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.quote b { display: block; font-size: 12px; color: var(--ash); }
.quote span { color: var(--pale-mist); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.reactions span { background: var(--midnight); border: 1px solid var(--steel-edge); border-radius: var(--r-pill); padding: 0 7px; font-size: 13px; height: 22px; display: inline-flex; align-items: center; }
.reactions span.mine { border-color: var(--ash); }
.sys-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ash); background: var(--slate-depth); border: 1px solid var(--steel-edge); padding: 5px 14px; border-radius: var(--r-pill); margin: 6px 0; }
.sys-pill.missed { color: var(--danger); border-color: rgba(255, 93, 115, .35); }
.msg-actions { position: absolute; top: -14px; display: none; gap: 2px; background: var(--slate-depth); border: 1px solid var(--steel-edge); border-radius: 12px; padding: 2px; z-index: 5; box-shadow: var(--shadow-pop); }
.msg-row.me .msg-actions { right: 8px; } .msg-row:not(.me) .msg-actions { left: 8px; }
.msg-row:hover .msg-actions, .msg-row.menu-open .msg-actions { display: flex; }
.msg-row.flash .bubble { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 2px var(--signal); } 100% { box-shadow: 0 0 0 0 transparent; } }
.load-more { align-self: center; margin: 8px 0; }

.composer { border-top: 1px solid var(--steel-edge); background: var(--midnight); padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.composer.note-mode { background: rgba(246, 176, 60, .05); border-top-color: rgba(246, 176, 60, .4); }
.composer .modes { display: flex; gap: 4px; }
.composer .modes button { border: 0; background: transparent; color: var(--ash); font-weight: 500; font-size: 13px; padding: 4px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.composer .modes button.active { background: var(--slate-depth); color: var(--paper); }
.composer .modes button.active.note { color: var(--amber); }
.composer-box { display: flex; align-items: flex-end; gap: 6px; background: var(--slate-depth); border: 1px solid var(--steel-edge); border-radius: 18px; padding: 6px 6px 6px 8px; }
.composer-box:focus-within { border-color: var(--graphite); }
.composer textarea { flex: 1; background: transparent; border: 0; resize: none; outline: none; padding: 8px 4px; max-height: 160px; min-height: 36px; font-size: 15px; line-height: 1.4; overflow-y: hidden; }
.composer textarea::placeholder { color: var(--mist); }
.ctx-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-left: 3px solid var(--ash); background: var(--slate-depth); border-radius: 8px; font-size: 13px; }
.ctx-bar b { display: block; font-size: 12px; color: var(--ash); }
.recording { display: flex; align-items: center; gap: 10px; flex: 1; padding: 0 8px; }
.recording .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.slash-pop { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); background: var(--slate-depth); border: 1px solid var(--steel-edge); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop); max-height: 260px; overflow-y: auto; z-index: 20; }
.slash-pop button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.slash-pop button:hover, .slash-pop button.sel { background: var(--steel-edge); }
.slash-pop b { font-size: 14px; } .slash-pop span { display: block; font-size: 13px; color: var(--ash); }
.line-warn { padding: 10px 16px; background: rgba(255, 93, 115, .1); color: var(--danger); font-size: 13px; text-align: center; border-top: 1px solid rgba(255, 93, 115, .3); }

.side-col { border-left: 1px solid var(--steel-edge); background: var(--midnight); overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.side-col .sec h5 { margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mist); }
.side-col .profile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.side-col .profile h4 { margin: 0; font-size: 19px; font-weight: 600; }
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv .item { display: flex; flex-direction: column; gap: 4px; }
.kv .item > label { font-size: 12px; color: var(--mist); }
.scheduled-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; background: var(--slate-depth); border-radius: 10px; font-size: 13px; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(4, 8, 15, .92); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 12px; }

@media (max-width: 1280px) { .inbox.with-panel { grid-template-columns: 340px minmax(0, 1fr); } .inbox.with-panel .side-col { position: absolute; right: 0; top: 0; bottom: 0; width: 320px; z-index: 30; box-shadow: var(--shadow-pop); } }
@media (max-width: 820px) {
  .inbox, .inbox.with-panel { grid-template-columns: minmax(0, 1fr); position: relative; }
  .inbox .convo { display: none; }
  .inbox.has-chat .list-col { display: none; }
  .inbox.has-chat .convo { display: flex; }
  .inbox.with-panel .side-col { width: 100%; }
  .msgs { padding: 12px; }
  .bubble { max-width: 88%; }
  .back-btn { display: inline-flex !important; }
  .convo-head { gap: 8px; padding: 10px 8px; }
  .convo-head .hdr-pill, .convo-head .lbl { display: none; }
}
.back-btn { display: none; }

/* ============ Ajustes ============ */
.settings { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.settings-nav { border-right: 1px solid var(--steel-edge); padding: 24px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.settings-nav h2 { font-size: 19px; margin: 0 0 12px 12px; font-weight: 600; letter-spacing: -0.009em; }
.settings-nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--ash); text-decoration: none; font-size: 14px; font-weight: 500; }
.settings-nav a:hover { background: var(--slate-depth); color: var(--paper); }
.settings-nav a.active { background: var(--slate-depth); color: var(--paper); }
.settings-nav .group { margin: 16px 12px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mist); }
.settings-body { overflow-y: auto; padding: 32px; }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--steel-edge); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .txt { flex: 1; min-width: 0; }
.setting-row .txt b { display: block; font-weight: 500; font-size: 15px; }
.setting-row .txt span { color: var(--ash); font-size: 13px; }
.line-card { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--steel-edge); flex-wrap: wrap; }
.line-card:last-child { border-bottom: 0; }
.qr-box { background: #fff; border-radius: 16px; padding: 12px; width: 264px; height: 264px; display: grid; place-items: center; margin: 0 auto; }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.pair-code { font-size: 34px; font-weight: 700; letter-spacing: .14em; text-align: center; padding: 16px; background: var(--midnight); border: 1px solid var(--steel-edge); border-radius: var(--r-btn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--steel-edge); border-radius: var(--r-pill); cursor: pointer; font-size: 13px; user-select: none; }
.chip-check input { accent-color: var(--signal); margin: 0; }
.chip-check:has(input:checked) { border-color: var(--ash); background: var(--slate-depth); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { background: var(--slate-depth); border: 1px solid var(--steel-edge); border-radius: var(--r-card); padding: 20px; }
.stat .v { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .l { color: var(--ash); font-size: 13px; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; gap: 2px; }
.bars .seg { width: 100%; border-radius: 4px; min-height: 2px; }
.bars .seg.in { background: var(--paper); }
.bars .seg.out { background: var(--graphite); }
.bars .lbl { font-size: 11px; color: var(--mist); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ash); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.usage { height: 6px; border-radius: 3px; background: var(--steel-edge); overflow: hidden; }
.usage > div { height: 100%; background: var(--paper); border-radius: 3px; }

@media (max-width: 820px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { flex-direction: row; overflow-x: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--steel-edge); }
  .settings-nav h2, .settings-nav .group { display: none; }
  .settings-nav a { white-space: nowrap; }
  .settings-body { padding: 20px 16px; }
}
