/* ═══════════════════════════════════════════════════════════════
   LULUA — Panel Cliente · Neumorphism Design System
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg:       #e0e5ec;
  --surface:  #e0e5ec;
  --card:     #e0e5ec;
  --border:   transparent;
  --border2:  transparent;
  --text:     #2d3436;
  --muted:    #636e72;
  --accent:   #00b894;
  --accent2:  #00a381;
  --danger:   #d63031;
  --warning:  #e17055;
  --info:     #0984e3;
  --radius:   18px;
  --font:     'Outfit', -apple-system, sans-serif;
  --mono:     'JetBrains Mono', monospace;

  --shadow-out:     6px 6px 14px rgba(163,177,198,0.6), -6px -6px 14px rgba(255,255,255,0.8);
  --shadow-out-sm:  3px 3px 8px rgba(163,177,198,0.5), -3px -3px 8px rgba(255,255,255,0.7);
  --shadow-in:      inset 3px 3px 7px rgba(163,177,198,0.5), inset -3px -3px 7px rgba(255,255,255,0.7);
  --shadow-in-deep: inset 4px 4px 10px rgba(163,177,198,0.6), inset -4px -4px 10px rgba(255,255,255,0.8);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── LOGIN ─────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-box {
  background: var(--card);
  border-radius: 28px;
  padding: 44px 40px;
  width: 400px;
  max-width: 95vw;
  box-shadow: var(--shadow-out);
}

.login-logo { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 4px; letter-spacing: -0.5px }
.login-sub  { font-size: 13px; color: var(--muted); margin-bottom: 30px; font-weight: 400 }

.login-error {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
  display: none;
  box-shadow: var(--shadow-in);
  font-weight: 500;
}

/* ─── APP SHELL ─────────────────────────────────────── */
.app { display: none; flex-direction: column; height: 100vh }
.app.visible { display: flex }

/* ─── TOPBAR ────────────────────────────────────────── */
.topbar {
  height: 64px;
  min-height: 64px;
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 14px;
  flex-shrink: 0;
  box-shadow: 3px 3px 8px rgba(163,177,198,0.35), -2px -2px 6px rgba(255,255,255,0.5);
  position: relative;
  z-index: 10;
}

.topbar-logo { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.3px }
.topbar-nav  { display: flex; gap: 4px; flex: 1; margin-left: 12px }

.nav-btn {
  padding: 8px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: none;
  background: transparent;
  font-family: var(--font);
  transition: all 0.25s ease;
}
.nav-btn:hover  { color: var(--text); box-shadow: var(--shadow-out-sm); background: var(--card) }
.nav-btn.active { color: var(--accent); background: var(--card); box-shadow: var(--shadow-in); font-weight: 600 }

.topbar-right { display: flex; align-items: center; gap: 12px }

.token-bar-wrap { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); font-weight: 500 }
.token-bar      { width: 72px; height: 6px; background: var(--card); border-radius: 3px; overflow: hidden; box-shadow: var(--shadow-in) }
.token-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 3px; transition: width 0.4s ease }
.token-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #fdcb6e) }
.token-bar-fill.danger  { background: linear-gradient(90deg, var(--danger), #ff7675) }

.btn-logout {
  background: var(--card);
  border: none;
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-out-sm);
}
.btn-logout:hover { color: var(--danger); box-shadow: var(--shadow-in) }

/* ─── STATUS DOTS ───────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0 }
.status-dot.connected   { background: var(--accent); box-shadow: 0 0 8px rgba(0,184,148,0.6) }
.status-dot.connecting  { background: var(--warning); animation: blink 1s infinite }
.status-dot.disconnected { background: #b2bec3 }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── CONTENT AREA ──────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  transition: padding 0.2s;
}
.content::-webkit-scrollbar        { width: 6px }
.content::-webkit-scrollbar-track  { background: transparent }
.content::-webkit-scrollbar-thumb  { background: rgba(163,177,198,0.4); border-radius: 3px }

.content.chat-mode { padding: 0; overflow: hidden }

.tab-content        { display: none }
.tab-content.active { display: block }
.tab-content.active.full-height { display: flex; height: 100% }

/* ─── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-out);
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ─── GRIDS ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px }

/* ─── INICIO — STATS ROW ─────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.stat {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-out);
  transition: box-shadow 0.3s ease;
}
.stat:hover { box-shadow: var(--shadow-out-sm) }

.stat-value { font-size: 26px; font-weight: 700; font-family: var(--mono); line-height: 1; color: var(--text) }
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: .5px; margin-bottom: 8px }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 400 }

/* Bot status card — spans first column */
.stat-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 24px;
}
.stat-bot-left  { display: flex; align-items: center; gap: 14px }
.stat-bot-icon  { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; transition: all .3s; background: rgba(163,177,198,0.2) }
.stat-bot-right { display: flex; align-items: center; gap: 10px }

/* ─── TOKENS WIDGET ─────────────────────────────────── */
.tokens-widget {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-out);
  position: relative;
  overflow: hidden;
}
.tokens-widget::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(0,184,148,0.08), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.progress-bar  { height: 8px; background: var(--card); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow-in) }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; transition: width 0.5s ease }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #fdcb6e) }
.progress-fill.danger  { background: linear-gradient(90deg, var(--danger), #ff7675) }

/* ─── TOGGLE ────────────────────────────────────────── */
.toggle {
  width: 44px; height: 24px;
  background: var(--card);
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-in);
}
.toggle.on { background: var(--accent) }
.toggle::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: left 0.25s ease;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}
.toggle.on::after { left: 23px }

/* ─── BUTTONS ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: var(--font);
  white-space: nowrap;
  box-shadow: var(--shadow-out-sm);
  background: var(--card);
  color: var(--text);
}
.btn:hover   { box-shadow: var(--shadow-in) }
.btn:active  { box-shadow: var(--shadow-in-deep) }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 4px 4px 10px rgba(0,184,148,0.3), -3px -3px 8px rgba(255,255,255,0.5);
}
.btn-primary:hover:not(:disabled) { background: var(--accent2); box-shadow: var(--shadow-in) }

.btn-ghost  { background: var(--card); color: var(--text); border: none }
.btn-danger { background: var(--card); color: var(--danger); box-shadow: var(--shadow-out-sm) }
.btn-danger:hover:not(:disabled) { box-shadow: var(--shadow-in) }

.btn-sm { padding: 7px 14px; font-size: 12px }
.btn-xs { padding: 5px 11px; font-size: 11px; border-radius: 9px }

/* ─── FORM FIELDS ───────────────────────────────────── */
.field { margin-bottom: 18px }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.3px }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
textarea,
select {
  width: 100%;
  background: var(--card);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  transition: box-shadow 0.25s ease;
  outline: none;
  box-shadow: var(--shadow-in);
}
input:focus, textarea:focus, select:focus {
  box-shadow: var(--shadow-in-deep), 0 0 0 2px rgba(0,184,148,0.15);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.6 }
select   { cursor: pointer }
select option { background: var(--card) }
input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent) }

/* ─── TABLES ────────────────────────────────────────── */
.table-wrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 2px solid rgba(163,177,198,0.3);
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(163,177,198,0.2);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none }
tr:hover td { background: rgba(0,184,148,0.04) }

/* ─── TAGS ──────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--card);
  color: var(--accent);
  margin: 2px;
  box-shadow: var(--shadow-out-sm);
}
.tag.paused { color: var(--danger) }

.phone-mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted) }

/* ─── TOOLBAR & SEARCH ──────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap }
.selected-count { font-size: 12px; color: var(--muted); font-family: var(--mono); font-weight: 500 }

.search-wrap { position: relative; flex: 1; max-width: 280px }
.search-wrap input { padding-left: 38px }
.search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
}

/* ─── QR CODE ───────────────────────────────────────── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px }
.qr-wrap img { width: 200px; height: 200px; border-radius: 16px; background: white; padding: 10px; box-shadow: var(--shadow-out) }
.qr-hint { color: var(--muted); font-size: 12.5px; text-align: center; max-width: 280px; line-height: 1.7 }

/* ─── MODALS ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(200,210,220,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all }

.modal {
  background: var(--card);
  border-radius: 24px;
  padding: 32px;
  width: 480px;
  max-width: 95vw;
  transform: translateY(16px);
  transition: transform 0.3s ease;
  box-shadow: 10px 10px 30px rgba(163,177,198,0.5), -10px -10px 30px rgba(255,255,255,0.7);
}
.modal-overlay.open .modal { transform: translateY(0) }
.modal-title   { font-size: 17px; font-weight: 700; margin-bottom: 22px; color: var(--text) }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px }

/* ─── CONVERSATION BUBBLES (modal) ──────────────────── */
.convo-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px;
}
.convo-list::-webkit-scrollbar       { width: 4px }
.convo-list::-webkit-scrollbar-thumb { background: rgba(163,177,198,0.4); border-radius: 2px }

.msg-bubble { max-width: 82%; padding: 11px 16px; border-radius: 16px; font-size: 13px; line-height: 1.6 }
.msg-user { background: var(--accent); color: white; align-self: flex-end; border-bottom-right-radius: 4px; box-shadow: 3px 3px 8px rgba(0,184,148,0.25) }
.msg-bot  { background: var(--card); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: var(--shadow-out-sm) }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 4px; font-family: var(--mono) }
.msg-user .msg-time { color: rgba(255,255,255,0.7) }

/* ─── PACK CARDS ────────────────────────────────────── */
.pack-card { border-radius: 16px; padding: 20px 22px; cursor: pointer; transition: all 0.25s ease; box-shadow: var(--shadow-out); background: var(--card) }
.pack-card:hover { box-shadow: var(--shadow-in) }
.pack-card.featured { box-shadow: 5px 5px 15px rgba(0,184,148,0.2), -5px -5px 15px rgba(255,255,255,0.7); position: relative }
.pack-card.featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  z-index: -1;
  opacity: 0.15;
}

/* ─── FILTER CHIPS ──────────────────────────────────── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: var(--muted);
  background: var(--card);
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--shadow-out-sm);
}
.filter-chip:hover  { color: var(--text); box-shadow: var(--shadow-in) }
.filter-chip.active { color: var(--accent); box-shadow: var(--shadow-in); font-weight: 700 }

/* ─── BANNERS ───────────────────────────────────────── */
.banner {
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-out);
}
.banner.warning { background: linear-gradient(135deg, rgba(225,112,85,0.08), transparent 60%) }
.banner.danger  { background: linear-gradient(135deg, rgba(214,48,49,0.08), transparent 60%) }

/* ─── TRIAL BANNER ──────────────────────────────────── */
.trial-banner {
  background: var(--card);
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-out);
  position: relative;
  overflow: hidden;
}
.trial-banner::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warning); border-radius: 4px 0 0 4px }
.trial-banner .trial-info { display: flex; align-items: center; gap: 12px }
.trial-banner .trial-icon { font-size: 22px; display: flex }
.trial-banner .trial-text { font-size: 13px; color: var(--warning); font-weight: 600 }
.trial-banner .trial-sub  { font-size: 12px; color: var(--muted); margin-top: 3px }
.trial-banner.expired::before { background: var(--danger) }
.trial-banner.expired .trial-text { color: var(--danger) }
.trial-banner.last-day { animation: trialPulse 2.5s infinite ease-in-out }
@keyframes trialPulse {
  0%,100% { box-shadow: var(--shadow-out) }
  50%     { box-shadow: 8px 8px 20px rgba(225,112,85,0.25), -6px -6px 14px rgba(255,255,255,0.8) }
}

/* ─── TRIAL EXPIRED OVERLAY ─────────────────────────── */
.trial-expired-overlay {
  position: fixed;
  inset: 0;
  background: rgba(200,210,220,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.trial-expired-overlay.visible { opacity: 1; pointer-events: all }

.trial-expired-box {
  background: var(--card);
  border-radius: 28px;
  padding: 44px;
  width: 440px;
  max-width: 95vw;
  text-align: center;
  box-shadow: 12px 12px 35px rgba(163,177,198,0.5), -12px -12px 35px rgba(255,255,255,0.7);
}
.trial-expired-box .expired-icon  { font-size: 52px; margin-bottom: 18px; display: flex; justify-content: center }
.trial-expired-box .expired-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: var(--text) }
.trial-expired-box .expired-desc  { font-size: 14px; color: var(--muted); line-height: 1.8; margin-bottom: 28px }

/* ─── EMPTY STATE ───────────────────────────────────── */
.empty { text-align: center; padding: 52px 28px; color: var(--muted) }
.empty-icon { font-size: 38px; margin-bottom: 14px; display: flex; justify-content: center; opacity: 0.6 }

/* ─── SPINNER ───────────────────────────────────────── */
.spin { animation: spin 0.8s linear infinite; display: inline-block }
@keyframes spin { to { transform: rotate(360deg) } }

/* ─── TOAST ─────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 8px 8px 24px rgba(163,177,198,0.5), -8px -8px 24px rgba(255,255,255,0.7);
  transform: translateY(24px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 300;
}
#toast.show    { transform: translateY(0); opacity: 1 }
#toast.success { border-left: 4px solid var(--accent) }
#toast.error   { border-left: 4px solid var(--danger) }
#toast.info    { border-left: 4px solid var(--info) }

/* ─── CHATS TAB ─────────────────────────────────────── */
.chats-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.chat-sidebar {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  border-right: none;
  box-shadow: 2px 0 8px rgba(163,177,198,0.25);
  background: var(--surface);
  z-index: 1;
}

.chat-sidebar-header {
  padding: 20px 18px 14px;
  flex-shrink: 0;
}

.chat-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.chat-search {
  position: relative;
}
.chat-search input {
  padding-left: 36px;
  border-radius: 10px;
  font-size: 13px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.chat-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: flex;
}

.chat-contact-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
}
.chat-contact-list::-webkit-scrollbar       { width: 4px }
.chat-contact-list::-webkit-scrollbar-thumb { background: rgba(163,177,198,0.4); border-radius: 2px }

.chat-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}
.chat-contact-item:hover  { box-shadow: var(--shadow-out-sm); background: var(--card) }
.chat-contact-item.active { box-shadow: var(--shadow-in); background: var(--card) }

.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-out-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.chat-contact-info { flex: 1; min-width: 0 }
.chat-contact-phone {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-contact-preview {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-contact-time {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  flex-shrink: 0;
}

/* ─── CHAT MAIN PANEL ───────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.chat-main-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  gap: 14px;
}
.chat-main-empty svg { opacity: 0.3 }
.chat-main-empty p   { font-size: 14px }

.chat-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(163,177,198,0.2);
  flex-shrink: 0;
  z-index: 1;
}

.chat-header-info { flex: 1; min-width: 0 }
.chat-header-phone { font-size: 15px; font-weight: 700; font-family: var(--mono); color: var(--text) }
.chat-header-tags  { font-size: 11px; color: var(--muted); margin-top: 2px }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-messages::-webkit-scrollbar       { width: 5px }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(163,177,198,0.4); border-radius: 3px }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-bot { grid-column: 1 / -1 }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr }
  .content { padding: 18px 16px; padding-bottom: 88px }
  .topbar-nav { display: none }
  .topbar { padding: 0 16px }
  .stats-row { grid-template-columns: 1fr 1fr }
  .stats-row .stat-bot { grid-column: 1 / -1 }
  .chat-sidebar { width: 260px; min-width: 260px }
}

@media (max-width: 520px) {
  .chat-sidebar { width: 100%; min-width: 0 }
  .chat-main    { display: none }
  .chats-layout.chat-open .chat-sidebar { display: none }
  .chats-layout.chat-open .chat-main    { display: flex }
}

/* ─── MOBILE NAV ────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  padding: 10px 12px;
  z-index: 50;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  box-shadow: 0 -4px 16px rgba(163,177,198,0.35);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 10px;
  color: var(--muted);
  border: none;
  background: transparent;
  font-family: var(--font);
  font-weight: 500;
  transition: all 0.2s ease;
}
.mobile-nav-btn.active { color: var(--accent); background: var(--card); box-shadow: var(--shadow-in) }
.mobile-nav-btn .icon  { font-size: 18px; display: flex; align-items: center; justify-content: center }

@media (max-width: 768px) { .mobile-nav { display: grid } }
