/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg:        #08090d;
  --surface:   #0f1117;
  --surface-2: #161820;
  --border:    #1e2030;
  --text:      #e2e4ed;
  --text-2:    #6b7084;
  --text-3:    #454860;
  --accent:    #6c5ce7;
  --accent-2:  #7c6df0;
  --success:   #00cec9;
  --danger:    #e17055;
  --warning:   #fdcb6e;
  --sidebar-w: 320px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== RGB GRID BACKGROUND ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Grid pattern com SVG */
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(108,92,231,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0,206,201,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 20%, rgba(225,112,85,0.05) 0%, transparent 60%);
  animation: rgbShift 12s ease-in-out infinite alternate;
}

@keyframes rgbShift {
  0% {
    background:
      radial-gradient(ellipse 80% 50% at 20% 40%, rgba(108,92,231,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0,206,201,0.06) 0%, transparent 60%),
      radial-gradient(ellipse 50% 60% at 50% 20%, rgba(225,112,85,0.05) 0%, transparent 60%);
  }
  25% {
    background:
      radial-gradient(ellipse 70% 60% at 30% 50%, rgba(0,206,201,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 80% 40% at 70% 30%, rgba(253,203,110,0.06) 0%, transparent 60%),
      radial-gradient(ellipse 60% 50% at 50% 70%, rgba(108,92,231,0.05) 0%, transparent 60%);
  }
  50% {
    background:
      radial-gradient(ellipse 60% 50% at 70% 60%, rgba(225,112,85,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 80% 50% at 20% 30%, rgba(108,92,231,0.06) 0%, transparent 60%),
      radial-gradient(ellipse 50% 40% at 50% 50%, rgba(0,206,201,0.05) 0%, transparent 60%);
  }
  75% {
    background:
      radial-gradient(ellipse 80% 40% at 40% 30%, rgba(253,203,110,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 60% 60% at 60% 70%, rgba(0,206,201,0.06) 0%, transparent 60%),
      radial-gradient(ellipse 70% 50% at 30% 50%, rgba(225,112,85,0.05) 0%, transparent 60%);
  }
  100% {
    background:
      radial-gradient(ellipse 70% 50% at 60% 50%, rgba(108,92,231,0.08) 0%, transparent 60%),
      radial-gradient(ellipse 60% 60% at 30% 40%, rgba(225,112,85,0.06) 0%, transparent 60%),
      radial-gradient(ellipse 80% 40% at 70% 60%, rgba(0,206,201,0.05) 0%, transparent 60%);
  }
}

/* ===== TIPOGRAFIA ===== */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}
code, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* ===== LINKS ===== */
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-2); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 420px;
  max-width: calc(100vw - 32px);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease;
}

/* Borda RGB animada no card de login */
.login-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 21px;
  background: conic-gradient(
    from 0deg,
    #6c5ce7, #00cec9, #fdcb6e, #e17055, #6c5ce7
  );
  z-index: -1;
  animation: borderRotate 4s linear infinite;
  opacity: 0.5;
}
.login-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 19px;
  background: var(--surface);
  z-index: -1;
}

@keyframes borderRotate {
  to { transform: rotate(360deg); filter: hue-rotate(360deg); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), #00cec9);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.login-logo-icon svg { width: 28px; height: 28px; color: white; }
.login-logo h1 {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 4px;
}
.login-logo p {
  color: var(--text-2);
  font-size: 14px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}
.form-input::placeholder { color: var(--text-3); }

textarea.form-input { resize: vertical; min-height: 80px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7084' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ===== BOTOES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px rgba(108,92,231,0.3);
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108,92,231,0.4);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-full { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}

.btn-danger {
  background: rgba(225,112,85,0.1);
  color: var(--danger);
  border: 1px solid rgba(225,112,85,0.2);
}
.btn-danger:hover { background: rgba(225,112,85,0.2); }

.btn-success {
  background: rgba(0,206,201,0.1);
  color: var(--success);
  border: 1px solid rgba(0,206,201,0.2);
}
.btn-success:hover { background: rgba(0,206,201,0.2); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-sm svg { width: 15px; height: 15px; }

/* ===== ERRO LOGIN ===== */
.login-error {
  background: rgba(225,112,85,0.1);
  border: 1px solid rgba(225,112,85,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

/* ============================================
   LAYOUT DASHBOARD
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #00cec9);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand-icon svg { width: 18px; height: 18px; color: white; }
.sidebar-brand span { font-family: 'Space Grotesk'; font-weight: 700; font-size: 15px; }

.sidebar-close {
  display: none;
  background: none; border: none; color: var(--text-2); cursor: pointer;
}
.sidebar-close svg { width: 22px; height: 22px; }

/* ===== SIDEBAR NAV ===== */
.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23454860' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--text-3); }

.sidebar-sessions {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.session-item:hover { background: var(--surface-2); }
.session-item.active {
  background: rgba(108,92,231,0.08);
  border-color: rgba(108,92,231,0.2);
}

.session-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #00cec9);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
  font-family: 'JetBrains Mono';
}
.session-info { flex: 1; overflow: hidden; }
.session-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-preview {
  font-size: 12px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-meta { text-align: right; flex-shrink: 0; }
.session-time { font-size: 11px; color: var(--text-3); font-family: 'JetBrains Mono'; }
.session-badge {
  font-size: 10px; background: var(--accent); color: white;
  padding: 2px 7px; border-radius: 10px; margin-top: 4px; display: inline-block;
}
.session-client-tag {
  font-size: 9px; background: rgba(0,206,201,0.15); color: var(--success);
  padding: 1px 6px; border-radius: 4px; margin-top: 3px; display: inline-block;
  font-family: 'JetBrains Mono';
}

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent); flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav-links {
  display: flex;
  gap: 4px;
}
.sidebar-nav-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.sidebar-nav-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav-btn.active { background: rgba(108,92,231,0.1); color: var(--accent); border-color: rgba(108,92,231,0.3); }
.sidebar-nav-btn svg { width: 16px; height: 16px; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== CHAT HEADER ===== */
.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.chat-header-info h2 {
  font-size: 16px;
  font-family: 'JetBrains Mono';
  font-weight: 500;
}
.chat-header-info span {
  font-size: 12px;
  color: var(--text-2);
}
.chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--success);
}
.chat-header-status::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.chat-header-actions { margin-left: auto; display: flex; gap: 8px; }

/* ===== MOBILE HEADER ===== */
.mobile-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
}
.mobile-bar button { background: none; border: none; color: var(--text); cursor: pointer; }
.mobile-bar button svg { width: 24px; height: 24px; }
.mobile-bar span { font-family: 'Space Grotesk'; font-weight: 700; font-size: 16px; }

/* ===== CHAT MESSAGES ===== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 70%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  animation: msgIn 0.3s ease;
  word-wrap: break-word;
  position: relative;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.agent {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--border);
}
.chat-bubble.user {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-bubble .bubble-time {
  font-size: 10px;
  opacity: 0.5;
  margin-top: 6px;
  display: block;
  font-family: 'JetBrains Mono';
}
.chat-bubble a { color: #a29bfe; text-decoration: underline; }
.chat-bubble.user a { color: #dfe6e9; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 20px; opacity: 0.2; stroke: var(--accent); }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 14px; max-width: 360px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(108,92,231,0.2); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2 { font-size: 16px; }
.card-body { padding: 20px; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
}
.stat-card:hover { border-color: rgba(108,92,231,0.3); transform: translateY(-2px); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.purple { background: rgba(108,92,231,0.12); color: var(--accent); }
.stat-icon.cyan { background: rgba(0,206,201,0.12); color: var(--success); }
.stat-icon.orange { background: rgba(225,112,85,0.12); color: var(--danger); }
.stat-icon.yellow { background: rgba(253,203,110,0.12); color: var(--warning); }
.stat-value { font-size: 26px; font-weight: 700; font-family: 'Space Grotesk'; display: block; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; display: block; }

/* ===== TABELA (admin) ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active { background: rgba(0,206,201,0.12); color: var(--success); }
.badge-inactive { background: rgba(225,112,85,0.12); color: var(--danger); }
.badge-superadmin { background: rgba(253,203,110,0.12); color: var(--warning); }
.badge-admin { background: rgba(108,92,231,0.12); color: var(--accent); }
.badge-viewer { background: rgba(107,112,132,0.12); color: var(--text-2); }

/* ===== API KEY (mascarada) ===== */
.api-key {
  font-family: 'JetBrains Mono';
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.api-key:hover { color: var(--text-2); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px) } to { opacity: 1; transform: scale(1) translateY(0) } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h2 { font-size: 20px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: none; color: var(--text-2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toastIn { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:translateY(0) } }

/* ===== OVERLAY MOBILE ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 95;
}
.overlay.show { display: block; }

/* ===== ADMIN PAGE ===== */
.admin-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
.admin-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { font-size: 22px; }
.admin-tabs {
  display: flex;
  gap: 4px;
}
.admin-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: 1px solid transparent;
}
.admin-tab:hover { color: var(--text); background: var(--surface-2); }
.admin-tab.active { color: var(--accent); background: rgba(108,92,231,0.08); border-color: rgba(108,92,231,0.2); }

.admin-content {
  padding: 24px 32px;
}
.admin-section { display: none; animation: fadeUp 0.3s ease; }
.admin-section.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .mobile-bar { display: flex; }
  .main-content { margin-left: 0; padding-top: 56px; }
  .admin-content { padding: 16px; }
  .admin-header { padding: 16px; flex-direction: column; gap: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .chat-bubble { max-width: 88%; }
  .login-card { padding: 24px; }
}
