/* ── Geek Agent Enterprise · CRM shell — Little Caesars MX DS ── */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--surface-page);
  color: var(--text-primary);
  min-width: 1200px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Layout ─────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  padding: var(--s-8) var(--s-10);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ── Sidebar ────────────────────────────────── */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: var(--s-6) var(--s-5) var(--s-5);
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

.sidebar-brand .sub {
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--n-300);
  margin-top: 6px;
}

.sidebar-nav { flex: 1; padding: var(--s-4) var(--s-3); overflow-y: auto; }

.nav-section {
  font-family: var(--font-condensed);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--n-500);
  padding: 14px 14px 8px;
}

.nav-badge {
  margin-left: auto;
  background: var(--lc-orange);
  color: #fff;
  font-size: 11px;
  font-weight: var(--fw-bold);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  line-height: 1.3;
}

.nav-item.active .nav-badge { background: rgba(255,255,255,.22); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: var(--fw-medium);
  color: var(--n-300);
  margin-bottom: 2px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }

.nav-item.active {
  background: var(--lc-orange);
  color: #fff;
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-hot);
}

.sidebar-foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid rgba(255,255,255,.09);
  font-size: 12px;
  color: var(--n-400);
}

.foot-user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--n-300); }

.foot-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--state-success); flex-shrink: 0; }

.foot-btn {
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--n-500);
  border-radius: var(--r-pill);
  color: var(--n-300);
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}

.foot-btn:hover { border-color: var(--lc-orange); color: #fff; }

/* ── Topbar ─────────────────────────────────── */
.topbar {
  height: 64px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: 0 var(--s-8);
  position: sticky;
  top: 0;
  z-index: 50;
}

.search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  padding: 9px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.search svg { width: 16px; height: 16px; flex-shrink: 0; }

.search input {
  border: 0; background: transparent; outline: none;
  font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
  flex: 1;
}

.topbar-spacer { flex: 1; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}

.icon-btn:hover { background: var(--surface-muted); }
.icon-btn svg { width: 18px; height: 18px; }

.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lc-orange);
  border: 2px solid var(--surface-card);
}

.user-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--surface-card);
  cursor: pointer;
}

.user-chip .who { text-align: right; line-height: 1.2; }
.user-chip .who .name { font-size: 13px; font-weight: var(--fw-semibold); }
.user-chip .who .role { font-size: 11px; color: var(--text-muted); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--lc-orange-100);
  color: var(--lc-orange-700);
  font-size: 13px; font-weight: var(--fw-bold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Page header ────────────────────────────── */
.eyebrow {
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--lc-orange);
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-6); margin-bottom: var(--s-6); }

.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: 700;
  letter-spacing: var(--tr-display);
  margin-top: 6px;
}

.page-sub { color: var(--text-muted); margin-top: 8px; font-size: var(--fs-body); }

/* ── Primitives ─────────────────────────────── */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: var(--s-6); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border-subtle);
}

.card-title { font-size: var(--fs-h4); font-weight: var(--fw-bold); font-family: var(--font-display); letter-spacing: var(--tr-tight); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: var(--fw-semibold);
  font-size: 14px; line-height: 1;
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  padding: 12px 22px; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--lc-orange); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--lc-orange-600); box-shadow: var(--shadow-hot); }

.btn-secondary { background: var(--lc-ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--n-700); }

.btn-ghost { background: transparent; color: var(--lc-ink); border-color: var(--border-medium); }
.btn-ghost:hover { background: var(--n-50); }

.btn-sm { padding: 9px 16px; font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-condensed);
  font-size: 11px; font-weight: var(--fw-semibold);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  line-height: 1.3;
}

.badge-hot    { background: var(--lc-orange-100); color: var(--lc-orange-700); }
.badge-ink    { background: var(--lc-ink); color: #fff; }
.badge-cream  { background: var(--n-100); color: var(--n-700); }
.badge-green  { background: #E3EFE5; color: var(--lc-green); }
.badge-red    { background: #F7E0DC; color: var(--lc-red); }
.badge-yellow { background: #FBF0D2; color: #8A6A10; }

/* ── Table ──────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table th {
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow);
  letter-spacing: .12em; text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-align: left;
  padding: 12px var(--s-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-muted);
}

.table td {
  padding: 14px var(--s-6);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--surface-muted); }

/* ── Stats ──────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }

.stat .label {
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow); letter-spacing: .12em; text-transform: uppercase;
  font-weight: var(--fw-semibold); color: var(--text-muted);
}

.stat .value {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 700; letter-spacing: var(--tr-display);
  line-height: 1.1; margin-top: 8px;
}

.stat .delta { font-size: 13px; margin-top: 6px; font-weight: var(--fw-medium); }
.delta-up { color: var(--state-success); }
.delta-down { color: var(--state-danger); }

/* ── Forms ──────────────────────────────────── */
.field { margin-bottom: var(--s-5); }

.field label {
  display: block;
  font-family: var(--font-condensed);
  font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase;
  font-weight: var(--fw-semibold); color: var(--text-secondary);
  margin-bottom: 8px;
}

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
  background: var(--surface-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--lc-orange-100);
}

.textarea { resize: vertical; min-height: 96px; line-height: var(--lh-body); }

/* ── Misc ───────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: var(--fw-medium);
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-pill);
  padding: 4px 12px; color: var(--text-secondary);
}

.folio { font-family: var(--font-mono); font-weight: var(--fw-bold); font-size: 13px; letter-spacing: .02em; }

.divider { height: 1px; background: var(--border-subtle); border: 0; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }

::selection { background: var(--lc-orange-100); }

/* ── Filter toolbar (reusable across list/inbox views) ── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.toolbar .select {
  width: auto; padding: 9px 34px 9px 14px; font-size: 13px; font-weight: var(--fw-medium);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23645C50' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center; cursor: pointer;
}

.toolbar-label {
  font-family: var(--font-condensed); font-size: var(--fs-eyebrow); letter-spacing: .1em;
  text-transform: uppercase; font-weight: var(--fw-semibold); color: var(--text-muted);
}

.toolbar-clear {
  font-family: var(--font-condensed); font-size: 12px; font-weight: var(--fw-semibold);
  letter-spacing: .04em; color: var(--lc-orange); cursor: pointer; margin-left: auto;
}

/* ── Summary chips row (inbox status counters) ── */
.summary-row { display: flex; gap: var(--s-3); margin-bottom: var(--s-5); }

.summary-chip {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-subtle); background: var(--surface-card);
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.summary-chip:hover { border-color: var(--border-medium); }
.summary-chip.active { border-color: var(--lc-orange); background: var(--lc-orange-050); }

.summary-chip .num { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: var(--tr-display); line-height: 1; }
.summary-chip .lbl { font-size: 12px; color: var(--text-muted); font-weight: var(--fw-medium); margin-top: 3px; }
.summary-chip.alert { border-color: var(--lc-red); background: #FBEDEA; }
.summary-chip.alert .num { color: var(--state-danger); }
.summary-chip.alert .lbl { color: var(--lc-red); }

/* ── Bulk action bar ── */
.bulk-bar {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--lc-ink); color: #fff;
  border-radius: var(--r-sm); padding: 10px 16px; margin-bottom: var(--s-3);
}
.bulk-bar .count { font-size: 13px; font-weight: var(--fw-semibold); }
.bulk-bar .spacer { flex: 1; }
.bulk-bar button {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-pill); padding: 7px 14px; font-size: 12.5px; font-weight: var(--fw-medium);
  cursor: pointer; transition: background var(--dur-fast) var(--ease-out);
}
.bulk-bar button:hover { background: rgba(255,255,255,.2); }

/* ── Tipo de queja chips (Con / Sin comentario) ── */
.badge-con-comentario { background: var(--lc-orange); color: #fff; }
.badge-sin-comentario { background: var(--n-200); color: var(--n-700); }

/* ── Channel icons ── */
.channel-icon {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.channel-icon svg { width: 17px; height: 17px; }
.channel-whatsapp { background: #25D366; color: #fff; }
.channel-web { background: var(--lc-ink); color: #fff; }

/* ── Client / avatar cells ── */
.cli-cell { display: flex; align-items: center; gap: 12px; }
.cli-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-condensed); font-size: 12px; font-weight: var(--fw-bold); color: #fff;
}
.cli-name { font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 8px; }
.cli-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Priority (Escalada por AI) row indicator ── */
.row-priority td:first-child { box-shadow: inset 3px 0 0 var(--state-danger); }
.row-priority { background: #FDF8F6; }
.row-priority:hover { background: #FBEDEA !important; }

.row-nav { cursor: pointer; }

.priority-flag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--lc-red); color: #fff;
  font-family: var(--font-condensed); font-size: 9.5px; font-weight: var(--fw-bold);
  letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--r-pill); line-height: 1.2;
}
.priority-flag svg { width: 10px; height: 10px; }

/* ── Pending category (Sin comentario + reminder) ── */
.cat-pending { display: flex; align-items: center; gap: 6px; color: var(--n-500); font-weight: var(--fw-medium); }
.cat-pending svg { width: 14px; height: 14px; flex-shrink: 0; }
.cat-main { font-weight: var(--fw-medium); }
.cat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Agent cell ── */
.agent-cell { display: flex; align-items: center; gap: 8px; }
.agent-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: var(--fw-bold); color: #fff;
  font-family: var(--font-condensed);
}
.agent-name { font-size: 13px; font-weight: var(--fw-medium); }
.agent-role { font-size: 11.5px; color: var(--text-muted); }

/* ══ Conversación individual · layout 3 columnas ══ */
.conv-app { display: flex; height: 100vh; overflow: hidden; }

/* ── Columna izquierda: lista de conversaciones ── */
.conv-list {
  width: 300px; flex-shrink: 0; background: var(--surface-card);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; height: 100%;
}
.conv-list-head { padding: var(--s-5) var(--s-5) var(--s-4); border-bottom: 1px solid var(--border-subtle); }
.conv-list-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: var(--tr-tight); }
.conv-list-search {
  margin-top: var(--s-4); display: flex; align-items: center; gap: 8px;
  background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: var(--r-pill);
  padding: 8px 14px; color: var(--text-muted); font-size: 13px;
}
.conv-list-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.conv-list-search input { border: 0; background: transparent; outline: none; font-family: var(--font-body); font-size: 13px; flex: 1; }
.conv-list-tabs { display: flex; gap: 8px; margin-top: var(--s-4); }
.conv-list-tab {
  font-family: var(--font-condensed); font-size: 11px; font-weight: var(--fw-semibold);
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-muted); border-radius: var(--r-pill); padding: 6px 12px;
}
.conv-list-tab.active { background: var(--lc-ink); color: #fff; }

.conv-items { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex; gap: 10px; padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-subtle); cursor: pointer; position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}
.conv-item:hover { background: var(--surface-muted); }
.conv-item.active { background: var(--lc-orange-050); }
.conv-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lc-orange); }

.conv-item-icons { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.conv-channel-mini {
  width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.conv-channel-mini svg { width: 11px; height: 11px; }
.conv-avatar-sm {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-condensed); font-size: 12px; font-weight: var(--fw-bold); color: #fff;
}
.conv-item-body { flex: 1; min-width: 0; }
.conv-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-item-name { font-size: 13.5px; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.conv-item-snippet { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.conv-item-foot .badge { font-size: 9.5px; padding: 3px 8px; }
.conv-item-suc { font-size: 10.5px; color: var(--text-muted); font-weight: var(--fw-medium); }

/* ── Columna centro: hilo de conversación ── */
.conv-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; background: var(--surface-page); }

.thread-head {
  display: flex; align-items: center; gap: 12px;
  padding: var(--s-4) var(--s-6); background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.thread-head-info { flex: 1; min-width: 0; }
.thread-head-name { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.thread-head-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.thread-head-meta .folio { color: var(--text-secondary); }

.thread-body { flex: 1; overflow-y: auto; padding: var(--s-6); display: flex; flex-direction: column; gap: 14px; }

.thread-daydivider {
  align-self: center; font-family: var(--font-condensed); font-size: 10.5px; font-weight: var(--fw-semibold);
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-muted); padding: 5px 14px; border-radius: var(--r-pill);
}

.msg-row { display: flex; flex-direction: column; max-width: 62%; }
.msg-row.from-client { align-self: flex-start; }
.msg-row.from-ai { align-self: flex-start; }
.msg-row.from-human { align-self: flex-end; align-items: flex-end; }

.msg-ai-label {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 5px;
  font-family: var(--font-condensed); font-size: 10.5px; font-weight: var(--fw-bold);
  letter-spacing: .07em; text-transform: uppercase; color: var(--lc-orange-700);
}
.msg-ai-label .ai-dot {
  width: 15px; height: 15px; border-radius: 5px; background: var(--lc-orange); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 8.5px;
}

.msg-bubble { padding: 12px 15px; font-size: 14px; line-height: 1.5; }
.msg-row.from-client .msg-bubble { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 4px 16px 16px 16px; }
.msg-row.from-ai .msg-bubble { background: var(--lc-orange-050); border: 1px solid var(--lc-orange-100); border-radius: 4px 16px 16px 16px; }
.msg-row.from-human .msg-bubble { background: var(--lc-ink); color: #fff; border-radius: 16px 4px 16px 16px; }

.msg-meta { font-size: 11px; color: var(--text-muted); margin-top: 5px; padding: 0 3px; }

.thread-handoff {
  align-self: stretch; display: flex; align-items: center; gap: 12px; margin: 4px 0;
}
.thread-handoff::before, .thread-handoff::after { content: ''; flex: 1; height: 1px; background: var(--state-danger); opacity: .35; }
.thread-handoff-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-condensed); font-size: 10.5px; font-weight: var(--fw-bold);
  letter-spacing: .08em; text-transform: uppercase; color: var(--state-danger);
  background: #FBEDEA; border: 1px solid #F0C9C0; padding: 6px 14px; border-radius: var(--r-pill); white-space: nowrap;
}
.thread-handoff-label svg { width: 12px; height: 12px; }

.thread-typing { padding: 0 var(--s-6) var(--s-2); font-size: 12px; color: var(--text-muted); font-style: italic; flex-shrink: 0; }

.composer { border-top: 1px solid var(--border-subtle); background: var(--surface-card); padding: var(--s-4) var(--s-6); flex-shrink: 0; }
.composer-tabs { display: flex; gap: 8px; margin-bottom: var(--s-3); }
.composer-tab {
  font-family: var(--font-condensed); font-size: 12px; font-weight: var(--fw-semibold);
  letter-spacing: .04em; padding: 8px 16px; border-radius: var(--r-pill); cursor: pointer;
  border: 1.5px solid var(--border-medium); background: transparent; color: var(--text-secondary);
}
.composer-tab.active { background: var(--lc-ink); color: #fff; border-color: var(--lc-ink); }
.composer-tab.danger { margin-left: auto; border-color: var(--lc-red); color: var(--lc-red); }
.composer-tab.danger:hover { background: #FBEDEA; }
.composer-box { border: 1.5px solid var(--border-medium); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.composer-box textarea {
  width: 100%; border: 0; outline: none; resize: none; font-family: var(--font-body); font-size: 14px;
  min-height: 44px; color: var(--text-primary); background: transparent;
}
.composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.composer-hint { font-size: 11.5px; color: var(--text-muted); }

/* ── Columna derecha: panel de contexto ── */
.conv-context {
  width: 320px; flex-shrink: 0; background: var(--surface-card);
  border-left: 1px solid var(--border-subtle); height: 100%; overflow-y: auto;
}
.ctx-section { padding: var(--s-5); border-bottom: 1px solid var(--border-subtle); }
.ctx-eyebrow {
  display: flex; align-items: center; gap: 7px; margin-bottom: var(--s-4);
  font-family: var(--font-condensed); font-size: 10.5px; font-weight: var(--fw-bold);
  letter-spacing: .1em; text-transform: uppercase; color: var(--lc-orange);
}
.ctx-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lc-orange); }

.ctx-client-head { display: flex; align-items: center; gap: 12px; }
.ctx-client-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--lc-orange);
  color: #fff; font-family: var(--font-condensed); font-weight: var(--fw-bold); font-size: 15px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ctx-client-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.ctx-client-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.ctx-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.ctx-row:last-child { border-bottom: 0; }
.ctx-row .k { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-condensed); font-weight: var(--fw-semibold); }
.ctx-row .v { font-weight: var(--fw-medium); text-align: right; }
.ctx-row .v.stars { color: var(--lc-yellow); letter-spacing: 1px; }

.ctx-confidence {
  margin-left: auto; font-family: var(--font-condensed); font-size: 10px; font-weight: var(--fw-bold);
  letter-spacing: .04em; background: var(--lc-orange-100); color: var(--lc-orange-700); padding: 3px 9px; border-radius: var(--r-pill);
}

.ctx-summary { font-size: 13px; line-height: 1.55; color: var(--text-secondary); background: var(--surface-muted); border-radius: var(--r-sm); padding: var(--s-4); }
.ctx-summary b { color: var(--text-primary); }

.ctx-hist-item { border: 1px solid var(--border-subtle); border-radius: var(--r-sm); padding: var(--s-3) var(--s-4); margin-top: var(--s-3); }
.ctx-hist-top { display: flex; justify-content: space-between; align-items: baseline; }
.ctx-hist-top .folio { font-size: 12.5px; }
.ctx-hist-top .when { font-size: 11px; color: var(--text-muted); }
.ctx-hist-cat { font-size: 13px; font-weight: var(--fw-medium); margin-top: 4px; }
.ctx-hist-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ══ Administración: role banner, tabs, modal, mini-map ══ */

/* ── Role banner ── */
.role-banner {
  background: var(--lc-ink); color: #fff;
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-8); font-size: 13px;
}
.role-banner .role-title { font-weight: var(--fw-bold); letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.role-banner .role-title .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--state-success); }
.role-banner .role-sep { color: var(--n-500); }
.role-banner .role-desc { color: var(--n-300); }
.role-banner .role-spacer { flex: 1; }
.role-pills { display: flex; gap: 6px; }
.role-pill {
  font-family: var(--font-condensed); font-size: 10.5px; font-weight: var(--fw-bold);
  letter-spacing: .08em; text-transform: uppercase; padding: 6px 13px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.18); color: var(--n-400);
}
.role-pill.current { background: var(--lc-orange); color: #fff; border-color: var(--lc-orange); }

/* ── Tabs ── */
.view-tabs { display: flex; gap: var(--s-6); border-bottom: 1.5px solid var(--border-subtle); margin-bottom: var(--s-5); }
.view-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 2px 14px; margin-bottom: -1.5px;
  font-family: var(--font-body); font-size: 15px; font-weight: var(--fw-semibold); color: var(--text-muted);
  border-bottom: 2.5px solid transparent; cursor: pointer;
}
.view-tab .count {
  font-family: var(--font-condensed); font-size: 11.5px; font-weight: var(--fw-bold);
  background: var(--n-100); color: var(--text-secondary); padding: 2px 9px; border-radius: var(--r-pill);
}
.view-tab.active { color: var(--lc-ink); border-color: var(--lc-orange); }
.view-tab.active .count { background: var(--lc-orange); color: #fff; }

/* ── Role badges (Usuarios) ── */
.badge-role-admin { background: var(--lc-ink); color: #fff; }
.badge-role-supervisor { background: var(--lc-orange); color: #fff; }
.badge-muted { background: var(--n-100); color: var(--n-500); }

/* ── Table row action icon buttons ── */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn-sm {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.icon-btn-sm svg { width: 15px; height: 15px; }
.icon-btn-sm:hover { background: var(--surface-muted); border-color: var(--border-medium); }
.icon-btn-sm.danger:hover { background: #FBEDEA; border-color: var(--lc-red); color: var(--lc-red); }

.suc-cell { display: flex; align-items: center; gap: 12px; }
.suc-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--lc-orange-050); color: var(--lc-orange-700);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}

/* ── Modal ── */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(26,22,19,.55);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: var(--s-6);
}
.modal-panel {
  width: 640px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  background: var(--surface-card); border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
}
.modal-head {
  background: var(--lc-orange); color: #fff; padding: var(--s-5) var(--s-6);
  display: flex; align-items: center; gap: 12px; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-head-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm); background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-head-icon svg { width: 18px; height: 18px; }
.modal-head-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.modal-head-eyebrow { font-family: var(--font-condensed); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.modal-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.15);
  border: 0; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,.28); }
.modal-body { padding: var(--s-6); }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border-subtle); background: var(--surface-muted);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── Stepper ── */
.stepper { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-6); }
.step { display: flex; align-items: center; gap: 8px; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--n-100); color: var(--text-muted);
  font-family: var(--font-condensed); font-size: 11px; font-weight: var(--fw-bold);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step.active .step-num { background: var(--lc-orange); color: #fff; }
.step-label { font-family: var(--font-condensed); font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.step.active .step-label { color: var(--lc-ink); }
.step-line { flex: 1; height: 1.5px; background: var(--border-subtle); }

.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-4); }

/* ── Mini mapa (decorativo) ── */
.minimap {
  position: relative; flex: 1; min-height: 168px; border-radius: var(--r-sm); overflow: hidden;
  background: #E7E2D6; border: 1.5px solid var(--border-medium);
}
.minimap-label {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-family: var(--font-condensed); font-size: 9.5px; font-weight: var(--fw-bold);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary);
  background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: var(--r-pill);
}
.minimap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.minimap-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 3px; z-index: 2; }
.minimap-zoom button {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border-medium);
  background: #fff; color: var(--text-secondary); font-weight: var(--fw-bold); cursor: pointer;
}
.ctx-hist-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ══ Knowledge Base: drawer lateral, toggle, thumbnails ══ */

/* ── Product thumbnail ── */
.prod-thumb {
  width: 44px; height: 44px; border-radius: var(--r-sm); flex-shrink: 0; overflow: hidden;
  background: var(--n-50); display: flex; align-items: center; justify-content: center;
}
.prod-thumb svg { width: 100%; height: 100%; }
.prod-name { font-weight: var(--fw-semibold); }
.prod-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; max-width: 320px; }
.price-base { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.price-base .mx { font-family: var(--font-condensed); font-size: 11px; font-weight: var(--fw-semibold); color: var(--text-muted); margin-right: 2px; }

.override-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-condensed); font-size: 11px; font-weight: var(--fw-bold);
  letter-spacing: .04em; padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--lc-orange-100); color: var(--lc-orange-700);
}
.override-pill.none { background: var(--n-100); color: var(--n-500); text-transform: uppercase; letter-spacing: .07em; font-size: 10px; }

.row-editing { background: var(--lc-orange-050); }
.row-editing td:first-child { box-shadow: inset 3px 0 0 var(--lc-orange); }
.row-editing:hover { background: var(--lc-orange-050) !important; }

/* ── Side drawer ── */
.drawer-scrim { position: fixed; inset: 0; background: rgba(26,22,19,.28); z-index: 150; }
.side-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 400px; z-index: 160;
  background: var(--surface-card); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
}
.drawer-head {
  background: var(--lc-orange); color: #fff; padding: var(--s-5) var(--s-6);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.drawer-head-eyebrow { font-family: var(--font-condensed); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.drawer-head-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 2px; }
.drawer-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.15);
  border: 0; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.drawer-close:hover { background: rgba(255,255,255,.28); }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-6); }
.drawer-foot {
  flex-shrink: 0; border-top: 1px solid var(--border-subtle); background: var(--surface-muted);
  padding: var(--s-4) var(--s-6);
}
.drawer-foot-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); margin-bottom: var(--s-3); }
.drawer-foot-note .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--state-success); flex-shrink: 0; }
.drawer-foot-actions { display: flex; gap: 10px; }
.drawer-foot-actions .btn { flex: 1; }

.photo-upload {
  display: flex; align-items: center; gap: 14px; padding: var(--s-4);
  border: 1.5px dashed var(--border-medium); border-radius: var(--r-sm);
}
.photo-upload .prod-thumb { width: 64px; height: 64px; }
.photo-upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }

/* ── Toggle switch ── */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.switch-row .k { font-weight: var(--fw-semibold); font-size: 14px; }
.switch-row .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.switch { width: 42px; height: 24px; border-radius: 99px; background: var(--n-300); position: relative; cursor: pointer; flex-shrink: 0; transition: background var(--dur-fast) var(--ease-out); }
.switch.on { background: var(--lc-orange); }
.switch .knob { width: 18px; height: 18px; border-radius: 50%; background: #fff; position: absolute; top: 3px; left: 3px; transition: left var(--dur-fast) var(--ease-out); box-shadow: var(--shadow-xs); }
.switch.on .knob { left: 21px; }

.override-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.override-table th {
  text-align: left; font-family: var(--font-condensed); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  font-weight: var(--fw-semibold); color: var(--text-muted); padding: 8px 0; border-bottom: 1px solid var(--border-subtle);
}
.override-table td { padding: 9px 0; border-bottom: 1px solid var(--border-subtle); }
.override-table tr:last-child td { border-bottom: 0; }
.override-table .price { text-align: right; font-weight: var(--fw-semibold); }

/* ── Input with leading/trailing icon (login, price fields, etc.) ── */
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 42px; }
.input-icon-wrap svg.leading { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-muted); }
.input-icon-wrap .trailing-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-muted); cursor: pointer; display: flex;
}
.input-icon-wrap .trailing-btn svg { width: 17px; height: 17px; }

/* ══ Plantillas WhatsApp: preview bubble + Flow cards ══ */

.tpl-row { cursor: pointer; }
.tpl-row.selected { background: var(--lc-orange-050); }
.tpl-row.selected td:first-child { box-shadow: inset 3px 0 0 var(--lc-orange); }
.tpl-row.selected:hover { background: var(--lc-orange-050) !important; }
.tpl-name { font-weight: var(--fw-semibold); font-family: var(--font-mono); font-size: 13.5px; }
.tpl-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.tpl-usage { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.tpl-usage-pending { font-size: 11px; font-weight: var(--fw-semibold); color: var(--lc-orange-700); letter-spacing: .02em; }
.tpl-usage-rejected { font-size: 11px; font-weight: var(--fw-semibold); color: var(--lc-red); letter-spacing: .02em; }

/* ── Preview panel (sticky) ── */
.wa-preview-panel { position: sticky; top: calc(64px + var(--s-6)); }
.wa-preview-eyebrow { font-family: var(--font-condensed); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: var(--fw-semibold); color: var(--text-muted); }
.wa-preview-name { font-family: var(--font-mono); font-weight: 700; font-size: 15px; margin-top: 4px; }
.wa-preview-badges { display: flex; gap: 6px; margin-top: 10px; }

.wa-phone-mock { margin-top: var(--s-5); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm); }
.wa-mini-header {
  background: #075e54; color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.wa-mini-avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--lc-orange); }
.wa-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wa-mini-header-name { font-size: 13.5px; font-weight: var(--fw-semibold); }
.wa-mini-header-sub { font-size: 10.5px; opacity: .8; margin-top: 1px; }

.wa-mini-body {
  background: #ece5dd; padding: 16px 12px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end;
}
.wa-mini-bubble {
  background: #fff; border-radius: 2px 10px 10px 10px; padding: 9px 11px; box-shadow: 0 1px 0.5px rgba(0,0,0,.13);
  font-size: 13.5px; line-height: 1.45; color: #111b21; max-width: 92%;
}
.wa-mini-bubble .tag {
  display: inline-block; font-family: var(--font-condensed); font-size: 9.5px; font-weight: var(--fw-bold);
  letter-spacing: .06em; text-transform: uppercase; color: #8a6a10; background: rgba(255,214,110,.5);
  padding: 2px 8px; border-radius: 5px; margin-bottom: 6px;
}
.wa-mini-bubble .time { display: block; text-align: right; font-size: 10.5px; color: #667781; margin-top: 4px; }
.wa-mini-buttons { background: #fff; border-radius: 0 0 10px 10px; margin-top: 1px; overflow: hidden; box-shadow: 0 1px 0.5px rgba(0,0,0,.13); }
.wa-mini-buttons button {
  display: block; width: 100%; background: #fff; border: 0; border-top: 1px solid #e9edef;
  padding: 9px 10px; color: #027eb5; font-size: 12.5px; font-weight: var(--fw-medium); text-align: center; cursor: default;
}

.wa-preview-vars { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--surface-muted); border-radius: var(--r-sm); }
.wa-preview-vars .cap { font-family: var(--font-condensed); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: var(--fw-semibold); color: var(--text-muted); margin-bottom: 6px; }
.wa-preview-vars code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 5px; padding: 2px 6px; margin: 2px 3px 2px 0; display: inline-block; }

/* ── WhatsApp Flow cards ── */
.flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.flow-card { padding: var(--s-5); }
.flow-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.flow-card-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.flow-card-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.45; }

.flow-mini-form { background: var(--surface-muted); border: 1px solid var(--border-subtle); border-radius: var(--r-sm); padding: var(--s-4); margin: var(--s-4) 0; }
.flow-mini-field { margin-bottom: 10px; }
.flow-mini-field:last-child { margin-bottom: 0; }
.flow-mini-field .lbl { font-size: 10px; font-family: var(--font-condensed); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: var(--fw-semibold); margin-bottom: 4px; }
.flow-mini-field .box { height: 22px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 5px; }

.flow-stats { display: flex; gap: var(--s-5); margin-bottom: var(--s-4); }
.flow-stat b { font-family: var(--font-display); font-size: 16px; font-weight: 700; display: block; }
.flow-stat span { font-size: 11px; color: var(--text-muted); }
.flow-card-actions { display: flex; gap: 8px; }
.flow-card-actions .btn { flex: 1; }

/* ══ Reclasificar queja: notice, stepper de selects, historial ══ */

.reclass-notice {
  display: flex; gap: 10px; background: var(--lc-orange-050); border: 1px solid var(--lc-orange-100);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: var(--s-5);
}
.reclass-notice svg { flex-shrink: 0; color: var(--lc-orange-700); width: 18px; height: 18px; margin-top: 1px; }
.reclass-notice b { color: var(--text-primary); }

.reclass-step-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: var(--font-condensed); font-size: var(--fs-eyebrow); letter-spacing: .1em; text-transform: uppercase;
  font-weight: var(--fw-semibold); color: var(--text-secondary);
}
.reclass-step-num {
  width: 18px; height: 18px; border-radius: 50%; background: var(--lc-ink); color: #fff;
  font-size: 10px; font-weight: var(--fw-bold); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.reclass-history { margin-top: var(--s-3); }
.reclass-history-item { display: flex; gap: 12px; padding: var(--s-3) 0; border-bottom: 1px solid var(--border-subtle); }
.reclass-history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.reclass-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: var(--fw-bold); color: #fff; font-family: var(--font-condensed);
}
.reclass-history-body { flex: 1; min-width: 0; }
.reclass-history-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.reclass-author { font-size: 13px; font-weight: var(--fw-semibold); }
.reclass-role { font-size: 11.5px; color: var(--text-muted); font-weight: var(--fw-regular); }
.reclass-when { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.reclass-change { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; flex-wrap: wrap; }
.reclass-change .old { color: var(--text-muted); text-decoration: line-through; }
.reclass-change .chip-mini { background: var(--n-100); padding: 3px 9px; border-radius: 5px; font-weight: var(--fw-semibold); font-size: 12px; }
.reclass-note { font-size: 12px; color: var(--text-secondary); font-style: italic; margin-top: 7px; line-height: 1.4; }
.reclass-confidence { font-size: 11px; color: var(--lc-orange-700); font-weight: var(--fw-bold); margin-top: 6px; }
.reclass-editing-tag { font-size: 11px; color: var(--lc-orange-700); font-weight: var(--fw-bold); }

/* ══ Vistas por rol (Franquicia / Sucursal): topbar chip + banner sutil ══ */

.role-user-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 14px; border: 1px solid var(--border-subtle); border-radius: var(--r-pill);
  background: var(--surface-card);
}
.role-user-chip .who { text-align: right; line-height: 1.3; }
.role-user-chip .who .name { font-size: 13px; font-weight: var(--fw-semibold); }
.role-user-chip .who .role-tag {
  font-family: var(--font-condensed); font-size: 9.5px; font-weight: var(--fw-bold);
  letter-spacing: .06em; text-transform: uppercase; color: var(--lc-orange-700);
  background: var(--lc-orange-100); padding: 1.5px 7px; border-radius: 4px; display: inline-block; margin-top: 2px;
}

.subtle-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--lc-orange-050); border-bottom: 1px solid var(--lc-orange-100);
  padding: 10px var(--s-8); font-size: 13px; color: var(--text-secondary);
}
.subtle-banner svg { width: 15px; height: 15px; color: var(--lc-orange-700); flex-shrink: 0; }
.subtle-banner b { color: var(--text-primary); }
.subtle-banner .spacer { flex: 1; }
.subtle-banner .tag { font-size: 11.5px; color: var(--text-muted); }

/* ══ Reportes: constructor, chips de columnas, resumen, programados ══ */

.report-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.report-pill {
  padding: 7px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--border-medium);
  font-size: 12.5px; font-weight: var(--fw-semibold); cursor: pointer; background: var(--surface-card); color: var(--text-secondary);
}
.report-pill.active { background: var(--lc-ink); color: #fff; border-color: var(--lc-ink); }

.col-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: var(--fw-semibold);
  padding: 5px 11px; border-radius: 6px; background: var(--lc-orange-050); color: var(--lc-orange-700);
  border: 1px solid var(--lc-orange-100); cursor: pointer;
}
.col-chip.off { background: var(--n-100); color: var(--text-muted); border-color: var(--border-subtle); }
.col-chip svg { width: 11px; height: 11px; }

.report-summary { background: var(--lc-orange); color: #fff; border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-hot); }
.report-summary .rs-num { font-family: var(--font-display); font-weight: 700; font-size: 52px; letter-spacing: var(--tr-display); line-height: 1; }
.report-summary .rs-lbl { font-family: var(--font-condensed); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: var(--fw-semibold); opacity: .85; margin-top: 4px; }
.report-summary .rs-split { display: flex; gap: var(--s-5); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid rgba(255,255,255,.25); }
.report-summary .rs-split div b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.report-summary .rs-split div span { font-size: 11px; opacity: .85; }
.report-summary .rs-rows { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid rgba(255,255,255,.25); }
.report-summary .rs-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; opacity: .95; }
.report-summary .rs-row b { font-weight: var(--fw-semibold); }
.report-summary .btn-block { width: 100%; margin-top: 10px; }

.sched-recipients { display: flex; }
.sched-recipients .ra { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-card); margin-left: -8px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: var(--fw-bold); color: #fff; }
.sched-recipients .ra:first-child { margin-left: 0; }
.sched-recipients .more { font-size: 11px; color: var(--text-muted); margin-left: 6px; align-self: center; }
.sched-format { display: flex; gap: 4px; }
.sched-format span { font-size: 10.5px; font-weight: var(--fw-semibold); background: var(--n-100); color: var(--text-secondary); padding: 2px 7px; border-radius: 5px; }

/* ══ Configuración: bot card, slider, capacidades, canales ══ */

.bot-card-head {
  background: var(--lc-ink); color: #fff; border-radius: var(--r-md) var(--r-md) 0 0;
  padding: var(--s-4) var(--s-6); display: flex; align-items: center; gap: 14px;
}
.bot-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--lc-orange); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bot-avatar svg { width: 20px; height: 20px; }
.bot-card-eyebrow { font-family: var(--font-condensed); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--n-400); font-weight: var(--fw-semibold); }
.bot-card-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-top: 2px; }
.bot-card-status { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--n-300); }
.bot-card-status .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--state-success); }

.conf-slider-wrap { padding: var(--s-2) 4px 0; }
.conf-slider { width: 100%; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--lc-orange) 0%, var(--lc-orange) 75%, var(--n-100) 75%, var(--n-100) 100%); outline: none; }
.conf-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--lc-ink); border: 3px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
.conf-slider-ticks { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text-muted); font-family: var(--font-condensed); }

.cap-row { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--border-subtle); border-radius: var(--r-sm); padding: var(--s-4); margin-bottom: 10px; }
.cap-row:last-child { margin-bottom: 0; }
.cap-icon { width: 38px; height: 38px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.cap-icon svg { width: 18px; height: 18px; }
.cap-body { flex: 1; }
.cap-title { font-weight: var(--fw-semibold); font-size: 14.5px; }
.cap-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.lang-pills { display: flex; flex-direction: column; gap: 8px; }
.lang-pill { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--border-medium); font-size: 13.5px; font-weight: var(--fw-medium); cursor: pointer; }
.lang-pill.active { background: var(--lc-ink); color: #fff; border-color: var(--lc-ink); font-weight: var(--fw-semibold); }

.guardrail-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 13px; }
.guardrail-row input { width: 15px; height: 15px; accent-color: var(--lc-orange); }

.model-card { border: 1.5px solid var(--border-subtle); border-radius: var(--r-sm); padding: var(--s-4); }
.model-card .name { font-family: var(--font-mono); font-weight: var(--fw-bold); font-size: 14px; }
.model-card .sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.channel-card { border: 1.5px solid var(--border-subtle); border-radius: var(--r-md); padding: var(--s-5); }
.channel-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s-4); }
.channel-card-icon { width: 42px; height: 42px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.channel-card-icon svg { width: 22px; height: 22px; }
.channel-card-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.channel-card-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-condensed); letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }
.channel-card-metric { display: flex; justify-content: space-between; align-items: baseline; margin: var(--s-3) 0; padding: var(--s-3) 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.channel-card-metric .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-condensed); font-weight: var(--fw-semibold); }
.channel-card-metric .v { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.channel-snippet {
  background: var(--lc-ink); color: #B8E986; font-family: var(--font-mono); font-size: 11px;
  border-radius: 6px; padding: 10px 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  position: relative; margin-top: var(--s-3);
}
.channel-snippet::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 40px;
  background: linear-gradient(to right, transparent, var(--lc-ink));
}

/* ══ Notificaciones: panel desplegable desde la campana ══ */

.notif-panel {
  position: fixed; width: 400px; max-height: 80vh; overflow-y: auto;
  background: var(--surface-card); border-radius: var(--r-md); box-shadow: var(--shadow-xl);
  z-index: 300; border: 1px solid var(--border-subtle);
}
.notif-head { background: var(--lc-ink); color: #fff; padding: var(--s-4) var(--s-5); border-radius: var(--r-md) var(--r-md) 0 0; }
.notif-head-top { display: flex; align-items: center; gap: 10px; }
.notif-head-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.notif-head-count { margin-left: auto; font-size: 11.5px; color: var(--n-300); }
.notif-tabs { display: flex; gap: 6px; margin-top: var(--s-3); }
.notif-tab {
  font-family: var(--font-condensed); font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: .04em;
  padding: 5px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.1); color: var(--n-300); cursor: pointer;
}
.notif-tab.active { background: var(--lc-orange); color: #fff; }

.notif-item { display: flex; gap: 12px; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border-subtle); position: relative; }
.notif-item.unread::before { content: ''; position: absolute; left: 6px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: var(--lc-orange); }
.notif-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.notif-icon svg { width: 16px; height: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-type { font-family: var(--font-condensed); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; font-weight: var(--fw-bold); color: var(--lc-orange-700); display: flex; align-items: center; gap: 5px; }
.notif-type.danger { color: var(--lc-red); }
.notif-when { margin-left: auto; font-size: 10.5px; color: var(--text-muted); font-weight: var(--fw-regular); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.notif-title { font-weight: var(--fw-semibold); font-size: 13.5px; margin-top: 4px; }
.notif-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.notif-actions { display: flex; gap: 8px; margin-top: 9px; }
.notif-actions button {
  font-size: 11.5px; font-weight: var(--fw-semibold); padding: 6px 12px; border-radius: var(--r-pill);
  border: 1.5px solid var(--border-medium); background: var(--surface-card); cursor: pointer;
}
.notif-actions button.primary { background: var(--lc-orange); color: #fff; border-color: var(--lc-orange); }
.notif-foot { display: flex; justify-content: space-between; padding: var(--s-3) var(--s-5); }
.notif-foot a { font-size: 12px; font-weight: var(--fw-semibold); color: var(--lc-orange); }
