/* ═══════════════════════════════════════════════════════
   AutoKul — Neon Glass UI
   Font: Bricolage Grotesque + Geist Mono
   Theme: Deep space dark, neon glassmorphism
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Geist+Mono:wght@300;400;500;600&display=swap');

:root {
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'Bricolage Grotesque', sans-serif;
  --font-mono:    'Geist Mono', monospace;

  --bg-base:    #0a0015;
  --bg-surface: #0d0020;
  --bg-card:    rgba(255,255,255,0.03);
  --bg-card-2:  rgba(255,255,255,0.05);
  --bg-input:   rgba(255,255,255,0.05);
  --bg-hover:   rgba(255,255,255,0.05);

  --border:        rgba(255,255,255,0.07);
  --border-md:     rgba(255,255,255,0.11);
  --border-accent: rgba(255,0,180,0.25);

  --text-primary:   #e8e0f5;
  --text-secondary: rgba(255,255,255,0.55);
  --text-muted:     rgba(255,255,255,0.25);
  --text-bright:    #ffffff;

  --accent:      #ff00cc;
  --accent-2:    #00d4ff;
  --accent-3:    #a64dff;
  --accent-dim:  rgba(255,0,204,0.1);
  --accent-glow: rgba(255,0,204,0.3);
  --cyan:        #00d4ff;

  --wa:      #25d366;
  --wa-dim:  rgba(37,211,102,0.12);
  --wa-glow: rgba(37,211,102,0.25);
  --fb:      #4dc8ff;
  --fb-dim:  rgba(77,200,255,0.1);
  --fb-glow: rgba(77,200,255,0.25);

  --green:  #4ade80;
  --amber:  #fbbf24;
  --red:    #ff6b6b;
  --purple: #c084fc;

  --sidebar-w: 230px;
  --sidebar-collapsed-w: 64px;
  --bottom-nav-h: 64px;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-card: 0 1px 1px rgba(0,0,0,0.4), 0 4px 24px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(255,0,180,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,212,255,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(120,0,255,0.06) 0%, transparent 50%);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; outline: none; background: none; }
input, textarea, select { font-family: var(--font-body); outline: none; border: none; background: none; color: var(--text-primary); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

.view { display: none !important; }
.view.active { display: flex !important; flex-direction: column; height: 100vh; overflow: hidden; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,0,204,0.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,0,204,0.35); }

/* Form Components */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.form-group input, .form-group textarea, .form-group select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  width: 100%;
  backdrop-filter: blur(10px);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: rgba(255,0,204,0.4);
  background: rgba(255,0,204,0.05);
  box-shadow: 0 0 0 3px rgba(255,0,204,0.08);
}
.form-group select option { background: #16002a; }
.form-hint { font-size: 0.68rem; color: var(--text-muted); line-height: 1.4; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 700;
  transition: all 0.18s; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, rgba(255,0,180,0.2), rgba(120,0,255,0.15));
  border-color: rgba(255,0,180,0.3); color: #ff66d4; backdrop-filter: blur(10px);
}
.btn-primary:hover { background: linear-gradient(135deg, rgba(255,0,180,0.3), rgba(120,0,255,0.25)); box-shadow: 0 4px 20px rgba(255,0,180,0.25); }
.btn-danger { background: rgba(255,107,107,0.1); color: var(--red); border-color: rgba(255,107,107,0.2); }
.btn-danger:hover { background: rgba(255,107,107,0.2); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn-full { width: 100%; }

.btn-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  padding: 10px 18px; background: rgba(255,0,180,0.08); border: 1px solid rgba(255,0,180,0.2);
  border-radius: var(--r-sm); color: #ff66d4; font-size: 0.84rem; font-weight: 700;
  cursor: pointer; transition: all 0.18s; font-family: var(--font-body); backdrop-filter: blur(10px);
}
.btn-save:hover { background: rgba(255,0,180,0.15); box-shadow: 0 2px 16px rgba(255,0,204,0.2); }
.btn-save:disabled { opacity: 0.4; cursor: not-allowed; }

/* Card */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-lg); padding: 18px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card); position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%); pointer-events: none;
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px;
}

/* Badge */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: linear-gradient(135deg, #ff00cc, #a64dff);
  color: #fff; font-size: 0.6rem; font-weight: 800; border-radius: 20px;
}

/* Status dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; transition: background 0.3s; }
.status-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.connecting { background: var(--amber); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.live-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live-pulse 1.8s infinite; }
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* Admin Layout — Sidebar style */
#admin-view.active { display: flex !important; flex-direction: column; background: var(--bg-base); }
.admin-layout { display: flex; flex: 1; overflow: hidden; }

.admin-sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.02); border-right: 1px solid rgba(255,255,255,0.06);
  overflow: hidden; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.admin-sidebar-brand {
  padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.admin-sidebar-brand .brand-name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(90deg, #ff00cc, #00d4ff, #a64dff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.1;
}
.admin-sidebar-brand .brand-sub { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.admin-sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }

.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 500;
  transition: all 0.15s; width: 100%; text-align: left;
  border: 1px solid transparent; background: none; font-family: var(--font-body); cursor: pointer;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.8); }
.admin-nav-item.active {
  background: rgba(255,0,180,0.08); border-color: rgba(255,0,180,0.15);
  color: #ff66d4; font-weight: 600;
}
.admin-nav-item.active .admin-nav-icon svg { filter: drop-shadow(0 0 6px rgba(255,0,204,0.4)); }
.admin-nav-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.admin-nav-label { flex: 1; }

.admin-sidebar-bottom {
  padding: 12px 10px; border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Admin Content Area */
.admin-content { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.admin-section { display: none; flex-direction: column; min-height: 100%; }
.admin-section.active { display: flex; }

/* Keep client-list-scroll scrolable inside admin section */
.admin-section .client-list-scroll { max-height: calc(100vh - 260px); overflow-y: auto; }

/* Old admin classes kept for any leftover refs */
.admin-view-body { display: flex; flex: 1; overflow: hidden; }
.admin-left { width: 40%; flex-shrink: 0; display: flex; flex-direction: column; background: rgba(255,255,255,0.015); border-right: 1px solid var(--border); overflow: hidden; }
.admin-left-scroll { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.admin-left .card { border-radius: var(--r-md); }
.admin-bottom-panel { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.admin-user-pill { display: flex; align-items: center; gap: 10px; flex: 1; }
.admin-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #ff00cc, #a64dff);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; color: #fff; flex-shrink: 0;
}
.splitter { width: 1px; background: var(--border); cursor: col-resize; flex-shrink: 0; }
.clients-card { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 20px; background: rgba(255,255,255,0.01); }
.admin-search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-md);
  border-radius: var(--r-sm); padding: 0 12px; margin-bottom: 14px; backdrop-filter: blur(10px);
}
.admin-search-bar input { flex: 1; padding: 9px 0; font-size: 0.84rem; }
.client-list-scroll { flex: 1; overflow-y: auto; }
.clients-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.clients-table thead th { text-align: left; padding: 8px 12px; color: var(--text-muted); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.clients-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.15s; }
.clients-table tbody tr:hover { background: rgba(255,0,204,0.04); }
.clients-table tbody td { padding: 10px 12px; color: var(--text-secondary); vertical-align: middle; }
.clients-table tbody td:first-child { color: var(--text-primary); font-weight: 600; }
.client-action-btns { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.client-action-btns button { padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600; border: 1px solid transparent; transition: all 0.15s; }
#client-count-badge { background: rgba(255,0,204,0.1); color: #ff66d4; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(255,0,204,0.2); }
.sidebar-logout-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: rgba(255,107,107,0.07); border: 1px solid rgba(255,107,107,0.15); color: var(--red); flex-shrink: 0; transition: all 0.18s; }
.sidebar-logout-btn:hover { background: rgba(255,107,107,0.15); }

/* Mobile admin */
@media (max-width: 767px) {
  .admin-layout { flex-direction: column; overflow-y: auto; }
  .admin-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .admin-sidebar-brand { padding: 10px 14px; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.05); }
  .admin-sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 6px; flex: 1; gap: 4px; overflow-y: visible; overflow-x: auto; }
  .admin-nav-item { padding: 6px 10px; font-size: 0.72rem; white-space: nowrap; }
  .admin-nav-label { display: none; }
  .admin-nav-item.active .admin-nav-label { display: block; }
  .admin-sidebar-bottom { padding: 8px 10px; border-top: none; border-left: 1px solid rgba(255,255,255,0.05); }
  .admin-content { flex: 1; }
  .admin-section .client-list-scroll { max-height: 50vh; }
}

/* Client Layout */
#client-view.active { display: flex !important; flex-direction: column; overflow: hidden; }
.client-layout { display: flex; flex: 1; overflow: hidden; position: relative; }

/* Sidebar */
.client-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.02); border-right: 1px solid rgba(255,255,255,0.06);
  overflow: hidden; transition: width 0.25s cubic-bezier(0.4,0,0.2,1); z-index: 10;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.client-sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); min-height: 60px; flex-shrink: 0; overflow: hidden; }
.sidebar-brand-text { overflow: hidden; transition: opacity 0.2s, width 0.25s; }
.client-sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; background: linear-gradient(90deg, #ff00cc, #00d4ff, #a64dff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 0.62rem; color: var(--text-muted); white-space: nowrap; }
.sidebar-toggle { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); transition: all 0.18s; flex-shrink: 0; margin-left: auto; }
.sidebar-toggle:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.client-sidebar.collapsed .sidebar-toggle { margin-left: 0; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 500; transition: all 0.15s;
  white-space: nowrap; overflow: hidden; width: 100%; text-align: left; position: relative;
  border: 1px solid transparent;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.8); }
.sidebar-nav-item.active { background: rgba(255,0,180,0.08); border-color: rgba(255,0,180,0.15); color: #ff66d4; font-weight: 600; }
.sidebar-nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 2px;
  background: linear-gradient(180deg, #ff00cc, #a64dff); border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(255,0,204,0.5);
}
.sidebar-nav-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s; }
.client-sidebar.collapsed .sidebar-nav-label { opacity: 0; pointer-events: none; }
.sidebar-group-label { display: flex; align-items: center; gap: 6px; padding: 10px 10px 4px; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); cursor: pointer; user-select: none; white-space: nowrap; overflow: hidden; }
.sidebar-group-label:hover { color: var(--text-secondary); }
.client-sidebar.collapsed .sidebar-group-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }
.sidebar-group-label .group-chevron { margin-left: auto; transition: transform 0.25s; flex-shrink: 0; }
.sidebar-sub-item { padding-left: 22px !important; }
.client-sidebar.collapsed .sidebar-sub-item { padding-left: 10px !important; }
.sidebar-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: live-pulse 1.8s infinite; flex-shrink: 0; }
.sidebar-bottom { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 8px; flex-shrink: 0; overflow: hidden; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #a64dff, #ff00cc); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 0.78rem; color: #fff; flex-shrink: 0; }
.sidebar-user-info { flex: 1; overflow: hidden; transition: opacity 0.2s; }
.client-sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }
.sidebar-username { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-plan { font-size: 0.64rem; color: var(--text-muted); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 99; backdrop-filter: blur(4px); }

/* Content Area */
.client-content-area { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
.content-section { display: none !important; flex-direction: column; min-height: 100%; }
.content-section.active { display: flex !important; }
.section-header { padding: 24px 28px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--text-bright); line-height: 1.2; }
.section-subtitle { font-size: 0.76rem; color: var(--text-muted); margin-top: 3px; }
.section-body { padding: 20px 28px 40px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.integration-card { background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--r-lg); padding: 20px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }

/* Dashboard */
.sub-cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sub-card {
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; backdrop-filter: blur(20px); position: relative; overflow: hidden;
}
.sub-card:hover { border-color: rgba(255,255,255,0.14); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.sub-card-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.sub-card-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.sub-card-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }

/* Chat log */
.chat-log-card { background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--r-lg); display: flex; flex-direction: column; flex: 1; min-height: 400px; overflow: hidden; backdrop-filter: blur(20px); }
.chat-log-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; gap: 12px; }
.chat-log-tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.04); padding: 3px; border-radius: var(--r-sm); }
.chat-log-tab { display: flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 7px; font-size: 0.74rem; font-weight: 600; color: var(--text-muted); transition: all 0.15s; border: 1px solid transparent; }
.chat-log-tab.active { background: rgba(255,255,255,0.08); color: var(--text-primary); border-color: rgba(255,255,255,0.08); }
.chat-log-tab:hover:not(.active) { color: var(--text-secondary); }
.chat-log-body { display: flex; flex: 1; overflow: hidden; }
#chat-contacts-sidebar { width: 220px; border-right: 1px solid rgba(255,255,255,0.05); overflow-y: auto; flex-shrink: 0; }
.contact-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid rgba(255,255,255,0.03); }
.contact-item:hover { background: rgba(255,255,255,0.03); }
.contact-item.active { background: rgba(255,0,180,0.07); border-left: 2px solid rgba(255,0,180,0.4); }
.contact-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; flex-shrink: 0; color: #fff; }
.contact-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
.contact-preview { font-size: 0.66rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-window { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); font-size: 0.8rem; }
.chat-empty-icon { font-size: 2.2rem; opacity: 0.3; }
.bubble-wrap { display: flex; gap: 8px; align-items: flex-end; }
.bubble-wrap.outgoing { flex-direction: row-reverse; }
.bubble { max-width: 70%; padding: 9px 13px; border-radius: 14px; font-size: 0.82rem; line-height: 1.55; word-break: break-word; }
.bubble.incoming { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: var(--text-primary); border-radius: 3px 14px 14px 14px; }
.bubble.outgoing { background: rgba(255,0,180,0.1); border: 1px solid rgba(255,0,180,0.2); color: #ff99ea; border-radius: 14px 3px 14px 14px; }
.bubble.system { background: rgba(251,191,36,0.07); border: 1px solid rgba(251,191,36,0.15); color: var(--amber); border-radius: 8px; font-size: 0.72rem; text-align: center; align-self: center; max-width: 90%; }
.bubble-meta { font-size: 0.62rem; color: var(--text-muted); margin-bottom: 2px; padding: 0 2px; }
#typing-indicator { padding: 8px 16px; font-size: 0.72rem; color: var(--purple); font-style: italic; border-top: 1px solid rgba(255,255,255,0.04); }

/* Bot Control */
.bot-status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; font-size: 0.78rem; font-weight: 600; margin-bottom: 14px; backdrop-filter: blur(10px); }
#qr-container { background: rgba(255,255,255,0.02); border: 1px dashed rgba(255,0,204,0.2); border-radius: var(--r-md); min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 16px; }
#qr-container img { max-width: 200px; border-radius: var(--r-sm); }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-placeholder span { font-size: 0.72rem; color: var(--text-muted); text-align: center; }

/* Schedule */
.toggle-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 12px; }
.toggle-label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.toggle-hint { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; cursor: pointer; inset: 0; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 34px; transition: all 0.3s; }
.toggle-track::after { content: ''; position: absolute; height: 18px; width: 18px; left: 2px; bottom: 2px; background: var(--text-muted); border-radius: 50%; transition: all 0.3s; }
.toggle-switch input:checked + .toggle-track { background: rgba(255,0,204,0.15); border-color: rgba(255,0,204,0.4); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); background: #ff66d4; box-shadow: 0 0 8px rgba(255,0,204,0.5); }
.sched-days { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.sched-day-btn { cursor: pointer; user-select: none; }
.sched-day-btn input { display: none; }
.sched-day-btn span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 36px; border-radius: 8px; font-size: 0.72rem; font-weight: 600; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); color: var(--text-muted); transition: all 0.15s; }
.sched-day-btn input:checked + span { background: rgba(255,0,204,0.1); border-color: rgba(255,0,204,0.25); color: #ff66d4; }

/* Split Layout */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Orders */
.order-card { background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07); border-radius: var(--r-md); padding: 16px; transition: border-color 0.2s; backdrop-filter: blur(16px); }
.order-card:hover { border-color: rgba(255,255,255,0.12); }
.order-status-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.order-status-badge.new { background: rgba(255,0,204,0.1); color: #ff66d4; }
.order-status-badge.confirmed { background: rgba(74,222,128,0.1); color: var(--green); }
.order-status-badge.processing { background: rgba(251,191,36,0.1); color: var(--amber); }
.order-status-badge.completed { background: rgba(74,222,128,0.12); color: var(--green); }
.order-status-badge.cancelled { background: rgba(255,107,107,0.1); color: var(--red); }
.order-field-row { display: flex; align-items: center; gap: 8px; padding: 8px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--r-sm); font-size: 0.8rem; margin-bottom: 6px; }
.order-field-row .field-tag { font-size: 0.7rem; color: var(--text-muted); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0; }

/* Mobile Bottom Nav */
.mobile-bottom-nav { display: none; }

/* Modals */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.modal-overlay.active { display: flex; }
.modal-box { background: rgba(20,0,35,0.95); border: 1px solid rgba(255,0,204,0.15); border-radius: var(--r-xl); padding: 32px; max-width: 400px; width: 90%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 60px rgba(255,0,204,0.08); animation: modal-in 0.2s ease-out; backdrop-filter: blur(30px); }
@keyframes modal-in { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 2.4rem; margin-bottom: 12px; }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.modal-body { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-cancel { padding: 9px 20px; border-radius: var(--r-sm); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: var(--font-body); }
.btn-cancel:hover { background: rgba(255,255,255,0.08); }

/* FB Copy btn */
.fb-copy-btn { padding: 5px 12px; border-radius: 6px; background: rgba(77,200,255,0.08); border: 1px solid rgba(77,200,255,0.2); color: #4dc8ff; font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: var(--font-body); }
.fb-copy-btn:hover { background: rgba(77,200,255,0.15); }

/* No Subscription */
#no-sub-view.active { display: flex !important; align-items: center; justify-content: center; background: radial-gradient(ellipse at 30% 30%, rgba(255,0,180,0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(0,212,255,0.06) 0%, transparent 60%); }
.no-sub-card { max-width: 420px; width: 90%; text-align: center; padding: 44px 36px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09); border-radius: var(--r-xl); box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(255,0,204,0.07); backdrop-filter: blur(30px); }
.no-sub-icon { width: 72px; height: 72px; margin: 0 auto 24px; background: rgba(255,0,204,0.08); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,0,204,0.2); box-shadow: 0 0 24px rgba(255,0,204,0.1); }
.no-sub-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--text-bright); margin-bottom: 10px; }
.no-sub-desc { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 28px; }
.no-sub-wa-btn { display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--wa), #128c7e); color: #fff; padding: 13px 28px; border-radius: 50px; font-weight: 700; font-size: 0.92rem; box-shadow: 0 4px 20px var(--wa-glow); transition: all 0.2s; }
.no-sub-wa-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--wa-glow); }
.no-sub-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 18px; }

/* Impersonation Banner */
#impersonation-banner { background: linear-gradient(90deg, rgba(251,191,36,0.08), rgba(251,191,36,0.04)); border-bottom: 1px solid rgba(251,191,36,0.15); padding: 8px 20px; display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--amber); flex-shrink: 0; }
#impersonation-banner button { margin-left: auto; padding: 4px 12px; border-radius: 6px; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); color: var(--amber); font-size: 0.72rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.15s; }
#impersonation-banner button:hover { background: rgba(251,191,36,0.2); }

/* Login Page */
body.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; height: auto; overflow: auto; padding: 24px;
  background: #0a0015;
  background-image:
    radial-gradient(ellipse at 15% 15%, rgba(255,0,180,0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 85%, rgba(0,212,255,0.1) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(120,0,255,0.07) 0%, transparent 60%);
}
body.login-page::before {
  content: ''; position: fixed; inset: 0;
  background-image: linear-gradient(rgba(255,0,204,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,0,204,0.04) 1px, transparent 1px);
  background-size: 60px 60px; pointer-events: none; z-index: 0;
}
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px; padding: 40px 36px 36px;
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset, 0 0 60px rgba(255,0,204,0.07);
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,0,204,0.4), rgba(0,212,255,0.4), transparent);
  border-radius: 24px 24px 0 0;
}
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.login-subtitle { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 28px; line-height: 1.5; }
.btn-login-submit {
  width: 100%; padding: 13px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(255,0,180,0.25), rgba(120,0,255,0.2));
  border: 1px solid rgba(255,0,180,0.3); color: #ff99ea;
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.02em;
}
.btn-login-submit:hover { background: linear-gradient(135deg, rgba(255,0,180,0.35), rgba(120,0,255,0.3)); box-shadow: 0 4px 24px rgba(255,0,204,0.3); transform: translateY(-1px); }
.error-msg { color: #ff6b6b; font-size: 0.78rem; text-align: center; margin-top: 10px; padding: 8px 12px; background: rgba(255,107,107,0.08); border: 1px solid rgba(255,107,107,0.18); border-radius: 8px; display: none; }

/* Responsive Mobile */
@media (max-width: 767px) {
  .client-sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1); width: 260px !important; }
  .client-sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 40px rgba(255,0,204,0.12), 4px 0 20px rgba(0,0,0,0.6); }
  .sidebar-overlay.active { display: block; }
  .client-content-area { padding-bottom: var(--bottom-nav-h); }
  .section-header { padding: 18px 16px 0; }
  .section-title { font-size: 1.1rem; }
  .section-body { padding: 16px 16px 32px; }
  .sub-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sub-card-value { font-size: 1.2rem; }
  .chat-log-body { flex-direction: column; }
  #chat-contacts-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); max-height: 140px; }
  #wa-contacts-list, #fb-contacts-list { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .contact-item { flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; min-width: 72px; text-align: center; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.03); }
  .contact-avatar { width: 40px; height: 40px; }
  .contact-name { font-size: 0.65rem; }
  .contact-preview { display: none; }
  .split-layout { grid-template-columns: 1fr; }
  .admin-view-body { flex-direction: column; overflow-y: auto; }
  .admin-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); overflow: hidden; max-height: 55vh; }
  .admin-left-scroll { overflow-y: auto; }
  .splitter { display: none; }
  .login-card { padding: 32px 24px 28px; }

  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-h);
    background: rgba(10,0,21,0.96); border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 90; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    padding: 0 4px; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 4px; color: var(--text-muted); font-size: 0.56rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: var(--r-sm); transition: all 0.15s; position: relative; }
  .mobile-nav-btn.active { color: #ff66d4; }
  .mobile-nav-btn.active svg { filter: drop-shadow(0 0 8px rgba(255,0,204,0.5)); }
  .mobile-nav-btn:active { transform: scale(0.93); }

  #mob-sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: rgba(12,0,22,0.97); border-top: 1px solid rgba(255,255,255,0.08); border-radius: 20px 20px 0 0; padding: 0 0 calc(var(--bottom-nav-h) + 8px); transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.4,0,0.2,1); display: block !important; backdrop-filter: blur(30px); box-shadow: 0 -20px 60px rgba(255,0,204,0.08); }
  #mob-sheet.open { transform: translateY(0); }
  #mob-sheet-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 190; backdrop-filter: blur(4px); }
  #mob-sheet-backdrop.active { display: block; }
  .mob-sheet-handle { width: 36px; height: 4px; background: rgba(255,255,255,0.12); border-radius: 2px; margin: 10px auto 6px; }
  #mob-sheet-title { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 6px 18px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
  #mob-sheet-items { display: flex; flex-direction: column; padding: 8px; max-height: 55vh; overflow-y: auto; }
  .mob-sheet-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); font-size: 0.86rem; font-weight: 500; color: var(--text-secondary); transition: all 0.15s; cursor: pointer; border: 1px solid transparent; }
  .mob-sheet-item:hover, .mob-sheet-item.active { background: rgba(255,255,255,0.04); color: var(--text-primary); }
  .mob-sheet-item.active { color: #ff66d4; border-color: rgba(255,0,204,0.12); background: rgba(255,0,204,0.06); }
  .mob-sheet-item svg { flex-shrink: 0; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .sub-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .section-header { padding: 20px 20px 0; }
  .section-body { padding: 16px 20px 32px; }
}
@media (min-width: 1400px) {
  :root { --sidebar-w: 250px; }
  .sub-cards-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Utilities */
.text-wa { color: var(--wa); }
.text-fb { color: var(--fb); }
.text-accent { color: #ff66d4; }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-purple { color: var(--purple); }
.text-muted { color: var(--text-muted); }
.info-box { font-size: 0.74rem; color: var(--text-secondary); background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--r-sm); padding: 10px 13px; line-height: 1.65; margin-bottom: 14px; }
.controls { display: flex; gap: 8px; }
.loading-shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-sm); height: 14px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }
.monospace { font-family: var(--font-mono); font-size: 0.82rem; }
.copy-field { display: flex; gap: 6px; align-items: center; }
.copy-field input { flex: 1; min-width: 0; background: rgba(77,200,255,0.05); border: 1px solid rgba(77,200,255,0.15); color: #7dd3fc; font-size: 0.74rem; padding: 7px 10px; border-radius: var(--r-sm); font-family: var(--font-mono); }
