/* ============================================================
   WhatsApp Business Manager — Stylesheet
   Design: Premium Dark, Refined & Clean
   ============================================================ */

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

/* ---- CSS Variables ---- */
:root {
  --bg-primary:    #0b0f17;
  --bg-secondary:  #111827;
  --bg-tertiary:   #1a2235;
  --bg-hover:      #1e2d42;
  --bg-active:     #1f3352;

  --accent:        #25d366;
  --accent-dark:   #128c50;
  --accent-soft:   rgba(37,211,102,.12);
  --accent-glow:   rgba(37,211,102,.25);

  --msg-out:       #1a4731;
  --msg-out-border:#20573c;
  --msg-in:        #1c2436;
  --msg-in-border: #253040;

  --text-primary:  #e8edf5;
  --text-secondary:#7b8fa8;
  --text-muted:    #4a5a72;
  --text-accent:   #25d366;

  --border:        rgba(255,255,255,.06);
  --border-strong: rgba(255,255,255,.12);
  --shadow-sm:     0 2px 8px rgba(0,0,0,.3);
  --shadow-md:     0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:     0 8px 40px rgba(0,0,0,.5);

  --status-sent:      #7b8fa8;
  --status-delivered: #7b8fa8;
  --status-read:      #25d366;
  --status-failed:    #ef4444;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --sidebar-w:  340px;
  --topbar-h:   60px;

  --font-main: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
button { font-family: var(--font-main); cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: var(--font-main); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37,211,102,.08) 0%, transparent 60%),
    var(--bg-primary);
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(37,211,102,.05);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--accent-glow);
}

.login-logo-icon svg { width: 26px; height: 26px; fill: white; }

.login-logo-text { line-height: 1.2; }
.login-logo-text h1 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.login-logo-text span { font-size: .8rem; color: var(--text-secondary); font-weight: 400; }

.login-heading { font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.login-subheading { font-size: .9rem; color: var(--text-secondary); margin-bottom: 32px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }

.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: var(--text-primary);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-weight: 600;
  transition: all .2s;
  cursor: pointer;
}
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #0b1a12;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { background: #2de874; box-shadow: 0 4px 28px rgba(37,211,102,.4); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 20px; height: 20px; }

.btn-danger { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.error-msg {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #ef4444;
  font-size: .85rem;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: width .3s, min-width .3s;
  position: relative;
  z-index: 10;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.sidebar-logo-icon svg { width: 20px; height: 20px; fill: white; }
.sidebar-logo-text { font-size: .95rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 9px 14px 9px 36px;
  color: var(--text-primary);
  font-size: .875rem;
  transition: border-color .2s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.filter-tab {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: all .2s;
  cursor: pointer;
  white-space: nowrap;
}
.filter-tab:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.filter-tab.active {
  background: var(--accent-soft);
  border-color: rgba(37,211,102,.3);
  color: var(--accent);
}

/* Conversation List */
.conv-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.conv-list::-webkit-scrollbar { width: 4px; }
.conv-list::-webkit-scrollbar-track { background: transparent; }
.conv-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  position: relative;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: var(--bg-active); border-left: 3px solid var(--accent); }

.conv-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  position: relative;
}
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }

.conv-info { flex: 1; min-width: 0; }
.conv-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.conv-preview {
  font-size: .8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.conv-time { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.conv-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #0b1a12;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  bottom: 1px;
  right: 1px;
  border: 2px solid var(--bg-secondary);
}
.status-dot.open { background: var(--accent); }
.status-dot.pending { background: #f59e0b; }
.status-dot.closed { background: var(--text-muted); }

.conv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
}
.conv-empty svg { width: 48px; height: 48px; opacity: .3; }
.conv-empty p { font-size: .85rem; line-height: 1.5; }

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
}
.user-info-sm { flex: 1; min-width: 0; }
.user-info-sm .user-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info-sm .user-role { font-size: .72rem; color: var(--text-muted); }

/* ============================================================
   MAIN CHAT AREA
   ============================================================ */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 100% 50% at 50% 100%, rgba(37,211,102,.03) 0%, transparent 60%),
    var(--bg-primary);
}

/* Empty state */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}
.chat-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .5;
}
.chat-empty-icon svg { width: 40px; height: 40px; }
.chat-empty h3 { font-size: 1.1rem; font-weight: 500; color: var(--text-secondary); }
.chat-empty p { font-size: .85rem; max-width: 280px; line-height: 1.6; }

/* Chat Header */
.chat-header {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-phone { font-size: .78rem; color: var(--text-secondary); }

.chat-header-actions { display: flex; gap: 4px; }

/* Chat messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Date separator */
.msg-date-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 10px;
}
.msg-date-sep span {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 14px;
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Message bubble */
.msg-wrap {
  display: flex;
  margin-bottom: 2px;
  animation: msgIn .15s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-wrap.out { justify-content: flex-end; }
.msg-wrap.in  { justify-content: flex-start; }

.msg-bubble {
  max-width: min(72%, 520px);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  position: relative;
  line-height: 1.5;
  font-size: .9rem;
}

.msg-wrap.out .msg-bubble {
  background: var(--msg-out);
  border: 1px solid var(--msg-out-border);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}
.msg-wrap.in .msg-bubble {
  background: var(--msg-in);
  border: 1px solid var(--msg-in-border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.msg-content { word-break: break-word; white-space: pre-wrap; }

.msg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
}
.msg-time { font-size: .68rem; color: var(--text-muted); }
.msg-status svg { width: 14px; height: 14px; }
.msg-status.sent     svg { color: var(--status-sent); }
.msg-status.delivered svg { color: var(--status-delivered); }
.msg-status.read     svg { color: var(--status-read); }
.msg-status.failed   svg { color: var(--status-failed); }

/* Media messages */
.msg-image {
  max-width: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 4px;
  cursor: pointer;
}
.msg-image img { width: 100%; display: block; }

.msg-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 4px;
}
.msg-doc svg { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.msg-doc-info { flex: 1; min-width: 0; }
.msg-doc-name { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-doc-size { font-size: .72rem; color: var(--text-secondary); }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--msg-in);
  border: 1px solid var(--msg-in-border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input */
.chat-input-area {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 8px 10px;
  transition: border-color .2s;
}
.chat-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: .9rem;
  resize: none;
  max-height: 160px;
  padding: 4px 6px;
  line-height: 1.5;
  overflow-y: auto;
}
.chat-textarea::placeholder { color: var(--text-muted); }

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b1a12;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-send:hover { background: #2de874; transform: scale(1.05); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-send svg { width: 20px; height: 20px; }

.attach-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: .82rem;
  color: var(--text-secondary);
}
.attach-preview svg { width: 18px; height: 18px; color: var(--accent); }
.attach-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-remove { cursor: pointer; color: var(--text-muted); }
.attach-remove:hover { color: #ef4444; }

/* ============================================================
   PANELS (Info, Settings, etc.)
   ============================================================ */
.panel {
  width: 320px;
  min-width: 320px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .3s, min-width .3s, opacity .3s;
}
.panel.hidden { width: 0; min-width: 0; opacity: 0; overflow: hidden; }

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  flex-shrink: 0;
}
.panel-header h3 { flex: 1; font-size: .95rem; font-weight: 600; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.contact-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
}
.contact-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.contact-card h4 { font-size: 1.1rem; font-weight: 600; }
.contact-card .phone { font-size: .85rem; color: var(--text-secondary); }

.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.info-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.info-value { font-size: .88rem; color: var(--text-primary); }

.status-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: .88rem;
  cursor: pointer;
}
.status-select:focus { outline: none; border-color: var(--accent); }
.status-select option { background: var(--bg-secondary); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: scale(.96) translateY(8px);
  transition: transform .2s;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h3 { flex: 1; font-size: 1rem; font-weight: 600; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   SETTINGS PAGE (inside panel or modal)
   ============================================================ */
.settings-section { margin-bottom: 28px; }
.settings-section h4 {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: .9rem; }
.toggle-desc { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }

.toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  position: relative;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: transform .2s, background .2s;
}
.toggle.on { background: var(--accent-soft); border-color: var(--accent); }
.toggle.on::after { transform: translateX(20px); background: var(--accent); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  box-shadow: var(--shadow-md);
  max-width: 320px;
  pointer-events: all;
  animation: toastIn .3s ease-out;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid #3b82f6; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--accent); }
.toast.error   .toast-icon { color: #ef4444; }
.toast.info    .toast-icon { color: #3b82f6; }

/* ============================================================
   LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   INSTALL PAGE
   ============================================================ */
.install-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
}
.install-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .3s;
}
.install-step.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1a12;
  box-shadow: 0 0 16px var(--accent-glow);
}
.install-step.done .step-circle {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.step-label { font-size: .72rem; color: var(--text-muted); text-align: center; }
.install-step.active .step-label { color: var(--accent); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    z-index: 100;
    height: 100%;
    transform: translateX(-100%);
    transition: transform .3s;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .panel { display: none; }

  :root { --sidebar-w: 100vw; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-danger { color: #ef4444; }
.fw-600 { font-weight: 600; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.w-full { width: 100%; }
