/* ============================================
   ZippBiz Automator - Style System
   Premium Dark/Light Mode Dashboard
   ============================================ */

/* ---- GOOGLE FONTS FALLBACK ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS VARIABLES ---- */
:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;

  /* Light mode (WCAG AAA Rasio >= 7:1) */
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-surface-elevated: #f8fafc;
  --bg-input: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255,255,255,0.92);
  --text-heading: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99,102,241,0.15);
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --nav-active-bg: #eef2ff;
  --nav-active-text: #4f46e5;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --topbar-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

html.dark-mode {
  --bg-base: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-2: #151e2e;
  --bg-surface-elevated: #151e2e;
  --bg-input: #090d16;
  --bg-sidebar: #0f172a;
  --bg-topbar: rgba(11,15,25,0.92);
  --text-heading: #ffffff;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-glow: rgba(129,140,248,0.15);
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --nav-active-bg: rgba(129,140,248,0.12);
  --nav-active-text: #a5b4fc;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.4);
  --topbar-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-main); }

/* ---- TOPBAR ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--topbar-shadow);
  padding-top: max(0px, env(safe-area-inset-top));
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  height: 58px;
  padding: 0 20px;
  gap: 12px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  max-width: 220px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-accent { color: var(--accent); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}
.status-dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.status-dot.disconnected { background: var(--red); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.btn-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-surface-2); border-color: var(--border-strong); transform: scale(1.05); }
.btn-icon:active { transform: scale(0.93); }

/* ---- MAIN LAYOUT ---- */
.main-layout {
  display: flex;
  min-height: calc(100vh - 58px);
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}
.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.18s;
}
.nav-item:hover { background: var(--nav-active-bg); color: var(--text-primary); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

/* ---- CONTENT AREA ---- */
.content-area {
  flex: 1;
  padding: 28px 24px;
  min-width: 0;
  overflow-x: hidden;
}

/* ---- TAB PANELS ---- */
.tab-panel { display: none; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }

/* ---- PAGE HEADER ---- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-desc { font-size: 14px; color: var(--text-muted); }

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.stat-icon { font-size: 28px; flex-shrink: 0; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- CARD ---- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ---- FEATURE GRID ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  transition: all 0.2s;
}
.feature-item:hover { border-color: var(--accent); background: var(--accent-glow); }
.feature-icon { font-size: 22px; flex-shrink: 0; }
.feature-info { flex: 1; min-width: 0; }
.feature-info strong { font-size: 13px; color: var(--text-primary); display: block; }
.feature-info p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- BADGES ---- */
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.badge-green { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); border: 1px solid rgba(245,158,11,0.3); }
.badge-gray { background: var(--bg-hover, rgba(148, 163, 184, 0.12)); color: var(--text-muted, #64748b); border: 1px solid var(--border, #cbd5e1); }
html.dark-mode .badge-gray { color: var(--text-secondary, #cbd5e1); background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--red, #ef4444); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ---- STEPS LIST ---- */
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.step-item { display: flex; align-items: flex-start; gap: 12px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.step-content strong { font-size: 13px; color: var(--text-primary); display: block; margin-bottom: 3px; }
.step-content p { font-size: 12px; color: var(--text-muted); }

/* ---- ACTIVITY LOG ---- */
.activity-log {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 8px;
}
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  background: var(--bg-surface-2);
}
.log-time { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.log-msg { color: var(--text-secondary); flex: 1; }
.log-info { border-left: 3px solid var(--blue); }
.log-success { border-left: 3px solid var(--green); }
.log-error { border-left: 3px solid var(--red); }
.log-warn { border-left: 3px solid var(--yellow); }

/* ---- FORM STYLES ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
input[type="text"], input[type="url"], input[type="tel"],
input[type="email"], input[type="password"], input[type="number"],
textarea, select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-main);
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; cursor: pointer; }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.char-count { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 3px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

/* ---- BUTTONS ---- */
.btn-primary, .btn-secondary, .btn-server-settings, .btn-save-config, .btn-danger, .btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px; font-weight: 600; font-family: var(--font-main);
  cursor: pointer; transition: all 0.18s; border: none; white-space: nowrap;
}
.btn-save-config {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-main);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.btn-save-config:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1.5px);
}
.btn-save-config:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.btn-primary {
  padding: 10px 20px; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  padding: 10px 20px; font-size: 14px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-base); border-color: var(--accent); color: var(--accent); }
.btn-secondary:active { transform: scale(0.96); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-server-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-main);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-server-settings:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1.5px);
  color: #ffffff !important;
}
.btn-server-settings:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}
.btn-danger {
  padding: 10px 20px; font-size: 14px;
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-danger:active { transform: scale(0.96); }
.btn-sm {
  padding: 6px 12px; font-size: 12px;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-primary.btn-sm,
.btn-sm.btn-primary,
.btn-danger.btn-sm,
.btn-sm.btn-danger,
.btn-save-config.btn-sm,
.btn-sm.btn-save-config {
  color: #ffffff !important;
}
.btn-sm:hover { color: var(--text-primary); border-color: var(--border-strong); }
.full-width { width: 100%; margin-bottom: 10px; }
.inline-btn {
  background: none; border: none; color: var(--accent);
  font-size: 12px; font-weight: 600; cursor: pointer; padding: 0;
  text-decoration: underline;
}
.inline-btn:hover { color: var(--accent-hover); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- TOGGLE SWITCH ---- */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  background: white; border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.notif-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-info strong { font-size: 14px; color: var(--text-primary); display: block; }
.toggle-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---- CHECKBOX ---- */
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }

/* ---- SESSION LAYOUT ---- */
.session-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.session-control-card {}
.session-status-box { text-align: center; padding: 30px 20px; }
.big-status-icon { font-size: 52px; margin-bottom: 12px; }
.big-status-text { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.big-status-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.session-btns { display: flex; flex-direction: column; gap: 8px; }
.qr-card {}
.qr-body { display: flex; flex-direction: column; gap: 16px; }
.qr-container { display: flex; align-items: center; justify-content: center; min-height: 200px; border-radius: 10px; background: var(--bg-surface-2); border: 2px dashed var(--border-strong); }
.qr-placeholder { text-align: center; padding: 20px; color: var(--text-muted); }
.qr-icon { font-size: 40px; margin-bottom: 10px; }
.qr-container img { max-width: 220px; border-radius: 8px; }
.qr-instructions ol { padding-left: 20px; }
.qr-instructions li { font-size: 13px; color: var(--text-secondary); margin-bottom: 5px; }
.qr-instructions p { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }

/* ---- SEND LAYOUT ---- */
.send-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ---- BLAST OPTIONS ---- */
.blast-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.blast-actions { display: flex; gap: 10px; }

/* ---- PROGRESS BAR ---- */
.progress-box { margin-bottom: 16px; }
.progress-bar-wrap { height: 10px; background: var(--bg-surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 999px; transition: width 0.3s ease; }
.progress-stats { display: flex; gap: 20px; font-size: 13px; color: var(--text-secondary); }
.progress-stats strong { color: var(--text-primary); }

/* ---- INFO BOX ---- */
.info-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.info-box p { margin-bottom: 8px; }
.info-box p:last-child { margin-bottom: 0; }
.info-box strong { color: var(--text-primary); }
.info-box-alt { border-left: 3px solid var(--accent); }
.arch-diagram {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}
.arch-node { background: var(--accent-glow); border: 1px solid var(--accent); color: var(--accent); padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.arch-arrow { color: var(--text-muted); }

/* ---- CODE BLOCKS ---- */
.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 12px;
}
.code-block code { color: #3730a3; font-weight: 600; font-family: 'Courier New', monospace; flex: 1; word-break: break-all; }
html.dark-mode .code-block code { color: #c7d2fe !important; }
.btn-copy {
  background: none; border: none; cursor: pointer; font-size: 16px;
  color: var(--text-muted); padding: 2px 4px; border-radius: 5px;
  transition: all 0.2s;
}
.btn-copy:hover { color: var(--accent); background: var(--accent-glow); }
.code-block-large {
  background: #0f172a;
  border-radius: 10px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  padding: 20px;
  white-space: pre;
  max-height: 420px;
}
html:not(.dark-mode) .code-block-large { background: #1e293b; color: #e2e8f0; }

/* ---- CONTACTS RESULT ---- */
.contact-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: var(--bg-surface-2);
}
.contact-result-item .phone { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.contact-result-item .name { font-size: 12px; color: var(--text-muted); }
.contact-status-ok { color: var(--green); font-size: 16px; }
.contact-status-no { color: var(--red); font-size: 16px; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  width: 100%; max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.btn-close {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: var(--bg-surface-2);
  color: var(--text-muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.btn-close:hover { background: rgba(239,68,68,0.1); color: var(--red); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.modal-actions { margin-top: 20px; }
.test-result { padding: 12px; border-radius: 8px; font-size: 13px; margin-top: 12px; }
.test-result.success { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.test-result.error { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* ---- TOAST ---- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: slideInRight 0.3s ease;
  border: 1px solid var(--border);
}
@keyframes slideInRight { from { transform: translateX(100%); opacity:0; } to { transform: translateX(0); opacity:1; } }
.toast-success { background: var(--bg-surface); border-left: 4px solid var(--green); color: var(--text-primary); }
.toast-error { background: var(--bg-surface); border-left: 4px solid var(--red); color: var(--text-primary); }
.toast-info { background: var(--bg-surface); border-left: 4px solid var(--blue); color: var(--text-primary); }
.toast-warn { background: var(--bg-surface); border-left: 4px solid var(--yellow); color: var(--text-primary); }

/* ---- MUTED TEXT ---- */
.muted-text { font-size: 13px; color: var(--text-muted); }

/* ---- RESPONSIVE MOBILE ---- */
@media (max-width: 768px) {
  .main-layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 8px;
    display: flex; overflow-x: auto;
  }
  .sidebar-top-nav { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-list { flex-direction: row; gap: 4px; flex-wrap: nowrap; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 10px; font-size: 11px; min-width: 60px; }
  .nav-label { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .session-layout, .send-layout, .feature-grid { grid-template-columns: 1fr; }
  .blast-options { grid-template-columns: 1fr 1fr; }
  .content-area { padding: 16px; }
  .topbar-inner { padding: 0 8px; gap: 6px; box-sizing: border-box; max-width: 100vw; }
  .topbar-col-left { gap: 6px !important; flex-shrink: 1; min-width: 0; }
  .topbar-brand { max-width: 105px !important; gap: 4px !important; flex-shrink: 0; }
  .topbar-brand .brand-accent { display: none !important; }
  .brand-icon { width: 28px; height: 28px; font-size: 14px; }
  .brand-name { font-size: 12.5px; white-space: nowrap; }
  .topbar-server-badge { padding: 3px 6px !important; font-size: 10.5px !important; flex-shrink: 0; }
  .topbar-col-right { gap: 6px !important; flex-shrink: 0; }
  .btn-text-desktop { display: none !important; }
  #btn-export-import-menu { padding: 6px 8px !important; font-size: 11.5px !important; }
  .topbar-actions { gap: 6px; }
  .topbar-device-wrapper select { max-width: 110px; font-size: 11px; padding: 4px 8px !important; }
  .status-pill { padding: 4px 6px; }
  .status-pill span:last-child { display: none; }
}

/* ---- INBOX ---- */
.inbox-status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; margin-bottom: 12px;
  font-size: 13px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.inbox-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 420px; overflow-y: auto;
}
.inbox-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.inbox-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  cursor: pointer; transition: all 0.18s;
}
.inbox-item:hover { border-color: var(--accent); background: var(--accent-glow); }
.inbox-item.selected { border-color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 0 2px var(--accent-glow); }
.inbox-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--green));
  color: white; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inbox-content { flex: 1; min-width: 0; }
.inbox-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.inbox-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.inbox-time { font-size: 11px; color: var(--text-muted); }
.inbox-phone { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.inbox-body { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.inbox-type-badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--bg-base); border: 1px solid var(--border); color: var(--text-muted); flex-shrink: 0; }

/* ==========================================================================
   ZIPPBIZ AUTOMATOR - UPGRADED SIDEBAR, PROFILE, SPLIT LAYOUT & TABLE STYLES
   ========================================================================== */

/* Sidebar Layout: Flex Column with Sticky Locked Footer (Desktop Only) */
@media (min-width: 769px) {
  .sidebar {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 58px) !important;
    position: sticky !important;
    top: 58px !important;
    overflow: hidden !important; /* Mencegah seluruh sidebar ter-scroll */
    padding: 14px 10px 10px 10px !important;
  }

  .sidebar-top-nav {
    flex: 1 1 auto !important;
    overflow-y: auto !important; /* Hanya menu navigasi yang scroll */
    overflow-x: hidden !important;
    padding-right: 4px;
    margin-bottom: 8px;
  }

  /* Custom scrollbar halus untuk menu sidebar */
  .sidebar-top-nav::-webkit-scrollbar {
    width: 4px;
  }
  .sidebar-top-nav::-webkit-scrollbar-thumb {
    background: var(--border, #334155);
    border-radius: 4px;
  }

  /* FOOTER SIDEBAR LOCK DI BAWAH */
  .sidebar-footer-wrap {
    flex-shrink: 0 !important; /* Dilarang mengecil */
    margin-top: auto !important; /* Mendorong ke dasar */
    padding-top: 10px !important;
    border-top: 1px solid var(--border, #334155) !important;
    background: var(--bg-sidebar, #0b0f19) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 10 !important;
  }
}

/* Topbar Profile Avatar & Popover Card */
.btn-profile-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-elevated, #1e293b);
  border: 1.5px solid var(--border, #334155);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  color: var(--text-heading, #f8fafc);
  touch-action: manipulation;
}

.btn-profile-avatar:hover {
  border-color: var(--accent, #10b981);
  transform: scale(1.05);
}

.prof-avatar-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-surface, #0f172a);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.profile-popover-card {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border, #334155);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  width: 250px;
  padding: 12px;
  z-index: 120;
  text-align: left;
}

/* Sidebar Profile Card */
.sidebar-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  transition: all 0.2s ease;
}

.sidebar-profile-card:hover {
  border-color: var(--accent, #10b981);
}

.prof-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prof-badge {
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.prof-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.prof-lic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated, rgba(0,0,0,0.04));
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.prof-lic-row:hover {
  background: rgba(16, 185, 129, 0.15);
}

.prof-lic-key {
  font-family: monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-copy-icon {
  font-size: 11px;
  color: var(--text-muted);
}

.prof-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prof-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.prof-text {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar Settings Button */
.sidebar-settings-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.sidebar-settings-btn:hover {
  background: var(--nav-active-bg);
  border-color: var(--accent, #10b981);
  color: var(--accent, #10b981);
}

.sidebar-settings-btn:active {
  transform: scale(0.97);
}

/* Split 2-Panel Layout for Devices */
.devices-split-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 992px) {
  .devices-split-layout {
    grid-template-columns: 1fr;
  }
}

/* View Toggle Buttons (Toolbar Perangkat dsb) */
.view-toggle-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--border);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
  height: 38px;
  box-sizing: border-box;
}

.view-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0 14px;
  height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4) !important;
}

/* Tombol Filter Status Kontak (Aksen Warna Khas ZippBiz) */
.contact-filter-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-surface-elevated) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.contact-filter-btn:hover {
  background: var(--bg-surface) !important;
  border-color: rgba(249, 115, 22, 0.5) !important;
  color: var(--text-primary) !important;
  transform: translateY(-1px) !important;
}

.contact-filter-btn.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  font-weight: 700 !important;
  transform: translateY(-1px) !important;
}

/* ---- CLICKABLE TAGS & FOLDER BADGES (EXPLORER STYLE) ---- */
.badge-tag, .contact-badge-clickable {
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.badge-tag:hover, .contact-badge-clickable:hover {
  transform: translateY(-1.5px) scale(1.04) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  filter: brightness(1.15) !important;
}
.badge-tag:active, .contact-badge-clickable:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Data Table for Devices */
.devices-data-table th, 
.devices-data-table td {
  padding: 12px 14px;
}

.devices-data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.devices-data-table tbody tr:hover {
  background: var(--bg-surface-elevated, rgba(0,0,0,0.02));
}

.role-badge-shield {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.shield-otp {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.shield-ai {
  background: rgba(56, 189, 248, 0.15);
  color: #0284c7;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* =========================================================
   WORLD-CLASS CONTACTS MODULE
   ========================================================= */
.contacts-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  flex-shrink: 0;
}
.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-tag-vip { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-tag-customer { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-tag-reseller { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-tag-lead { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-tag-general { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Tampilan Grid Kartu Kontak */
.contacts-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.contact-card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.contact-card-item:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   MODAL DIALOG NATIVE STYLING (STANDAR ZIPPBIZ DUAL-BLOCK)
   ========================================================= */
dialog.modal-dialog {
  border: 1px solid var(--border, #334155) !important;
  border-radius: 16px !important;
  background: var(--bg-surface, #151e2e) !important;
  color: var(--text-primary, #ffffff) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
  padding: 0 !important;
  overflow: hidden !important;
  margin: auto !important;
}

dialog.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
}

.modal-dialog .modal-content {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}

.modal-dialog .modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: var(--bg-surface-elevated) !important;
}

.modal-dialog .modal-header h3 {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text-heading) !important;
  margin: 0 !important;
}

.modal-dialog .modal-close {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  font-size: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.modal-dialog .modal-close:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
}

.modal-dialog .modal-body {
  padding: 20px !important;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}

.modal-dialog .modal-footer {
  padding: 14px 20px !important;
  border-top: 1px solid var(--border) !important;
  background: var(--bg-surface-elevated) !important;
}

.modal-dialog label:not(.checkbox-label):not(.extract-group-item):not(.custom-control-label) {
  color: var(--text-heading) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  display: block !important;
  margin-bottom: 5px !important;
}

/* ---- MODAL EKSTRAK GRUP: ITEM CHECKLIST ERGONOMIS & ANTI-SHRINK ---- */
.extract-group-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  min-height: 54px !important;
  box-sizing: border-box !important;
  border-radius: 9px !important;
  background: var(--bg-surface-elevated) !important;
  cursor: pointer !important;
  font-size: 13px !important;
  border: 1px solid var(--border) !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important; /* Mencegah flexbox menciutkan baris menjadi gepeng */
  margin-bottom: 0 !important;
  width: 100% !important;
}

.extract-group-item:hover {
  background: rgba(56, 189, 248, 0.08) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

.extract-group-item.selected {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

.extract-group-item input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  accent-color: #0284c7 !important;
  margin: 0 !important;
}

.extract-group-item-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

.extract-group-item.selected .extract-group-item-icon {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
}

.extract-group-item-info {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.extract-group-item-title {
  font-weight: 700 !important;
  color: var(--text-heading) !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.extract-group-item-meta {
  font-size: 11px !important;
  color: var(--text-muted, #94a3b8) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  line-height: 1.2 !important;
}

.extract-group-item-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

.extract-group-item.selected .extract-group-item-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

/* ---- RESPONSIVITAS MOBILE MODAL EKSTRAK GRUP ---- */
@media (max-width: 640px) {
  #modal-extract-group .modal-content {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 94vh !important;
  }
  #modal-extract-group .modal-header {
    padding: 12px 14px !important;
  }
  #modal-extract-group .modal-body {
    padding: 14px 12px !important;
    gap: 10px !important;
  }
  #extract-group-selection-area > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  #extract-group-selection-area > div:first-child > div {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
  }
  #extract-group-selection-area > div:first-child > div button {
    width: 100% !important;
    padding: 7px 4px !important;
    font-size: 11px !important;
    text-align: center !important;
    justify-content: center !important;
  }
  #modal-extract-group .modal-footer {
    flex-direction: column-reverse !important;
    gap: 8px !important;
    padding: 12px 14px !important;
  }
  #modal-extract-group .modal-footer > div {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  #modal-extract-group .modal-footer button {
    width: 100% !important;
    justify-content: center !important;
    min-height: 42px !important;
  }
}

.modal-dialog p {
  color: var(--text-secondary) !important;
}

/* Semantic Code Block — Blok Ganda (Light & Dark Mode) */
.code-block-dark {
  background: #0f172a;
  color: #f8fafc;
  padding: 14px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 12.5px;
  overflow-x: auto;
  line-height: 1.5;
}
html.dark-mode .code-block-dark {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
}

/* ---- DEVICE HUB MODAL TABS & STYLES ---- */
.btn-tab-hub {
  transition: all 0.15s ease;
  background: transparent;
  color: var(--text-secondary);
}
.btn-tab-hub:hover {
  color: var(--accent) !important;
}
.btn-tab-hub.active {
  background: var(--bg-surface-elevated) !important;
  color: var(--accent) !important;
  border-top: 2px solid var(--accent) !important;
}

/* ---- SEGMENTED DUAL-TAB SWITCHER (KONTAK VS GRUP WA) SIMETRIS 2 KOLOM DI TENGAH ---- */
.contacts-subview-switcher {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 520px !important;
  margin: 0 auto !important;
  background: var(--bg-surface-elevated) !important;
  padding: 6px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  gap: 8px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  box-sizing: border-box !important;
}

.contacts-subview-divider {
  width: 1.5px !important;
  height: 28px !important;
  background: var(--border) !important;
  border-radius: 1px !important;
  flex-shrink: 0 !important;
}

.contacts-subview-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  min-height: 44px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  text-align: center !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-muted, #94a3b8) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.contacts-subview-btn:hover {
  color: var(--text-heading) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.contacts-subview-btn.active#btn-subview-contacts {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.contacts-subview-btn.active#btn-subview-folders {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

@media (max-width: 640px) {
  .contacts-subview-switcher {
    max-width: 100% !important;
    gap: 4px !important;
    padding: 4px !important;
  }
  .contacts-subview-btn {
    padding: 8px 10px !important;
    font-size: 12px !important;
    min-height: 40px !important;
    gap: 4px !important;
  }
  .contacts-subview-divider {
    height: 22px !important;
  }
}

/* ---- ARSITEKTUR SALURAN RILIS AUTOMATOR (STABLE, BETA, RESTORE) ---- */
.channel-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 16px !important;
  margin-top: 16px !important;
  margin-bottom: 24px !important;
}

.channel-card {
  position: relative !important;
  background: var(--bg-surface) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 14px !important;
  padding: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  box-sizing: border-box !important;
}

.channel-card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

.channel-card.active {
  border-color: #10b981 !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-surface) 100%) !important;
  box-shadow: 0 0 0 1.5px #10b981, 0 6px 20px rgba(16, 185, 129, 0.25) !important;
}

.channel-card.channel-beta.active {
  border-color: #8b5cf6 !important;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, var(--bg-surface) 100%) !important;
  box-shadow: 0 0 0 1.5px #8b5cf6, 0 6px 20px rgba(139, 92, 246, 0.25) !important;
}

.channel-card.channel-restore.active {
  border-color: #f59e0b !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-surface) 100%) !important;
  box-shadow: 0 0 0 1.5px #f59e0b, 0 6px 20px rgba(245, 158, 11, 0.25) !important;
}

.channel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
  gap: 8px !important;
}

.channel-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.channel-icon {
  font-size: 22px !important;
}

.channel-title {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text-heading) !important;
}

.channel-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.3px !important;
  text-transform: uppercase !important;
}

.channel-badge-stable {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

.channel-badge-beta {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #a78bfa !important;
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
}

.channel-badge-restore {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.channel-desc {
  font-size: 12.5px !important;
  color: var(--text-muted) !important;
  line-height: 1.5 !important;
  margin: 0 0 14px !important;
  flex: 1 !important;
}

.channel-meta-box {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  margin-bottom: 14px !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

.channel-meta-item {
  display: flex !important;
  flex-direction: column !important;
}

.channel-meta-lbl {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
}

.channel-meta-val {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: var(--text-heading) !important;
  margin-top: 2px !important;
}

.btn-channel-switch {
  width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 16px !important;
  min-height: 40px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.btn-channel-current {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border: 1.5px solid rgba(16, 185, 129, 0.4) !important;
  cursor: default !important;
  box-shadow: none !important;
}

.btn-channel-stable-action {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.45) !important;
}

.btn-channel-stable-action:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55) !important;
}

.btn-channel-beta-action {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45) !important;
}

.btn-channel-beta-action:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.55) !important;
}

.btn-channel-restore-action {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45) !important;
}

.btn-channel-restore-action:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.55) !important;
}

.badge-channel-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

.badge-channel-pill:hover {
  transform: scale(1.05) !important;
}


