#login-screen{
  position:fixed;inset:0;background:#07090e;z-index:99999;
  display:none;
  align-items:center;justify-content:center;
  background-image: radial-gradient(circle at 50% 30%, rgba(47, 164, 124, 0.14) 0%, transparent 60%), radial-gradient(circle at 80% 80%, rgba(63, 191, 146, 0.09) 0%, transparent 60%);
  animation:fadeIn .2s cubic-bezier(0.16,1,0.3,1);
}
html.auth-guest #login-screen {
  display: flex !important;
}
html.auth-preloaded #login-screen {
  display: none !important;
}
.login-box{
  background:rgba(15, 20, 32, 0.88);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
  border:1px solid rgba(255,255,255,.1);border-radius:20px;
  padding:42px 36px;width:370px;max-width:90vw;
  box-shadow:0 24px 60px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,0.05);
}
.login-logo{
  display:flex;align-items:center;gap:12px;margin-bottom:30px;
  font-size:22px;font-weight:800;letter-spacing:0.5px;
  background:linear-gradient(180deg,#fff,#cbd5e1);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
}
.login-logo-icon{
  width:42px;height:42px;background:linear-gradient(135deg,#ffffff,#cbd5e1);border-radius:12px;
  display:flex;align-items:center;justify-content:center;font-size:20px;color:#07090e;
  box-shadow:0 6px 18px rgba(255,255,255,0.2);
}
.login-title{font-size:13px;color:#94a3b8;margin-bottom:24px;line-height:1.5}
.login-input{
  width:100%;padding:13px 16px;background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.1);
  border-radius:10px;color:#f1f5f9;font-size:14px;outline:none;margin-bottom:14px;
  font-family:inherit;transition:all .2s;
}
.login-input:focus{border-color:#2fa47c;box-shadow:0 0 0 3px rgba(47,164,124,0.25);background:rgba(0,0,0,.5)}
.login-btn{
  width:100%;padding:13px;border-radius:10px;border:none;
  background:linear-gradient(135deg,#217a5b 0%,#2fa47c 50%,#1f7a56 100%);
  color:#fff;font-size:15px;font-weight:700;cursor:pointer;
  margin-top:8px;transition:all .2s cubic-bezier(0.16,1,0.3,1);
  box-shadow:0 6px 20px rgba(47,164,124,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
}
.login-btn:hover{filter:brightness(1.08);transform:translateY(-1px);box-shadow:0 8px 25px rgba(47,164,124,0.55);}
.login-btn:active{transform:translateY(1px) scale(0.99);}
.login-btn:disabled{opacity:.5;cursor:not-allowed;transform:none !important;box-shadow:none !important;}
.login-error{color:#f87171;font-size:13px;margin-top:12px;text-align:center;min-height:20px;font-weight:500}

:root {
  /* Phase 1 Modernized Design Tokens */
  --bg: #080b11;
  --bg-alt: #0d121d;
  --panel: rgba(15, 23, 42, 0.7);
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --bg-mesh: radial-gradient(circle at 10% 15%, rgba(47, 164, 124, 0.08) 0%, transparent 45%),
             radial-gradient(circle at 90% 85%, rgba(63, 191, 146, 0.06) 0%, transparent 45%),
             radial-gradient(circle at 50% 50%, rgba(47, 158, 140, 0.03) 0%, transparent 60%);
  --sb: rgba(13, 18, 29, 0.88);
  --c1: rgba(15, 23, 42, 0.72);
  --c2: rgba(24, 34, 53, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: rgba(47, 164, 124, 0.55);
  --text: #f1f5f9;
  --muted: #94a3b8;

  /* Accent Tokens */
  --blue: #2fa47c;
  --blue-glow: rgba(47, 164, 124, 0.25);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.2);
  --yellow: #f59e0b;
  --yellow-glow: rgba(245, 158, 11, 0.2);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.2);
  --cyan: #2f9e8c;
  --cyan-glow: rgba(47, 158, 140, 0.2);
  --purple: #3fbf92;
  --purple-glow: rgba(63, 191, 146, 0.25);

  --glass-blur: blur(20px);
  --card-radius: 14px;
  --btn-radius: 10px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

/* Custom Sleek Dark Scrollbars (Webkit / Chrome / Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: #2fa47c;
}
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  background-color: var(--bg);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* SIDEBAR */
.sidebar {
  width: 248px;
  min-width: 248px;
  background: var(--sb);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .24s cubic-bezier(0.16,1,0.3,1), min-width .24s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  z-index: 900;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}
.logo {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  transition: all .2s ease;
}
.logo-box {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #07090e;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.18);
}
.logo-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* TOGGLE BUTTONS */
.sidebar-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* COLLAPSED STATE */
body.sidebar-collapsed .sidebar{
  width:68px;
  min-width:68px;
}
body.sidebar-collapsed .logo{
  padding:12px 6px;
  justify-content:center;
  flex-direction:column;
  gap:8px;
}
body.sidebar-collapsed .logo-title-wrap{
  justify-content:center;
}
body.sidebar-collapsed .logo-text{
  display:none !important;
}
body.sidebar-collapsed .user-box-wrap{
  margin:10px 8px 6px;
}
body.sidebar-collapsed .user-box{
  padding:8px 0;
  justify-content:center;
}
body.sidebar-collapsed .user-info,
body.sidebar-collapsed #user-chevron{
  display:none !important;
}
body.sidebar-collapsed .user-dropdown{
  left:72px;
  top:0;
  width:250px;
}
body.sidebar-collapsed .nav{
  padding:8px 6px;
}
body.sidebar-collapsed .nav a{
  padding:11px 0;
  justify-content:center;
  gap:0;
}
body.sidebar-collapsed .nav a i{
  width:auto;
  font-size:17px;
  margin:0;
}
body.sidebar-collapsed .nav-text{
  display:none !important;
}
body.sidebar-collapsed .badge-new{
  position:absolute;
  top:4px;
  right:6px;
  width:7px;
  height:7px;
  padding:0;
  border-radius:50%;
  font-size:0;
  margin:0;
  box-shadow:0 0 6px #2fa47c;
}

.user-box-wrap{position:relative;margin:12px 12px 6px;z-index:999;}
.user-box{padding:10px 12px;background:var(--c1);backdrop-filter:blur(10px);border:1px solid var(--border);border-radius:12px;display:flex;align-items:center;gap:10px;cursor:pointer;transition:all .2s ease;user-select:none;}
.user-box:hover{background:var(--c2);border-color:rgba(47,164,124,.4);box-shadow:0 4px 18px rgba(0,0,0,.35);}
.user-box.open{border-color:var(--blue);background:var(--c2);}
.avatar{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#2f9e8c,#2fa47c);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;flex-shrink:0;color:#fff;box-shadow:0 2px 8px rgba(47,164,124,0.3);}
.user-info{flex:1;overflow:hidden;}
.user-info h4{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.user-info span{font-size:11px;color:var(--green);display:flex;align-items:center;gap:4px;}

/* USER DROPDOWN (FAST SWITCH) */
.user-dropdown{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  width:100%;
  background:rgba(15, 20, 32, 0.95);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:14px;
  box-shadow:0 20px 50px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.05);
  z-index:10000;
  display:none;
  flex-direction:column;
  padding:8px;
  animation:udFadeIn .18s cubic-bezier(0.16,1,0.3,1);
}
.user-dropdown.show{display:flex;}
@keyframes udFadeIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.ud-header{display:flex;align-items:center;justify-content:space-between;padding:6px 8px 8px;border-bottom:1px solid rgba(255,255,255,.06);margin-bottom:6px;}
.ud-title{display:flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;color:#c7d2e3;text-transform:uppercase;letter-spacing:.4px;}
.ud-badge{font-size:10px;font-weight:700;padding:2px 7px;border-radius:10px;background:rgba(47,164,124,.18);color:#818cf8;border:1px solid rgba(47,164,124,.3);}
.ud-accounts-list{display:flex;flex-direction:column;gap:3px;max-height:220px;overflow-y:auto;padding-right:2px;}
.ud-loading{color:var(--muted);font-size:11.5px;padding:12px;text-align:center;}
.ud-item{display:flex;align-items:center;gap:9px;padding:7px 9px;border-radius:9px;cursor:pointer;transition:all .15s ease;border:1px solid transparent;}
.ud-item:hover{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.08);transform:translateX(2px);}
.ud-item.active{background:rgba(47,164,124,.14);border-color:rgba(47,164,124,.35);cursor:default;}
.ud-item.active:hover{transform:none;}
.ud-avatar{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;flex-shrink:0;color:#fff;}
.ud-avatar.admin{background:linear-gradient(135deg,#1f7a56,#2fa47c);}
.ud-avatar.user{background:linear-gradient(135deg,#2f9e8c,#2fa47c);}
.ud-info{flex:1;overflow:hidden;}
.ud-name{font-size:12.5px;font-weight:600;color:#e2e8f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ud-role{font-size:10.5px;color:var(--muted);display:flex;align-items:center;gap:4px;}
.ud-current-tag{font-size:9.5px;font-weight:600;color:var(--green);background:rgba(16,185,129,.15);border:1px solid rgba(16,185,129,.3);padding:2px 6px;border-radius:4px;display:flex;align-items:center;gap:3px;}
.ud-switch-arrow{font-size:11px;color:var(--muted);transition:all .15s;opacity:0;}
.ud-item:hover .ud-switch-arrow{opacity:1;color:var(--blue);transform:translateX(2px);}
.ud-divider{height:1px;background:rgba(255,255,255,.06);margin:6px 0;}
.ud-actions{display:flex;flex-direction:column;gap:2px;}
.ud-action-btn{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:8px;font-size:12px;font-weight:500;color:#cbd5e1;cursor:pointer;transition:all .15s;}
.ud-action-btn:hover{background:rgba(255,255,255,.06);color:#fff;}
.ud-action-btn i{width:16px;text-align:center;font-size:12px;}
.ud-action-btn.gold{color:var(--yellow);background:rgba(245,158,11,.1);border:1px solid rgba(245,158,11,.25);margin-bottom:2px;}
.ud-action-btn.gold:hover{background:rgba(245,158,11,.2);}
.ud-action-btn.danger{color:var(--red);}
.ud-action-btn.danger:hover{background:rgba(239,68,68,.12);color:#fca5a5;}

/* NAV LINKS */
.nav{flex:1;overflow-y:auto;padding:8px 10px}
.nav-sep{height:1px;background:var(--border);margin:8px 0}
.nav-label{font-size:10px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.6px;padding:5px 10px 3px}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9.5px 12px;
  border-radius:9px;
  color:var(--muted);
  font-size:13.5px;
  font-weight:500;
  cursor:pointer;
  text-decoration:none;
  transition:all .18s cubic-bezier(0.16,1,0.3,1);
  position:relative;
  margin-bottom:2px;
  border:1px solid transparent;
}
.nav a:hover{
  color:#ffffff;
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.05);
  transform:translateX(2px);
}
.nav a.active{
  background:linear-gradient(90deg, rgba(47, 164, 124, 0.16) 0%, rgba(63, 191, 146, 0.08) 100%);
  color:#ffffff;
  border:1px solid rgba(47, 164, 124, 0.35);
  box-shadow:0 4px 14px rgba(47, 164, 124, 0.15);
  font-weight:600;
}
.nav a.active i {
  color:#818cf8;
}
.nav a i{width:18px;text-align:center;font-size:15px;transition:color .2s}
.badge-new{background:linear-gradient(90deg,#217a5b,#3fbf92);color:#fff;font-size:9.5px;font-weight:700;padding:2px 6px;border-radius:6px;margin-left:auto;letter-spacing:.3px}
.sb-footer{padding:12px 14px;border-top:1px solid var(--border);display:flex;gap:8px}
.sb-btn{flex:1;padding:8px;border-radius:8px;border:1px solid var(--border);background:var(--c1);color:var(--text);font-size:12px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;transition:.2s}
.sb-btn:hover{background:var(--c2);border-color:rgba(255,255,255,.15)}
.sb-btn.danger{background:rgba(239,68,68,.1);border-color:rgba(239,68,68,.25);color:var(--red)}
.sb-btn.danger:hover{background:rgba(239,68,68,.2)}

/* MAIN */
.main{flex:1;display:flex;flex-direction:column;overflow:hidden}
.topbar{
  padding:11px 24px;
  background:rgba(11, 15, 23, 0.82);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-shrink:0;
  box-shadow:0 4px 20px rgba(0, 0, 0, 0.25);
}
.top-btn{
  padding:7px 14px;
  border-radius:8px;
  border:1px solid var(--border);
  background:rgba(255, 255, 255, 0.04);
  color:var(--text);
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  transition:all .2s cubic-bezier(0.16,1,0.3,1);
  backdrop-filter:blur(10px);
}
.top-btn:hover{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.18);transform:translateY(-1px);}
.top-btn.gold{color:var(--yellow);border-color:rgba(245,158,11,.3);background:rgba(245,158,11,.08)}
.content{flex:1;overflow-y:auto;padding:24px}

/* TABS */
.tab{display:none;animation:fadeIn .25s cubic-bezier(0.16,1,0.3,1)}
.tab.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

/* CARDS & GLASSMORPHISM 2.0 */
.card{
  background:linear-gradient(160deg, rgba(17, 24, 39, 0.72) 0%, rgba(13, 18, 30, 0.82) 100%);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  border:var(--glass-border);
  border-radius:var(--card-radius);
  padding:22px;
  box-shadow:var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:all .24s cubic-bezier(0.16,1,0.3,1);
}
.card:hover{
  border-color:rgba(255,255,255,.16);
  box-shadow:0 12px 36px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.card-title{
  font-size:15px;
  font-weight:700;
  margin-bottom:18px;
  display:flex;
  align-items:center;
  gap:10px;
  color:#f8fafc;
  letter-spacing:.2px;
  transition:all .2s ease;
}
.card-title:hover{color:#fff}
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:20px}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin-bottom:20px}

/* STAT CARDS */
.stat-card{
  background:linear-gradient(160deg, rgba(20, 27, 45, 0.75) 0%, rgba(13, 18, 30, 0.85) 100%);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  border:var(--glass-border);
  border-radius:var(--card-radius);
  padding:20px;
  position:relative;
  overflow:hidden;
  transition:all .25s cubic-bezier(0.16,1,0.3,1);
  box-shadow:var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.stat-card:hover{
  transform:translateY(-2px);
  border-color:rgba(47, 164, 124, 0.35);
  box-shadow:0 14px 35px rgba(0, 0, 0, 0.5), 0 0 25px var(--accent-glow, rgba(47, 164, 124, 0.2));
}
.stat-card::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:3px;
  background:var(--accent-color, linear-gradient(90deg, #2fa47c, #a855f7));
  box-shadow:0 0 12px var(--accent-color, rgba(47, 164, 124, 0.7));
}
.stat-label{font-size:13px;color:var(--muted);margin-bottom:12px;font-weight:500;display:flex;align-items:center;gap:7px}
.stat-val{
  font-size:32px;
  font-weight:800;
  letter-spacing:-0.8px;
  background:linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
}
.stat-tag{
  font-size:12px;
  padding:3px 9px;
  border-radius:6px;
  font-weight:700;
  position:absolute;
  top:16px;
  right:16px;
  border:1px solid transparent;
  letter-spacing:.3px;
  backdrop-filter:blur(8px);
  transition:all .2s ease;
}
.stat-tag:hover{transform:translateY(-1px)}
.tag-g{background:rgba(16,185,129,.15);color:#34d399;border-color:rgba(16,185,129,.35);box-shadow:0 0 10px rgba(16,185,129,.1)}
.tag-y{background:rgba(245,158,11,.15);color:#fbbf24;border-color:rgba(245,158,11,.35);box-shadow:0 0 10px rgba(245,158,11,.1)}
.tag-b{background:rgba(47,164,124,.15);color:#818cf8;border-color:rgba(47,164,124,.35);box-shadow:0 0 10px rgba(47,164,124,.1)}
.tag-r{background:rgba(239,68,68,.15);color:#f87171;border-color:rgba(239,68,68,.35);box-shadow:0 0 10px rgba(239,68,68,.1)}

/* ROW */
.row{display:flex;gap:16px;margin-bottom:20px}
.col{flex:1;min-width:0}
.col-2{flex:2;min-width:0}

/* TABLE */
.table-wrap{
  overflow-x:auto;
  border-radius:12px;
  border:var(--glass-border);
  background:rgba(13, 17, 26, 0.6);
  backdrop-filter:blur(12px);
  box-shadow:0 4px 20px rgba(0, 0, 0, 0.25);
}
table{width:100%;border-collapse:collapse;font-size:13px}
th{
  padding:13px 16px;
  background:rgba(18, 24, 38, 0.95);
  color:var(--muted);
  font-weight:600;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.5px;
  text-align:left;
  white-space:nowrap;
  border-bottom:1px solid var(--border);
}
td{padding:12px 16px;border-top:1px solid rgba(255, 255, 255, 0.05);transition:background .15s ease}
tr:hover td{background:rgba(255,255,255,.035)}

/* BADGES & LIVE INDICATORS */
.badge{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:8px;font-size:12px;font-weight:600;border:1px solid transparent;transition:all .2s cubic-bezier(0.16,1,0.3,1);user-select:none}
.badge:hover{transform:translateY(-1px);filter:brightness(1.1)}
.badge-ok{background:rgba(16,185,129,.12);color:#34d399;border-color:rgba(16,185,129,.25)}
.badge-err{background:rgba(239,68,68,.12);color:#f87171;border-color:rgba(239,68,68,.25)}
.badge-warn{background:rgba(245,158,11,.12);color:#fbbf24;border-color:rgba(245,158,11,.25)}
.badge-gray{background:rgba(255,255,255,.06);color:var(--muted);border-color:rgba(255,255,255,.08)}
.badge-blue{background:rgba(47,164,124,.14);color:#818cf8;border-color:rgba(47,164,124,.3)}
.badge-purple{background:rgba(63,191,146,.12);color:#e0b06a;border-color:rgba(63,191,146,.25)}

/* COMMAND CENTER 2.0 (DASHBOARD HUB) */
.command-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.72) 0%, rgba(13, 18, 30, 0.85) 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
  flex-wrap: wrap;
}
.cc-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.cc-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(47, 164, 124, 0.22) 0%, rgba(63, 191, 146, 0.16) 100%);
  border: 1px solid rgba(47, 164, 124, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #818cf8;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--blue-glow);
}
.cc-title {
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cc-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.cc-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #34d399;
}

/* QUICK COMMAND BAR */
.quick-cmd-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}
.quick-cmd-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.quick-cmd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}
.quick-cmd-btn {
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  user-select: none;
}
.quick-cmd-btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.quick-cmd-btn:active {
  transform: translateY(1px) scale(0.98);
}
.btn-action-spam {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.btn-action-spam:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 16px var(--yellow-glow);
}
.btn-action-proxy {
  background: rgba(47, 158, 140, 0.12);
  border-color: rgba(47, 158, 140, 0.35);
  color: #6fbfae;
}
.btn-action-proxy:hover {
  background: rgba(47, 158, 140, 0.22);
  border-color: rgba(47, 158, 140, 0.5);
  box-shadow: 0 4px 16px var(--cyan-glow);
}
.btn-action-pipeline {
  background: linear-gradient(135deg, rgba(47, 164, 124, 0.25) 0%, rgba(63, 191, 146, 0.2) 100%);
  border-color: rgba(47, 164, 124, 0.45);
  color: #a5b4fc;
}
.btn-action-pipeline:hover {
  background: linear-gradient(135deg, rgba(47, 164, 124, 0.35) 0%, rgba(63, 191, 146, 0.3) 100%);
  border-color: rgba(47, 164, 124, 0.65);
  box-shadow: 0 4px 18px var(--blue-glow);
}
.btn-action-health {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.btn-action-health:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 4px 16px var(--green-glow);
}

/* 4 KEY KPI HUB CARDS */
.kpi-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 1200px) {
  .kpi-hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .kpi-hub-grid {
    grid-template-columns: 1fr;
  }
}
.kpi-hub-card {
  background: linear-gradient(160deg, rgba(20, 27, 45, 0.78) 0%, rgba(13, 18, 30, 0.88) 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.kpi-hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 164, 124, 0.4);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5), 0 0 25px var(--accent-glow, rgba(47, 164, 124, 0.2));
}
.kpi-hub-card::before {
  content:'';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-color, #2fa47c);
  box-shadow: 0 0 14px var(--accent-glow, rgba(47, 164, 124, 0.6));
}
.kpi-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-hub-title {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.kpi-hub-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-hub-val {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.1;
  color: #fff;
}
.kpi-hub-sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}
.kpi-hub-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}
.kpi-hub-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-color, #2fa47c);
  box-shadow: 0 0 8px var(--accent-glow, rgba(47, 164, 124, 0.5));
  transition: width .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.kpi-hub-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}
.kpi-metric-item {
  display: flex;
  flex-direction: column;
}
.kpi-metric-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-metric-val {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

/* Typography polish: comfortable font sizes */
.stat-label{font-size:13px !important}
.nav-label{font-size:11.5px !important}
.text-sm{font-size:13px !important}
.text-xs{font-size:12px !important}
.s-stat span{font-size:12px !important}
.stage-num{font-size:11.5px !important}
.stage-badge{font-size:11.5px !important}
.proxy-detail{font-size:12px !important}
.log-ts{font-size:12px !important}
.log-session-tag{font-size:12px !important}
.ud-role{font-size:12px !important}
.ud-badge{font-size:11.5px !important}
.badge-new{font-size:11px !important}

@keyframes pulse-dot-g {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.online-dot{width:7px;height:7px;border-radius:50%;display:inline-block}
.dot-g{background:#10b981;box-shadow:0 0 8px #10b981;animation:pulse-dot-g 2s infinite}
.dot-r{background:#ef4444;box-shadow:0 0 6px #ef4444}
.dot-y{background:#f59e0b;box-shadow:0 0 6px #f59e0b}

/* FORMS */
.form-group{margin-bottom:14px}
.form-group label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px;font-weight:500}
.inp{
  width:100%;
  padding:10px 14px;
  background:rgba(10, 14, 22, 0.65);
  border:1px solid rgba(255, 255, 255, 0.1);
  border-radius:10px;
  color:var(--text);
  font-size:13px;
  outline:none;
  font-family:inherit;
  transition:all .2s cubic-bezier(0.16,1,0.3,1);
  backdrop-filter:blur(8px);
}
.inp:focus{
  border-color:#2fa47c;
  background:rgba(15, 20, 32, 0.9);
  box-shadow:0 0 0 3px rgba(47, 164, 124, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
}
textarea.inp{resize:vertical;min-height:80px}
select.inp option{background:#111520;color:#f1f5f9}

/* BUTTONS */
.btn{
  padding:9px 18px;
  border-radius:var(--btn-radius);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  border:1px solid rgba(255, 255, 255, 0.1);
  color:#fff;
  display:inline-flex;
  align-items:center;
  gap:7px;
  transition:all .2s cubic-bezier(0.16,1,0.3,1);
  white-space:nowrap;
  box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.16);
  user-select:none;
}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none !important;box-shadow:none !important}
.btn:hover:not(:disabled){
  transform:translateY(-1.5px);
  filter:brightness(1.08);
}
.btn:active:not(:disabled){
  transform:translateY(1px) scale(0.98);
}
.btn-blue{
  background:linear-gradient(135deg, #217a5b 0%, #2fa47c 50%, #1f7a56 100%);
  box-shadow:0 4px 14px rgba(47, 164, 124, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-blue:hover:not(:disabled){
  box-shadow:0 6px 20px rgba(47, 164, 124, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-green{
  background:linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow:0 4px 14px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-green:hover:not(:disabled){
  box-shadow:0 6px 20px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-red{
  background:linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow:0 4px 14px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-red:hover:not(:disabled){
  box-shadow:0 6px 20px rgba(239, 68, 68, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-purple{
  background:linear-gradient(135deg, #1f7a56 0%, #3fbf92 100%);
  box-shadow:0 4px 14px rgba(63, 191, 146, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-purple:hover:not(:disabled){
  box-shadow:0 6px 20px rgba(63, 191, 146, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-outline{
  background:rgba(255, 255, 255, 0.04);
  border:1px solid var(--border);
  color:var(--text);
  backdrop-filter:blur(8px);
}
.btn-outline:hover:not(:disabled){
  background:rgba(255, 255, 255, 0.08);
  border-color:rgba(255, 255, 255, 0.2);
}
.btn-sm{padding:6px 12px;font-size:12px;border-radius:8px}
.btn-xs{padding:4px 9px;font-size:11px;border-radius:6px}
.flex-btns{display:flex;gap:10px;flex-wrap:wrap}

/* TERMINAL */
.terminal{
  background:#05070a;
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px;
  height:380px;
  overflow-y:auto;
  font-family:'JetBrains Mono','Fira Code','Consolas',monospace;
  font-size:12px;
  line-height:1.6;
  color:#e2e8f0;
  word-break:break-word;
  box-shadow:inset 0 2px 14px rgba(0, 0, 0, 0.65);
}
.log-err{color:#f87171}
.log-warn{color:#fbbf24}
.log-info{color:#5fae9c}
.log-debug{color:#94a3b8}
.log-success{color:#34d399}
.log-ts{color:#64748b;margin-right:6px;font-size:11px}
.log-session-tag{background:rgba(47,164,124,0.15);color:#818cf8;border:1px solid rgba(47,164,124,0.3);padding:1px 5px;border-radius:4px;font-size:11px;margin-right:6px}

.log-ctrl{
  background:#111520 !important;
  border:1px solid rgba(255, 255, 255, 0.15) !important;
  color:#f1f5f9 !important;
  border-radius:7px !important;
  outline:none !important;
  color-scheme:dark !important;
  font-family:inherit !important;
  font-size:12px !important;
  cursor:pointer;
  transition:all .15s ease;
}
.log-ctrl:focus{
  border-color:#2fa47c !important;
  box-shadow:0 0 0 2px rgba(47, 164, 124, 0.25) !important;
}
.log-ctrl option{
  background:#111520 !important;
  color:#f1f5f9 !important;
}
input[type="datetime-local"].log-ctrl{
  cursor:text;
}
input[type="datetime-local"].log-ctrl::-webkit-calendar-picker-indicator{
  filter:invert(0.9) hue-rotate(180deg);
  cursor:pointer;
  opacity:0.8;
}
input[type="datetime-local"].log-ctrl::-webkit-calendar-picker-indicator:hover{
  opacity:1;
}

/* PREVENT BROWSER AUTOFILL STYLING OVERRIDE */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #131824 inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #f1f5f9 !important;
  transition: background-color 5000s ease-in-out 0s;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}
input[type="search"]::-ms-clear,
input[type="search"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

/* TOGGLE */
.switch{position:relative;display:inline-block;width:42px;height:22px;flex-shrink:0}
.switch input{opacity:0;width:0;height:0}
.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.15);transition:.3s;border-radius:22px}
.slider:before{position:absolute;content:"";height:16px;width:16px;left:3px;bottom:3px;background:#fff;transition:.3s;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,0.4)}
input:checked+.slider{background:linear-gradient(135deg, #2fa47c, #3fbf92)}
input:checked+.slider:before{transform:translateX(20px)}

/* AUTOPILOT BANNER */
.ap-banner{
  background:linear-gradient(160deg, rgba(20, 26, 42, 0.82) 0%, rgba(13, 17, 28, 0.9) 100%);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  border:1px solid rgba(47, 164, 124, 0.25);
  border-radius:16px;
  padding:24px;
  margin-bottom:20px;
  position:relative;
  overflow:hidden;
  box-shadow:0 12px 35px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}
.ap-banner::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,#217a5b,#3fbf92,#d9a45b);box-shadow:0 0 14px rgba(47,164,124,0.6)}
.ap-title{font-size:19px;font-weight:700;display:flex;align-items:center;gap:10px;margin-bottom:6px;color:#f8fafc}
.ap-desc{font-size:13px;color:var(--muted);margin-bottom:18px}
.ap-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.preset-btn{
  background:rgba(255, 255, 255, 0.04);
  border:1px solid rgba(255, 255, 255, 0.1);
  padding:7px 15px;
  border-radius:20px;
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  transition:all .2s cubic-bezier(0.16,1,0.3,1);
  white-space:nowrap;
  backdrop-filter:blur(8px);
}
.preset-btn:hover{color:var(--text);border-color:rgba(255,255,255,0.22);transform:translateY(-1px);}
.preset-btn.active{background:rgba(47,164,124,.28) !important;color:#fff !important;border-color:var(--blue) !important;box-shadow:0 0 16px rgba(47,164,124,.5) !important;font-weight:600}
.preset-btn[data-preset="safe"].active{background:rgba(16,185,129,.25) !important;color:#34d399 !important;border-color:#10b981 !important;box-shadow:0 0 16px rgba(16,185,129,.45) !important}
.preset-btn[data-preset="balanced"].active{background:rgba(47,164,124,.28) !important;color:#818cf8 !important;border-color:#2fa47c !important;box-shadow:0 0 16px rgba(47,164,124,.5) !important}
.preset-btn[data-preset="turbo"].active{background:rgba(239,68,68,.28) !important;color:#f87171 !important;border-color:#ef4444 !important;box-shadow:0 0 16px rgba(239,68,68,.5) !important}
.preset-btn[data-preset^="custom"].active, .preset-btn.active:has(.fa-star){background:rgba(245,158,11,.25) !important;color:#fbbf24 !important;border-color:#f59e0b !important;box-shadow:0 0 18px rgba(245,158,11,.55) !important}
.ap-footer{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);border-top:1px solid rgba(255,255,255,0.08);padding-top:14px}

/* PIPELINE GRID */
.pipeline-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.stage{
  background:linear-gradient(160deg, rgba(19, 25, 38, 0.75) 0%, rgba(12, 16, 26, 0.85) 100%);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  border:1px solid var(--border);
  border-radius:14px;
  padding:18px;
  position:relative;
  display:flex;
  flex-direction:column;
  box-shadow:0 6px 20px rgba(0,0,0,0.3);
  transition:all .2s ease;
}
.stage:hover{transform:translateY(-2px);border-color:rgba(255,255,255,0.14)}
.stage:nth-child(1){border-top:3px solid var(--green)}
.stage:nth-child(2){border-top:3px solid var(--yellow)}
.stage:nth-child(3){border-top:3px solid var(--blue)}
.stage:nth-child(4){border-top:3px solid var(--red)}
.stage-num{font-size:10px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px}
.stage-title{font-size:14px;font-weight:600;margin-bottom:8px;display:flex;align-items:center;gap:7px;color:#f8fafc}
.stage-desc{font-size:11.5px;color:var(--muted);line-height:1.5;flex:1;margin-bottom:14px}
.stage-stats{display:flex;gap:16px;padding:10px;background:rgba(0,0,0,.3);border-radius:10px;margin-bottom:14px;border:1px solid rgba(255,255,255,0.04)}
.s-stat span{display:block;font-size:9px;color:var(--muted);text-transform:uppercase;font-weight:600;margin-bottom:3px}
.s-stat strong{font-size:16px;font-weight:700;color:#f8fafc}
.stage-badge{position:absolute;top:14px;right:14px;font-size:10px;padding:3px 8px;border-radius:10px;font-weight:600;display:flex;align-items:center;gap:3px;backdrop-filter:blur(8px)}
.stage-badge::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor}
.sb-g{background:rgba(16,185,129,.14);color:#34d399;border:1px solid rgba(16,185,129,.25)}
.sb-b{background:rgba(47,164,124,.14);color:#818cf8;border:1px solid rgba(47,164,124,.25)}

/* PROXIES */
.proxy-card{
  background:linear-gradient(160deg, rgba(19, 25, 38, 0.72) 0%, rgba(13, 17, 27, 0.85) 100%);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow:0 4px 16px rgba(0,0,0,0.25);
  transition:all .2s ease;
}
.proxy-card:hover{border-color:rgba(255,255,255,0.14);transform:translateY(-1px)}
.proxy-card.selected{border-color:rgba(47,164,124,0.65) !important;background:linear-gradient(160deg,rgba(30,41,65,0.85) 0%,rgba(20,27,45,0.95) 100%) !important;box-shadow:0 0 0 1px rgba(47,164,124,0.4),0 8px 24px rgba(0,0,0,0.4) !important}
.proxy-card-cb{width:16px;height:16px;accent-color:var(--blue);cursor:pointer;flex-shrink:0;margin-right:2px}
.proxy-icon{width:38px;height:38px;background:rgba(255,255,255,0.06);border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;color:#5fae9c}
.proxy-info{flex:1}
.proxy-host{font-size:13px;font-weight:600;color:#f1f5f9}
.proxy-detail{font-size:11px;color:var(--muted);margin-top:3px}
.proxy-actions{display:flex;gap:8px;align-items:center}

/* NOTIFICATION */
.notif{
  position:fixed;
  bottom:20px;
  right:20px;
  background:rgba(15, 20, 32, 0.95);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  padding:14px 18px;
  font-size:13px;
  z-index:10000;
  max-width:320px;
  transform:translateX(120%);
  transition:.35s cubic-bezier(0.16,1,0.3,1);
  box-shadow:0 12px 35px rgba(0,0,0,.6);
}
.notif.show{transform:translateX(0)}
.notif.ok{border-left:4px solid var(--green)}
.notif.err{border-left:4px solid var(--red)}
.notif.info{border-left:4px solid var(--blue)}

/* STATS TICKER */
#ticker{font-size:11.5px;color:var(--muted);display:flex;align-items:center;gap:10px;padding:4px 0}
#ticker span{color:var(--text);font-weight:600}

/* MODAL */
.modal-bg{position:fixed;inset:0;background:rgba(4,7,13,0.75);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);z-index:100005 !important;display:none;align-items:center;justify-content:center}
.modal-bg.show{display:flex !important}
.modal{
  background:rgba(15, 20, 32, 0.95);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:18px;
  padding:26px;
  max-width:480px;
  width:90%;
  max-height:90vh;
  overflow-y:auto;
  box-shadow:0 25px 60px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.05);
}
.modal-title{font-size:16px;font-weight:700;margin-bottom:18px;display:flex;justify-content:space-between;align-items:center;color:#f8fafc}
.modal-close{background:none;border:none;color:var(--muted);font-size:20px;cursor:pointer;line-height:1;transition:color .15s}
.modal-close:hover{color:#fff}

/* SESSION DETAILS MODAL STYLES */
.modal-session-card {
  background: linear-gradient(165deg, #0e1626, #162032) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px !important;
  padding: 24px !important;
  max-width: 580px !important;
  width: 95% !important;
  max-height: 92vh !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75) !important;
}
.sess-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.sess-avatar {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2fa47c, #3fbf92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(47, 164, 124, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
}
.sess-avatar:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 22px rgba(47, 164, 124, 0.5);
}
.sess-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.sess-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.sess-avatar-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.sess-avatar:hover .sess-avatar-hover-overlay {
  opacity: 1;
}
.sess-avatar-edit-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #217a5b;
  border: 2px solid #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 2;
}
.sess-avatar-edit-icon:hover {
  transform: scale(1.15);
  background: #2fa47c;
}
.acc-table-row {
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.acc-table-row.row-selected {
  background-color: rgba(16, 185, 129, 0.12) !important;
}
.acc-table-row:hover {
  background-color: rgba(255, 255, 255, 0.035);
}
.acc-table-row.row-selected:hover {
  background-color: rgba(16, 185, 129, 0.18) !important;
}
.acc-chk-th,
.acc-chk-cell {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
  position: relative;
}
.acc-chk-hitbox {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 48px;
  cursor: pointer !important;
  user-select: none;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}
.acc-chk-hitbox:hover {
  background-color: rgba(16, 185, 129, 0.12);
}
.acc-row-chk,
#acc-chk-all {
  width: 18px !important;
  height: 18px !important;
  accent-color: #10b981;
  cursor: pointer !important;
  margin: 0 !important;
  border-radius: 5px;
  transition: transform 0.12s ease;
}
.acc-chk-hitbox:hover .acc-row-chk,
.acc-chk-hitbox:hover #acc-chk-all {
  transform: scale(1.15);
}

/* Custom rounded checkbox from reference UI */
.acc-chk-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  width: 22px;
  height: 22px;
  margin: 0;
}
.acc-chk-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.acc-chk-custom {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 10px;
  transition: all 0.15s ease;
}
.acc-chk-wrap:hover .acc-chk-custom {
  border-color: rgba(255, 255, 255, 0.45);
  transform: scale(1.08);
}
.acc-chk-wrap input[type="checkbox"]:checked + .acc-chk-custom {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}
.acc-chk-wrap input[type="checkbox"]:indeterminate + .acc-chk-custom {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

/* Accounts Selection Dropdown Menu */
.acc-dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  border-radius: 7px !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  color: #cbd5e1 !important;
  cursor: pointer !important;
  text-align: left !important;
  box-shadow: none !important;
  transform: none !important;
  user-select: none !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}
.acc-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  transform: none !important;
}
.acc-dropdown-item.acc-item-green {
  color: #34d399 !important;
}
.acc-dropdown-item.acc-item-green:hover {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
}
.acc-dropdown-item.acc-item-red {
  color: #f87171 !important;
}
.acc-dropdown-item.acc-item-red:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

/* Stat Cards */
.acc-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) {
  .acc-stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .acc-stat-cards {
    grid-template-columns: 1fr;
  }
}
.acc-stat-card {
  background: #0d1217;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
}
.acc-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.acc-stat-card.card-active {
  border: 1.5px solid #10b981 !important;
  background: rgba(16, 185, 129, 0.06) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}
.acc-stat-card.card-active-red {
  border: 1.5px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}
.acc-stat-card.card-active-blue {
  border: 1.5px solid #6fbfae !important;
  background: rgba(95, 174, 156, 0.06) !important;
  box-shadow: 0 0 20px rgba(95, 174, 156, 0.25), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}
.acc-stat-card-accent-line {
  position: absolute;
  bottom: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  border-radius: 2px;
  opacity: 0.9;
}
.acc-stat-card-accent-line.blue {
  background: #6fbfae;
  box-shadow: 0 0 10px #6fbfae;
}

/* Filter Bar */
.acc-filter-bar {
  background: #0c1015;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9999px;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.acc-filter-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.acc-btn-filter-toggle {
  display: none !important;
}
.acc-filter-badge {
  background: #6fbfae;
  color: #041019;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.2;
}
.acc-btn-filter-toggle.has-active-filters {
  border-color: #6fbfae !important;
  background: rgba(95, 174, 156, 0.15) !important;
  color: #6fbfae !important;
}
.acc-filters-drawer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.acc-pill-search {
  position: relative;
  display: flex;
  align-items: center;
}
.acc-pill-search input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 14px 6px 32px;
  color: #f8fafc;
  font-size: 12.5px;
  width: 140px;
  outline: none;
  transition: all 0.2s ease;
}
.acc-pill-search input:focus {
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.06);
  width: 180px;
}
.acc-pill-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.03) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 10px center / 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 26px 6px 14px;
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}
.acc-pill-select:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.acc-pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 14px;
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
  transition: all 0.15s ease;
}
.acc-pill-btn:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.acc-pill-icon-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.acc-pill-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Table Card */
.acc-table-card {
  background: #090e13;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.acc-table-card table {
  width: 100%;
  border-collapse: collapse;
}
.acc-table-card table#accounts-table,
#accounts-table {
  width: 100% !important;
  min-width: 1200px !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.acc-table-card thead th {
  padding: 13px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  user-select: none;
}
.acc-table-card tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.acc-table-card tbody tr:last-child {
  border-bottom: none;
}
.acc-table-card tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.025);
}
.acc-table-card tbody tr.row-selected {
  background-color: rgba(16, 185, 129, 0.12) !important;
}
.acc-table-card tbody td {
  padding: 11px 14px;
  font-size: 13px;
  vertical-align: middle;
}

/* Accounts Mobile Cards View */
.acc-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}
.acc-mobile-card {
  background: #0d1217;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  position: relative;
  cursor: pointer;
}
.acc-mobile-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: #11171e;
}
.acc-mobile-card.row-selected {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15) !important;
}

/* Status Badges */
.acc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.acc-status-pill.status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.acc-status-pill.status-quarantine {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.acc-status-pill.status-spam {
  background: rgba(217, 164, 91, 0.12);
  color: #e6bf85;
  border: 1px solid rgba(217, 164, 91, 0.25);
}
.acc-status-pill.status-unauth {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.acc-status-pill.status-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.acc-status-pill.status-frozen {
  background: rgba(95, 174, 156, 0.12);
  color: #6fbfae;
  border: 1px solid rgba(95, 174, 156, 0.25);
}
.acc-status-pill.status-unchecked {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.acc-proxy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.4;
  padding: 1px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.acc-proxy-pill:hover {
  filter: brightness(1.25);
  transform: translateY(-1px);
}
.acc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}
.dot-orange {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}
.dot-red {
  background: #f87171;
  box-shadow: 0 0 6px #f87171;
}
.dot-gray {
  background: #94a3b8;
}

/* Misc column icons */
.acc-misc-icons {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #475569;
  font-size: 13px;
}
.acc-misc-icons i.active,
.acc-misc-icons span.active {
  color: #cbd5e1;
}
.acc-misc-icons i.clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}
.acc-misc-icons i.clickable:hover {
  color: #6fbfae;
  transform: scale(1.15);
}

/* Pagination */
.acc-page-size-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 2px 8px;
  font-size: 11.5px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.acc-page-size-btn:hover {
  color: #fff;
}
.acc-page-size-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 700;
}
.acc-page-nav-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 11px;
  transition: color 0.15s ease;
}
.acc-page-nav-btn:hover {
  color: #fff;
}
.acc-page-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Dock buttons */
.acc-dock-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.acc-dock-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.1);
}
.tbl-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(47,164,124,0.4), rgba(63,191,146,0.4));
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tbl-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(47, 164, 124, 0.45);
}
.tbl-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.tbl-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.tbl-avatar-zoom-badge {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.18s ease;
  border-radius: 50%;
}
.tbl-avatar:hover .tbl-avatar-zoom-badge {
  opacity: 1;
}
@keyframes modalAvatarZoom {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.sess-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.sess-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sess-chip-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sess-chip-val {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sess-bio-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 14px;
  line-height: 1.5;
  color: var(--text);
}
.sess-codes-panel {
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid rgba(95, 174, 156, 0.25);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.sess-otp-hero {
  background: linear-gradient(135deg, rgba(95, 174, 156, 0.15), rgba(33, 122, 91, 0.12));
  border: 1px solid rgba(95, 174, 156, 0.35);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 18px rgba(95, 174, 156, 0.12);
}
.sess-code-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.45;
}
.sess-code-item:last-child {
  margin-bottom: 0;
}

/* ASSIGN PROXY MODAL STYLES */
.modal-assign-proxy {
  background: #0d121c !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px !important;
  padding: 24px !important;
  max-width: 600px !important;
  width: 95% !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
}
.assign-sess-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.assign-sess-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}
.assign-sess-row.selected {
  background: rgba(47, 164, 124, 0.08);
  border-color: rgba(47, 164, 124, 0.35);
}
.assign-sess-cb {
  width: 17px;
  height: 17px;
  accent-color: #2fa47c;
  cursor: pointer;
}
.assign-sess-proxy-tag {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: monospace;
  color: #94a3b8;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-filter-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-filter-pill.pill-active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}
.btn-filter-pill.pill-blue {
  background: rgba(47, 164, 124, 0.15);
  border-color: #2fa47c;
  color: #a8dcc7;
}

/* ONLINE AUDIT PREMIUM STYLES */
.audit-header { margin-bottom: 18px; }
.audit-title-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.audit-title { font-size: 21px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; margin: 0; }
.audit-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; margin-top: 4px; }
.audit-actions-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-audit-act { background: rgba(18, 24, 38, 0.6); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: #e2e8f0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all .15s ease; text-decoration: none; }
.btn-audit-act:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }
.btn-act-csv { border-color: rgba(16, 185, 129, 0.45); color: #a7f3d0; }
.btn-act-csv:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.15); }
.btn-act-txt { border-color: rgba(95, 174, 156, 0.45); color: #bae6fd; }
.btn-act-txt:hover { border-color: #6fbfae; background: rgba(95, 174, 156, 0.15); }
.btn-act-copy { border-color: rgba(63, 191, 146, 0.45); color: #e9d5ff; }
.btn-act-copy:hover { border-color: #a855f7; background: rgba(63, 191, 146, 0.15); }
.btn-act-tg { border-color: rgba(47, 164, 124, 0.45); color: #c7d2fe; }
.btn-act-tg:hover { border-color: #2fa47c; background: rgba(47, 164, 124, 0.15); }
.btn-act-clear { border-color: rgba(239, 68, 68, 0.45); color: #fecaca; }
.btn-act-clear:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.btn-act-refresh { border-color: rgba(47, 164, 124, 0.45); color: #bfdbfe; }
.btn-act-refresh:hover { border-color: #2fa47c; background: rgba(47, 164, 124, 0.15); }

/* 8 STATS CARDS GRID */
.audit-stats-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 1400px) { .audit-stats-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .audit-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.audit-stat-card { background: #131722; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; min-height: 84px; transition: transform .15s ease, border-color .15s ease; }
.audit-stat-card:hover { border-color: rgba(255, 255, 255, 0.15); transform: translateY(-1px); }
.audit-stat-title { font-size: 11.5px; font-weight: 500; color: #94a3b8; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-stat-val { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-top: 8px; line-height: 1; }

/* MIDDLE 2 PANELS */
.audit-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 1024px) { .audit-config-grid { grid-template-columns: 1fr; } }
.mode-pills { display: inline-flex; background: rgba(0, 0, 0, 0.35); padding: 3px; border-radius: 8px; border: 1px solid var(--border); gap: 4px; }
.mode-pill { background: transparent; border: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s ease; }
.mode-pill.active { background: #059669; color: #fff; box-shadow: 0 0 12px rgba(16, 185, 129, 0.3); }
.turbo-callout { background: rgba(6, 78, 59, 0.25); border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 10px; padding: 11px 14px; font-size: 12.5px; color: #d1fae5; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.audit-bot-banner { background: rgba(33, 122, 91, 0.15); border: 1px solid rgba(47, 164, 124, 0.35); border-radius: 10px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; margin: 14px 0 16px 0; cursor: pointer; }
.audit-bot-banner input[type="checkbox"] { width: 17px; height: 17px; accent-color: #2fa47c; cursor: pointer; }
.audit-bot-banner label { font-size: 12.5px; color: #e0e7ff; font-weight: 500; cursor: pointer; margin: 0; display: flex; align-items: center; gap: 8px; }
.btn-turbo-start { width: 100%; padding: 13px; border-radius: 10px; border: none; background: #059669; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s ease; box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35); }
.btn-turbo-start:hover { background: #10b981; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45); transform: translateY(-1px); }
.btn-single-start { width: 100%; padding: 13px; border-radius: 10px; border: none; background: #0284c7; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s ease; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35); }
.btn-single-start:hover { background: #2f9e8c; box-shadow: 0 6px 20px rgba(47, 158, 140, 0.45); transform: translateY(-1px); }

/* BOTTOM TABLE & TOOLBAR */
.qfilter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qfilter-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.qfilter-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: #cbd5e1; border-radius: 20px; padding: 4px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .15s ease; }
.qfilter-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.qfilter-btn.active { background: #217a5b; border-color: #2fa47c; color: #fff; box-shadow: 0 0 10px rgba(47, 164, 124, 0.35); }
.audit-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.audit-toolbar-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #e2e8f0; cursor: pointer; white-space: nowrap; margin: 0; }
.audit-toolbar-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.audit-toolbar-num { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.audit-toolbar-num input { width: 70px; padding: 6px 8px; font-size: 12px; }
.audit-search-wrap { flex: 1; min-width: 200px; position: relative; }
.audit-search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.audit-search-wrap input { width: 100%; padding: 7px 10px 7px 30px; font-size: 12.5px; }

/* TABLE */
.audit-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.audit-table th { background: #0f131a; color: #94a3b8; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.audit-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.audit-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.audit-cell-chat { display: flex; flex-direction: column; gap: 3px; }
.audit-chat-name { font-weight: 600; color: #fff; font-size: 13px; }
.audit-chat-url { font-size: 11.5px; color: #6fbfae; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; word-break: break-all; }
.audit-chat-url:hover { text-decoration: underline; }
.type-badge-group { background: rgba(6, 182, 212, 0.12); color: #6fbfae; border: 1px solid rgba(95, 174, 156, 0.25); padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.type-badge-channel { background: rgba(244, 63, 94, 0.12); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.25); padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pct-bar-wrap { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.pct-bar-track { flex: 1; height: 7px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; }
.pct-bar-fill { height: 100%; border-radius: 4px; }
.pct-val-label { font-size: 12.5px; font-weight: 700; min-width: 50px; text-align: right; }
.status-pill-ok { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35); color: #34d399; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-pill-err { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #f87171; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.audit-row-act { background: transparent; border: 1px solid var(--border); color: #94a3b8; width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s ease; font-size: 12px; text-decoration: none; }
.audit-row-act:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.audit-row-act.leave:hover { color: #f87171; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.12); }
.qfilter-log { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; font-size: 11px; padding: 2px 7px; border-radius: 6px; cursor: pointer; transition: all .15s ease; user-select: none; }
.qfilter-log:hover { background: rgba(255,255,255,0.1); color: #fff; }
.qfilter-log.active { background: rgba(95,174,156,0.18); border-color: #6fbfae; color: #fff; font-weight: 600; }

/* MISC */
.divider{height:1px;background:var(--border);margin:16px 0}
.mt8{margin-top:8px}
.mb8{margin-bottom:8px}
.mb16{margin-bottom:16px}
.text-muted{color:var(--muted)}
.text-sm{font-size:12px}
.w100{width:100%}
.flex{display:flex;align-items:center;gap:10px}
.flex-between{display:flex;justify-content:space-between;align-items:center}
.spin{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.progress-bar{height:8px;background:rgba(255,255,255,.06);border-radius:6px;overflow:hidden;margin-top:8px;position:relative}
.progress-fill{height:100%;background:linear-gradient(90deg, #2fa47c, #5fae9c);border-radius:6px;transition:width .6s cubic-bezier(0.16,1,0.3,1);box-shadow:0 0 10px rgba(47,164,124,.5)}
.check-item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text);cursor:pointer;user-select:none;margin-bottom:6px}
.check-item input[type="checkbox"]{width:15px;height:15px;accent-color:var(--blue);cursor:pointer;flex-shrink:0}

/* ============================================================ */
/* DIRECT MESSAGES (DIALOGS) MODERN STYLES                     */
/* ============================================================ */
.dm-container {
  display: flex;
  height: calc(100vh - 110px);
  min-height: 620px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 15px 0 25px;
}
.dm-sidebar {
  width: 340px;
  background: var(--c1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.dm-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dm-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px 0;
}
.dm-filter-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.dm-filter-tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dm-filter-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.dm-filter-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 600;
}
.dm-filter-tab .dm-badge-cnt {
  font-size: 10px;
  opacity: 0.75;
  font-weight: 600;
  margin-left: 2px;
}
.dm-filter-tab.active .dm-badge-cnt {
  opacity: 1;
  background: rgba(255,255,255,0.22);
  padding: 1px 5px;
  border-radius: 8px;
}
.dm-dialog-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dm-dialog-list::-webkit-scrollbar { width: 6px; }
.dm-dialog-list::-webkit-scrollbar-track { background: transparent; }
.dm-dialog-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.dm-dialog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
  border: 1px solid transparent;
  min-height: 56px;
}
.dm-dialog-item:hover {
  background: rgba(255,255,255,0.06);
}
.dm-dialog-item.active {
  background: rgba(47,164,124,0.15);
  border-color: rgba(47,164,124,0.3);
}
.dm-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.dm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  background: #2fa47c;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.dm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dm-online-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid var(--c1);
  border-radius: 50%;
}
.dm-dialog-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}
.dm-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.dm-dialog-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.dm-dialog-time {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.dm-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.dm-dialog-snippet {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.dm-badge-unread {
  background: #2fa47c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  flex-shrink: 0;
}
.dm-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}
.dm-chat-header {
  height: 60px;
  padding: 0 20px;
  background: var(--c1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.dm-history-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dm-history-container::-webkit-scrollbar { width: 6px; }
.dm-history-container::-webkit-scrollbar-track { background: transparent; }
.dm-history-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.dm-date-divider {
  align-self: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 12px;
  margin: 8px 0;
}
.dm-bubble {
  width: fit-content;
  max-width: 100%;
  min-width: 70px;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dm-bubble-out {
  align-self: flex-end;
  background: #217a5b;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.dm-bubble-in {
  align-self: flex-start;
  background: var(--c2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.dm-bubble-text {
  word-break: normal;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.45;
}
.dm-bubble-deleted {
  border: 1px dashed rgba(239, 68, 68, 0.65) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  position: relative;
}
.dm-bubble-out.dm-bubble-deleted {
  background: linear-gradient(135deg, rgba(47, 164, 124, 0.6), rgba(239, 68, 68, 0.35)) !important;
  border: 1px dashed rgba(248, 113, 113, 0.75) !important;
}
.dm-deleted-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
  margin-right: 4px;
  letter-spacing: 0.2px;
}
.dm-edited-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
  margin-right: 4px;
  cursor: help;
}
.dm-edited-box {
  margin-top: 5px;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.22);
  border-left: 2px solid #f59e0b;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
}
.dm-edited-label {
  color: #f59e0b;
  font-weight: 600;
  margin-right: 4px;
}
.dm-ayugram-badge {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
}
.dm-bubble-sender {
  font-size: 11px;
  font-weight: 600;
  color: #5fae9c;
  margin-bottom: 2px;
  display: block;
}
.dm-bubble-meta {
  font-size: 10px;
  text-align: right;
  margin-top: 3px;
  opacity: 0.6;
}
.dm-media-img {
  max-width: 300px;
  max-height: 260px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  object-fit: cover;
  transition: opacity 0.2s ease;
}
.dm-media-img:hover {
  opacity: 0.9;
}
.dm-doc-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 4px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
}
.dm-input-area {
  background: var(--c1);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  gap: 8px;
}
.dm-tpl-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.dm-tpl-scroll::-webkit-scrollbar { height: 4px; }
.dm-tpl-scroll::-webkit-scrollbar-track { background: transparent; }
.dm-tpl-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
.dm-tpl-pill {
  background: rgba(47,164,124,0.1);
  border: 1px solid rgba(47,164,124,0.2);
  color: #5fae9c;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.dm-tpl-pill:hover {
  background: rgba(47,164,124,0.15);
  border-color: rgba(47,164,124,0.3);
}
.dm-tpl-item-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(47,164,124,0.08);
  border: 1px solid rgba(47,164,124,0.22);
  transition: all 0.15s ease;
}
.dm-tpl-item-wrap:hover {
  background: rgba(47,164,124,0.15);
  border-color: rgba(47,164,124,0.42);
}
.dm-tpl-pill-btn {
  background: transparent;
  border: none;
  color: #5fae9c;
  font-size: 12px;
  padding: 6px 8px 6px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  user-select: none;
}
.dm-tpl-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
}
.dm-tpl-mini-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.dm-tpl-mini-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.dm-tpl-mini-btn.edit:hover {
  color: #6fbfae;
  background: rgba(95,174,156,0.2);
}
.dm-tpl-mini-btn.del:hover {
  color: #f87171;
  background: rgba(239,68,68,0.2);
}
.dm-tpl-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
}
.dm-tpl-card:hover {
  background: rgba(255,255,255,0.045);
  border-color: rgba(47,164,124,0.35);
}
.dm-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.dm-type-user { background: rgba(47,164,124,0.15); color: #5fae9c; }
.dm-type-group { background: rgba(63,191,146,0.15); color: #e0b06a; }
.dm-type-channel { background: rgba(245,158,11,0.15); color: #fcd34d; }
.dm-type-bot { background: rgba(16,185,129,0.15); color: #6ee7b7; }

/* CRM Lead Status Badges & Pills */
.dm-lead-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1.3;
}
.dm-lead-new { background: rgba(16,185,129,0.18); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.dm-lead-dialog { background: rgba(245,158,11,0.18); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.dm-lead-paid { background: rgba(47,164,124,0.18); color: #5fae9c; border: 1px solid rgba(47,164,124,0.3); }
.dm-lead-rejected { background: rgba(239,68,68,0.18); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.dm-lead-vip { background: rgba(63,191,146,0.18); color: #e0b06a; border: 1px solid rgba(63,191,146,0.3); }

.dm-lead-filter-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.dm-lead-filter-bar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.dm-lead-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.dm-lead-pill:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.dm-lead-pill.active { background: rgba(47,164,124,0.2); border-color: #2fa47c; color: #a8dcc7; font-weight: 600; }

/* Message Bubble Container & Hover Toolbar */
.dm-bubble-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: min(720px, 80%);
  width: fit-content;
  min-width: 0;
}
.dm-bubble-wrap.dm-wrap-out { align-self: flex-end; align-items: flex-end; margin-left: auto; }
.dm-bubble-wrap.dm-wrap-in { align-self: flex-start; align-items: flex-start; margin-right: auto; }

.dm-bubble-actions {
  display: none;
  position: absolute;
  top: -14px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 2px 4px;
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  z-index: 15;
}
.dm-wrap-out .dm-bubble-actions { right: 8px; }
.dm-wrap-in .dm-bubble-actions { left: 8px; }
.dm-bubble-wrap:hover .dm-bubble-actions { display: flex; align-items: center; }

.dm-action-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
}
.dm-action-btn:hover { background: rgba(255,255,255,0.12); color: #fff; transform: scale(1.1); }

/* Quick Reactions Popover */
.dm-react-popover {
  display: none;
  position: absolute;
  top: -42px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 3px 8px;
  gap: 3px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  z-index: 40;
  animation: dmFadeIn 0.15s ease-out;
  max-width: min(390px, 86vw);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.dm-react-popover::-webkit-scrollbar {
  display: none;
}
.dm-wrap-out .dm-react-popover { right: 8px; }
.dm-wrap-in .dm-react-popover { left: 8px; }
.dm-react-popover.show { display: flex; align-items: center; }

.dm-react-emoji-btn {
  background: transparent;
  border: none;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dm-react-emoji-btn:hover { transform: scale(1.35); background: rgba(255, 255, 255, 0.15); }
.dm-react-emoji-btn.dm-react-default {
  background: rgba(47, 164, 124, 0.22);
  border: 1px solid rgba(95, 174, 156, 0.4);
  border-radius: 12px;
}
.dm-react-emoji-btn.dm-react-default:hover {
  background: rgba(47, 164, 124, 0.4);
}

@keyframes dmFloatHandshake {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -80%) scale(1.35);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -120%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -160%) scale(0.9);
  }
}
.dm-floating-reaction {
  position: absolute;
  pointer-events: none;
  z-index: 999;
  font-size: 38px;
  animation: dmFloatHandshake 0.8s ease-out forwards;
}

/* Reactions Pill Bar Under Message */
.dm-reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  align-items: center;
}
.dm-wrap-out .dm-reactions-bar { justify-content: flex-end; }
.dm-wrap-in .dm-reactions-bar { justify-content: flex-start; }

.dm-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.dm-reaction-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px) scale(1.04);
}
.dm-reaction-pill.chosen {
  background: rgba(33, 122, 91, 0.32);
  border: 1.5px solid #2fa47c;
  color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(47, 164, 124, 0.3);
}
.dm-reaction-pill.chosen:hover {
  background: rgba(33, 122, 91, 0.45);
  border-color: #5fae9c;
}

.dm-reaction-emoji {
  font-size: 15px;
  line-height: 1;
}
.dm-reaction-who-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 8px;
  letter-spacing: 0.2px;
}
.dm-reaction-who-tag.me {
  background: rgba(47, 164, 124, 0.45);
  color: #ffffff;
}
.dm-reaction-who-tag.other {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-reaction-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
}
.dm-react-emoji-btn.active-chosen {
  background: rgba(47, 164, 124, 0.4) !important;
  border: 1.5px solid #5fae9c !important;
  box-shadow: 0 0 10px rgba(95, 174, 156, 0.5);
  transform: scale(1.15);
}

/* Reply Quote in Bubble */
.dm-reply-quote {
  border-left: 3px solid #6fbfae;
  padding: 3px 8px;
  margin-bottom: 5px;
  border-radius: 0 6px 6px 0;
  background: rgba(0,0,0,0.15);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.dm-reply-quote:hover { background: rgba(0,0,0,0.25); }
.dm-reply-quote-sender { font-weight: 700; color: #6fbfae; font-size: 11px; margin-bottom: 1px; }
.dm-reply-quote-text { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

/* Reply Preview Bar Above Input */
.dm-reply-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(95,174,156,0.1);
  border-left: 3px solid #6fbfae;
  border-radius: 6px;
  font-size: 12px;
  color: #6fbfae;
  animation: dmSlideDown 0.15s ease-out;
}
@keyframes dmSlideDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dmFadeIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* Emoji Picker Popover */
.dm-emoji-picker {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 20px;
  width: 290px;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 50;
}
.dm-emoji-picker.show { display: block; animation: dmFadeIn 0.15s ease-out; }
.dm-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.dm-emoji-grid button {
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}
.dm-emoji-grid button:hover { background: rgba(255,255,255,0.1); transform: scale(1.25); }

/* Voice Recording Bar */
.dm-voice-recording-bar {
  display: none;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 8px 14px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 18px;
}
.dm-voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: wsPulse 1.2s infinite;
}

/* Chat In-history Search Bar */
.dm-chat-search-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(15,23,42,0.95);
  border-bottom: 1px solid var(--border);
  z-index: 9;
}
.dm-chat-search-bar.show { display: flex; animation: dmSlideDown 0.15s ease-out; }

/* Pinned Message Bar (Telegram Style) */
.dm-pinned-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid rgba(251, 191, 36, 0.22);
  border-left: 3px solid #fbbf24;
  flex-shrink: 0;
  z-index: 10;
  animation: dmSlideDown 0.18s ease-out;
}
.dm-pinned-unpin-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.dm-pinned-unpin-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* Floating Scroll-to-Bottom Button */
.dm-scroll-bottom-btn {
  display: none;
  position: absolute;
  right: 18px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 40;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.dm-scroll-bottom-btn:hover {
  background: rgba(47, 164, 124, 0.25);
  border-color: #2fa47c;
  color: #5fae9c;
  transform: scale(1.08);
}
.dm-scroll-bottom-btn:active {
  transform: scale(0.94);
}
.dm-new-msgs-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  background: #217a5b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  border: 2px solid #0f172a;
  min-width: 18px;
  text-align: center;
}

/* Bubble Audio Dark Mode */
.dm-bubble audio {
  max-width: 100% !important;
  width: 250px;
  height: 36px;
  border-radius: 18px;
  outline: none;
}


/* Review / Pre-moderation styles */
.rev-sub-tab.active { background: rgba(47, 164, 124, 0.2) !important; border-color: rgba(47, 164, 124, 0.5) !important; color: #5fae9c !important; font-weight: 600; }
.rev-reason-chip { cursor: pointer; transition: all 0.15s ease; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); color: #cbd5e1; }
.rev-reason-chip:hover { border-color: #5fae9c !important; color: #a8dcc7 !important; background: rgba(47,164,124,0.1) !important; }
.rev-reason-chip.selected { background: rgba(47, 164, 124, 0.25) !important; border-color: #2fa47c !important; color: #a8dcc7 !important; }

/* ===== Worker statistics ===== */
.ws-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:18px}
.ws-range{display:inline-flex;background:#12151d;border:1px solid #242c3d;border-radius:10px;padding:3px;gap:2px}
.ws-range button{background:transparent;border:0;color:var(--muted);font-weight:600;font-size:12px;padding:6px 14px;border-radius:8px;cursor:pointer;transition:all .2s}
.ws-range button.active{background:linear-gradient(90deg,#2fa47c,#3fbf92);color:#fff;box-shadow:0 4px 14px rgba(47,164,124,.35)}
.ws-live{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--muted)}
.ws-live .dot{width:8px;height:8px;border-radius:50%;background:#475569}
.ws-live.on{color:var(--green)}
.ws-live.on .dot{background:var(--green);box-shadow:0 0 0 0 rgba(16,185,129,.6);animation:wsPulse 1.6s infinite}
@keyframes wsPulse{0%{box-shadow:0 0 0 0 rgba(16,185,129,.55)}70%{box-shadow:0 0 0 9px rgba(16,185,129,0)}100%{box-shadow:0 0 0 0 rgba(16,185,129,0)}}
.ws-kpi-sub{font-size:12px;color:var(--muted);margin-top:6px}
.ws-kpi-sub b{color:#e8edf5}
.ws-charts{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-bottom:20px}
.ws-chart-box{position:relative;height:260px}
.ws-workers{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px}
.ws-card{background:linear-gradient(145deg,#161a24,#10131b);border:1px solid #242c3d;border-radius:16px;padding:20px;position:relative;overflow:hidden;transition:all .25s cubic-bezier(.16,1,.3,1)}
.ws-card:hover{transform:translateY(-3px);border-color:rgba(255,255,255,.18);box-shadow:0 12px 30px rgba(0,0,0,.4)}
.ws-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--ws-accent,var(--green));box-shadow:0 0 14px var(--ws-accent,var(--green))}
.ws-head{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.ws-avatar{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:17px;color:#fff;background:linear-gradient(135deg,#2fa47c,#3fbf92);flex:none}
.ws-name{font-weight:700;font-size:15px;color:#f1f5f9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ws-sub{font-size:11px;color:var(--muted);margin-top:2px}
.ws-badge{margin-left:auto;font-size:11px;font-weight:700;padding:4px 10px;border-radius:20px;white-space:nowrap}
.ws-badge.ok{background:rgba(16,185,129,.14);color:#34d399}
.ws-badge.quarantine{background:rgba(245,158,11,.14);color:#fbbf24}
.ws-badge.dead,.ws-badge.frozen{background:rgba(239,68,68,.14);color:#f87171}
.ws-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.ws-tile{background:#0f121a;border:1px solid #20283a;border-radius:12px;padding:10px 12px}
.ws-tile .v{font-size:20px;font-weight:800;color:#f1f5f9;line-height:1.1}
.ws-tile .l{font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:4px}
.ws-tile .d{font-size:11px;font-weight:700;margin-top:3px}
.ws-bar-wrap{margin-bottom:12px}
.ws-bar-top{display:flex;justify-content:space-between;font-size:11.5px;color:var(--muted);margin-bottom:5px}
.ws-bar-top b{color:#e8edf5}
.ws-bar{height:8px;border-radius:8px;background:#1a2030;overflow:hidden;display:flex}
.ws-bar span{display:block;height:100%;transition:width .6s cubic-bezier(.16,1,.3,1)}
.ws-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.ws-chip{font-size:11px;font-weight:600;padding:4px 9px;border-radius:8px;background:#151a25;border:1px solid #22293a;color:#a9b4c7}
.ws-chip b{color:#e8edf5}
.ws-chip.warn b{color:#fbbf24}
.ws-chip.bad b{color:#f87171}
.ws-empty{padding:40px;text-align:center;color:var(--muted);font-size:13px}
@media(max-width:1000px){.ws-charts{grid-template-columns:1fr}}

/* ===== Account cleanup ===== */
.cl-opt{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;background:#0f121a;border:1px solid #20283a;border-radius:12px;cursor:pointer;transition:all .2s}
.cl-opt:hover{border-color:#34406a}
.cl-opt input{margin-top:3px;accent-color:#f59e0b;width:16px;height:16px}
.cl-opt b{color:#f1f5f9;font-size:13px}
.cl-opt span{display:block;color:var(--muted);font-size:11.5px;margin-top:2px}
.cl-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}
.cl-tile{background:#0f121a;border:1px solid #20283a;border-radius:12px;padding:12px;text-align:center}
.cl-tile .v{font-size:24px;font-weight:800;color:#f1f5f9;line-height:1}
.cl-tile .l{font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:6px}
.cl-keep{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.cl-keep .ws-chip{background:rgba(16,185,129,.08);border-color:rgba(16,185,129,.25)}
.cl-progress{height:10px;border-radius:10px;background:#1a2030;overflow:hidden;margin:10px 0 6px}
.cl-progress span{display:block;height:100%;background:linear-gradient(90deg,#f59e0b,#ef4444);transition:width .5s}
.cl-log{background:#080a0f;border:1px solid #1c2232;border-radius:10px;padding:10px 12px;font:11.5px/1.5 ui-monospace,monospace;color:#a9b4c7;max-height:150px;overflow:auto;white-space:pre-wrap}
.cl-warn{background:rgba(239,68,68,.08);border:1px solid rgba(239,68,68,.28);border-radius:12px;padding:12px 14px;font-size:12.5px;color:#fca5a5;margin:14px 0}

/* ============================================================ */
/* MODERN MOBILE & RESPONSIVE LAYOUT ENGINE                     */
/* ============================================================ */

/* Backdrop overlay for mobile drawer */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.dm-mobile-back-btn {
  display: none;
}
.dm-mobile-action-btn {
  display: none;
}
.dm-mobile-more-menu {
  display: none;
}

/* Metric Stats Grid (Schedule and Overview tabs) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Tablet styles (<= 1024px) */
@media (max-width: 1024px) {
  .acc-table-card { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  .grid4 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .grid3 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .pipeline-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .cl-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .acc-stat-cards { grid-template-columns: repeat(2, 1fr) !important; }
  .content { padding: 18px 16px !important; }
}

/* Mobile smartphones and small tablets (<= 768px) */
@media (max-width: 768px) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  body {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
  }

  /* PREVENT IOS FORM AUTO-ZOOM ON FOCUS (< 16px causes Safari zoom) */
  input, select, textarea, .inp, .acc-pill-search input, .acc-pill-select {
    font-size: 16px !important;
  }

  /* TOUCH ERGONOMICS & INSTANT TAP FEEDBACK */
  button, .btn, .acc-dock-btn, .mb-item, .acc-pill-btn, .acc-pill-icon-btn, .mode-pill, .day-pill {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* OFF-CANVAS MOBILE DRAWER SIDEBAR */
  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 290px !important;
    min-width: 290px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    background: #0d1118 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-backdrop {
    z-index: 99998 !important;
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Force expanded readable view inside mobile drawer */
  body.sidebar-collapsed .logo {
    padding: 14px 16px !important;
    flex-direction: row !important;
    justify-content: space-between !important;
  }
  body.sidebar-collapsed .logo-text {
    display: inline-block !important;
  }
  body.sidebar-collapsed .user-box-wrap {
    margin: 12px 12px 6px !important;
  }
  body.sidebar-collapsed .user-box {
    padding: 10px 12px !important;
    justify-content: flex-start !important;
  }
  body.sidebar-collapsed .user-info,
  body.sidebar-collapsed #user-chevron {
    display: block !important;
  }
  body.sidebar-collapsed .user-dropdown,
  .user-dropdown {
    position: absolute !important;
    left: 0 !important;
    top: calc(100% + 6px) !important;
    width: 100% !important;
  }
  body.sidebar-collapsed .nav {
    padding: 8px !important;
  }
  body.sidebar-collapsed .nav a {
    padding: 11px 12px !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    font-size: 13.5px !important;
  }
  body.sidebar-collapsed .nav-text {
    display: inline-block !important;
  }
  body.sidebar-collapsed .badge-new {
    position: static !important;
    margin-left: auto !important;
    width: auto !important;
    height: auto !important;
    font-size: 9px !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    box-shadow: none !important;
  }

  /* MAIN LAYOUT ON MOBILE */
  .main {
    width: 100vw !important;
    min-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
  }

  .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 14px 12px calc(116px + env(safe-area-inset-bottom, 0px)) !important;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    box-sizing: border-box !important;
  }
  .tab.active {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .sidebar .nav {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* TOPBAR ON MOBILE (Notch aware) */
  .topbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px !important;
    min-height: calc(50px + env(safe-area-inset-top, 0px)) !important;
    gap: 6px !important;
    background: #0f131a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
  }
  #topbar-toggle-sidebar {
    display: flex !important;
    min-width: 38px !important;
    min-height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }
  #ticker {
    font-size: 11px !important;
    max-width: 140px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .top-btn {
    padding: 7px 11px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    min-height: 36px !important;
    white-space: nowrap !important;
  }
  .topbar .cmd-palette-kbd {
    display: none !important;
  }

  /* CARDS, ROWS & GRIDS */
  .card, .ap-banner, .ap-hero {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .card {
    padding: 16px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 12px !important;
  }
  .card-title {
    font-size: 13.5px !important;
    margin-bottom: 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .row {
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
  }
  .col:not(button):not(.btn):not(a),
  .col-2:not(button):not(.btn):not(a) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }
  .hub-context-tabs {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    box-sizing: border-box !important;
  }
  .hub-context-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .hub-context-tabs .btn {
    flex: 1 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    justify-content: center !important;
    padding: 8px 10px !important;
    min-height: 36px !important;
    font-size: 11.5px !important;
  }
  .grid4, .grid3, .grid2, .pipeline-grid, .cl-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }
  .stat-card {
    padding: 13px 12px !important;
    border-radius: 12px !important;
  }
  .stat-val {
    font-size: 24px !important;
  }

  /* SCHEDULE & METRIC STATS GRIDS */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  /* ACCOUNTS TAB: 2x2 STAT CARDS (COMPACT VIEW) */
  .acc-stat-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .acc-stat-card {
    padding: 12px 10px !important;
    border-radius: 12px !important;
  }
  .acc-stat-card .acc-stat-card-accent-line {
    margin-top: 8px !important;
  }

  /* ACCOUNTS FILTER BAR MOBILE CARD */
  .acc-filter-bar {
    border-radius: 16px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-bottom: 12px !important;
  }
  .acc-filter-main-row {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  .acc-pill-search {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .acc-pill-search input {
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
  }
  .acc-pill-search input:focus {
    width: 100% !important;
  }
  .acc-btn-filter-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    height: 38px !important;
    padding: 0 10px !important;
    border-radius: 12px !important;
    font-size: 11.5px !important;
    flex: 0 0 auto !important;
  }
  .acc-hide-sm {
    display: none !important;
  }
  .acc-pill-btn {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    flex: 0 0 auto !important;
    justify-content: center !important;
  }
  .acc-pill-icon-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    flex: 0 0 auto !important;
  }
  .acc-filters-drawer {
    display: none !important;
    width: 100% !important;
    padding: 8px 0 2px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    gap: 8px !important;
  }
  .acc-filters-drawer.open {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .acc-filters-drawer .acc-pill-select {
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 10px !important;
    font-size: 11.5px !important;
    flex: 1 1 100% !important;
  }
  .acc-filters-drawer .acc-reset-filter-btn {
    grid-column: span 2 !important;
    width: 100% !important;
    height: 36px !important;
    border-radius: 10px !important;
    justify-content: center !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
  }

  /* ACCOUNTS TABLE SCROLL WRAPPER */
  .acc-table-card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 14px !important;
    width: 100% !important;
    margin-bottom: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  }
  .acc-table-card table:not(#accounts-table) {
    min-width: 600px !important;
    font-size: 12px !important;
  }
  .acc-table-card:has(table:not(#accounts-table)) th,
  .acc-table-card:has(table:not(#accounts-table)) td {
    padding: 8px 9px !important;
    white-space: nowrap !important;
  }
  .acc-table-card:has(table:not(#accounts-table)) th:nth-child(2),
  .acc-table-card:has(table:not(#accounts-table)) td:nth-child(2) {
    display: none !important;
  }

  /* ACCOUNTS FLOATING BULK ACTION DOCK (NO COLLISION WITH BOTTOM NAV) */
  #floating-acc-dock,
  .floating-acc-dock {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    transform: translateY(140%) !important;
    border-radius: 16px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
    z-index: 9995 !important;
  }
  #floating-acc-dock.dock-visible,
  .floating-acc-dock.dock-visible {
    transform: translateY(0) !important;
  }
  #floating-acc-dock .dock-divider,
  .floating-acc-dock .dock-divider {
    display: none !important;
  }
  #floating-acc-dock .dock-actions,
  .floating-acc-dock .dock-actions {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  #floating-acc-dock .dock-btn,
  .floating-acc-dock .dock-btn {
    min-height: 36px !important;
    padding: 7px 10px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
  }
  #accounts-bulk-dock {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    border-radius: 18px !important;
    padding: 8px 12px !important;
    z-index: 9995 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .acc-dock-header-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 4px !important;
  }
  .acc-dock-quick-actions {
    display: flex !important;
  }
  .acc-dock-divider {
    display: none !important;
  }
  .acc-dock-scroll-bar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 2px 2px !important;
    width: 100% !important;
  }
  .acc-dock-scroll-bar::-webkit-scrollbar {
    display: none !important;
  }
  #accounts-bulk-dock .acc-dock-btn {
    flex: 0 0 auto !important;
    min-width: 38px !important;
    height: 38px !important;
    font-size: 14.5px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ACCOUNTS PAGINATION ON MOBILE */
  .acc-pagination-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    text-align: center !important;
    margin-top: 10px !important;
  }
  .acc-pagination-wrap > div {
    justify-content: center !important;
  }
  .acc-page-size-pills {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  /* CLEANER PRESETS & OPTIONS GRIDS */
  #tab-cleaner div[style*="minmax(330px"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  #tab-cleaner div[style*="minmax(280px"] {
    grid-template-columns: 1fr !important;
  }
  #cleaner-preset-card-wipe, #cleaner-preset-card-soft {
    min-width: 0 !important;
    width: 100% !important;
    padding: 14px 14px !important;
  }

  /* WORKERS STATS ON MOBILE */
  .ws-workers {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .ws-charts {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .ws-chart-box {
    height: 210px !important;
  }
  .ws-toolbar {
    gap: 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .ws-range {
    width: 100% !important;
    justify-content: space-around !important;
  }
  .ws-range button {
    flex: 1 !important;
    text-align: center !important;
  }

  /* FLEX BARS & BUTTONS */
  .flex-between {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .flex-btns {
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .flex-btns .btn,
  .flex-btns label.btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
  .btn {
    padding: 9px 13px !important;
    font-size: 12px !important;
    min-height: 38px !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.25 !important;
  }
  .acc-smart-pill {
    white-space: nowrap !important;
  }
  .btn-sm {
    padding: 7px 11px !important;
    font-size: 11.5px !important;
    min-height: 34px !important;
  }
  .btn-xs {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }

  /* ACCOUNTS PAGINATION TOUCH TARGETS */
  .acc-page-size-btn {
    min-width: 36px !important;
    min-height: 34px !important;
    padding: 5px 8px !important;
    font-size: 12px !important;
  }
  .acc-page-nav-btn {
    min-width: 36px !important;
    min-height: 36px !important;
  }

  /* PROXIES TAB MOBILE FIXES */
  #tab-proxies .btn {
    min-width: 34px !important;
    min-height: 36px !important;
  }
  #btn-tab-p-luxhost,
  #btn-tab-p-manual,
  #btn-tab-p-pool {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 8px 6px !important;
    font-size: 11px !important;
    min-height: 36px !important;
    justify-content: center !important;
  }
  .proxy-geo-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  #proxy-tab-default-geo {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    padding: 6px 10px !important;
  }
  .proxy-filter-pills {
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 6px !important;
  }
  .proxy-filter-pills .btn {
    min-height: 34px !important;
    padding: 6px 10px !important;
    white-space: nowrap !important;
  }
  .proxy-card {
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .proxy-info {
    flex: 1 1 180px !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }
  .proxy-actions {
    width: 100% !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding-top: 6px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }
  .proxy-actions .btn {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 6px 10px !important;
  }

  /* WARMER TAB MOBILE FIXES */
  #tab-warmer .card {
    overflow: hidden !important;
  }
  #tab-warmer div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  #wm-cfg-crawler-act-day,
  #wm-cfg-worker-act-day {
    width: 92px !important;
    min-height: 36px !important;
    height: 36px !important;
  }

  /* SCHEDULE TAB MOBILE FIXES */
  #sched-account-select {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  #tab-schedule label {
    max-width: 100% !important;
    white-space: normal !important;
  }

  /* ONLINE AUDIT & REVIEW MOBILE TOUCH TARGETS */
  #btn-mode-turbo,
  #btn-mode-mtproto,
  .mode-pill {
    min-height: 36px !important;
    padding: 7px 12px !important;
  }
  .qfilter-btn {
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
  }
  #audit-min-members,
  #audit-min-pct,
  #rev-min-pct-inp,
  #rev-sort-sel {
    min-width: 96px !important;
    min-height: 38px !important;
    height: 38px !important;
  }
  #tab-review #rev-sort-sel {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* ADMIN & LOGS MOBILE FIXES */
  #tab-admin .ap-banner > div:first-child {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #tab-admin button {
    min-width: 34px !important;
    min-height: 34px !important;
  }
  #tab-logs div[style*="gap:10px"] {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #log-search-input {
    min-height: 36px !important;
    height: 36px !important;
  }
  #log-date-from,
  #log-date-to {
    min-height: 38px !important;
    height: 38px !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    box-sizing: border-box !important;
  }
  .modal {
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  #modal-profile-avatar .modal-footer-actions {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* GENERAL DATA TABLES ON MOBILE */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }
  table {
    min-width: 580px !important;
    font-size: 11.5px !important;
  }
  th, td {
    padding: 8px 10px !important;
    white-space: nowrap !important;
  }

  /* ============================================================ */
  /* MESSENGER (DM / ДИАЛОГИ) FULL RESPONSIVE MOBILE ENGINE       */
  /* ============================================================ */
  body.tab-messages-active .content {
    padding: 0 !important;
    overflow: hidden !important;
    height: calc(100vh - 50px - env(safe-area-inset-top, 0px)) !important;
    height: calc(100dvh - 50px - env(safe-area-inset-top, 0px)) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  body.tab-messages-active #tab-messages.active {
    height: 100% !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .dm-container {
    height: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: var(--bg) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Screen 1: Master Dialogs List */
  .dm-sidebar {
    width: 100% !important;
    min-width: 100% !important;
    border-right: none !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }
  .dm-sidebar-header {
    padding: 10px 12px !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    background: var(--c1) !important;
  }
  #dm-search {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom on focus */
    padding: 8px 28px 8px 32px !important;
  }
  .dm-dialog-list {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 6px 8px calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .dm-dialog-item {
    padding: 10px 12px !important;
    min-height: 60px !important;
    border-radius: 12px !important;
  }

  /* Screen 2: Active Chat View (Native Full-Screen Mobile Messenger) */
  body.mobile-chat-open .topbar,
  body.mobile-chat-open #mobile-bottom-nav,
  body.mobile-chat-open .mobile-bottom-nav {
    display: none !important;
  }
  body.tab-messages-active.mobile-chat-open .content {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .dm-chat-view {
    display: none !important;
    width: 100% !important;
    height: 100% !important;
    flex-direction: column !important;
    background: var(--bg) !important;
  }
  .dm-container.mobile-chat-open .dm-sidebar {
    display: none !important;
  }
  body.mobile-chat-open .dm-chat-view,
  .dm-container.mobile-chat-open .dm-chat-view {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: #090d16 !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .dm-chat-header {
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    max-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px 8px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
  }
  .dm-mobile-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text) !important;
    font-size: 15px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin-right: 2px !important;
    transition: transform 0.12s ease, background 0.12s ease !important;
  }
  .dm-mobile-back-btn:active {
    background: rgba(95, 174, 156, 0.25) !important;
    transform: scale(0.92) !important;
  }
  .dm-chat-header .dm-avatar-wrap {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0 !important;
  }
  .dm-chat-header .dm-avatar {
    width: 38px !important;
    height: 38px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }
  #dm-chat-title {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #fff !important;
  }
  #dm-chat-subtitle {
    font-size: 11px !important;
    color: #94a3b8 !important;
  }
  #dm-lead-status-select {
    max-width: 96px !important;
    height: 30px !important;
    font-size: 11px !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  .dm-desktop-action {
    display: none !important;
  }
  .dm-mobile-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
  }
  .dm-history-container {
    flex: 1 1 auto !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    padding: 12px 10px 14px !important;
    gap: 6px !important;
    background: #080c14 !important;
  }
  .dm-bubble-wrap {
    max-width: 86% !important;
  }
  .dm-bubble {
    max-width: 100% !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    padding: 8px 12px !important;
    border-radius: 14px !important;
  }
  .dm-bubble-actions {
    top: -26px !important;
  }
  .dm-bubble-wrap.active-actions .dm-bubble-actions {
    display: flex !important;
  }
  .dm-bubble-wrap .dm-react-popover.show {
    top: -68px !important;
    z-index: 100 !important;
  }
  .dm-input-area {
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  #dm-input {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom on input focus */
    max-height: 110px !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
  }
  .dm-mobile-more-menu {
    position: absolute;
    top: 42px;
    right: 6px;
    min-width: 215px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: dmFadeIn 0.18s ease-out;
  }
  .dm-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
  }
  .dm-more-item:hover, .dm-more-item:active {
    background: rgba(255, 255, 255, 0.08);
  }
  .dm-more-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
  }
  .dm-more-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 6px;
  }
  .dm-tpl-scroll {
    padding-bottom: 2px !important;
    gap: 4px !important;
  }
  .dm-tpl-pill {
    font-size: 11px !important;
    padding: 4px 9px !important;
    border-radius: 8px !important;
  }
  .dm-scroll-bottom-btn {
    bottom: 14px !important;
    right: 14px !important;
    width: 38px !important;
    height: 38px !important;
  }
  .dm-emoji-picker {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 250px !important;
    z-index: 100000 !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.85) !important;
  }
  .dm-emoji-grid {
    grid-template-columns: repeat(8, 1fr) !important;
    max-height: 190px !important;
    gap: 6px !important;
  }
  .dm-emoji-grid button {
    font-size: 20px !important;
    padding: 6px !important;
  }
  .dm-lead-filter-bar {
    padding: 4px 0 2px 0 !important;
    gap: 4px !important;
  }
  .dm-lead-pill {
    font-size: 10.5px !important;
    padding: 3px 7px !important;
    border-radius: 10px !important;
  }
  .dm-pinned-bar {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
  }

  /* NATIVE BOTTOM-SHEET MODALS ON MOBILE */
  .modal-bg {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100005 !important;
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }
  #modal-avatar-fullscreen {
    align-items: center !important;
    justify-content: center !important;
  }
  .modal, .modal-session-card, .modal-assign-proxy {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(88vh - env(safe-area-inset-top, 0px)) !important;
    max-height: calc(88dvh - env(safe-area-inset-top, 0px)) !important;
    border-radius: 22px 22px 0 0 !important;
    padding: 14px 16px calc(26px + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    border-bottom: none !important;
    animation: mobileSheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.88) !important;
    position: relative !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .modal::before, .modal-session-card::before, .modal-assign-proxy::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    margin: 0 auto 12px auto;
  }
  .modal-close {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    font-size: 16px !important;
  }
  @keyframes mobileSheetUp {
    from {
      transform: translateY(100%);
      opacity: 0.5;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .sess-hero {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
  }
  .sess-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* PREVIEWS & HERO BANNERS */
  .ap-hero, .ap-banner {
    padding: 16px 12px !important;
    border-radius: 12px !important;
  }
  .ap-title {
    font-size: 15px !important;
    flex-wrap: wrap !important;
  }
  .ap-controls {
    gap: 6px !important;
  }
  .preset-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    white-space: normal !important;
  }

  /* LOGS TERMINAL ON MOBILE */
  .terminal {
    height: 360px !important;
    font-size: 11px !important;
    padding: 10px !important;
    line-height: 1.5 !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #log-header-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  /* REVIEW PRE-MODERATION TAB */
  .audit-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .audit-actions-bar {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .audit-actions-bar button,
  .audit-actions-bar label {
    width: 100% !important;
    justify-content: center !important;
  }
  .audit-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .rev-sub-tab {
    flex: 1 1 auto !important;
    text-align: center !important;
    font-size: 11px !important;
    padding: 6px 8px !important;
  }

  /* FLOATING TOAST NOTIFICATIONS (SAFE POSITIONED) */
  .notif {
    left: 10px !important;
    right: 10px !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: calc(100vw - 20px) !important;
    border-radius: 12px !important;
    z-index: 10000 !important;
  }
}

/* MOBILE FLOATING BOTTOM DOCK */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 16, 26, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px 8px env(safe-area-inset-bottom, 0px) 8px;
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04);
    z-index: 9990;
    user-select: none;
  }
  .mb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 4px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex: 1;
    text-align: center;
    border: 1px solid transparent;
  }
  .mb-item i {
    font-size: 16px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
  }
  .mb-item span {
    font-size: 9.5px;
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: -0.2px;
  }
  .mb-item:hover {
    color: var(--text);
  }
  .mb-item:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.08);
  }
  .mb-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(47, 164, 124, 0.25) 0%, rgba(63, 191, 146, 0.15) 100%);
    border-color: rgba(47, 164, 124, 0.4);
    box-shadow: 0 4px 14px rgba(47, 164, 124, 0.25);
  }
  .mb-item.active i {
    transform: translateY(-2px);
    color: #818cf8;
    text-shadow: 0 0 12px rgba(47, 164, 124, 0.8);
  }
  .mb-item.active span {
    color: #ffffff;
    font-weight: 700;
  }
  .mb-badge-dot {
    position: absolute;
    top: 6px;
    right: calc(50% - 14px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
  }
}

/* Small mobile devices (<= 420px) */
@media (max-width: 420px) {
  .audit-stats-grid {
    grid-template-columns: 1fr !important;
  }
  .topbar {
    padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px !important;
  }
  #ticker {
    display: none !important;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .ws-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .ws-tile:last-child {
    grid-column: 1 / -1 !important;
  }
  .mb-item span {
    font-size: 9px !important;
  }
  .mb-item i {
    font-size: 15px !important;
  }
}

/* Extra small devices (<= 360px) */
@media (max-width: 360px) {
  .acc-stat-cards {
    grid-template-columns: 1fr !important;
  }
  .mb-item span {
    font-size: 8.5px !important;
  }
  .mb-item i {
    font-size: 14px !important;
  }
}

/* Responsive adjustments for account creation modal on small screens (<= 600px) */
@media (max-width: 600px) {
  #create-acc-modal .ca-grid-3,
  #create-acc-modal [style*="grid-template-columns:1fr 1fr 1fr"],
  #create-acc-modal [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

#create-acc-modal.show{display:flex!important}

/* ============================================================ */
/* TELEGRAM WEBAPP MODE (MOBILE CRM IN POCKET)                  */
/* ============================================================ */
html.is-telegram-webapp,
body.in-telegram-webapp {
  --bg: var(--tg-theme-bg-color, #080b11);
  --bg-alt: var(--tg-theme-secondary-bg-color, #0d121d);
  --text: var(--tg-theme-text-color, #f1f5f9);
  --muted: var(--tg-theme-hint-color, #94a3b8);
  --blue: var(--tg-theme-button-color, #2fa47c);
  background-color: var(--tg-theme-bg-color, #080b11) !important;
}

html.is-telegram-webapp .topbar {
  display: none !important;
}

html.is-telegram-webapp .main {
  padding-top: 0 !important;
  margin-top: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
}

html.is-telegram-webapp #tab-messages.active {
  height: 100vh !important;
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
}

#tab-messages:not(.active) {
  display: none !important;
}

html.is-telegram-webapp .dm-container {
  height: calc(100vh - 46px) !important;
  height: calc(100dvh - 46px) !important;
}

/* ============================================================ */
/* CRM VIEW SWITCHER & KANBAN LEADS PIPELINE                    */
/* ============================================================ */
.dm-view-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

.dm-view-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dm-view-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.dm-view-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(47, 164, 124, 0.4), rgba(63, 191, 146, 0.3));
  box-shadow: 0 2px 8px rgba(47, 164, 124, 0.25);
}

.dm-kanban-total-badge {
  background: rgba(47, 164, 124, 0.3);
  color: #a5b4fc;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Kanban Board Container */
.dm-kanban-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 120px);
  height: calc(100dvh - 120px);
  background: var(--bg);
}

html.is-telegram-webapp .dm-kanban-container {
  height: calc(100vh - 46px) !important;
  height: calc(100dvh - 46px) !important;
}

.dm-kanban-board {
  display: flex;
  gap: 14px;
  padding: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-height: 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.dm-kanban-column {
  flex: 0 0 280px;
  width: 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  min-height: 0;
  transition: border-color 0.2s, background 0.2s;
}

.dm-kanban-column.drag-over {
  border-color: #2fa47c;
  background: rgba(47, 164, 124, 0.08);
  box-shadow: 0 0 16px rgba(47, 164, 124, 0.2);
}

.dm-kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.dm-kanban-col-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.dm-kanban-col-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.dm-kanban-card {
  background: rgba(24, 34, 53, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 11px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  position: relative;
}

.dm-kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  border-color: rgba(47, 164, 124, 0.45);
}

.dm-kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.dm-kanban-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.dm-kanban-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-kanban-card-date {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.dm-kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6fbfae;
  margin-bottom: 6px;
  overflow: hidden;
}

.dm-kanban-card-session {
  background: rgba(95, 174, 156, 0.12);
  color: #6fbfae;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
}

.dm-kanban-card-preview {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
  word-break: break-word;
}

.dm-kanban-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dm-kanban-stage-select {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  max-width: 145px;
}

.dm-kanban-empty-col {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 12px;
  font-style: italic;
  opacity: 0.6;
}

/* Badge colors for 5 CRM stages */
.dm-lead-badge.dm-lead-in_dialog,
.dm-lead-badge.dm-lead-dialog {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.dm-lead-badge.dm-lead-offer {
  background: rgba(95, 174, 156, 0.15);
  color: #6fbfae;
  border-color: rgba(95, 174, 156, 0.3);
}

.dm-lead-badge.dm-lead-paid {
  background: rgba(63, 191, 146, 0.15);
  color: #e0b06a;
  border-color: rgba(63, 191, 146, 0.3);
}

.dm-lead-badge.dm-lead-rejected {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.3);
}

/* ============================================================
   PIPELINE DIAGNOSTICS, TRUST SCORE, COMMAND PALETTE & FUNNEL
   ============================================================ */
.pipe-diag-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(16, 24, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
}
.pipe-diag-bar.warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(16, 24, 38, 0.9));
}
.pipe-diag-bar.critical {
  border-color: rgba(239, 68, 68, 0.55);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(16, 24, 38, 0.9));
}
.pipe-diag-bar.ok {
  border-color: rgba(16, 185, 129, 0.35);
}
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.trust-pill.trust-veteran { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.38); }
.trust-pill.trust-trusted { background: rgba(47, 164, 124, 0.15); color: #6fbfae; border-color: rgba(95, 174, 156, 0.38); }
.trust-pill.trust-normal { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.25); }
.trust-pill.trust-newbie { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.38); }
.trust-pill.trust-risk,
.trust-pill.trust-frozen { background: rgba(239, 68, 68, 0.16); color: #f87171; border-color: rgba(239, 68, 68, 0.4); }

.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(5, 9, 18, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.cmd-palette-backdrop.show { display: flex; }
.cmd-palette-box {
  width: min(620px, 94vw);
  background: #0d1524;
  border: 1px solid rgba(95, 174, 156, 0.35);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}
.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cmd-palette-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 14px;
}
.cmd-palette-list {
  max-height: 55vh;
  overflow-y: auto;
  padding: 6px;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 13px;
}
.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: rgba(47, 164, 124, 0.16);
}
.cmd-palette-kbd {
  font-size: 10px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 2px 6px;
}

.batch-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10040;
  width: 310px;
  background: #0f172a;
  border: 1px solid rgba(95, 174, 156, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  display: none;
}
.batch-toast.show { display: block; }
.batch-toast-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}
.batch-toast-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2fa47c, #10b981);
  transition: width 0.25s ease;
}

.funnel-stage-row {
  display: grid;
  grid-template-columns: 165px 1fr 70px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}
.funnel-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.funnel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2fa47c, #34d399);
  border-radius: 999px;
}
@media (max-width: 520px) {
  .funnel-stage-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(60px, 1fr) auto !important;
    gap: 8px !important;
    font-size: 11.5px !important;
  }
}
