/* ==========================================================================
   AUTOFLOW PREMIUM DESIGN SYSTEM & DASHBOARD STYLES
   ========================================================================== */

:root {
  /* Colors */
  --bg-main: #08080a;
  --bg-sidebar: #0e0e11;
  --bg-card: rgba(22, 22, 26, 0.65);
  --bg-input: rgba(36, 36, 42, 0.45);
  
  --ink-primary: rgba(255, 255, 255, 0.95);
  --ink-secondary: rgba(228, 228, 231, 0.7);
  --ink-muted: rgba(161, 161, 170, 0.55);
  
  --accent-cyan: #10b981; /* Emerald green */
  --accent-cyan-glow: rgba(16, 185, 129, 0.35);
  --accent-cyan-dim: rgba(16, 185, 129, 0.12);
  --accent-blue: #0ea5e9; /* Telegram blue */
  --accent-blue-glow: rgba(14, 165, 233, 0.3);
  --accent-purple: #8b5cf6;
  --accent-gold: #f59e0b;
  
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-glass-focus: rgba(16, 185, 129, 0.25);
  
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* Radius & Shadows */
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-premium: 0 8px 32px -4px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border-glass);
  --shadow-glow: 0 0 24px var(--accent-cyan-glow);

  --scrollbar-size: 10px;
  --scrollbar-size-slim: 7px;
  --scrollbar-track: rgba(255, 255, 255, 0.025);
  --scrollbar-thumb: rgba(255, 255, 255, 0.18);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.3);
  --scrollbar-thumb-active: rgba(16, 185, 129, 0.48);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

input,
select,
textarea {
  color-scheme: dark;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent-cyan);
}

.shell button:not(.nav-btn):not(.color-dot):not(.modal-close):not(.topbar-icon-btn):not(.customizer-trigger-btn):not(.theme-toggle-select-btn):not(.icon-only-link):not(.campaign-shell-header):not(.campaign-head-main),
.modal button:not(.modal-close),
.login-card button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  color: var(--ink-primary);
  min-height: 38px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.shell button:not(.nav-btn):not(.color-dot):not(.modal-close):not(.topbar-icon-btn):not(.customizer-trigger-btn):not(.theme-toggle-select-btn):not(.icon-only-link):not(.campaign-shell-header):not(.campaign-head-main):hover,
.modal button:not(.modal-close):hover,
.login-card button:hover {
  transform: translateY(-1px);
  border-color: var(--border-glass-focus);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2), 0 0 0 3px var(--accent-cyan-dim);
}

.shell button:disabled,
.modal button:disabled,
.login-card button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.modal label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal label select,
.modal label textarea,
.login-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.search-input):not(.custom-input),
.shell select:not(.custom-select),
.shell textarea:not(.custom-textarea) {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--ink-primary);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.modal label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.modal label select:focus,
.modal label textarea:focus,
.login-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.search-input):not(.custom-input):focus,
.shell select:not(.custom-select):focus,
.shell textarea:not(.custom-textarea):focus {
  border-color: var(--border-glass-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

/* Reset & Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background: 
    radial-gradient(circle at 50% -20%, rgba(16, 185, 129, 0.12), transparent 50rem),
    radial-gradient(circle at 10% 20%, rgba(38, 38, 38, 0.15), transparent 45rem),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05), transparent 45rem),
    var(--bg-main);
}

body.locked {
  overflow: hidden;
}

/* Scrollbar Customization */
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--scrollbar-thumb), rgba(255, 255, 255, 0.11)) padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), rgba(255, 255, 255, 0.18)) padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--scrollbar-thumb-active), rgba(16, 185, 129, 0.28)) padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.scroll-styled,
pre,
textarea,
.modal-card,
.login-gate {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.scroll-styled::-webkit-scrollbar,
pre::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.login-gate::-webkit-scrollbar {
  width: var(--scrollbar-size-slim);
  height: var(--scrollbar-size-slim);
}

.scroll-styled::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track,
.login-gate::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-styled::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.login-gate::-webkit-scrollbar-thumb {
  min-height: 34px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--scrollbar-thumb), rgba(255, 255, 255, 0.1)) padding-box;
}

.scroll-styled::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
.modal-card::-webkit-scrollbar-thumb:hover,
.login-gate::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), rgba(255, 255, 255, 0.18)) padding-box;
}

/* Typography elements */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-primary);
}

p {
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   GLASSMORPHISM UTILITY
   ========================================================================== */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.glow-card {
  position: relative;
}

.glow-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
  pointer-events: none;
  z-index: 2;
}

/* ==========================================================================
   INTERACTIVE TOOLTIPS (Pure CSS)
   ========================================================================== */
[data-tooltip].with-tooltip,
#activitySvgChart [data-tooltip],
#donutSlices [data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  display: none;
}

[data-tooltip].with-tooltip::before,
#activitySvgChart [data-tooltip]::before,
#donutSlices [data-tooltip]::before {
  content: attr(data-tooltip);
  display: block;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translate(-50%, 4px) scale(0.95);
  background: rgba(11, 11, 13, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 400;
  white-space: normal;
  width: 220px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.18s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  text-align: center;
}

[data-tooltip].with-tooltip:hover::before,
#activitySvgChart [data-tooltip]:hover::before,
#donutSlices [data-tooltip]:hover::before {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ==========================================================================
   LOGIN & MAINTENANCE GATE
   ========================================================================== */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(11, 11, 13, 0.8), #030304 95%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 36px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: login-card-intro 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-card-intro {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--ink-primary);
}

.brand-logo-text .star {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px var(--accent-cyan-glow);
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--ink-secondary);
}

.login-status-box {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-secondary);
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
}

.login-status-box.info {
  border-color: rgba(14, 165, 233, 0.2);
  background: rgba(14, 165, 233, 0.05);
  color: rgba(14, 165, 233, 0.9);
}

.telegram-login-widget {
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   GLOBAL STRUCTURE / SHELL
   ========================================================================== */
.shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

body.login-page .shell {
  display: none;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  margin-bottom: 32px;
}

.sidebar-brand a {
  text-decoration: none;
}

.brand-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--ink-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-logo .cyan-star {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px var(--accent-cyan-glow);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  overflow-y: auto;
}

.menu-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  font-weight: 700;
}

/* Nav Button elements */
.nav-btn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav-btn svg {
  color: var(--ink-muted);
  transition: color 0.18s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-primary);
}

.nav-btn:hover svg {
  color: var(--ink-primary);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border-color: var(--accent-cyan-glow);
  color: #fff;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 0 8px var(--accent-cyan-glow);
}

.nav-btn.active svg {
  color: var(--accent-cyan);
}

.nav-btn.danger-highlight.active svg {
  color: var(--accent-cyan);
}

.nav-btn.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.nav-btn.is-disabled:hover {
  transform: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
}

.acc-indicator {
  position: relative;
  display: flex;
}

.pulsing-green {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px #10b981;
}

.acc-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.acc-info .lbl {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.acc-info .name {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telegram-links {
  display: flex;
  gap: 8px;
}

.footer-link {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ink-secondary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px;
  transition: background 0.18s, color 0.18s;
}

.footer-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 10px;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Dashboard Body & Viewport */
.dashboard-body {
  flex: 1;
  margin-left: 280px;
  width: calc(100% - 280px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border-glass);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 7, 9, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--ink-primary);
  cursor: pointer;
}

.active-tab-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.12);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: #10b981;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.online {
  background: #10b981;
}

/* Dashboard Content Area */
.dashboard-content {
  padding: 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Tab/Page container switching animate */
.page {
  display: none;
  animation: page-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  flex-direction: column;
  flex: 1;
}

.page.active {
  display: flex;
}

@keyframes page-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PAGE: HOME / OVERVIEW REDESIGN
   ========================================================================== */
/* ==========================================================================
   PAGE: HOME / OVERVIEW REDESIGN
   ========================================================================== */
.dashboard-header-console {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  background: rgba(18, 18, 24, 0.55);
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.dashboard-header-console::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.console-welcome h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.console-welcome p {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.console-widgets {
  display: flex;
  align-items: center;
  gap: 20px;
}

.live-clock-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-display);
}

.live-clock-widget .time {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.live-clock-widget .date {
  font-size: 10.5px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.system-status-pill-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  color: var(--accent-cyan);
  font-weight: 500;
}

.system-status-pill-v2 .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
  animation: pulse-cyan-dot 2s infinite;
}

@keyframes pulse-cyan-dot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 14px var(--accent-cyan); }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Redesigned Stats Cards with Embedded Sparklines */
.stats-grid-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card-v2 {
  position: relative;
  overflow: hidden;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 108px;
  background: rgba(18, 18, 24, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.stat-card-v2 .card-left {
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.stat-card-v2 .card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}

.stat-card-v2 .sparkline-wrapper {
  width: 80px;
  height: 36px;
  opacity: 0.45;
  transition: opacity 0.25s;
}

.stat-card-v2:hover .sparkline-wrapper {
  opacity: 0.9;
}

.stat-card-v2 .sparkline-path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-icon-wrapper-v2 {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}

.stat-card-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

/* Brand Metric Accents (Emerald primary, Red Youtube, Blue Telegram, Yellow Gmail, Purple Campaign) */
.stat-card-v2.yt-accent {
  --metric-color: #ef4444;
  --metric-glow: rgba(239, 68, 68, 0.25);
}
.stat-card-v2.tg-accent {
  --metric-color: #0ea5e9;
  --metric-glow: rgba(14, 165, 233, 0.25);
}
.stat-card-v2.email-accent {
  --metric-color: #f59e0b;
  --metric-glow: rgba(245, 158, 11, 0.25);
}
.stat-card-v2.purple-accent {
  --metric-color: #8b5cf6;
  --metric-glow: rgba(139, 92, 246, 0.25);
}

.stat-card-v2 .stat-icon-wrapper-v2 {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-glass);
  color: var(--ink-secondary);
}

.stat-card-v2:hover .stat-icon-wrapper-v2 {
  background: var(--metric-color);
  color: #08080a;
  border-color: var(--metric-color);
  box-shadow: 0 0 10px var(--metric-glow);
  transform: scale(1.05);
}

.stat-card-v2:hover {
  border-color: var(--metric-glow);
}

.stat-card-v2 .sparkline-path {
  stroke: var(--metric-color);
  filter: drop-shadow(0 0 3px var(--metric-glow));
}

.stat-data-v2 small {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-data-v2 strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

/* Custom Interactive SVG Chart Styling (Taller) */
.chart-card-v2 {
  padding: 24px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(18, 18, 24, 0.65);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-color.harvested {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan-glow);
}

.legend-color.sent {
  background: var(--accent-blue);
  box-shadow: 0 0 6px var(--accent-blue-glow);
}

.chart-body-wrapper {
  position: relative;
  width: 100%;
  height: 180px; /* Shorter height */
}

#activitySvgChart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Glowing chart paths */
.chart-path-harvested {
  stroke: var(--accent-cyan);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.35));
}

.chart-path-sent {
  stroke: var(--accent-blue);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.3));
}

.chart-area-harvested {
  fill: url(#areaGradientHarvested);
  opacity: 0.08;
}

.chart-area-sent {
  fill: url(#areaGradientSent);
  opacity: 0.08;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.035);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.chart-axis-text {
  fill: var(--ink-muted);
  font-size: 10px;
  font-family: var(--font-mono);
  user-select: none;
}

.chart-interactive-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: crosshair;
}

.chart-interactive-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
  stroke-dasharray: 4,4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.chart-hover-dot {
  stroke-width: 2.5;
  r: 5.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.1s;
}

.chart-hover-dot.harvested {
  fill: #08080a;
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.chart-hover-dot.sent {
  fill: #08080a;
  stroke: var(--accent-blue);
  filter: drop-shadow(0 0 6px var(--accent-blue));
}

.chart-tooltip-floating {
  position: absolute;
  background: rgba(14, 14, 18, 0.95);
  border: 1px solid var(--border-glass-focus);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 11.5px;
  font-family: var(--font-sans);
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.15s, left 0.15s, top 0.15s;
  box-shadow: 0 10px 24px rgba(0,0,0,0.65);
  min-width: 150px;
  backdrop-filter: blur(12px);
}

.chart-tooltip-floating.visible {
  opacity: 1;
}

.chart-tooltip-floating .title {
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.chart-tooltip-floating .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.chart-tooltip-floating .row.cyan { color: var(--accent-cyan); }
.chart-tooltip-floating .row.blue { color: var(--accent-blue); }

.chart-tooltip-floating .row strong {
  font-family: var(--font-mono);
  color: inherit;
}

/* IDE Terminal Log Monitors */
.live-section-header {
  margin-bottom: 16px;
}

.live-section-header h2 {
  font-size: 16px;
  margin-top: 4px;
  margin-bottom: 4px;
  color: var(--ink-secondary);
}

.mini-eyebrow {
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.live-monitors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.monitor-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 320px;
  background: rgba(14, 14, 18, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
}

.monitor-header {
  height: 40px;
  border-bottom: 1px solid var(--border-glass);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

/* Mac-style Window Action Buttons */
.monitor-header .window-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.monitor-header .window-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.monitor-header .window-dot.close { background: #ff5f56; }
.monitor-header .window-dot.minimize { background: #ffbd2e; }
.monitor-header .window-dot.maximize { background: #27c93f; }

.monitor-header .title-area {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--ink-secondary);
}

.monitor-header h3 {
  font-size: 12px;
  font-weight: 500;
}

.indicator-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ink-muted);
}

.indicator-pulse.active {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
  animation: pulse-cyan-dot 2s infinite;
}

.status-badge {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-cyan);
}

.terminal-body {
  flex: 1;
  min-height: 0;
  padding: 16px;
  background: #0b0b0e;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.terminal-body pre {
  font-family: inherit;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
  color: rgba(241, 245, 249, 0.85);
}

/* ==========================================================================
   PAGE COMMON LAYOUT & FORM ELEMENTS
   ========================================================================== */
.page-head-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 24px;
}

.page-head-bar h2 {
  font-size: 26px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.category-tag {
  font-size: 9.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 1.5px;
  font-weight: 700;
}

/* Grid Layout for Panels */
.control-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}

.left-controls-col,
.right-controls-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.panel-header svg {
  color: var(--accent-cyan);
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.panel-caption {
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Form Controls */
.control-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.custom-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.custom-label span {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.custom-input,
.custom-select,
.custom-textarea {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
}

.custom-select,
.shell select:not(.custom-select),
.modal label select {
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.custom-input[type="date"] {
  color-scheme: dark;
  min-height: 40px;
  position: relative;
}

.custom-input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: none;
}

html[data-theme="light"] .custom-input[type="date"] {
  color-scheme: light;
}

.date-picker-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: stretch;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.date-picker-shell:focus-within,
.date-picker-shell.is-open {
  border-color: var(--border-glass-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

.date-picker-shell.is-open {
  z-index: 1300;
}

.panel:has(.date-picker-shell.is-open) {
  z-index: 80;
  overflow: visible;
}

.date-picker-shell .custom-input[type="date"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 40px;
  cursor: pointer;
}

.date-picker-shell .custom-input[type="date"]:focus {
  box-shadow: none;
}

.date-picker-button {
  width: 38px;
  min-height: 38px;
  border: 0 !important;
  border-left: 1px solid var(--border-glass) !important;
  border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
  display: grid;
  place-items: center;
  background: transparent !important;
  color: var(--ink-secondary) !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.date-picker-button:hover {
  color: var(--accent-cyan) !important;
  transform: none !important;
  background: var(--accent-cyan-dim) !important;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 286px;
  padding: 14px;
  z-index: 1400;
  border-radius: 16px;
  border: 1px solid var(--border-glass-focus);
  background: rgba(14, 14, 18, 0.96);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.48), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.date-picker-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.date-picker-title {
  text-align: center;
  color: var(--ink-primary);
  font-weight: 800;
  font-size: 13px;
}

.date-picker-nav {
  width: 32px;
  height: 32px;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  display: grid;
  place-items: center;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.date-picker-weekdays {
  margin-bottom: 7px;
}

.date-picker-weekdays span {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.date-picker-day {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: var(--ink-secondary) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  box-shadow: none !important;
}

.date-picker-day:hover {
  transform: none !important;
  color: var(--ink-primary) !important;
  border-color: var(--border-glass-focus) !important;
  background: var(--accent-cyan-dim) !important;
}

.date-picker-day.is-outside {
  opacity: 0.34;
}

.date-picker-day.is-today {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.date-picker-day.is-selected {
  color: #fff !important;
  background: linear-gradient(135deg, var(--accent-cyan), #0ea5e9) !important;
  border-color: transparent !important;
}

.date-picker-day.is-disabled,
.date-picker-day:disabled {
  cursor: not-allowed;
  color: rgba(154, 158, 170, 0.35) !important;
  background: rgba(255, 255, 255, 0.012) !important;
  border-color: rgba(255, 255, 255, 0.025) !important;
  opacity: 0.62;
}

.date-picker-day.is-disabled:hover,
.date-picker-day:disabled:hover {
  color: rgba(154, 158, 170, 0.35) !important;
  background: rgba(255, 255, 255, 0.012) !important;
  border-color: rgba(255, 255, 255, 0.025) !important;
  transform: none !important;
}

.custom-textarea {
  resize: vertical;
}

.custom-input:focus,
.custom-select:focus,
.custom-textarea:focus {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.custom-input:disabled,
.custom-select:disabled,
.custom-textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-muted);
}

.disabled-filter {
  opacity: 0.58;
}

.disabled-filter .switch-visual,
.custom-switch-container input:disabled + .switch-visual {
  cursor: not-allowed;
  filter: saturate(0.7);
}

/* Custom Checkbox */
.custom-checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-primary);
  font-weight: 650;
  user-select: none;
}

.custom-checkbox-container input {
  display: none;
}

.checkbox-visual {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-glass);
  border-radius: 7px;
  background: var(--bg-input);
  position: relative;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.custom-checkbox-container:hover .checkbox-visual {
  border-color: var(--border-glass-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

.custom-checkbox-container input:checked + .checkbox-visual {
  background: linear-gradient(135deg, var(--accent-cyan), #0ea5e9);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim), inset 0 1px 1px rgba(255, 255, 255, 0.22);
}

.custom-checkbox-container input:checked + .checkbox-visual::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Custom Switch Toggle */
.custom-switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-secondary);
}

.custom-switch-container input {
  display: none;
}

.switch-visual {
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  position: relative;
  transition: background 0.2s;
  border: 1px solid var(--border-glass);
}

.switch-visual::after {
  content: "";
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.custom-switch-container input:checked + .switch-visual {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.custom-switch-container input:checked + .switch-visual::after {
  transform: translateX(16px);
}

.admin-feature-toggle input:checked + .switch-visual {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.admin-feature-toggle input:checked + .switch-visual::after {
  transform: translateX(16px);
}

/* Buttons */
.action-trigger-btn {
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
  transition: transform 0.18s, box-shadow 0.18s;
}

.action-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.45);
}

.action-trigger-btn:active {
  transform: translateY(1px);
}

.action-trigger-btn.full-width {
  width: 100%;
}

.secondary-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.secondary-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.secondary-action-btn.full-width {
  width: 100%;
}

/* ==========================================================================
   SPECIFIC VIEWS STYLING
   ========================================================================== */

/* YouTube Parser query history list */
.history-tag-list {
  display: grid;
  gap: 8px;
}

.history-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-glass);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-secondary);
  font: inherit;
  text-align: left;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}

.history-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-primary);
}

.history-item small {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 11.5px;
}

.history-item:hover {
  background: rgba(255, 42, 31, 0.08);
  border-color: rgba(255, 42, 31, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

/* Filters Grid */
.youtube-search-card,
.telegram-search-card {
  padding: 22px;
  border-radius: 22px;
  align-items: stretch;
  gap: 22px;
  background: rgba(20, 20, 25, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.youtube-search-card .left-controls-col,
.youtube-search-card .right-controls-col,
.telegram-search-card .left-controls-col,
.telegram-search-card .right-controls-col {
  display: grid;
  gap: 18px;
  align-content: stretch;
  min-width: 0;
}

.youtube-search-card .left-controls-col {
  grid-template-rows: minmax(150px, auto) minmax(220px, auto) minmax(190px, auto) minmax(160px, 1fr);
}

.youtube-search-card .right-controls-col {
  grid-template-rows: minmax(100px, auto) minmax(470px, auto) minmax(300px, 1fr);
}

.telegram-search-card .left-controls-col {
  grid-template-rows: minmax(205px, auto) minmax(330px, 1fr);
}

.telegram-search-card .right-controls-col {
  grid-template-rows: minmax(100px, auto) minmax(290px, auto) minmax(300px, 1fr);
}

.youtube-search-card .panel,
.telegram-search-card .panel {
  height: 100%;
  border-radius: var(--radius-md);
  min-height: 0;
}

.youtube-search-card .progress-panel,
.telegram-search-card .progress-panel {
  height: 360px;
  max-height: 360px;
  overflow: hidden;
}

.youtube-search-card .progress-panel .terminal-body,
.telegram-search-card .progress-panel .terminal-body {
  max-height: 224px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.youtube-search-card .progress-panel pre,
.telegram-search-card .progress-panel pre {
  margin: 0;
}

.parser-action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09), rgba(255, 255, 255, 0.026));
}

.parser-action-panel h3 {
  margin-top: 4px;
  font-size: 16px;
}

.parser-action-panel .action-trigger-btn {
  min-width: 148px;
}

.youtube-search-card .query-history,
.telegram-search-card .query-history {
  overflow: hidden;
}

.youtube-search-card .query-history .history-tag-list,
.telegram-search-card .query-history .history-tag-list {
  overflow: auto;
  padding-right: 2px;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.filters-grid .contact-priority-filter {
  grid-column: 1 / -1;
}

.filters-grid .personalization-language-filter {
  grid-column: 1 / -1;
}

.filters-grid .subscriber-filter {
  min-width: 0;
}

.switches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* Recipient list previews */
.recipient-preview-card {
  height: 280px;
  display: flex;
  flex-direction: column;
}

.recipient-head {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.count-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.recipient-preview-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.recipient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.recipient-row a,
.telegram-links a {
  min-width: 0;
  color: color-mix(in srgb, var(--accent-cyan) 65%, var(--ink-primary));
  text-decoration: none;
  border-bottom: 1px solid rgba(80, 220, 255, 0.2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-row a:hover,
.telegram-links a:hover {
  color: var(--ink-primary);
  border-bottom-color: var(--accent-cyan);
}

.recipient-row .email {
  color: var(--ink-secondary);
}

.recipient-row .status {
  font-size: 11px;
  color: var(--ink-muted);
}

/* ==========================================================================
   PAGE: DATABASE (TABLE) STYLES
   ========================================================================== */
.search-bar-wrapper {
  position: relative;
  width: 320px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 36px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: rgba(255, 42, 31, 0.4);
}

.database-switcher-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.database-switcher-panel .meta-info .lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.database-switcher-panel .meta-info h3 {
  font-size: 15px;
  margin-top: 2px;
}

.db-controls-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-select.slim,
.custom-input.slim,
.secondary-action-btn.slim,
.action-trigger-btn.slim {
  padding: 8px 12px;
  font-size: 12.5px;
  height: 36px;
}

.custom-input.slim {
  width: 180px;
}

.secondary-action-btn.slim.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
}

.secondary-action-btn.slim.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Tabs switcher rows */
.source-tabs-row,
.view-tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}

.source-mode-tab,
.table-tab {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  position: relative;
  transition: color 0.18s;
}

.source-mode-tab:hover,
.table-tab:hover {
  color: var(--ink-primary);
}

.source-mode-tab.active,
.table-tab.active {
  color: #fff;
}

.source-mode-tab.active::after,
.table-tab.active::after {
  content: "";
  height: 2px;
  background: var(--accent-cyan);
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
}

/* Toolbar dashboard options */
.toolbar-dashboard {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.toolbar-group-label {
  padding: 0 4px 0 6px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar-group-accent {
  background: rgba(16, 185, 129, 0.045);
}

.toolbar-spacer {
  flex: 1 1 24px;
}

.toolbar-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s, border-color 0.18s;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.toolbar-btn.highlight {
  border-color: rgba(14, 165, 233, 0.3);
  background: rgba(14, 165, 233, 0.08);
  color: rgba(14, 165, 233, 0.95);
}

.toolbar-btn.highlight:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.5);
}

.toolbar-btn.active {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.12);
  color: var(--ink-primary);
}

.details-toggle-btn {
  min-width: 158px;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(255, 255, 255, 0.025));
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.details-toggle-btn:hover {
  border-color: rgba(34, 211, 238, 0.28);
  color: var(--ink-primary);
}

.details-toggle-btn.active {
  border-color: rgba(34, 211, 238, 0.42);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(16, 185, 129, 0.08));
  color: var(--ink-primary);
}

.details-toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.08);
}

.details-toggle-btn.active .details-toggle-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.12), 0 0 18px var(--accent-cyan-glow);
}

.details-toggle-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.details-toggle-copy b {
  font-size: 12.5px;
  line-height: 1.1;
}

.details-toggle-copy small {
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.details-toggle-btn.active .details-toggle-copy small {
  color: var(--accent-cyan);
}

.reply-check-btn {
  border-color: rgba(16, 185, 129, 0.26);
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
}

.reply-check-btn:disabled {
  opacity: 0.62;
  cursor: wait;
}

.reply-check-progress {
  position: relative;
  min-width: 210px;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.reply-check-progress span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 750;
  color: var(--ink-primary);
}

.reply-check-progress b {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(14, 165, 233, 0.18));
  transition: width 0.24s ease;
}

/* Contacts type filter chips */
.contacts-type-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filter-chip.active {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-weight: 500;
}

.campaign-empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  margin-bottom: 20px;
  background: rgba(20, 20, 25, 0.52);
}

.sender-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 14px;
  color: var(--ink-primary);
}

.sender-section-title h3 {
  font-size: 18px;
  line-height: 1.25;
}

.campaign-shell {
  display: block;
  margin-bottom: 24px;
}

.campaign-empty-state .eyebrow,
.campaign-shell-header .eyebrow,
.campaign-extra-head .eyebrow {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-muted);
  font-weight: 700;
}

.campaign-empty-state h3,
.campaign-shell-header h3,
.campaign-extra-head h3 {
  font-size: 17px;
  color: var(--ink-primary);
  line-height: 1.25;
}

.campaign-empty-state p {
  margin-top: 5px;
  max-width: 720px;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.campaign-shell-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  margin-bottom: 14px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.campaign-shell-body {
  transition: opacity 0.18s ease;
  min-width: 0;
}

.campaign-shell.is-collapsed .campaign-shell-body,
.campaign-extra-card.is-collapsed .campaign-extra-body {
  display: none;
}

.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.campaign-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.campaign-extra-card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  min-width: 0;
}

.campaign-extra-head {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.campaign-head-main {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  text-align: left;
}

.campaign-head-delete {
  margin-right: 14px;
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.08);
  color: #fb7185;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.campaign-head-delete:hover {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.42);
}

.campaign-extra-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaign-extra-body.control-panel-grid {
  display: grid;
  align-items: stretch;
}

.campaign-full-card {
  border-radius: 18px;
}

.campaign-full-card .panel {
  border-radius: var(--radius-md);
  min-height: 0;
  height: 100%;
}

.campaign-full-card .left-controls-col,
.campaign-full-card .right-controls-col {
  display: grid;
  align-content: stretch;
  gap: 24px;
  min-width: 0;
}

.campaign-full-card .left-controls-col {
  grid-template-rows: auto auto minmax(250px, auto);
}

[data-extra-campaign="email"].campaign-full-card .left-controls-col,
[data-extra-campaign="webSender"].campaign-full-card .left-controls-col {
  grid-template-rows: auto auto;
}

.campaign-full-card .right-controls-col {
  grid-template-rows: auto minmax(250px, auto) minmax(360px, 1fr);
}

.campaign-action-panel {
  min-height: 100px;
}

.campaign-action-panel .action-trigger-btn {
  min-width: 190px;
  white-space: nowrap;
}

.campaign-full-card .progress-panel {
  min-height: 360px;
}

.campaign-full-card .terminal-body {
  min-height: 210px;
}

.campaign-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.campaign-full-card .custom-label,
.campaign-full-card .custom-select,
.campaign-full-card .custom-input,
.campaign-full-card .custom-textarea,
.campaign-shell .custom-label,
.campaign-shell .custom-select,
.campaign-shell .custom-input,
.campaign-shell .custom-textarea {
  min-width: 0;
}

.campaign-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.muted-chip {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .campaign-empty-state,
  .campaign-shell-header,
  .campaign-extra-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .campaign-head-main {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .campaign-head-delete {
    margin: 0 18px 16px;
  }

  .campaign-field-grid {
    grid-template-columns: 1fr;
  }

  .campaign-full-card .left-controls-col,
  .campaign-full-card .right-controls-col {
    grid-template-rows: none;
  }
}

/* Data Table Rendering */
.table-meta-bar {
  padding: 10px 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
  font-size: 12.5px;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-container-card {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  max-height: 500px;
  overflow: auto;
  min-width: 0;
}

.custom-data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.custom-data-table th,
.custom-data-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-glass);
}

.custom-data-table th {
  background: rgba(255, 255, 255, 0.01);
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
}

.custom-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.custom-data-table td {
  max-width: 280px;
  vertical-align: middle;
}

.custom-data-table td:not(:first-child) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-link {
  color: color-mix(in srgb, var(--accent-cyan) 72%, var(--ink-primary));
  text-decoration: none;
  border-bottom: 1px solid rgba(80, 220, 255, 0.22);
  font-weight: 600;
}

.table-link:hover {
  color: var(--ink-primary);
  border-bottom-color: var(--accent-cyan);
}

.table-status-select {
  min-width: 142px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 30px 0 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.table-status-select:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.table-status-select.status-sent {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.08);
}

.table-status-select.status-error {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
}

.table-status-select.status-empty {
  color: var(--ink-muted);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.table-status-select.status-pending {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
}

.reply-status-toggle {
  min-width: 58px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-secondary);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.reply-status-toggle.reply-yes {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(16, 185, 129, 0.1);
}

.reply-status-toggle.reply-no {
  color: #fb7185;
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.1);
}

.reply-status-toggle.reply-unknown {
  color: var(--ink-muted);
}

/* ==========================================================================
   PAGE: SYSTEM SETTINGS (NEW)
   ========================================================================== */
.settings-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.api-buttons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.settings-add-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: background 0.18s, border-color 0.18s;
}

.settings-add-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.settings-add-card .plus {
  font-size: 20px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.settings-add-card .text {
  display: flex;
  flex-direction: column;
}

.settings-add-card strong {
  font-size: 13.5px;
  color: #fff;
}

.settings-add-card small {
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* Active resource listings cards style */
.settings-resources-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sub-resource-group {
  min-width: 0;
}

.sub-resource-group h4 {
  font-size: 11.5px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

.mini-list-panel {
  max-height: none;
  overflow: visible;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.024);
  padding: 9px;
}

.access-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.access-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.access-head > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.access-head strong {
  color: var(--ink-primary);
  font-size: 14px;
  line-height: 1.2;
}

.access-count {
  min-width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

.access-empty {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 12.5px;
  line-height: 1.45;
}

.access-empty.compact {
  padding: 8px 0 2px;
  font-size: 11.5px;
}

.access-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(58px, auto) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  min-width: 0;
}

.resource-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resource-main strong {
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.resource-main small,
.resource-main a {
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
}

.resource-main a:hover {
  color: var(--accent-cyan);
}

.access-row em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.resource-open-btn {
  min-height: 28px !important;
  padding: 5px 8px !important;
  border-radius: 9px !important;
  font-size: 11px !important;
  color: var(--ink-secondary) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  box-shadow: none !important;
}

.delete-access {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: var(--ink-muted);
  font-size: 18px !important;
  cursor: pointer;
  padding: 0 !important;
  box-shadow: none !important;
}

.delete-access:hover {
  color: var(--accent-cyan);
}

.resource-subgroup {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.resource-subgroup + .resource-subgroup {
  margin-top: 8px;
}

.resource-subgroup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-subgroup-title b {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-secondary);
  font-size: 11px;
}

/* ==========================================================================
   PAGE: OFFERS PAGE STYLES
   ========================================================================== */
.offers-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.switches-inline {
  display: flex;
  gap: 32px;
}

.offer-fields-list {
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
}

.offer-card,
.tg-message-card,
.offer-field-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.offer-card {
  position: relative;
}

.offer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 48%);
  opacity: 0.22;
}

.offer-card > *,
.tg-message-card > * {
  position: relative;
}

.offer-card-head,
.offer-field-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.offer-card-head label {
  flex: 1;
  min-width: 0;
}

.offer-card label,
.tg-message-card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.offer-card input,
.offer-card textarea,
.tg-message-card input,
.tg-message-card textarea {
  width: 100%;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}

.offer-card textarea,
.tg-message-card textarea {
  min-height: 110px;
}

.offer-card input:focus,
.offer-card textarea:focus,
.tg-message-card input:focus,
.tg-message-card textarea:focus {
  border-color: var(--accent-cyan-glow);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

.offer-remove,
.tg-remove-message {
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.08);
  color: #fb7185;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  white-space: nowrap;
}

.offer-remove:disabled,
.tg-remove-message:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tg-formatbar,
.tg-message-head,
.tg-photo-actions,
.tg-message-actions,
.tg-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tg-message-head {
  justify-content: space-between;
}

.tg-message-head strong {
  color: var(--ink-primary);
  font-size: 15px;
}

.tg-formatbar button,
.tg-message-actions button,
.offer-card .soft,
.file-button {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
}

.offer-card .soft.full {
  width: 100%;
  justify-content: center;
}

.offer-card .soft:hover,
.tg-formatbar button:hover,
.file-button:hover {
  border-color: var(--accent-cyan-glow);
  background: var(--accent-cyan-dim);
}

.file-button input {
  display: none;
}

.tg-photo-list {
  margin-top: 4px;
}

.tg-photo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-secondary);
  font-size: 12px;
  padding: 5px 8px 5px 10px;
}

.tg-photo-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-photo-pill button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-primary);
  cursor: pointer;
  line-height: 1;
}

.offer-field-card-header h4 {
  font-size: 13px;
}

.offer-limit-note {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.055);
  color: var(--ink-secondary);
  font-size: 12.5px;
  line-height: 1.45;
}

.offer-variables-panel {
  grid-column: 1 / -1;
  gap: 10px;
}

.offer-variables-panel p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.offer-variables-panel code {
  display: inline-block;
  margin: 2px 3px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-primary);
  font-size: 12px;
}

.tg-preview-box {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

.preview-title {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.tg-phone-preview-frame {
  max-height: 260px;
  min-height: 140px;
  background:
    linear-gradient(135deg, rgba(42, 171, 238, 0.12), transparent 42%),
    #17212b;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  padding: 14px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.45;
  color: #fff;
}

.tg-preview-offer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-preview-offer + .tg-preview-offer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tg-preview-offer small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.tg-preview-bubble {
  width: fit-content;
  max-width: min(100%, 520px);
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: #243447;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  overflow-wrap: anywhere;
}

.tg-preview-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tg-preview-photo {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(42, 171, 238, 0.18);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   PAGE: ADMIN PANEL STYLES
   ========================================================================== */
.admin-grid-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  align-items: start;
}

.admin-grid-layout > .panel,
.admin-section-card {
  min-width: 0;
}

.admin-section-card {
  margin-top: 26px;
}

.admin-users-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 8px;
}

.admin-db-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(34, 211, 238, 0.075);
}

.admin-db-view-banner span {
  display: block;
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-db-view-banner strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-primary);
  font-size: 15px;
}

.admin-users-board {
  max-height: 720px;
  overflow-y: auto;
  padding: 12px;
  border-radius: var(--radius-md);
}

.admin-users-compact {
  display: grid;
  gap: 10px;
}

.admin-user-card {
  position: relative;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.admin-user-main {
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px minmax(135px, 0.8fr) minmax(100px, 0.55fr) minmax(252px, 1.12fr) minmax(130px, 0.65fr) minmax(190px, auto);
  grid-template-areas:
    "toggle identity meta stats activity actions"
    "toggle identity meta stats activity access";
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.admin-user-expand {
  grid-area: toggle;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.admin-user-identity,
.admin-user-meta,
.admin-user-activity {
  min-width: 0;
}

.admin-user-identity {
  grid-area: identity;
}

.admin-user-meta {
  grid-area: meta;
}

.admin-user-stats {
  grid-area: stats;
}

.admin-user-activity {
  grid-area: activity;
}

.admin-user-identity strong,
.admin-user-identity small,
.admin-user-meta span,
.admin-user-activity b,
.admin-user-activity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity strong {
  color: var(--ink-primary);
  font-size: 15px;
}

.admin-user-identity small,
.admin-user-meta span,
.admin-user-activity span {
  color: var(--ink-secondary);
  font-size: 11.5px;
  line-height: 1.4;
}

.admin-user-activity b {
  color: var(--ink-primary);
  font-size: 12px;
}

.admin-user-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.admin-user-stats span {
  min-width: 0;
  padding: 8px 7px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.admin-user-stats b,
.admin-user-stats small {
  display: block;
  text-align: right;
}

.admin-user-stats b {
  color: var(--ink-primary);
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.admin-user-stats small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-stats b.metric-digits-1,
.admin-user-stats b.metric-digits-2 {
  font-size: 24px;
}

.admin-user-stats b.metric-digits-3 {
  font-size: 22px;
}

.admin-user-stats b.metric-digits-4 {
  font-size: 18px;
}

.admin-user-stats b.metric-digits-5 {
  font-size: 15px;
}

.admin-user-stats b.metric-digits-6 {
  font-size: 13px;
}

.admin-user-stats b.metric-digits-7 {
  font-size: 11px;
}

.admin-user-stats .has-errors b {
  color: var(--danger);
}

.admin-user-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-user-actions button,
.admin-db-pick,
.admin-detail-full-btn {
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  min-height: 32px;
  padding: 7px 9px;
  cursor: pointer;
}

.admin-user-actions button:hover,
.admin-db-pick:hover,
.admin-detail-full-btn:hover {
  background: rgba(34, 211, 238, 0.12);
  color: #fff;
}

.admin-user-access {
  grid-area: access;
  justify-self: end;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-user-access.is-revoked {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.admin-user-details {
  padding: 0 12px 12px 58px;
}

.admin-db-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.admin-db-modal-grid h3 {
  margin: 0 0 10px;
  color: var(--ink-primary);
  font-size: 14px;
}

.admin-db-pick {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  text-align: left;
}

.admin-db-pick span {
  min-width: 0;
}

.admin-db-pick b,
.admin-db-pick small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-db-pick small {
  margin-top: 3px;
  color: var(--ink-secondary);
  font-size: 11px;
}

.admin-db-pick em {
  flex: 0 0 auto;
  color: var(--accent-cyan);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.admin-database-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--ink-secondary);
  font-size: 12px;
}

.admin-detail-full-btn {
  width: 100%;
}

.status-readonly {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.reply-status-toggle.is-readonly {
  cursor: default;
  pointer-events: none;
}

.inline-action-form {
  display: flex;
  gap: 10px;
}

.inline-action-form.max-width-form {
  max-width: 480px;
}

.bot-commands-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
}

.commands-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.commands-tags code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--accent-cyan);
}

.limits-inputs-form,
.maintenance-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-limits-grid,
.admin-feature-grid {
  display: grid;
  gap: 12px;
}

.admin-limits-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-feature-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-feature-toggle {
  min-height: 136px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.admin-feature-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 170, 0, 0.34);
  background: rgba(255, 255, 255, 0.055);
}

.admin-feature-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-feature-toggle .switch-visual {
  grid-row: 1 / span 2;
  margin-top: 2px;
}

.admin-feature-toggle b {
  color: var(--ink-primary);
  font-size: 14px;
  line-height: 1.25;
}

.admin-feature-toggle small {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.status-summary {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.wide-admin-col {
  grid-column: 1 / span 2;
}

.admin-command-card .bot-commands-card {
  min-height: 200px;
}

.feature-disabled {
  opacity: 0.64;
}

.feature-disabled .action-trigger-btn:not(.stop) {
  cursor: not-allowed;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.admin-row span,
.admin-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row small {
  grid-column: 1;
  color: var(--ink-secondary);
  font-size: 11px;
}

.admin-row button,
.admin-actions-cell button,
.admin-detail-item button,
.admin-error button,
.admin-downloads button {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  min-height: 32px;
  padding: 7px 10px;
  cursor: pointer;
}

.admin-row button:hover,
.admin-actions-cell button:hover,
.admin-detail-item button:hover,
.admin-error button:hover,
.admin-downloads button:hover {
  border-color: rgba(255, 170, 0, 0.45);
  background: rgba(255, 170, 0, 0.1);
}

.admin-user-row td strong,
.admin-user-row td small {
  display: block;
}

.admin-user-row td small {
  margin-top: 4px;
  color: var(--ink-secondary);
  font-size: 11px;
}

.admin-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-detail-row td {
  padding: 0 12px 18px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
}

.admin-detail-card {
  min-width: 0;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.admin-detail-wide {
  grid-column: span 3;
}

.admin-detail-title,
.admin-detail-item,
.admin-error > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-detail-title {
  margin-bottom: 10px;
  color: var(--ink-primary);
}

.admin-detail-title span {
  color: var(--accent-cyan);
}

.admin-detail-item,
.admin-error,
.admin-activity {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}

.admin-detail-item + .admin-detail-item,
.admin-error + .admin-error,
.admin-activity + .admin-activity {
  margin-top: 8px;
}

.admin-detail-item div,
.admin-activity {
  min-width: 0;
}

.admin-detail-item b,
.admin-detail-item small,
.admin-activity b,
.admin-activity span,
.admin-activity small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-detail-item small,
.admin-activity span,
.admin-activity small,
.admin-error span {
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.admin-error p {
  margin: 8px 0 0;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.admin-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-log-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-log-preview pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* ==========================================================================
   MODAL WINDOW & TOAST POPUPS
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: opacity 0.2s ease;
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  padding: 34px;
  position: relative;
  animation: modal-card-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal-card h2 {
  margin: 0 42px 12px 0;
  line-height: 1.14;
}

.modal-card > p,
.modal-card form > p {
  margin: 0 0 22px;
  color: var(--ink-secondary);
  line-height: 1.48;
}

.modal-card form {
  display: grid;
  gap: 18px;
}

.modal label {
  display: grid;
  gap: 8px;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}

@keyframes modal-card-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--ink-secondary);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.modal-close:hover {
  color: var(--ink-primary);
  background: var(--accent-cyan-dim);
  border-color: var(--border-glass-focus);
  transform: translateY(-1px);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.modal-actions.stacked-actions {
  flex-direction: column;
  align-items: stretch;
}

.modal-actions button,
.priority-grid button {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.modal-actions button {
  min-height: 42px;
  padding: 10px 16px;
}

.modal-actions button:hover,
.priority-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
  color: #fff;
}

.modal-actions button.accent {
  border-color: rgba(14, 165, 233, 0.55);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.92), rgba(34, 197, 94, 0.72));
  color: #fff;
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.18);
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.priority-grid button {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 14px;
  text-align: left;
}

.priority-grid button small {
  color: var(--ink-secondary);
  line-height: 1.35;
}

.auth-step-panel,
.auth-primary-panel,
.auth-qr-panel {
  display: grid;
  gap: 16px;
}

.auth-primary-panel {
  margin-top: 4px;
}

.auth-main-action {
  width: 100%;
  min-height: 136px !important;
  display: grid !important;
  align-content: center;
  gap: 10px;
  padding: 24px !important;
  text-align: left;
  border-radius: 18px !important;
  border-color: rgba(34, 197, 94, 0.34) !important;
  background:
    radial-gradient(circle at 86% 25%, rgba(163, 255, 18, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(34, 197, 94, 0.08)) !important;
}

.auth-main-action strong {
  color: var(--ink-primary);
  font-size: 19px;
  line-height: 1.15;
}

.auth-main-action small,
.auth-secondary-action {
  color: var(--ink-secondary);
  line-height: 1.4;
}

.auth-secondary-action {
  justify-self: start;
  min-height: 34px !important;
  padding: 7px 10px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.auth-method-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-method-strip button {
  min-height: 38px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  box-shadow: none !important;
}

.auth-method-strip button.active {
  background: rgba(14, 165, 233, 0.16) !important;
  color: var(--ink-primary) !important;
}

.auth-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-panel-head strong {
  color: var(--ink-primary);
  font-size: 14px;
}

.auth-refresh-btn {
  min-height: 30px !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
}

.auth-qr-panel {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.auth-qr-panel small {
  color: var(--ink-secondary);
  line-height: 1.45;
}

.auth-qr-panel img {
  width: min(260px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  justify-self: center;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.qr-result-shell {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.qr-box {
  display: grid;
  place-items: center;
  width: min(260px, 100%);
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
}

.qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-loading,
.qr-fallback {
  width: min(260px, 100%);
  min-height: 220px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--ink-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.auth-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-secondary);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.auth-status[data-tone="success"] {
  color: var(--accent-cyan);
  background: rgba(16, 185, 129, 0.08);
}

.auth-status[data-tone="warning"] {
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.08);
}

.auth-status[data-tone="error"] {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
}

.compact-label {
  margin-bottom: 2px;
}

.compact-grid.one,
.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.compact-grid.one label {
  min-width: 0;
}

.compact-grid.one button,
.code-row button {
  min-height: 42px !important;
  white-space: nowrap;
}

.auth-code-input,
.code-row input.auth-code-input {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    var(--bg-input);
  color: var(--ink-primary);
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-code-input::placeholder {
  color: var(--ink-muted);
}

.auth-code-input:focus {
  border-color: var(--border-glass-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-code-input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .modal {
    padding: 14px;
  }

  .modal-card {
    max-width: 100%;
    padding: 28px 20px 22px;
  }

  .compact-grid.one,
  .code-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  background: rgba(18, 18, 22, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .control-panel-grid,
  .settings-layout-grid,
  .offers-layout-grid,
  .admin-grid-layout {
    grid-template-columns: 1fr;
  }

  .youtube-search-card .left-controls-col,
  .youtube-search-card .right-controls-col,
  .telegram-search-card .left-controls-col,
  .telegram-search-card .right-controls-col {
    grid-template-rows: none;
  }
  
  .wide-admin-col {
    grid-column: span 1;
  }

  .admin-limits-grid,
  .admin-feature-grid,
  .admin-detail-grid,
  .admin-log-preview {
    grid-template-columns: 1fr;
  }

  .admin-user-main {
    grid-template-columns: 34px minmax(0, 1fr) minmax(180px, auto);
    grid-template-areas:
      "toggle identity access"
      "toggle meta actions"
      "stats stats stats"
      "activity activity activity";
    padding-right: 12px;
  }

  .admin-user-expand {
    grid-area: toggle;
  }

  .admin-user-identity {
    grid-area: identity;
  }

  .admin-user-meta {
    grid-area: meta;
  }

  .admin-user-stats {
    grid-area: stats;
  }

  .admin-user-activity {
    grid-area: activity;
  }

  .admin-user-actions {
    grid-area: actions;
  }

  .admin-user-access {
    grid-area: access;
    position: static;
  }

  .admin-user-details {
    padding-left: 12px;
  }

  .admin-detail-wide {
    grid-column: span 1;
  }
  
  .overview-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-text p {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .admin-db-view-banner,
  .admin-user-main {
    align-items: stretch;
  }

  .admin-db-view-banner,
  .admin-user-actions {
    flex-direction: column;
  }

  .admin-user-main {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-areas:
      "toggle identity"
      "meta meta"
      "access access"
      "stats stats"
      "activity activity"
      "actions actions";
  }

  .admin-user-access {
    justify-self: start;
  }

  .admin-user-stats,
  .admin-db-modal-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .dashboard-body {
    margin-left: 0;
    width: 100%;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .live-monitors-grid {
    grid-template-columns: 1fr;
  }
  
  .hub-links-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-topbar {
    padding: 0 20px;
  }
  
  .dashboard-content {
    padding: 20px;
  }
}

/* ==========================================================================
   ITERATION 4: THEME SWITCHER, UNIFIED STATS, AND ASYMMETRIC GRID LAYOUT
   ========================================================================== */

/* Accent Presets */
html[data-accent="emerald"] {
  --accent-cyan: #10b981;
  --accent-cyan-glow: rgba(16, 185, 129, 0.35);
  --accent-cyan-dim: rgba(16, 185, 129, 0.12);
  --border-glass-focus: rgba(16, 185, 129, 0.25);
  --shadow-glow: 0 0 24px var(--accent-cyan-glow);
}
html[data-accent="cobalt"] {
  --accent-cyan: #0ea5e9;
  --accent-cyan-glow: rgba(14, 165, 233, 0.35);
  --accent-cyan-dim: rgba(14, 165, 233, 0.12);
  --border-glass-focus: rgba(14, 165, 233, 0.25);
  --shadow-glow: 0 0 24px var(--accent-cyan-glow);
}
html[data-accent="ruby"] {
  --accent-cyan: #f43f5e;
  --accent-cyan-glow: rgba(244, 63, 94, 0.35);
  --accent-cyan-dim: rgba(244, 63, 94, 0.12);
  --border-glass-focus: rgba(244, 63, 94, 0.25);
  --shadow-glow: 0 0 24px var(--accent-cyan-glow);
}
html[data-accent="amethyst"] {
  --accent-cyan: #8b5cf6;
  --accent-cyan-glow: rgba(139, 92, 246, 0.35);
  --accent-cyan-dim: rgba(139, 92, 246, 0.12);
  --border-glass-focus: rgba(139, 92, 246, 0.25);
  --shadow-glow: 0 0 24px var(--accent-cyan-glow);
}
html[data-accent="amber"] {
  --accent-cyan: #f59e0b;
  --accent-cyan-glow: rgba(245, 158, 11, 0.35);
  --accent-cyan-dim: rgba(245, 158, 11, 0.12);
  --border-glass-focus: rgba(245, 158, 11, 0.25);
  --shadow-glow: 0 0 24px var(--accent-cyan-glow);
}

/* Light Theme overrides */
html[data-theme="light"] {
  --bg-main: #f6f7fb;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-input: rgba(248, 250, 252, 0.96);
  
  --ink-primary: #121826;
  --ink-secondary: #4b5565;
  --ink-muted: #7d8597;
  
  --border-glass: rgba(15, 23, 42, 0.1);
  --border-glass-focus: var(--accent-cyan-glow);
  
  --shadow-premium: 0 16px 36px -24px rgba(15, 23, 42, 0.38), 0 0 0 1px var(--border-glass);
  --scrollbar-track: rgba(15, 23, 42, 0.035);
  --scrollbar-thumb: rgba(15, 23, 42, 0.22);
  --scrollbar-thumb-hover: rgba(15, 23, 42, 0.36);
  --scrollbar-thumb-active: var(--accent-cyan-glow);
}

html[data-theme="light"] body {
  background: 
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 247, 251, 0.92)),
    radial-gradient(circle at 50% -20%, var(--accent-cyan-dim), transparent 46rem),
    radial-gradient(circle at 4% 18%, rgba(14, 165, 233, 0.055), transparent 35rem),
    radial-gradient(circle at 88% 84%, rgba(16, 185, 129, 0.055), transparent 38rem),
    var(--bg-main);
}

html[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 12px 0 38px rgba(15, 23, 42, 0.045);
}

html[data-theme="light"] .dashboard-topbar {
  background: rgba(255, 255, 255, 0.78);
  border-bottom-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.035);
}

html[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    0 18px 42px rgba(15, 23, 42, 0.07);
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] .active-tab-title,
html[data-theme="light"] .brand-logo,
html[data-theme="light"] .acc-info .name,
html[data-theme="light"] .stat-data-v2 strong {
  color: var(--ink-primary);
}

html[data-theme="light"] .nav-btn:hover,
html[data-theme="light"] .footer-link:hover {
  background: rgba(15, 23, 42, 0.045);
  color: var(--ink-primary);
}

html[data-theme="light"] .nav-btn.active {
  color: var(--ink-primary);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(255, 255, 255, 0.72));
  border-color: rgba(16, 185, 129, 0.26);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 10px 24px rgba(16, 185, 129, 0.08);
}

html[data-theme="light"] .account-badge,
html[data-theme="light"] .footer-link,
html[data-theme="light"] .topbar-icon-btn,
html[data-theme="light"] .customizer-trigger-btn,
html[data-theme="light"] .theme-toggle-select-btn,
html[data-theme="light"] .toolbar-dashboard,
html[data-theme="light"] .table-container-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .panel.glass,
html[data-theme="light"] .chart-card-v2.glass,
html[data-theme="light"] .monitor-card.glass,
html[data-theme="light"] .unified-stats-card.glass {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .stat-item {
  background: rgba(15, 23, 42, 0.025);
}

html[data-theme="light"] .terminal-body {
  background: #10131a;
  color: rgba(255, 255, 255, 0.86);
}

html[data-theme="light"] .monitor-header {
  background: rgba(15, 23, 42, 0.04);
  border-bottom: 1px solid var(--border-glass);
}

html[data-theme="light"] .custom-input,
html[data-theme="light"] .custom-select,
html[data-theme="light"] .custom-textarea,
html[data-theme="light"] .modal label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="light"] .modal label select,
html[data-theme="light"] .modal label textarea,
html[data-theme="light"] .login-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="light"] .shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.search-input):not(.custom-input),
html[data-theme="light"] .shell select:not(.custom-select),
html[data-theme="light"] .shell textarea:not(.custom-textarea),
html[data-theme="light"] .date-picker-shell {
  color-scheme: light;
  color: var(--ink-primary);
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .custom-input::placeholder,
html[data-theme="light"] .custom-textarea::placeholder,
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(75, 85, 101, 0.48);
}

html[data-theme="light"] .shell button:not(.nav-btn):not(.color-dot):not(.modal-close):not(.topbar-icon-btn):not(.customizer-trigger-btn):not(.theme-toggle-select-btn):not(.icon-only-link):not(.campaign-shell-header):not(.campaign-head-main),
html[data-theme="light"] .modal button:not(.modal-close),
html[data-theme="light"] .login-card button {
  color: var(--ink-primary);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 249, 0.82));
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .shell button:not(.nav-btn):not(.color-dot):not(.modal-close):not(.topbar-icon-btn):not(.customizer-trigger-btn):not(.theme-toggle-select-btn):not(.icon-only-link):not(.campaign-shell-header):not(.campaign-head-main):hover,
html[data-theme="light"] .modal button:not(.modal-close):hover,
html[data-theme="light"] .login-card button:hover {
  background: linear-gradient(135deg, #fff, rgba(248, 250, 252, 0.92));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09), 0 0 0 3px var(--accent-cyan-dim);
}

html[data-theme="light"] .modal-card,
html[data-theme="light"] .news-popup,
html[data-theme="light"] .error-popup,
html[data-theme="light"] .customizer-popup,
html[data-theme="light"] .date-picker-popover,
html[data-theme="light"] .faq-panel {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .faq-panel-overlay {
  background: rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .faq-item {
  background: rgba(15, 23, 42, 0.045);
}

html[data-theme="light"] .faq-style-panel {
  background: rgba(15, 23, 42, 0.045);
}

html[data-theme="light"] .faq-ratio {
  background: rgba(16, 185, 129, 0.09);
}

html[data-theme="light"] .faq-ratio i {
  background: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .mini-list-panel,
html[data-theme="light"] .access-row,
html[data-theme="light"] .resource-subgroup-title b,
html[data-theme="light"] .delete-access,
html[data-theme="light"] .resource-open-btn {
  background: rgba(15, 23, 42, 0.035) !important;
}

html[data-theme="light"] .date-picker-day {
  background: rgba(15, 23, 42, 0.035) !important;
  color: var(--ink-secondary) !important;
}

html[data-theme="light"] .date-picker-day:hover {
  background: var(--accent-cyan-dim) !important;
  color: var(--ink-primary) !important;
}

/* Topbar Right alignment */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.topbar-icon-btn:hover,
.news-dropdown-wrapper.open .topbar-icon-btn,
.error-dropdown-wrapper.open .topbar-icon-btn,
body.faq-panel-open .faq-trigger-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan-glow);
  color: var(--accent-cyan);
}

.topbar-icon-btn:active {
  transform: translateY(1px);
}

.error-dropdown-wrapper {
  position: relative;
}

.error-center-trigger {
  color: #fca5a5;
}

.error-dropdown-wrapper.open .error-center-trigger,
.error-center-trigger:hover {
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.1);
}

.error-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fb7185;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.46);
}

.error-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 96px));
  padding: 14px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  background: rgba(14, 14, 18, 0.97);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.error-dropdown-wrapper.open .error-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.error-popup-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.error-popup-head span {
  display: block;
  color: var(--ink-primary);
  font-size: 15px;
  font-weight: 850;
}

.error-popup-head small {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.error-clear-all {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ink-muted) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.error-clear-all:hover {
  color: #fecaca !important;
  transform: none !important;
}

.error-clear-all:disabled {
  opacity: 0.35;
  cursor: default;
}

.error-list {
  display: grid;
  gap: 9px;
  max-height: 430px;
  overflow-y: auto;
  padding-top: 10px;
  padding-right: 2px;
}

.error-item {
  display: grid;
  gap: 7px;
  padding: 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.error-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.error-item time {
  color: #fb7185;
  font-size: 11px;
  font-weight: 850;
}

.error-item-head button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.error-item-head button:hover {
  color: #fff;
  background: rgba(248, 113, 113, 0.18);
}

.error-item strong {
  color: var(--ink-primary);
  font-size: 13px;
  line-height: 1.32;
}

.error-item p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 12.5px;
  line-height: 1.42;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.error-empty {
  padding: 18px 10px 8px;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

.faq-trigger-wrap {
  position: relative;
}

.faq-text-trigger {
  width: auto;
  min-width: 118px;
  padding: 0 13px;
  gap: 8px;
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.faq-text-trigger span {
  display: inline-block;
}

.faq-onboarding-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(286px, calc(100vw - 32px));
  z-index: 1085;
  padding: 12px;
  border-radius: 14px;
  background: rgba(18, 18, 23, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.faq-onboarding-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 28px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: inherit;
  border-left: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass);
}

.faq-onboarding-popover.hidden {
  display: none;
}

.faq-onboarding-popover p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 12.5px;
  line-height: 1.42;
}

.faq-onboarding-popover button {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 650;
  padding: 0;
  cursor: pointer;
  opacity: 0.78;
}

.faq-onboarding-popover button:hover {
  color: var(--ink-secondary);
  opacity: 1;
}

.news-dropdown-wrapper {
  position: relative;
}

.news-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-cyan);
  color: #04100d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.news-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(330px, calc(100vw - 32px));
  padding: 14px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  background: rgba(14, 14, 18, 0.96);
  border: 1px solid var(--border-glass-focus);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(18px);
}

.news-dropdown-wrapper.open .news-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.news-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-glass);
}

.news-popup-head span {
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 700;
}

.news-popup-head small {
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 2px;
}

.news-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.news-item.is-new {
  border-color: var(--accent-cyan-glow);
  background: linear-gradient(135deg, var(--accent-cyan-dim), rgba(255, 255, 255, 0.02));
}

.news-item time {
  grid-row: 1 / span 2;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding-top: 2px;
}

.news-item strong {
  color: var(--ink-primary);
  font-size: 12.5px;
  line-height: 1.2;
}

.news-item p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.news-empty {
  padding: 14px 10px 4px;
  color: var(--ink-secondary);
  font-size: 12px;
}

.admin-news-editor {
  display: grid;
  gap: 10px;
}

.admin-news-editor textarea {
  min-height: 104px;
  resize: vertical;
}

.admin-news-editor small {
  color: var(--ink-secondary);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.faq-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(2px);
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.faq-panel {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1100;
  width: min(430px, calc(100vw - 28px));
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(18, 18, 23, 0.96);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  visibility: hidden;
  transition: transform 0.28s ease, opacity 0.22s ease, visibility 0.22s ease;
  overflow: hidden;
}

body.faq-panel-open .faq-panel-overlay,
body.faq-panel-open .faq-panel {
  opacity: 1;
  visibility: visible;
}

body.faq-panel-open .faq-panel {
  display: flex;
  transform: translateX(0);
}

.faq-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.faq-panel-head span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faq-panel-head h3 {
  margin: 0;
  color: var(--ink-primary);
  font-size: 22px;
  line-height: 1.05;
}

.faq-close-btn {
  flex: 0 0 auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  scroll-padding: 12px;
}

.faq-item {
  overflow: visible;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.faq-question {
  width: 100%;
  min-height: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink-primary) !important;
  box-shadow: none !important;
  text-align: left;
  transform: none !important;
}

.faq-question span {
  min-width: 0;
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.faq-question svg {
  flex: 0 0 auto;
  color: var(--ink-muted);
  transition: transform 0.18s ease, color 0.18s ease;
}

.faq-item.open .faq-question svg {
  color: var(--accent-cyan);
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  overflow: visible;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-answer-body {
  min-height: 0;
  overflow: visible;
  padding: 0 16px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.faq-answer-body p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.faq-ratio {
  margin: 12px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--ink-primary);
}

.faq-ratio span {
  grid-column: 1;
  justify-self: center;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
}

.faq-ratio i {
  grid-column: 1;
  height: 1px;
  width: 100%;
  background: rgba(255, 255, 255, 0.16);
}

.faq-ratio b {
  grid-column: 2;
  grid-row: 1 / span 3;
  color: var(--accent-cyan);
  font-size: 13px;
  white-space: nowrap;
}

.faq-answer-body p + p,
.faq-answer-body ul + p,
.faq-answer-body p + ul {
  margin-top: 10px;
}

.faq-answer-body ul {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.faq-answer-body li {
  position: relative;
  padding-left: 16px;
  color: var(--ink-secondary);
  font-size: 12.8px;
  line-height: 1.45;
}

.faq-answer-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.faq-soft-note {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(245, 158, 11, 0.075);
  color: var(--ink-primary) !important;
}

.faq-inline-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  background: rgba(34, 211, 238, 0.07);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
}

.faq-inline-link.is-muted {
  color: var(--ink-muted);
  border-color: var(--border-glass);
  background: rgba(255, 255, 255, 0.035);
}

.faq-item.open .faq-answer-body {
  padding-bottom: 16px;
}

.faq-style-panel {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.faq-style-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.faq-style-head span {
  color: var(--accent-cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faq-style-head strong {
  color: var(--ink-primary);
  font-size: 13px;
}

.faq-style-controls {
  display: grid;
  gap: 10px;
}

.faq-style-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-style-row > span {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 700;
}

.faq-style-panel .theme-toggle-select-btn {
  width: 100%;
  justify-content: center;
}

/* Customizer Topbar styles (Hover-dropdown) */
.customizer-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.customizer-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.customizer-trigger-btn svg {
  color: var(--accent-cyan);
  transition: transform 0.3s;
}

.customizer-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan-glow);
  color: var(--ink-primary);
}

.customizer-trigger-btn:hover svg {
  transform: rotate(30deg);
}

.customizer-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 200px;
  padding: 16px;
  background: rgba(14, 14, 18, 0.95);
  border: 1px solid var(--border-glass-focus);
  border-radius: var(--radius-md);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.customizer-dropdown-wrapper:hover .customizer-popup,
.customizer-dropdown-wrapper.open .customizer-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.popup-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popup-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  font-weight: 600;
}

.popup-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 12px 0;
}

.theme-toggle-select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.theme-toggle-select-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan-glow);
}

html[data-theme="light"] .customizer-popup {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .customizer-trigger-btn {
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .theme-toggle-select-btn {
  background: rgba(0, 0, 0, 0.01);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

html[data-theme="light"] .color-dot {
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.color-dot:hover {
  transform: scale(1.25);
}

.color-dot.active {
  transform: scale(1.15);
  border-color: #ffffff;
  box-shadow: 0 0 8px currentColor;
}

html[data-theme="light"] .color-dot.active {
  border-color: #111827;
}

/* Specific button colors for dots */
.color-dot.emerald { background: #10b981; color: rgba(16, 185, 129, 0.7); }
.color-dot.cobalt { background: #0ea5e9; color: rgba(14, 165, 233, 0.7); }
.color-dot.ruby { background: #f43f5e; color: rgba(244, 63, 94, 0.7); }
.color-dot.amethyst { background: #8b5cf6; color: rgba(139, 92, 246, 0.7); }
.color-dot.amber { background: #f59e0b; color: rgba(245, 158, 11, 0.7); }

/* Liquid Glass Buttons */
.action-trigger-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-md) !important;
  color: #fff !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    0 4px 15px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer;
}

.action-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    0 0 12px var(--accent-cyan-glow),
    0 8px 24px rgba(0, 0, 0, 0.45) !important;
  transform: translateY(-1.5px) scale(1.02);
}

.action-trigger-btn:active {
  transform: translateY(0.5px) scale(0.98);
}

.action-trigger-btn.stop {
  border-color: #ef4444 !important;
}

.action-trigger-btn.stop:hover {
  border-color: #f43f5e !important;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    0 0 12px rgba(244, 63, 94, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* Brand stats items with vibrant gradient overlays */
.stat-item.yt-accent {
  background: radial-gradient(circle at 10% 20%, rgba(239, 68, 68, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(239, 68, 68, 0.15);
}
.stat-item.yt-accent:hover {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

.stat-item.tg-accent {
  background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(14, 165, 233, 0.15);
}
.stat-item.tg-accent:hover {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.25);
}

.stat-item.email-accent {
  background: radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(245, 158, 11, 0.15);
}
.stat-item.email-accent:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.stat-item.purple-accent {
  background: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(139, 92, 246, 0.15);
}
.stat-item.purple-accent:hover {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

/* Integrations items colorful gradients */
.stat-item.yt-key-metric {
  background: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(244, 63, 94, 0.15);
}
.stat-item.yt-key-metric:hover {
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.25);
}

.stat-item.google-sheet-metric {
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(16, 185, 129, 0.15);
}
.stat-item.google-sheet-metric:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.stat-item.tg-account-metric {
  background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.01));
  border-color: rgba(59, 130, 246, 0.15);
}
.stat-item.tg-account-metric:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

/* Custom glow overlay for activity card */
#activityChartCard {
  background: radial-gradient(circle at 50% 0%, var(--accent-cyan-dim), rgba(18, 18, 24, 0.65));
}

.dashboard-grid-layout-v3 {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 1024px) {
  .dashboard-grid-layout-v3 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: start;
  }
}

.dashboard-left-flow {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.dashboard-right-flow {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.live-monitors-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Unified Stats Card */
.unified-stats-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.panel-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-muted);
  font-weight: 600;
}

.panel-section-title svg {
  color: var(--accent-cyan);
}

.unified-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.stats-group.operational {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .stats-group.operational {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-group.operational {
    grid-template-columns: 1fr;
  }
}

.unified-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 2px 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .stat-item:hover {
  background: rgba(0, 0, 0, 0.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-item .stat-icon-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-secondary);
  flex-shrink: 0;
}

.stat-item.yt-accent .stat-icon-brand {
  color: #ef4444; /* YouTube Red */
  background: rgba(239, 68, 68, 0.1);
}
.stat-item.tg-accent .stat-icon-brand {
  color: #0ea5e9; /* Telegram Blue */
  background: rgba(14, 165, 233, 0.1);
}
.stat-item.email-accent .stat-icon-brand {
  color: #f59e0b; /* Gmail Amber */
  background: rgba(245, 158, 11, 0.1);
}
.stat-item.purple-accent .stat-icon-brand {
  color: #8b5cf6; /* TG Post purple */
  background: rgba(139, 92, 246, 0.1);
}

/* Integrations item brand colors */
.stat-item.yt-key-metric .stat-icon-brand {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
}
.stat-item.google-sheet-metric .stat-icon-brand {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}
.stat-item.tg-account-metric .stat-icon-brand {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-content .label {
  font-size: 10px;
  color: var(--ink-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-content .value {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--ink-primary);
}

.stat-content .value-sub {
  font-size: 12px;
  color: var(--ink-primary);
  font-weight: 600;
}

.status-badge-inline {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
  width: fit-content;
}

.status-badge-inline.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-badge-inline.inactive {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
}


/* ==========================================================================
   ETHEREAL PREMIUM LAYOUT SYSTEM OVERRIDES
   ========================================================================== */



/* Ethereal Overview Layout Grid */
.ethereal-overview-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .ethereal-overview-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
  }
}

/* Lime-green glass card */
.ethereal-balance-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.02) 100%);
  padding: 30px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}

.ethereal-balance-card::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.35) 0%, rgba(16, 185, 129, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.ethereal-balance-card .card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 12px;
}

.ethereal-balance-card .card-label {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ethereal-balance-card .card-value {
  font-size: 42px;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
  line-height: 1;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
  margin-top: 4px;
}

.ethereal-balance-card .card-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.ethereal-balance-card .card-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.ethereal-btn {
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
}

.ethereal-btn.dark-pill {
  background: #08080a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ethereal-btn.dark-pill:hover {
  background: #111115;
  transform: translateY(-2px);
}

.ethereal-btn.light-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.ethereal-btn.light-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* Mini Stats Stack details */
.ethereal-stats-mini-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ethereal-stats-card {
  padding: 20px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  background: rgba(20, 20, 25, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-card-header .icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-card-header .icon-circle.tg-style {
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

.stats-card-header .icon-circle.email-style {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.stats-card-header .growth-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.stats-card-header .growth-badge.green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.stats-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stats-card-body .label {
  font-size: 11px;
  color: var(--ink-secondary);
  font-weight: 500;
}

.stats-card-body .value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--ink-primary);
}

.stats-card-body .sub-label {
  font-size: 11px;
  color: var(--ink-muted);
}

/* Ethereal Charts Row styling */
.ethereal-charts-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .ethereal-charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.chart-legend-simple {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-secondary);
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-color-dot.harvesting {
  background: var(--accent-cyan);
}

.legend-color-dot.delivery {
  background: var(--accent-blue);
}

.chart-bar-rect {
  rx: 3px;
  ry: 3px;
  cursor: pointer;
  transition: opacity 0.2s, fill 0.2s;
}

.chart-bar-rect.harvesting {
  fill: var(--accent-cyan);
  opacity: 0.7;
}

.chart-bar-rect.delivery {
  fill: var(--accent-blue);
  opacity: 0.7;
}

.chart-bar-rect:hover {
  opacity: 1;
  filter: brightness(1.2) drop-shadow(0 0 4px currentColor);
}

.chart-point {
  cursor: crosshair;
  transition: r 0.16s ease, filter 0.16s ease;
}

.chart-point.harvested {
  fill: var(--bg-main);
  stroke: var(--accent-cyan);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px var(--accent-cyan-glow));
}

.chart-point.sent {
  fill: var(--bg-main);
  stroke: var(--accent-blue);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px var(--accent-blue-glow));
}

.chart-point:hover {
  r: 6;
}

.chart-day-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  cursor: crosshair;
}

html[data-theme="light"] .chart-tooltip-floating,
html[data-theme="light"] .news-popup,
html[data-theme="light"] .error-popup {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .topbar-icon-btn {
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="light"] .news-item,
html[data-theme="light"] .error-item {
  background: rgba(0, 0, 0, 0.018);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .error-item-head button {
  background: rgba(15, 23, 42, 0.06);
}

/* Donut chart styles */
.donut-chart-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
}

.donut-chart-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

#donutSvg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-segment {
  transition: stroke-dasharray 0.3s, stroke-dashoffset 0.3s, stroke-width 0.2s;
  cursor: pointer;
}

.donut-segment:hover {
  stroke-width: 5.5;
  filter: brightness(1.15);
}

.donut-center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-label .label {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.donut-center-label .value {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-primary);
  font-family: var(--font-display);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-secondary);
}

.donut-legend-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.donut-legend-item strong {
  font-family: var(--font-display);
  color: var(--ink-primary);
  font-weight: 600;
}

/* Recent Activity logs styling */
.activity-card-v2 {
  padding: 24px;
  border-radius: 24px;
  background: rgba(20, 20, 25, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

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

.activity-header .eyebrow {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.activity-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-primary);
}

.live-indicator {
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-indicator .pulsing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
  animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.activity-table-wrapper {
  max-height: 240px;
  overflow-y: auto;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.activity-table th {
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--ink-primary);
}

.activity-table .time-col {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: 12px;
  width: 90px;
}

.activity-table .process-col {
  font-weight: 500;
  color: var(--ink-primary);
  width: 130px;
}

.activity-table .event-col {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-table .event-line {
  display: -webkit-box;
  max-height: 34px;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.activity-table .status-col {
  width: 54px;
  text-align: center;
}

.status-pill-log {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.status-pill-log .dot {
  display: none;
}

.status-pill-log.success {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
}

.status-pill-log.warning,
.status-pill-log.info {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
}

.status-pill-log.error {
  color: #fb7185;
  background: rgba(239, 68, 68, 0.14);
}

.activity-table .empty-row {
  text-align: center;
  padding: 30px;
  color: var(--ink-muted);
}

/* Integrations Card Overlapping Stack Deck styling */
.integrations-stack-card {
  padding: 24px;
  border-radius: 24px;
  background: rgba(20, 20, 25, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stack-header {
  margin-bottom: 20px;
}

.stacked-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.stacked-card {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s, border-color 0.3s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  cursor: pointer;
  box-sizing: border-box;
}

.stacked-card.google-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.03) 100%);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.stacked-card.youtube-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(239, 68, 68, 0.03) 100%);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.stacked-card.telegram-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(14, 165, 233, 0.03) 100%);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.stacked-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.1);
}

.stacked-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stacked-card .brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
  text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.stacked-card .chip-foil {
  width: 20px;
  height: 14px;
  background: linear-gradient(135deg, #ffd700, #b8860b);
  border-radius: 3px;
  opacity: 0.8;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.4);
}

.stacked-card .card-mid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stacked-card .sheet-status-text,
.stacked-card .keys-count-label,
.stacked-card .sessions-count-label {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-sans);
}

.stacked-card .acc-email,
.stacked-card .quota-desc,
.stacked-card .session-desc {
  font-size: 11px;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stacked-card .card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.stacked-card .card-system-type {
  font-family: var(--font-display);
  font-weight: 600;
  color: rgba(255,255,255,0.35);
}

/* Background processes tracker panel */
.processes-tracker-card {
  padding: 24px;
  border-radius: 24px;
  background: rgba(20, 20, 25, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.process-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.process-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.process-item-row:first-child {
  padding-top: 0;
}

.process-item-row .proc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.process-item-row .proc-icon.youtube {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.process-item-row .proc-icon.telegram {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.process-item-row .proc-icon.telegram-sender {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.process-item-row .proc-icon.email {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.process-item-row .proc-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-left: 14px;
  min-width: 0;
}

.process-item-row .proc-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.process-item-row .proc-meta span {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proc-status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 0.3s, box-shadow 0.3s;
}

.pulse-indicator-dot.active {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
  animation: dot-active-pulse 1.6s infinite;
}

@keyframes dot-active-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.dashboard-control-room {
  --dash-gap: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--dash-gap);
}

.ops-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  grid-template-rows: auto auto;
  gap: var(--dash-gap);
  align-items: stretch;
}

.home-command-card {
  grid-column: 1;
  grid-row: 1;
}

.dashboard-logs-compact {
  grid-column: 1;
  grid-row: 2;
}

.ops-process-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ops-log-card,
.ops-process-card,
.dashboard-info-panel,
.home-kpi-card,
.dashboard-chart-panel {
  border-radius: 20px;
  background: rgba(20, 20, 25, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.ops-log-card {
  min-height: 0;
}

.ops-log-card .activity-table-wrapper {
  max-height: 236px;
}

.dashboard-logs-compact {
  padding: 18px;
  min-height: 306px;
  max-height: 340px;
  overflow: hidden;
}

.dashboard-logs-compact .activity-header {
  margin-bottom: 12px;
}

.dashboard-logs-compact .activity-table-wrapper {
  max-height: 254px;
}

.dashboard-logs-compact .activity-table th,
.dashboard-logs-compact .activity-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.ops-process-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 18px;
}

.ops-process-card .processes-list-wrapper {
  display: grid;
  gap: 12px;
  flex: 1;
}

.process-board {
  min-height: 0;
}

.process-group-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.process-group-card.is-running {
  border-color: rgba(16, 185, 129, 0.22);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.075), rgba(255, 255, 255, 0.035));
}

.process-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.process-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.process-group-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-primary);
}

.process-group-icon.youtube { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.process-group-icon.telegram { color: #0ea5e9; background: rgba(14, 165, 233, 0.1); }
.process-group-icon.telegram-sender { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.process-group-icon.email { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }

.process-group-title strong {
  display: block;
  color: var(--ink-primary);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
}

.process-group-title > div > span {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.process-group-icon svg {
  display: block;
}

.process-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.process-state-pill.is-running {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.process-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.process-state-pill.is-running .process-state-dot {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1);
}

.process-mini-grid {
  display: grid;
  gap: 8px;
}

.process-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.process-mini-row strong {
  display: block;
  color: var(--ink-primary);
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-mini-row span {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.25;
}

.process-mini-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.tracker-header,
.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.ops-process-card .tracker-header {
  position: static;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  margin: 0 0 14px;
}

.tracker-header .eyebrow,
.panel-title-row .eyebrow {
  display: block;
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tracker-header h3,
.panel-title-row h3 {
  font-size: 17px;
  font-weight: 650;
  color: var(--ink-primary);
}

.ops-process-card .tracker-header h3 {
  color: var(--ink-primary);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--dash-gap);
}

.home-kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(86px, auto);
  gap: 16px;
  align-items: center;
}

.home-kpi-card::before {
  content: "";
  position: absolute;
  inset: auto 8px 8px auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(28px);
  pointer-events: none;
}

.home-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
  opacity: 0.55;
  pointer-events: none;
}

.home-kpi-card.tg::before { background: #0ea5e9; }
.home-kpi-card.email::before { background: #f59e0b; }
.home-kpi-card.total::before { background: #10b981; }
.home-kpi-card.conversion::before { background: #f43f5e; }

.home-kpi-card .kpi-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-primary);
  position: relative;
  z-index: 1;
  overflow: hidden;
  grid-column: 1;
  align-self: center;
}

.home-kpi-card.tg .kpi-icon { color: #0ea5e9; background: rgba(14, 165, 233, 0.12); }
.home-kpi-card.email .kpi-icon { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.home-kpi-card.total .kpi-icon { color: #10b981; background: rgba(16, 185, 129, 0.12); }
.home-kpi-card.conversion .kpi-icon { color: #f43f5e; background: rgba(244, 63, 94, 0.12); }

.home-kpi-card .kpi-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.home-kpi-card .kpi-copy span {
  font-size: 15px;
  color: var(--ink-primary);
  font-weight: 750;
  grid-column: 2;
  min-width: 0;
  line-height: 1.12;
  max-width: 14ch;
}

.home-kpi-card strong {
  font-family: var(--font-display);
  font-size: clamp(42px, 3.7vw, 58px);
  line-height: 0.95;
  color: var(--ink-primary);
  grid-column: 3;
  justify-self: end;
  align-self: center;
  max-width: 100%;
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 14px 34px rgba(255, 255, 255, 0.08);
}

.home-kpi-card strong.digits-2 {
  font-size: clamp(38px, 3.25vw, 52px);
}

.home-kpi-card strong.digits-3 {
  font-size: clamp(34px, 2.85vw, 46px);
}

.home-kpi-card strong.digits-4 {
  font-size: clamp(29px, 2.45vw, 39px);
}

.home-kpi-card strong.digits-5 {
  font-size: clamp(24px, 2.05vw, 33px);
}

.home-kpi-card .kpi-copy small {
  margin-top: 0;
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

.home-kpi-card small b {
  color: var(--ink-secondary);
  font-weight: 700;
}

.home-kpi-card.conversion {
  grid-template-rows: none;
}

.dashboard-info-panel {
  padding: 20px;
}

.home-command-card {
  position: relative;
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.home-command-card .panel-title-row {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  margin: 0;
  min-height: 0;
}

.home-command-toolbar {
  justify-content: space-between;
  align-items: center;
}

.home-command-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.95fr) minmax(0, 1.05fr);
  gap: var(--dash-gap);
  flex: 1;
  min-height: 0;
}

.base-snapshot-panel,
.offer-snapshot-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compact-section-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
}

.compact-section-head span {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.compact-section-head strong {
  color: var(--ink-primary);
  font-size: 15px;
  font-weight: 750;
  text-align: left;
}

.home-command-card .compact-section-head {
  display: flex;
  min-height: 24px;
}

.base-summary-panel {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.base-summary-panel {
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  gap: 0;
  height: 224px;
  overflow: hidden;
}

.base-summary-main {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(80, 220, 255, 0.08), rgba(255, 255, 255, 0.02));
  border-right: 1px solid rgba(255, 255, 255, 0.055);
}

.base-summary-main span,
.base-summary-list span {
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.base-summary-main strong {
  font-family: var(--font-display);
  color: var(--ink-primary);
  font-size: 68px;
  line-height: 0.88;
  letter-spacing: 0;
  white-space: nowrap;
  max-width: 100%;
  text-shadow: 0 10px 28px rgba(80, 220, 255, 0.16);
}

.base-summary-list {
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.base-summary-list div {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.base-summary-list div + div {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.base-summary-list strong {
  font-family: var(--font-display);
  color: var(--ink-primary);
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  max-width: 48%;
  text-align: right;
  flex: 0 1 auto;
}

.base-summary-panel strong.digits-2 {
  font-size: 0.88em;
}

.base-summary-panel strong.digits-3 {
  font-size: 0.76em;
}

.base-summary-panel strong.digits-4 {
  font-size: 0.66em;
}

.base-summary-panel strong.digits-5 {
  font-size: 0.56em;
}

.base-summary-main strong.digits-2 {
  font-size: 56px;
}

.base-summary-main strong.digits-3 {
  font-size: 48px;
}

.base-summary-main strong.digits-4 {
  font-size: 40px;
}

.base-summary-main strong.digits-5 {
  font-size: 34px;
}

.base-summary-list strong.digits-2 {
  font-size: 42px;
}

.base-summary-list strong.digits-3 {
  font-size: 36px;
}

.base-summary-list strong.digits-4 {
  font-size: 30px;
}

.base-summary-list strong.digits-5 {
  font-size: 25px;
}

.dashboard-quota-bottom {
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--dash-gap);
  padding: 22px;
  overflow: hidden;
}

.quota-strip-title {
  display: block;
  min-width: 0;
}

.quota-strip-title .eyebrow {
  display: block;
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quota-strip-title h3 {
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.quota-status-chip {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.quota-status-chip.ready {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.quota-strip-meter {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.quota-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quota-meter-head span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quota-meter-head strong {
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-size: 18px;
}

.quota-strip-meter .quota-meter {
  margin: 0 0 10px;
}

.quota-strip-meter p {
  margin: 0;
  min-height: 18px;
  max-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dashboard-quota-bottom .quota-value {
  min-width: 72px;
  text-align: right;
  font-size: 34px;
  line-height: 1;
}

.icon-only-link {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-only-link:hover {
  transform: translateY(-1px);
  color: var(--accent-cyan);
  border-color: rgba(80, 220, 255, 0.28);
}

.discovery-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.discovery-stats div,
.contacts-total-line,
.offer-summary-line,
.offer-reply-row {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.discovery-stats div {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.discovery-stats span,
.contacts-total-line span,
.offer-summary-line span,
.offer-reply-row span,
.quota-panel p {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.35;
}

.discovery-stats strong,
.contacts-total-line strong,
.offer-summary-line strong {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-primary);
}

.contacts-total-line {
  margin-top: 10px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: end;
}

.contacts-total-line small {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--ink-muted);
}

.muted-chip {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.offer-summary-line {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  margin-bottom: 10px;
}

.offer-reply-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 330px;
  overflow: auto;
}

.offer-reply-list .empty-state-line {
  grid-column: 1 / -1;
}

.offer-reply-mosaic {
  --offer-cols: 2;
  --offer-rows: 1;
  height: 224px;
  max-height: none;
  overflow: hidden;
  grid-template-columns: repeat(var(--offer-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--offer-rows), minmax(0, 1fr));
  align-content: stretch;
}

.offer-reply-row {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(54px, auto);
  gap: clamp(8px, 1vw, 12px);
  align-items: center;
  min-height: 0;
  overflow: hidden;
}

.offer-reply-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.offer-reply-row > div:last-child {
  align-items: flex-end;
  text-align: right;
  min-width: 0;
}

.offer-reply-row strong {
  color: var(--ink-primary);
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-reply-row > div:last-child strong {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 0.95;
}

.offer-reply-row span {
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-reply-row > div:first-child span {
  display: block;
  color: var(--ink-muted);
}

.offer-reply-mosaic[data-density="regular"] .offer-reply-row > div:last-child span {
  font-size: 10.5px;
}

.offer-reply-mosaic[data-density="dense"] .offer-reply-row,
.offer-reply-mosaic[data-density="compact"] .offer-reply-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 10px;
  align-content: center;
}

.offer-reply-mosaic[data-density="dense"] .offer-reply-row > div:last-child,
.offer-reply-mosaic[data-density="compact"] .offer-reply-row > div:last-child {
  align-items: flex-end;
  text-align: right;
}

.offer-reply-mosaic[data-density="dense"] .offer-reply-row span,
.offer-reply-mosaic[data-density="compact"] .offer-reply-row span {
  display: none;
}

.offer-reply-mosaic[data-density="dense"] .offer-reply-row strong,
.offer-reply-mosaic[data-density="compact"] .offer-reply-row strong {
  font-size: 12px;
}

.offer-reply-mosaic[data-density="dense"] .offer-reply-row > div:last-child strong,
.offer-reply-mosaic[data-density="compact"] .offer-reply-row > div:last-child strong {
  font-size: 18px;
}

.offer-reply-row.muted {
  opacity: 0.76;
}

.empty-state-line {
  padding: 18px 14px;
  border-radius: 12px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.quota-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-primary);
}

.quota-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.055);
  margin: 12px 0;
}

.quota-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #0ea5e9);
  transition: width 0.3s ease;
}

.quota-meter.unavailable span {
  width: 100% !important;
  opacity: 0.18;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
}

.dashboard-chart-panel {
  padding: 20px;
}

.dashboard-chart-panel .chart-body-wrapper {
  min-height: 220px;
}

html[data-theme="light"] .ops-log-card,
html[data-theme="light"] .ops-process-card,
html[data-theme="light"] .dashboard-info-panel,
html[data-theme="light"] .home-kpi-card,
html[data-theme="light"] .dashboard-chart-panel {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .discovery-stats div,
html[data-theme="light"] .contacts-total-line,
html[data-theme="light"] .offer-summary-line,
html[data-theme="light"] .offer-reply-row,
html[data-theme="light"] .empty-state-line,
html[data-theme="light"] .process-group-card,
html[data-theme="light"] .process-mini-row,
html[data-theme="light"] .base-summary-panel {
  background: rgba(15, 23, 42, 0.025);
  border-color: rgba(15, 23, 42, 0.075);
}

html[data-theme="light"] .base-summary-main {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.66));
  border-color: rgba(15, 23, 42, 0.075);
}

html[data-theme="light"] .base-summary-list div + div {
  border-color: rgba(15, 23, 42, 0.075);
}

html[data-theme="light"] .process-group-card.is-running {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(255, 255, 255, 0.72));
  border-color: rgba(16, 185, 129, 0.22);
}

html[data-theme="light"] .process-state-pill,
html[data-theme="light"] .process-mini-badge,
html[data-theme="light"] .process-group-icon {
  background: rgba(15, 23, 42, 0.045);
}

html[data-theme="light"] .quota-meter,
html[data-theme="light"] .icon-only-link {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
}

@media (max-width: 1180px) {
  .ops-primary-grid,
  .dashboard-secondary-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .home-command-card,
  .dashboard-logs-compact,
  .ops-process-card {
    grid-column: auto;
    grid-row: auto;
  }

  .home-command-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .dashboard-quota-bottom {
    grid-template-columns: minmax(160px, 0.38fr) minmax(0, 1fr) auto;
  }

  .dashboard-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .dashboard-metric-grid,
  .discovery-stats,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .offer-reply-list {
    grid-template-columns: 1fr;
  }

  .offer-reply-mosaic {
    --offer-cols: 1 !important;
    height: 300px;
    overflow: auto;
  }

  .home-command-layout,
  .base-summary-panel {
    grid-template-columns: 1fr;
  }

  .base-summary-panel {
    min-height: 0;
  }

  .base-summary-main {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  }

  .dashboard-quota-bottom {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quota-strip-meter p {
    white-space: normal;
    max-height: 36px;
  }

  .filters-grid .contact-priority-filter {
    grid-column: auto;
  }

  .activity-header,
  .chart-header,
  .panel-title-row,
  .tracker-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-log-card,
  .ops-process-card,
  .dashboard-info-panel,
  .home-kpi-card,
  .dashboard-chart-panel {
    border-radius: 16px;
  }

  .activity-table .process-col,
  .activity-table .status-col {
    width: auto;
  }
}

/* Final light-theme polish: keep late component rules from turning controls into white-on-white blocks. */
html[data-theme="light"] .action-trigger-btn {
  color: var(--ink-primary) !important;
  text-shadow: none !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.9)) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 14px 28px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .action-trigger-btn:hover {
  color: var(--ink-primary) !important;
  background: linear-gradient(135deg, #fff, rgba(236, 253, 245, 0.92)) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 0 0 3px var(--accent-cyan-dim), 0 16px 32px rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .action-trigger-btn:disabled,
html[data-theme="light"] .action-trigger-btn[disabled] {
  color: rgba(75, 85, 101, 0.58) !important;
  background: rgba(241, 245, 249, 0.78) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  text-shadow: none !important;
}

html[data-theme="light"] .logout-btn {
  color: #dc2626 !important;
  background: rgba(254, 242, 242, 0.88) !important;
  border-color: rgba(220, 38, 38, 0.18) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 10px 24px rgba(220, 38, 38, 0.06) !important;
}

html[data-theme="light"] .logout-btn:hover {
  color: #b91c1c !important;
  background: rgba(254, 226, 226, 0.92) !important;
  border-color: rgba(220, 38, 38, 0.28) !important;
}

html[data-theme="light"] .modal-close {
  color: var(--ink-secondary);
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .status-badge,
html[data-theme="light"] .status-badge-inline,
html[data-theme="light"] .process-state-pill,
html[data-theme="light"] .process-mini-badge,
html[data-theme="light"] .muted-chip {
  background: rgba(15, 23, 42, 0.055);
  color: var(--ink-secondary);
}

html[data-theme="light"] .settings-add-card {
  background: rgba(248, 250, 252, 0.86);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .settings-add-card:hover {
  background: #fff;
  border-color: rgba(16, 185, 129, 0.24);
}

html[data-theme="light"] .settings-add-card strong {
  color: var(--ink-primary);
}

html[data-theme="light"] .settings-add-card small {
  color: var(--ink-secondary);
}

html[data-theme="light"] .stacked-card {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .stacked-card .brand-name,
html[data-theme="light"] .stacked-card .sheet-status-text,
html[data-theme="light"] .stacked-card .keys-count-label,
html[data-theme="light"] .stacked-card .sessions-count-label {
  color: var(--ink-primary);
  text-shadow: none;
}

html[data-theme="light"] .stacked-card .acc-email,
html[data-theme="light"] .stacked-card .quota-desc,
html[data-theme="light"] .stacked-card .session-desc,
html[data-theme="light"] .stacked-card .card-system-type,
html[data-theme="light"] .stacked-card .card-bottom {
  color: var(--ink-secondary);
}

.home-command-card .home-command-toolbar h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-command-card .panel-title-row {
  min-height: 0;
  margin: 0;
}

.home-command-card .compact-section-head strong {
  font-size: 15px;
}

/* Borderless surface experiment: cards separate from the canvas by fill, not outlines. */
:where(
  .glass,
  .dashboard-info-panel,
  .home-kpi-card,
  .dashboard-chart-panel,
  .activity-card-v2,
  .ops-log-card,
  .ops-process-card,
  .process-group-card,
  .process-mini-row,
  .base-summary-panel,
  .offer-reply-row,
  .empty-state-line,
  .dashboard-quota-bottom,
  .quota-strip-meter,
  .admin-card,
  .settings-add-card,
  .stacked-card,
  .modal-content,
  .popup-menu,
  .dropdown-menu,
  .table-shell,
  .tab-card,
  .sender-instance,
  .sender-instance-card,
  .campaign-card,
  .filter-card,
  .integration-card,
  .offer-card,
  .database-card,
  .sheet-card,
  .account-card,
  .logs-card,
  .stat-card-v2,
  .faq-panel,
  .faq-item,
  .faq-style-panel
) {
  border-color: transparent !important;
}

/* Review hardening: keep dense operational data inside its own surfaces. */
.dashboard-content,
.page,
.toolbar-dashboard,
.table-meta-bar,
.table-container-card,
.admin-users-board,
.admin-users-compact,
.admin-user-card,
.dashboard-info-panel,
.dashboard-quota-bottom,
.activity-table-wrapper {
  min-width: 0;
  max-width: 100%;
}

.activity-table {
  table-layout: fixed;
}

.activity-table .event-col {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-logs-compact .activity-table-wrapper {
  overflow-x: hidden;
}

.base-summary-panel {
  height: auto;
  min-height: 224px;
}

.base-summary-main,
.base-summary-list div {
  min-width: 0;
}

.base-summary-main span,
.base-summary-list span,
.quota-strip-meter p,
.admin-user-identity strong,
.admin-user-identity small,
.admin-user-meta span,
.admin-user-activity b,
.admin-user-activity span,
.admin-detail-item,
.admin-error,
.admin-activity {
  overflow-wrap: anywhere;
}

.table-container-card {
  width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  contain: paint;
}

.custom-data-table {
  table-layout: fixed;
}

.custom-data-table th,
.custom-data-table td {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-data-table td:not(:first-child) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.table-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-user-main,
.admin-user-stats,
.admin-user-actions {
  min-width: 0;
}

.admin-user-actions button {
  min-width: 0;
  overflow-wrap: anywhere;
}

.confirm-modal-copy {
  display: grid;
  gap: 8px;
}

.confirm-modal-copy h2 {
  font-size: 20px;
  line-height: 1.2;
}

.confirm-modal-copy p {
  max-width: 560px;
  color: var(--ink-secondary);
  overflow-wrap: anywhere;
}

.confirm-modal-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.danger-action {
  border-color: rgba(244, 63, 94, 0.34) !important;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(244, 63, 94, 0.055)) !important;
  color: #fb7185 !important;
}

.scheduler-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.scheduler-create-card,
.scheduler-queue-card {
  min-width: 0;
}

.scheduler-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.schedule-time-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.schedule-time-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.schedule-time-head span,
.schedule-time-inputs span {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.schedule-time-head b {
  color: var(--ink-primary);
  font-size: 18px;
}

.schedule-quick-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.schedule-quick-row button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.schedule-quick-row button:hover {
  background: rgba(16, 185, 129, 0.18);
  transform: translateY(-1px);
}

.schedule-time-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-time-inputs label {
  display: grid;
  gap: 8px;
}

.schedule-time-inputs input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink-primary);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.schedule-limit-note {
  margin: 16px 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.schedule-preview-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.schedule-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.schedule-preview-head span {
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.schedule-preview-head b {
  color: var(--ink-primary);
  text-align: right;
}

.schedule-preview-list {
  display: grid;
  gap: 8px;
}

.schedule-preview-list div {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.schedule-preview-list span,
.scheduled-job-preview span {
  color: var(--ink-secondary);
  font-size: 12px;
}

.schedule-preview-list b,
.scheduled-job-preview b {
  color: var(--ink-primary);
  overflow-wrap: anywhere;
}

.scheduler-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.scheduler-actions span {
  color: var(--ink-secondary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.scheduled-jobs-list {
  display: grid;
  gap: 12px;
  max-height: min(640px, calc(100vh - 260px));
  overflow: auto;
  padding-right: 4px;
}

.scheduled-job-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.scheduled-job-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.scheduled-job-main span {
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scheduled-job-main h3 {
  margin: 4px 0;
  font-size: 18px;
  line-height: 1.15;
}

.scheduled-job-main small {
  color: var(--ink-secondary);
}

.scheduled-job-main > b {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
}

.scheduled-job-card.is-pending .scheduled-job-main > b {
  color: #fbbf24;
}

.scheduled-job-card.is-started .scheduled-job-main > b {
  color: #34d399;
}

.scheduled-job-card.is-error .scheduled-job-main > b {
  color: #fb7185;
}

.scheduled-job-card.is-cancelled {
  opacity: 0.68;
}

.scheduled-job-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scheduled-job-preview span {
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  overflow-wrap: anywhere;
}

.scheduled-job-error {
  margin: 0;
  color: #fb7185;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .dashboard-topbar {
    max-width: 100vw;
    overflow: visible;
  }

  .topbar-left {
    min-width: 0;
  }

  .topbar-right {
    min-width: 0;
    max-width: calc(100vw - 116px);
    gap: 8px;
    justify-content: flex-end;
  }

  .faq-trigger-wrap,
  .news-dropdown-wrapper,
  .error-dropdown-wrapper {
    min-width: 0;
  }

  .faq-text-trigger {
    min-width: 0;
    max-width: 88px;
    padding-inline: 8px;
  }

  .faq-text-trigger span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .faq-onboarding-popover {
    right: 0;
    max-width: min(286px, calc(100vw - 32px));
  }

  .error-popup {
    right: -88px;
    width: min(360px, calc(100vw - 24px));
  }

  #toast {
    right: 16px;
    left: auto;
    max-width: calc(100vw - 32px);
  }

  .sidebar {
    left: -280px;
    transform: none;
  }

  .sidebar.open {
    left: 0;
    transform: none;
  }

  .dashboard-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .base-summary-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .base-summary-main,
  .base-summary-list div {
    min-height: 104px;
    padding: 16px 22px;
  }

  .base-summary-main strong {
    font-size: clamp(34px, 16vw, 58px);
  }

  .base-summary-list strong {
    font-size: clamp(28px, 13vw, 44px);
  }

  .quota-strip-meter p {
    max-height: none;
  }

  .table-container-card {
    max-width: calc(100vw - 40px);
  }

  .custom-data-table {
    min-width: 100%;
    width: 100%;
    table-layout: fixed;
    font-size: 11.5px;
  }

  .custom-data-table th,
  .custom-data-table td {
    padding: 10px 8px;
  }

  .database-switcher-panel {
    align-items: stretch;
    gap: 14px;
  }

  .db-controls-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .db-controls-actions .custom-select,
  .db-controls-actions .custom-input {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .db-controls-actions .secondary-action-btn {
    width: 100%;
    min-width: 0;
  }

  .activity-table .time-col {
    width: 68px;
  }

  .activity-table .event-col {
    max-width: none;
  }

  .admin-users-board {
    overflow-x: hidden;
    padding: 10px;
  }

  .admin-user-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scheduler-layout-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .scheduler-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-quick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-preview-list div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .scheduler-actions,
  .scheduled-job-main {
    align-items: stretch;
    flex-direction: column;
  }

  .scheduled-jobs-list {
    max-height: none;
  }
}
