:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-card-hover: #243044;
  --surface: #ffffff;
  --surface-soft: #f4f6fa;
  --text: #1a1d26;
  --text-muted: #5c6370;
  --accent: #2aabee;
  --accent-dark: #229ed9;
  --success: #31b545;
  --warning: #e8a317;
  --danger: #e53935;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 20, 25, 0.08);
  --nav-h: 56px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.45;
}

body.splash-active {
  overflow: hidden;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.app-splash.splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(42, 171, 238, 0.22), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(29, 127, 196, 0.18), transparent 42%),
    linear-gradient(145deg, #0f1419 0%, #17212b 42%, #1e3a5f 100%);
}

.splash-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 28px;
  animation: splashIn 0.7s ease-out both;
}

.splash-logo-wrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
}

.splash-logo {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 28px rgba(42, 171, 238, 0.45));
}

.splash-title {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ffffff 0%, #b8ecff 45%, #5bc8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.splash-tagline {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  font-weight: 500;
}

.splash-loader {
  width: min(220px, 70vw);
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.splash-loader-bar {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2aabee, #7dd3fc, #2aabee);
  background-size: 200% 100%;
  animation: splashLoader 1.1s ease-in-out infinite;
}

.splash-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.splash-rights {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes splashLoader {
  0% {
    transform: translateX(-120%);
    background-position: 0% 50%;
  }
  100% {
    transform: translateX(320%);
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-inner {
    animation: none;
  }

  .splash-loader-bar {
    animation: none;
    width: 100%;
    transform: none;
  }
}

.app-header {
  background: linear-gradient(135deg, #17212b 0%, #1e3a5f 55%, #16324f 100%);
  color: #fff;
  padding: 18px 28px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 50%, rgba(42, 171, 238, 0.18), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(91, 200, 255, 0.12), transparent 38%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.brand-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.teleflow-logo {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(42, 171, 238, 0.35));
}

.tf-ring {
  transform-origin: 32px 32px;
}

.tf-ring-1 {
  animation: tfRingSpin 12s linear infinite;
}

.tf-ring-2 {
  animation: tfRingSpin 8s linear infinite reverse;
}

.tf-flow {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.tf-flow-1 {
  animation: tfFlowDraw 2.8s ease-in-out infinite;
}

.tf-flow-2 {
  animation: tfFlowDraw 2.8s ease-in-out 0.35s infinite;
}

.tf-flow-3 {
  animation: tfFlowDraw 2.8s ease-in-out 0.7s infinite;
}

.tf-plane {
  transform-origin: 32px 32px;
  animation: tfPlaneFloat 3.2s ease-in-out infinite;
}

.tf-shine {
  transform-origin: 32px 32px;
  animation: tfPlaneFloat 3.2s ease-in-out infinite;
}

.brand-text h1 {
  margin: 0 0 2px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name {
  background: linear-gradient(90deg, #ffffff 0%, #b8ecff 45%, #5bc8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text p {
  margin: 0;
  opacity: 0.88;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.brand-rights {
  margin-top: 6px !important;
  font-size: 0.72rem !important;
  opacity: 0.55 !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}

@keyframes tfRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes tfFlowDraw {
  0%, 100% {
    stroke-dashoffset: 48;
    opacity: 0.35;
  }
  45%, 55% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes tfPlaneFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1.5px) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .tf-ring-1,
  .tf-ring-2,
  .tf-flow-1,
  .tf-flow-2,
  .tf-flow-3,
  .tf-plane,
  .tf-shine {
    animation: none;
  }

  .tf-flow {
    stroke-dashoffset: 0;
    opacity: 0.85;
  }
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px 22px;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2aabee, #1d7fc4);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(42, 171, 238, 0.25);
}

.app-header h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 700;
}

.app-header p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.92rem;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid #e2e6ee;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.nav-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-btn:hover {
  background: #eef1f6;
  color: var(--text);
}

.nav-btn.active {
  background: #e3f2fd;
  color: var(--accent-dark);
}

main {
  padding: 24px 28px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-header .subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Dashboard home */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.dash-hero h2 {
  margin: 0 0 4px;
}

.dash-progress-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #2aabee 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(42, 171, 238, 0.25);
}

.dash-progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.dash-progress-head strong {
  font-size: 1.25rem;
}

.dash-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 99px;
  transition: width 0.5s ease;
}

.dash-alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}

.dash-alert-job {
  background: linear-gradient(90deg, #fff8e1, #fff3e0);
  border: 1px solid #ffcc80;
}

.dash-attention {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #b71c1c;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.dash-device-reminder {
  background: #fff8e1;
  border-color: #ffe082;
  color: #e65100;
}

.dead-otp-panel {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0 14px;
}

.dead-otp-panel h4 {
  margin: 0 0 6px;
  color: #b71c1c;
  font-size: 0.95rem;
}

.dead-otp-panel table {
  width: 100%;
  font-size: 12px;
}

.login-live-panel {
  border: 1px solid #90caf9;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: #0d47a1;
}

.login-live-panel.hidden {
  display: none;
}

.login-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.login-live-step {
  font-weight: 600;
}

.login-live-phones {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  margin: 4px 0;
}

.login-live-bar {
  height: 6px;
  background: rgba(13, 71, 161, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.login-live-bar-fill {
  height: 100%;
  background: #1976d2;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.login-live-counts {
  font-size: 0.85em;
  opacity: 0.9;
  margin-top: 6px;
}

.hint-inline {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.85em;
  opacity: 0.9;
}

#bulkMsgMessagePanel.hidden {
  display: none;
}

.dash-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.dash-pill {
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid #d0d8e4;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  margin: 0;
  transition: background 0.15s, border-color 0.15s;
}

.dash-pill:hover {
  background: #e3f2fd;
  border-color: #90caf9;
}

.dash-panel {
  background: var(--surface);
  border: 1px solid #e8ecf2;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.dash-panel h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.dash-chip {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f0f3f8;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-chip.ok {
  background: #e8f5e9;
  color: #2e7d32;
}

.dash-activity {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}

.dash-activity li {
  padding: 10px 0;
  border-bottom: 1px solid #eef0f4;
  font-size: 0.82rem;
  line-height: 1.35;
}

.dash-activity li:last-child {
  border-bottom: none;
}

.dash-activity .act-time {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.dash-activity .act-ok {
  color: var(--success);
}
.dash-activity .act-warn {
  color: var(--warning);
}
.dash-activity .act-bad {
  color: var(--danger);
}

.dash-link-btn {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.dash-safe-hint {
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
}

.stat-click {
  cursor: pointer;
  text-align: left;
  width: 100%;
  border: 1px solid #e8ecf2;
  font-family: inherit;
}

.stat-click:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid #e8ecf2;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card.accent .stat-value {
  color: var(--accent-dark);
}
.stat-card.ok .stat-value {
  color: var(--success);
}
.stat-card.warn .stat-value {
  color: var(--warning);
}
.stat-card.bad .stat-value {
  color: var(--danger);
}

.dash-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid #e8ecf2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  min-height: 130px;
}

.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(42, 171, 238, 0.15);
  border-color: #b8d9f0;
}

.home-card .card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  line-height: 1;
}

.home-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.home-card .card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.home-card-groups {
  position: relative;
  overflow: visible;
  padding: 0;
  cursor: default;
  min-height: 130px;
}

.home-card-groups:hover,
.home-card-groups.groups-slide-open {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(42, 171, 238, 0.15);
  border-color: #b8d9f0;
}

.groups-card-face {
  padding: 22px 20px;
  width: 100%;
  height: 100%;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
}

.groups-manage-link {
  margin-top: auto;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.groups-manage-link:hover {
  text-decoration: underline;
}

.groups-slide {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  width: 240px;
  max-height: min(360px, 70vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid #d0d8e4;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(15, 20, 25, 0.18);
  padding: 14px 12px;
  z-index: 50;
  transform: translateX(-16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s;
}

.home-card-groups:hover .groups-slide,
.home-card-groups.groups-slide-open .groups-slide {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.groups-slide-title {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.groups-slide-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-slide-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #e8ecf2;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  transition: background 0.12s, border-color 0.12s;
}

.group-slide-btn:hover {
  background: #e3f2fd;
  border-color: #90caf9;
  color: var(--accent-dark);
}

.group-slide-btn .count {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.accounts-filter-badge {
  margin-top: 8px;
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 8px;
  font-size: 0.9rem;
}

.accounts-filter-badge.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .groups-slide {
    left: 0;
    top: calc(100% + 8px);
    width: 100%;
    max-width: 280px;
    transform: translateY(-8px);
  }
  .home-card-groups:hover .groups-slide,
  .home-card-groups.groups-slide-open .groups-slide {
    transform: translateY(0);
  }
}

.dash-quick {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid #e8ecf2;
  box-shadow: var(--shadow);
}

.dash-quick h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

/* Forms & tables */
button,
.btn {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin: 4px 4px 4px 0;
  transition: background 0.15s;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #e8ecf2;
  color: var(--text);
}

button.secondary:hover {
  background: #d5dbe6;
}

textarea {
  width: 100%;
  min-height: 160px;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid #d0d5de;
  padding: 10px;
  font-family: inherit;
}

input,
select {
  padding: 8px 10px;
  margin: 4px 4px 4px 0;
  min-width: 120px;
  border-radius: 8px;
  border: 1px solid #d0d5de;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  margin-top: 12px;
  font-size: 13px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid #e8ecf2;
}

th,
td {
  border-bottom: 1px solid #eef0f4;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f3f8;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

tr:last-child td {
  border-bottom: none;
}

.filters,
.toolbar {
  background: var(--surface);
  padding: 14px 16px;
  margin-top: 12px;
  border: 1px solid #e8ecf2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.filters input[type='text'],
.filters input:not([type='checkbox']):not([type='file']) {
  min-width: 120px;
}

.filters #errorFilter {
  min-width: 200px;
  flex: 1 1 180px;
  max-width: 320px;
}

.filters #searchTwofa {
  min-width: 140px;
  flex: 1 1 120px;
  max-width: 200px;
}

.toolbar strong {
  margin-right: 8px;
}

.hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 6px;
}

.twofa-toolbar input[type='password'] {
  min-width: 140px;
}

.queue-panel,
.bulk-panel,
.manual-login-panel {
  background: var(--surface);
  border: 1px solid #e8ecf2;
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

.bulk-msg-limits-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.bulk-msg-limits-toolbar input[type='number'] {
  width: 120px;
  font-weight: 400;
}

.bulk-panel h3 {
  margin-top: 0;
}

.bulk-msg-results-panel {
  position: fixed;
  top: 72px;
  right: 16px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 88px);
  background: var(--surface);
  border: 1px solid #e8ecf2;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(15, 20, 25, 0.18);
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.bulk-msg-results-panel.hidden {
  display: none;
}
.bulk-msg-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid #e8ecf2;
}
.bulk-msg-results-head h3 {
  margin: 0;
  font-size: 15px;
}
.bulk-msg-results-close {
  min-width: 32px;
  padding: 4px 10px;
  font-size: 18px;
  line-height: 1;
}
.bulk-msg-results-summary {
  margin: 8px 14px 0;
  font-size: 12px;
}
.bulk-msg-results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid #e8ecf2;
}
.bulk-msg-tab {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #d8dee8;
  background: #f4f6fa;
  cursor: pointer;
}
.bulk-msg-tab.active {
  background: var(--accent, #2aabee);
  color: #fff;
  border-color: transparent;
}
.bulk-msg-results-body {
  overflow: auto;
  flex: 1;
  min-height: 120px;
  max-height: calc(100vh - 260px);
  padding: 8px 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}
.bulk-msg-result-row {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  border: 1px solid #eef1f6;
  background: #fafbfc;
}
.bulk-msg-result-row.ok {
  border-left: 3px solid #31b545;
}
.bulk-msg-result-row.fail {
  border-left: 3px solid #e53935;
}
.bulk-msg-result-row.blocked {
  border-left: 3px solid #e8a317;
}
.bulk-msg-result-row.skipped {
  border-left: 3px solid #9aa3b2;
}
.bulk-msg-result-row strong {
  font-weight: 600;
}

.proxy-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.proxy-add-row select,
.proxy-add-row input {
  min-width: 0;
}

.proxy-add-row select {
  min-width: 140px;
}

.proxy-add-row input[type='number'],
.proxy-add-row input#proxyPort {
  width: 90px;
}

.proxy-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.proxy-list li {
  padding: 8px 0;
  border-bottom: 1px solid #eef1f6;
  font-size: 0.9rem;
}

.proxy-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.proxy-list-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.share-url {
  font-size: 0.78rem;
  color: var(--accent-dark);
  word-break: break-all;
}

.col-url {
  max-width: 220px;
}

.ns-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.ns-crumb-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #1565c0);
  cursor: pointer;
  font-weight: 600;
}

.ns-crumb-link:hover {
  text-decoration: underline;
}

.ns-crumb-sep {
  color: var(--muted, #888);
}

.ns-crumb-current {
  color: var(--text, #333);
  font-weight: 600;
}

.ns-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.ns-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 12px;
  background: var(--surface, #fff);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 110px;
}

.ns-card:hover {
  border-color: var(--accent, #2aabee);
  box-shadow: 0 4px 14px rgba(42, 171, 238, 0.12);
}

button.ns-card {
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

button.ns-card:focus,
button.ns-card:active {
  background: var(--surface, #fff);
  color: inherit;
}

button.ns-card:focus-visible {
  outline: 2px solid var(--accent, #2aabee);
  outline-offset: 2px;
}

.country-flag-img {
  display: inline-block;
  vertical-align: middle;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.ns-country-card .ns-card-flag {
  display: block;
  line-height: 0;
}

.ns-crumb-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ns-card-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.ns-card-stat {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent, #1565c0);
}

.ns-master-card {
  border-left: 4px solid #1565c0;
}

.ns-level-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ns-level-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 1;
}

.ns-subsection-title {
  margin: 20px 0 10px;
  font-size: 0.95rem;
}

.ns-detail-meta {
  display: block;
  margin-bottom: 12px;
}

.ns-masters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

[data-theme="dark"] .ns-card {
  background: var(--surface, #1e1e1e);
  border-color: var(--border, #333);
}

[data-theme="dark"] .ns-card:hover {
  box-shadow: 0 4px 14px rgba(42, 171, 238, 0.2);
}

[data-theme="dark"] button.ns-card:focus,
[data-theme="dark"] button.ns-card:active {
  background: var(--surface, #1e1e1e);
}

.number-sets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.number-sets-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.ns-name-input {
  min-width: 160px;
}

.number-sets-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 8px 0 16px;
}

.ns-stat {
  font-weight: 600;
}

.number-sets-export-row,
.number-sets-upload-row,
.number-sets-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.number-sets-table {
  width: 100%;
  border-collapse: collapse;
}

.number-sets-table th,
.number-sets-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #e0e0e0);
  text-align: left;
  vertical-align: middle;
}

.number-sets-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.ns-export-count {
  width: 100px;
}

.ns-export-note {
  min-width: 160px;
}

.number-sets-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.number-sets-history-head h3 {
  margin: 0;
}

.number-sets-history-table td:last-child {
  white-space: nowrap;
}

.number-sets-cross-pick {
  max-height: 160px;
  overflow-y: auto;
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
}

.number-sets-crosscheck-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.pf-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.pf-results-list {
  margin-top: 10px;
}

.pf-result-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.pf-result-row:last-child {
  border-bottom: none;
}

.pf-result-files {
  font-size: 0.9em;
  margin: 4px 0;
  word-break: break-word;
}

.pf-result-files a {
  margin-right: 8px;
}

.pf-result-files a.pf-xlsx-link {
  font-weight: 600;
  color: var(--accent, #2563eb);
}

.pf-sessions-wrap {
  max-height: 340px;
  overflow: auto;
}

.pf-import-panel {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--panel-bg, rgba(0, 0, 0, 0.02));
}

.pf-import-toolbar {
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.pf-import-toolbar textarea {
  min-width: 220px;
  max-width: 320px;
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}

.pf-proxy-assign-opt {
  white-space: nowrap;
  font-size: 0.9em;
}

.pf-sessions-table {
  width: 100%;
  font-size: 0.92rem;
}

.pf-sessions-table th,
.pf-sessions-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.pf-checking-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.pf-st-idle { background: #e2e8f0; color: #475569; }
.pf-st-running { background: #dbeafe; color: #1d4ed8; }
.pf-st-waiting { background: #fef3c7; color: #b45309; }
.pf-st-connecting { background: #e0e7ff; color: #4338ca; }
.pf-st-flood { background: #ffedd5; color: #c2410c; }
.pf-st-error { background: #fee2e2; color: #b91c1c; }
.pf-st-done { background: #dcfce7; color: #15803d; }
.pf-st-stopped { background: #f3e8ff; color: #7e22ce; }

.pf-job-live {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.9rem;
}

[data-theme='dark'] .pf-st-idle { background: #334155; color: #e2e8f0; }
[data-theme='dark'] .pf-job-live { background: #1e3a5f; border-color: #2563eb; }

.ns-master-pick.hidden {
  display: none;
}

.ns-master-pick {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  font-size: 0.85rem;
}

.ns-master-pick select {
  min-width: 180px;
}

.ns-platform-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ns-platform-label {
  font-size: 0.8rem;
  color: var(--muted, #666);
}

.ns-platform-btns {
  display: flex;
  gap: 6px;
}

.ns-platform-btn {
  min-width: 48px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border, #d0d0d0);
  background: var(--surface, #fff);
  font-weight: 700;
  cursor: pointer;
}

.ns-platform-btn.active {
  background: #e3f2fd;
  border-color: #1565c0;
  color: #1565c0;
}

.ns-platform-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f3e5f5;
  color: #6a1b9a;
}

.ns-master-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #e3f2fd;
  color: #1565c0;
}

.country-select-option {
  font-size: 0.95rem;
}

.api-profile-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.api-profile-table th,
.api-profile-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border, #e0e0e0);
  vertical-align: middle;
}

.api-profile-table th {
  font-size: 0.8rem;
  color: var(--muted, #666);
  font-weight: 600;
}

.proxy-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: #e3f2fd;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timing-panel {
  background: linear-gradient(135deg, #e8f4fc 0%, #f0f4ff 100%);
  border: 1px solid #c5d4f0;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.timing-panel label {
  margin: 0;
  white-space: nowrap;
}

.import-format-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 8px 0 6px;
  font-size: 13px;
}

.import-format-opt {
  margin: 0;
  white-space: nowrap;
  font-weight: 600;
}

.ui-prefs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.ui-prefs-row label {
  margin: 0;
  font-weight: 600;
  min-width: 72px;
}

.ui-prefs-row select {
  min-width: 220px;
  max-width: 100%;
}

.twofa-hint {
  margin: 4px 0 10px;
}

.filter-presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px dashed #c5d4f0;
  border-radius: var(--radius);
  font-size: 13px;
}

.filter-presets-bar select {
  min-width: 160px;
}

.select-oldest-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.select-oldest-label input {
  width: 72px;
  font-weight: 400;
}

.flood-wait-panel {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 13px;
}

.flood-wait-panel table {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
}

.dash-flood-wait {
  background: #fff3e0;
  border-color: #ffcc80;
  color: #e65100;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.backup-upload {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.backup-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.accounts-row-count {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.keyboard-hints {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.import-preview-panel {
  background: var(--surface);
  border: 1px solid #e8ecf2;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
}

.import-preview-panel table {
  width: 100%;
  font-size: 12px;
}

.import-preview-table-wrap {
  max-height: 220px;
  overflow: auto;
}

tr.preview-new td:last-child {
  color: #15803d;
  font-weight: 600;
}

tr.preview-dup td:last-child {
  color: #b45309;
}

tr.preview-bad td:last-child {
  color: #b71c1c;
}

.proxy-toolbar select {
  min-width: 180px;
}

.accounts-shortcut-hint kbd {
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  font-size: 0.85em;
}

.btn-link {
  padding: 2px 8px;
  margin: 0 0 0 6px;
  font-size: 12px;
  background: transparent;
  border: 1px solid #999;
  color: var(--danger);
}

.btn-danger {
  background: var(--danger) !important;
  color: #fff !important;
}

.active-job-banner {
  background: #fff8e1;
  border-bottom: 2px solid var(--warning);
  padding: 12px 28px;
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}

.active-job-banner button {
  background: var(--danger);
}

.job-row-active {
  background: #fffde7 !important;
}

.name-preview {
  background: #f8f9fc;
  border: 1px solid #dde;
  padding: 10px;
  margin-top: 10px;
  border-radius: 8px;
  max-width: 900px;
}

.privacy-toolbar label {
  margin-right: 16px;
}

.accounts-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 12px;
  -webkit-overflow-scrolling: touch;
  scroll-padding-right: 300px;
}

.accounts-table-wrap .accounts-scroll-hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

.accounts-table {
  font-size: 12px;
  table-layout: auto;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.accounts-table th,
.accounts-table td {
  padding: 6px 8px;
  vertical-align: middle;
  box-sizing: border-box;
}

.accounts-table th {
  font-size: 0.7rem;
  white-space: nowrap;
  background: #f8fafc;
}

.accounts-table .col-check {
  width: 32px;
  min-width: 32px;
  text-align: center;
}
.accounts-table .col-id {
  width: 44px;
  min-width: 44px;
}
.accounts-table .col-phone {
  min-width: 124px;
  white-space: nowrap;
}
.accounts-table .col-grp {
  min-width: 88px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accounts-table .col-name {
  min-width: 96px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accounts-table .col-user {
  min-width: 64px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accounts-table .col-uid {
  min-width: 92px;
  white-space: nowrap;
  text-align: center;
}
.accounts-table .col-uid-digits {
  min-width: 44px;
  max-width: 52px;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.accounts-table .col-2fa {
  min-width: 72px;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.accounts-table .col-dev {
  min-width: 52px;
  text-align: center;
  white-space: nowrap;
}
.accounts-table .col-st {
  min-width: 72px;
  text-align: center;
  white-space: nowrap;
}
.accounts-table .col-err {
  min-width: 100px;
  max-width: 180px;
}
.accounts-table .col-hlth {
  min-width: 56px;
  text-align: center;
  white-space: nowrap;
}
.accounts-table .col-freeze {
  min-width: 56px;
  text-align: center;
  white-space: nowrap;
}

.accounts-table .col-spam {
  min-width: 72px;
  max-width: 110px;
  text-align: center;
  white-space: nowrap;
}

.spam-badge.spam-limited-date {
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.freeze-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
}

.freeze-badge.freeze-ok {
  color: #15803d;
  background: rgba(21, 128, 61, 0.12);
}

.freeze-badge.freeze-bad {
  color: #b71c1c;
  background: #ffebee;
}

.freeze-badge.freeze-warn {
  color: #e65100;
  background: #fff3e0;
}

.freeze-badge.freeze-unknown {
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
}

.spam-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: lowercase;
}

.spam-badge.spam-ok {
  color: #15803d;
  background: rgba(21, 128, 61, 0.12);
}

.spam-badge.spam-bad {
  color: #b71c1c;
  background: #ffebee;
}

.spam-badge.spam-warn {
  color: #e65100;
  background: #fff3e0;
}

.spam-badge.spam-flagged {
  color: #b45309;
  background: #fef3c7;
}

.spam-badge.spam-unknown {
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
}

.accounts-table .col-session {
  min-width: 118px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-muted, #64748b);
  background: inherit;
}

.accounts-table .col-act {
  min-width: 300px;
  width: 300px;
  max-width: 300px;
  vertical-align: top;
  white-space: normal;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface, #fff);
  border-left: 1px solid #e2e8f0;
  box-shadow: -8px 0 12px rgba(15, 20, 25, 0.08);
}

.accounts-table thead .col-act {
  z-index: 4;
  background: #f8fafc;
}

.accounts-table td.col-act {
  background: var(--surface, #fff);
}

.session-time {
  font-variant-numeric: tabular-nums;
}

.accounts-table .col-dev {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.device-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.device-reminder-badge {
  display: block;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 3px;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  white-space: nowrap;
}

.device-reminder-soon {
  font-size: 10px;
  opacity: 0.75;
}

.device-reminder-skipped {
  display: block;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e8f4fd;
  color: #1565c0;
  border: 1px solid #90caf9;
  white-space: nowrap;
}

.group-shared-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.device-count {
  display: inline-block;
  min-width: 1.25rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.device-count.device-ok {
  color: var(--success, #15803d);
  background: rgba(21, 128, 61, 0.1);
}
.device-count.device-warn {
  color: var(--warning, #b45309);
  background: rgba(180, 83, 9, 0.12);
}

.cell-error {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  color: #8b1a1a;
  font-size: 11px;
  cursor: pointer;
  word-break: break-word;
}

.cell-error:hover {
  background: #fff5f5;
  border-radius: 4px;
}

.cell-error.expanded {
  -webkit-line-clamp: unset;
  display: block;
  max-height: none;
  white-space: pre-wrap;
}

.cell-muted {
  color: #999;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.row-actions-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}

.row-actions-line.row-actions-move select.rowMoveGroup {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  width: auto;
}

.row-actions select,
.row-actions-line select {
  padding: 4px 6px;
  font-size: 11px;
  margin: 0;
  flex-shrink: 0;
}

.btn-xs {
  padding: 4px 8px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  border-radius: 5px !important;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-xs.primary {
  background: var(--accent, #2aabee) !important;
  color: #fff !important;
  border: 1px solid var(--accent-dark, #229ed9) !important;
}

.btn-danger-outline,
.btn-xs.btn-danger-outline {
  background: #ffebee !important;
  color: #c62828 !important;
  border: 1px solid #ef9a9a !important;
}

td select:not(.rowMoveGroup) {
  min-width: 100px;
  max-width: 140px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-success {
  background: #e8f5e9;
  color: #2e7d32;
}
.status-failed {
  background: #ffebee;
  color: #c62828;
}
.status-pending {
  background: #fff3e0;
  color: #e65100;
}

@media (max-width: 960px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main {
    padding: 16px;
  }
  .dash-cards {
    grid-template-columns: 1fr;
  }
  .dash-hero {
    flex-direction: column;
  }
}

[data-theme='dark'] {
  color-scheme: dark;
  --surface: #1e293b;
  --surface-soft: #0f172a;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
}

[data-theme='dark'] body {
  background: var(--surface-soft);
  color: var(--text);
}

[data-theme='dark'] main,
[data-theme='dark'] .bulk-panel,
[data-theme='dark'] .home-card,
[data-theme='dark'] .stat-card,
[data-theme='dark'] .dash-card,
[data-theme='dark'] .queue-panel,
[data-theme='dark'] .dead-otp-panel,
[data-theme='dark'] .login-live-panel,
[data-theme='dark'] .filters,
[data-theme='dark'] .privacy-toolbar {
  background: var(--surface);
  color: var(--text);
  border-color: #334155;
}

[data-theme='dark'] table {
  background: var(--surface);
  border-color: #334155;
}

[data-theme='dark'] th {
  background: #172033;
  color: var(--text-muted);
}

[data-theme='dark'] input,
[data-theme='dark'] textarea,
[data-theme='dark'] select {
  background: #0f172a;
  color: var(--text);
  border-color: #475569;
}

[data-theme='dark'] input::placeholder,
[data-theme='dark'] textarea::placeholder {
  color: #64748b;
}

[data-theme='dark'] .app-nav {
  background: #172033;
  border-color: #334155;
}

[data-theme='dark'] .nav-btn {
  color: var(--text-muted);
}

[data-theme='dark'] .nav-btn:hover,
[data-theme='dark'] .nav-btn.active {
  background: rgba(42, 171, 238, 0.15);
  color: #7dd3fc;
}

[data-theme='dark'] .app-footer {
  background: #172033;
  border-color: #334155;
  color: var(--text-muted);
}

[data-theme='dark'] th,
[data-theme='dark'] td {
  border-bottom-color: #334155;
}

[data-theme='dark'] th,
[data-theme='dark'] .accounts-table th {
  background: #172033;
  color: var(--text-muted);
}

[data-theme='dark'] .accounts-table .col-act,
[data-theme='dark'] .accounts-table td.col-act {
  background: var(--surface, #0f172a);
  border-left-color: #334155;
  box-shadow: -8px 0 12px rgba(0, 0, 0, 0.35);
}

[data-theme='dark'] .timing-panel {
  background: linear-gradient(135deg, #1e293b 0%, #172033 100%);
  border-color: #334155;
}

[data-theme='dark'] .hint,
[data-theme='dark'] .subtitle,
[data-theme='dark'] .cell-muted {
  color: var(--text-muted);
}

[data-theme='dark'] .dash-alert-job {
  background: linear-gradient(90deg, #422006, #451a03);
  border-color: #92400e;
  color: #fde68a;
}

[data-theme='dark'] .dash-attention,
[data-theme='dark'] .dead-otp-panel {
  background: #3f1d1d;
  border-color: #7f1d1d;
  color: #fecaca;
}

[data-theme='dark'] .dash-device-reminder {
  background: #422006;
  border-color: #92400e;
  color: #fde68a;
}

[data-theme='dark'] button.secondary,
[data-theme='dark'] .btn-xs.secondary {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

[data-theme='dark'] .filter-presets-bar {
  background: var(--surface);
  border-color: #475569;
}

[data-theme='dark'] .flood-wait-panel,
[data-theme='dark'] .dash-flood-wait {
  background: #422006;
  border-color: #92400e;
  color: #fde68a;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 8px;
  position: relative;
  z-index: 1;
}

.auth-user-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.users-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.users-add-row input {
  min-width: 140px;
  flex: 1;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.users-toolbar h3 {
  margin: 0;
}

.users-table,
.perm-matrix {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td,
.perm-matrix th,
.perm-matrix td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8ecf0;
  text-align: left;
}

.perm-matrix td:not(:first-child) {
  text-align: center;
  width: 72px;
}

.user-status-active { color: var(--success); font-weight: 600; }
.user-status-off { color: var(--text-muted); }

[data-theme='dark'] .header-auth .auth-user-label {
  color: #94a3b8;
}

/* Mobile navigation */
.nav-toggle {
  display: none;
  border: 1px solid #d0d7e2;
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px 12px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  body.nav-open .app-nav {
    display: flex;
  }

  .nav-btn {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
  }

  main {
    padding: 16px 14px 32px;
  }

  .header-auth {
    gap: 8px;
  }

  .auth-user-label {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.toast-in {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { background: #166534; }
.toast-warning { background: #b45309; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1e40af; }

.group-scope-box {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e2e6ee;
  border-radius: 8px;
  background: #f8fafc;
}

.group-scope-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.group-scope-item {
  margin: 0;
  font-size: 0.88rem;
}

.audit-log-table td {
  font-size: 0.85rem;
  vertical-align: top;
}

.dash-duplicates {
  border-left: 4px solid #f59e0b;
}

.dash-missing-session {
  border-left: 4px solid #6366f1;
}

#statDuplicatesCard.hidden-stat {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-card {
  background: var(--surface);
  border-radius: 12px;
  width: min(920px, 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e6ee;
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 16px 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.dup-section {
  margin-bottom: 20px;
}

.dup-section h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.dup-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
}

[data-theme='dark'] .group-scope-box {
  background: #1e293b;
  border-color: #334155;
}

[data-theme='dark'] .modal-card {
  background: #0f172a;
}

[data-theme='dark'] .modal-head {
  border-color: #334155;
}
