/* ==========================================================================
   VFS Helper — Professional SaaS Modern Dashboard Stylesheet
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Deep High-End Dark Palette */
  --bg-app: #090d16;
  --bg-sidebar: #0f1422;
  --bg-header: rgba(15, 20, 34, 0.85);
  --bg-card: #141b2d;
  --bg-card-hover: #192238;
  --bg-row: #111726;
  --bg-row-alt: #0d121f;
  --bg-input: #0b0f19;

  --border-subtle: #1e293f;
  --border-strong: #2a3854;
  --border-focus: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ================= LAYOUT ================= */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-brand {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--primary-blue);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-subtle);
  padding: 12px 10px 4px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  padding: 2px 7px;
  border-radius: 999px;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

.system-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0d121e;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.status-indicator-dot.pulse {
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.status-info {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.status-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #4ade80;
}

/* ================= MAIN CANVAS ================= */
.main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  overflow: hidden;
}

/* ================= HEADER NAVBAR ================= */
.header {
  height: 64px;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 10;
}

.route-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #121828;
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.flag-icon {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.flag-in {
  background: linear-gradient(to bottom, #ff9933 33.3%, #ffffff 33.3%, #ffffff 66.6%, #138808 66.6%);
}

.flag-bg {
  background: linear-gradient(to bottom, #ffffff 33.3%, #00966e 33.3%, #00966e 66.6%, #d62612 66.6%);
}

.route-country {
  color: #f1f5f9;
}

.route-arrow {
  color: var(--primary-blue);
  font-size: 12px;
}

.route-pill {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-action-primary {
  background: #1e293b;
  border: 1px solid var(--border-strong);
  color: #f1f5f9;
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.btn-action-primary:hover {
  background: #28354d;
  border-color: #3b82f6;
  color: #ffffff;
}

.btn-action-accent {
  background: var(--primary-blue);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 15px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-action-accent:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-1px);
}

/* ================= VIEWPORT ================= */
.content-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ================= METRICS ROW ================= */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.metric-card:hover {
  border-color: var(--border-strong);
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-blue-subtle { background: rgba(59, 130, 246, 0.15); }
.bg-green-subtle { background: rgba(16, 185, 129, 0.15); }
.bg-amber-subtle { background: rgba(245, 158, 11, 0.15); }
.bg-purple-subtle { background: rgba(139, 92, 246, 0.15); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-subtle);
}

.metric-value {
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.text-green { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-purple { color: #a78bfa !important; }

/* ================= TABLE CONTROLS ================= */
.table-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pills-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  background: #0f1422;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-pill:hover {
  background: #182035;
  color: #fff;
}

.filter-pill.active {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

.batch-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-run-all {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.btn-run-all:hover {
  background: #10b981;
  color: #0b1322;
}

.btn-stop-all {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-stop-all:hover {
  background: #f43f5e;
  color: #fff;
}

.filters-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 7px 12px;
}

.search-input-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12.5px;
  width: 100%;
}

.custom-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.btn-reset {
  background: transparent;
  border: 1px dashed var(--border-subtle);
  color: var(--text-subtle);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-reset:hover {
  color: #fff;
  border-color: var(--text-muted);
}

/* ================= DATA TABLE ================= */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead tr {
  background: #0f1525;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  text-transform: uppercase;
  white-space: nowrap;
}

.th-checkbox { width: 44px; text-align: center; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-row);
  transition: background 0.12s ease;
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-row-alt);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody tr.row-active-running {
  background: rgba(59, 130, 246, 0.15) !important;
}

.data-table td {
  padding: 14px;
  vertical-align: middle;
}

.applicant-info-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.applicant-email-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.applicant-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-subtle);
}

.badge-visa-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.28);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.applicant-details-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
}

.passport-badge {
  font-family: var(--font-mono);
  color: #cbd5e1;
  font-size: 11px;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-completed {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-running {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  animation: pulseRunning 1.5s infinite;
}

@keyframes pulseRunning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.badge-ready {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.badge-stopped {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Result & Payment Cell */
.payment-cell-wrapper {
  max-width: 320px;
}

.pay-link-ready-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pay-link-ready-box strong {
  font-size: 12px;
  color: #4ade80;
}

.btn-open-payment {
  background: var(--accent-emerald);
  color: #062417;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  transition: all 0.12s ease;
}

.btn-open-payment:hover {
  background: #34d399;
}

/* Action Run Flow Button */
.btn-run-single {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
}

.btn-run-single:hover {
  background: var(--accent-emerald);
  color: #041f14;
}

.btn-run-single.is-active-stop {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.btn-inspect-steps {
  background: #1e273a;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.btn-inspect-steps:hover {
  color: #fff;
  border-color: var(--border-strong);
}

/* ================= SLIDE-OVER DRAWER ================= */
.pipeline-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 580px;
  max-width: 95vw;
  height: 100vh;
  background: #0d121f;
  border-left: 1px solid var(--border-strong);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.pipeline-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #111728;
}

.drawer-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--primary-blue);
  display: block;
  margin-bottom: 3px;
}

.drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.drawer-header p {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 2px;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-run-flow-drawer {
  background: var(--primary-blue);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-close-drawer:hover { color: #fff; }

.payment-gateway-card {
  margin: 14px 20px 0 20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 8px;
  padding: 12px 14px;
}

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

.pg-status {
  font-size: 11px;
  font-weight: 800;
  color: #34d399;
}

.pg-slot {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.pg-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pg-link-url {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #93c5fd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-pg {
  background: #10b981;
  border: none;
  color: #041f14;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
}

.drawer-steps-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  background: #141b2c;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
}

.step-card.step-done { border-left: 3px solid var(--accent-emerald); }
.step-card.step-pending { opacity: 0.5; border-left: 3px solid #334155; }

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

.step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.step-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.http-method {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.http-status { color: #34d399; font-weight: 700; }

.step-url {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
  margin-bottom: 8px;
  word-break: break-all;
}

.step-json-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.json-box {
  background: #090e19;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 7px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #cbd5e1;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
}

.json-box-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 3px;
  display: block;
}

/* ================= MODALS & FILE IMPORT ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hidden { display: none !important; }

.modal-box {
  width: 600px;
  max-width: 100%;
  background: #111728;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-box.modal-xl {
  width: 860px;
}

.modal-head {
  padding: 18px 22px;
  background: #0f1525;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head p { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 16px;
  cursor: pointer;
}

.modal-tabs-header {
  display: flex;
  background: #0b101c;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-tab-toggle {
  flex: 1;
  background: transparent;
  border: none;
  padding: 11px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.modal-tab-toggle.active {
  color: #fff;
  border-bottom-color: var(--primary-blue);
  background: rgba(59, 130, 246, 0.08);
}

.modal-body-scroll {
  padding: 18px 22px;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

.spreadsheet-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px;
  color: #f1f5f9;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  resize: vertical;
}

.drop-zone {
  border: 2px dashed #2563eb;
  background: rgba(37, 99, 235, 0.05);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hidden-file-input { display: none; }

.import-defaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.preview-card {
  margin-top: 14px;
  background: #0d121f;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-parse-refresh {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.preview-scroll {
  max-height: 180px;
  overflow-y: auto;
}

.preview-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.preview-grid-table th {
  background: #141b2c;
  padding: 7px 9px;
  color: var(--text-subtle);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.preview-grid-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #0f1525;
  border-top: 1px solid var(--border-subtle);
}

.modal-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-form-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label, .modal-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.custom-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
}

.custom-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-foot-inline {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* ================= TOAST STACK ================= */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #172138;
  border: 1px solid var(--primary-blue);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}

/* Mail & Settings Panels */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 22px 24px;
}

.panel-title-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title-area h2 { font-size: 17px; font-weight: 700; }
.panel-title-area p { font-size: 12.5px; color: var(--text-subtle); margin-top: 2px; }

.mail-lookup-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

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

.mail-card-otp {
  background: #0f1525;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 20px;
}

.mail-card-otp .label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
}

.mail-card-otp .otp-number {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--accent-emerald);
  margin: 14px 0;
}

.mail-card-otp .sub { font-size: 12px; color: var(--text-subtle); }

.mail-card-inbox {
  background: #0f1525;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
}

.inbox-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: #fff; }
.messages-container { display: flex; flex-direction: column; gap: 8px; }

.mail-item {
  background: #151d30;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
}

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

.full-width { grid-column: span 2; }

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.user-card {
  background: #0f1525;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
}

.logs-terminal {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  padding: 6px 10px;
  border-radius: 4px;
  background: #111829;
  border-left: 3px solid var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ================= ROLE-BASED VISIBILITY ================= */
body.is-not-admin .admin-only {
  display: none !important;
}

/* ================= AUTHENTICATION LOGIN GATE ================= */
.auth-gate {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top center, #111c36 0%, #070b13 65%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300;
}

.auth-backdrop-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 440px;
  max-width: 100%;
  background: rgba(17, 23, 40, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 28px 28px 24px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  flex-shrink: 0;
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
}

.auth-subtitle {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--primary-blue);
  margin-top: 2px;
}

.auth-loading-banner {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-input {
  padding: 10px 13px;
  font-size: 13.5px;
}

.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrap .auth-input {
  width: 100%;
  padding-right: 40px;
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

.btn-toggle-pw:hover {
  color: #ffffff;
}

.auth-alert {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
}

.btn-login-submit {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 11px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transition: all 0.15s ease;
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

.btn-login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-footer-note {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.45;
}

/* ================= SIDEBAR USER PROFILE ================= */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user-card {
  background: #0d1322;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.user-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-card-meta {
  min-width: 0;
  flex: 1;
}

.user-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 1px;
}

.role-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.role-admin {
  background: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.45);
}

.role-user {
  background: rgba(6, 182, 212, 0.16);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.user-quota-row {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.mini-progress-track {
  width: 100%;
  height: 4px;
  background: #1a243b;
  border-radius: 999px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--primary-blue);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.user-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}

.btn-sidebar-sm {
  background: #172035;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-sidebar-sm:hover {
  background: #23304d;
  color: #ffffff;
  border-color: var(--border-strong);
}

.btn-sidebar-logout:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

/* ================= TABLE REASSIGN & ROW CONTROLS ================= */
.admin-reassign-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid var(--border-subtle);
}

.btn-secondary-sm {
  background: #1e293b;
  border: 1px solid var(--border-strong);
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary-sm:hover {
  border-color: var(--primary-blue);
  color: #ffffff;
}

.btn-danger-solid {
  background: #e11d48;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 15px;
  border-radius: 7px;
  cursor: pointer;
}

.btn-danger-solid:hover {
  background: #be123c;
}

.btn-delete-row {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
  font-size: 11px;
  padding: 5px 7px;
  border-radius: 5px;
  cursor: pointer;
}

.btn-delete-row:hover {
  background: #e11d48;
  color: #ffffff;
}

.owner-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.owner-name {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.owner-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
}

/* ================= ADMIN SUMMARY & PERFORMANCE ANALYTICS ================= */
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-kpi-card {
  background: #0f1525;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.admin-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.admin-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.status-pill-suspended {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.rate-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 125px;
}

.rate-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.rate-bar-track {
  width: 100%;
  height: 7px;
  background: #1a243b;
  border-radius: 999px;
  overflow: hidden;
}

.rate-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.rate-high { background: #10b981; color: #34d399; }
.rate-mid  { background: #f59e0b; color: #fbbf24; }
.rate-low  { background: #f43f5e; color: #fb7185; }
.rate-none { background: #475569; color: #94a3b8; }

.outcome-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.outcome-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #161f33;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  white-space: nowrap;
}

.outcome-pill.is-done { color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.outcome-pill.is-fail { color: #fb7185; border-color: rgba(244, 63, 94, 0.3); }
.outcome-pill.is-pay  { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.3); }

.action-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.btn-tbl-sm {
  background: #182238;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-tbl-sm:hover {
  border-color: var(--primary-blue);
  color: #ffffff;
}

.btn-tbl-sm.is-warn:hover {
  border-color: #f59e0b;
  color: #fbbf24;
}

.btn-tbl-sm.is-danger:hover {
  border-color: #f43f5e;
  color: #fda4af;
}

.btn-tbl-sm.is-success:hover {
  border-color: #10b981;
  color: #34d399;
}

.my-account-box {
  background: #0f1525;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.my-account-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.my-account-field span {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 600;
}

.my-account-field strong {
  font-size: 13px;
  color: #f1f5f9;
}

.audit-table td, .audit-table th {
  padding: 9px 12px;
  font-size: 11.5px;
}

.audit-action-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.audit-action-badge.is-alert {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}
