:root {
  --bg-dark: #0a0b10;
  --bg-card: rgba(18, 20, 32, 0.72);
  --bg-card-hover: rgba(26, 29, 46, 0.85);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-focus: #7952f5;
  
  --primary: #7952f5;
  --primary-glow: rgba(121, 82, 245, 0.35);
  --primary-hover: #8f6cf7;
  
  --accent: #00d2ff;
  --accent-glow: rgba(0, 210, 255, 0.35);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  
  --warning: #f59e0b;
  --danger: #ef4444;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Glowing Orbs */
.glow-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.sphere-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7952f5, transparent 70%);
  top: -100px;
  left: -100px;
}

.sphere-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #00d2ff, transparent 70%);
  bottom: 50px;
  right: -50px;
  animation-duration: 25s;
}

.sphere-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  top: 40%;
  left: 30%;
  opacity: 0.25;
  animation-duration: 30s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 11, 16, 0.75);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #d1d5db);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(121, 82, 245, 0.8), rgba(99, 102, 241, 0.8));
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* Main Container */
.main-container {
  max-width: 1440px;
  margin: 32px auto 80px;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Announcement */
.announcement-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, rgba(121, 82, 245, 0.15), rgba(0, 210, 255, 0.08));
  border: 1px solid rgba(121, 82, 245, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  margin-bottom: 24px;
  font-size: 0.92rem;
  color: #e5e7eb;
}

.announcement-icon {
  font-size: 1.25rem;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

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

html.admin-entry-loading .tab-pane {
  visibility: hidden;
}

body.admin-view .glow-sphere {
  display: none;
}

body.admin-view .announcement-card {
  display: none !important;
}

body.admin-view .app-header,
body.admin-view .glass-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.admin-view .app-header {
  background: #0a0b10;
}

body.admin-view .glass-card {
  background: #121420;
}

body.admin-view #pane-admin {
  animation: none;
}

#pane-verify, #pane-query {
  max-width: 860px;
  margin: 0 auto;
}

#pane-admin {
  width: 100%;
}

.admin-login-card {
  max-width: 480px;
  margin: 40px auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Workflow Steps */
.main-workflow-card {
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.75) 0%, rgba(12, 14, 24, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(121, 82, 245, 0.1);
  border-radius: var(--radius-lg);
  padding: 38px 44px;
  position: relative;
  overflow: hidden;
}

.main-workflow-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.6), transparent);
}

.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding: 0 10px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.step-item.active .step-num {
  background: linear-gradient(135deg, #7952f5, #6366f1);
  border-color: #a78bfa;
  color: #fff;
  box-shadow: 0 0 24px var(--primary-glow);
  transform: scale(1.08);
}

.step-item.active .step-label {
  color: #fff;
  font-weight: 700;
}

.step-item.done .step-num {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  color: #34d399;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.step-item.done .step-label {
  color: #34d399;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 14px -16px;
  transition: background 0.3s ease;
}

.step-connector.active {
  background: linear-gradient(90deg, #10b981, #7952f5);
}

/* Flow Stages */
.flow-stage {
  display: none;
}

.flow-stage.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.stage-header {
  margin-bottom: 28px;
}

.stage-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #a78bfa;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.stage-header h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #fff;
}

.stage-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.required-star {
  color: var(--danger);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.form-input, .form-select {
  width: 100%;
  background: rgba(10, 12, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 0.93rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.input-wrapper .form-input {
  padding-left: 48px;
}

.form-textarea {
  min-height: 90px;
  resize: none;
  line-height: 1.6;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.form-textarea::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#inputSheerId {
  resize: none !important;
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

#inputSheerId::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(121, 82, 245, 0.2);
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.btn-paste {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #d1d5db;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #7952f5, #6366f1);
  color: #fff;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8f6cf7, #7478f7);
  box-shadow: 0 6px 24px rgba(121, 82, 245, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #e5e7eb;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.flex-1 {
  flex: 1;
}

/* Stage 2 Redesign */
.verified-card-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.pill-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.pill-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.02em;
}

.pill-key {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.04em;
}

.pill-change-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #d1d5db;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  transition: all 0.2s;
}

.pill-change-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Stage 2 Forms & Inputs */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.btn-quick-paste {
  background: rgba(121, 82, 245, 0.12);
  border: 1px solid rgba(121, 82, 245, 0.3);
  color: #c4b5fd;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-quick-paste:hover {
  background: rgba(121, 82, 245, 0.25);
  color: #fff;
  border-color: #a78bfa;
}

.textarea-wrapper {
  position: relative;
  display: block;
}

.textarea-icon {
  position: absolute;
  top: 14px;
  left: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.textarea-wrapper .form-textarea {
  padding-left: 46px;
  padding-top: 12px;
  min-height: 90px;
  line-height: 1.55;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.field-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.warning-callout {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fef3c7;
}

.warning-callout code {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fbbf24;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.info-callout {
  background: rgba(121, 82, 245, 0.08);
  border: 1px solid rgba(121, 82, 245, 0.22);
  color: #e0e7ff;
}

.info-callout strong {
  color: #c7d2fe;
}

.callout-icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.callout-content {
  flex: 1;
}

.action-footer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.btn-back {
  padding: 14px 22px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-submit-task {
  flex: 1;
  height: 50px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px rgba(121, 82, 245, 0.45);
}

/* Stage 3: Live Progress & Terminal */
.task-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(121, 82, 245, 0.12), rgba(0, 210, 255, 0.08));
  border: 1px solid rgba(121, 82, 245, 0.25);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 22px;
  transition: all 0.3s ease;
}

.task-status-banner.is-failed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.09), rgba(245, 158, 11, 0.07));
  border: 1px solid rgba(239, 68, 68, 0.28);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08);
}

.fail-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.fail-banner-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.fail-banner-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fca5a5;
  letter-spacing: -0.01em;
}

.fail-banner-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.fail-sub-icon {
  font-size: 1.05rem;
}

.fail-banner-actions {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.fail-act-head {
  font-weight: 600;
  color: #fef08a;
  margin-bottom: 5px;
}

.fail-act-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

.fail-act-list li {
  margin-bottom: 3px;
}

.spinner-pulse {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(121, 82, 245, 0.2);
  border-top-color: #a78bfa;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  margin-top: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.status-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.order-meta-box {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
}

.meta-item {
  font-size: 0.88rem;
}

.meta-label {
  color: var(--text-dim);
  margin-right: 6px;
}

.meta-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.text-accent {
  color: var(--accent);
}

/* Terminal Box */
.terminal-box {
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 24px;
}

.terminal-header {
  background: #11141e;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
  display: flex;
  gap: 6px;
  margin-right: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.live-pill {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.terminal-body {
  padding: 16px;
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
}

.log-line {
  color: #9ca3af;
  word-break: break-all;
}

.log-time {
  color: #6b7280;
  margin-right: 8px;
}

/* Stage 3: Control Action Bar */
.action-bar-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Refresh Button */
.btn-task-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-task-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(121, 82, 245, 0.45);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(121, 82, 245, 0.18);
}

.btn-task-refresh:active {
  transform: translateY(0);
}

.refresh-icon {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.refresh-icon.is-spinning {
  animation: spinRefresh 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spinRefresh {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Sync Indicator */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-dim);
  user-select: none;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sync-dot.live {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.sync-dot.ended {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  animation: none;
}

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

.sync-label {
  letter-spacing: 0.01em;
}

/* Restart Button - Primary Prominent CTA */
.btn-task-restart {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, #7952f5 0%, #6366f1 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(121, 82, 245, 0.42);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-task-restart:hover {
  background: linear-gradient(135deg, #8f6cf7 0%, #7579f9 100%);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 24px rgba(121, 82, 245, 0.6);
  transform: translateY(-1.5px);
  color: #fff;
}

.btn-task-restart:hover svg {
  transform: rotate(-30deg);
}

.btn-task-restart svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.btn-task-restart:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .action-bar-task {
    flex-direction: column;
    align-items: stretch;
  }
  .action-bar-left, .action-bar-right {
    width: 100%;
    justify-content: space-between;
  }
  .btn-task-refresh, .btn-task-restart {
    flex: 1;
    justify-content: center;
  }
}

/* Success Screen */
.success-splash {
  text-align: center;
  padding: 20px 0;
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
  border: 2px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #10b981;
  box-shadow: 0 0 30px var(--success-glow);
}

.success-splash h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.success-sub {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.success-details-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  max-width: 480px;
  margin: 0 auto 24px;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

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

.detail-row span {
  color: var(--text-muted);
}

.guide-steps {
  display: none !important;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: #11131e;
  border: 1px solid rgba(121, 82, 245, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-badge-pulse {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  animation: pulse 1.5s infinite;
}

.modal-badge-pulse.badge-purple {
  background: rgba(121, 82, 245, 0.2);
  border: 1px solid rgba(121, 82, 245, 0.5);
  color: #c4b5fd;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.countdown-circle-wrap {
  text-align: center;
  margin-bottom: 20px;
  padding: 14px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.06);
}

.countdown-digits {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ef4444;
}

.countdown-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.modal-steps-guide {
  font-size: 0.9rem;
  color: #d1d5db;
  line-height: 1.6;
}

/* Admin Tabs & Tables */
.admin-subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding: 6px;
  background: rgba(14, 17, 28, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.subnav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.subnav-btn.active {
  background: linear-gradient(135deg, rgba(121, 82, 245, 0.9), rgba(99, 102, 241, 0.9));
  border-color: rgba(167, 139, 250, 0.5);
  color: #fff;
  box-shadow: 0 4px 16px rgba(121, 82, 245, 0.4);
}

.admin-subpane {
  display: none;
}

.admin-subpane.active {
  display: block;
}

/* Card Stats Grid */
.card-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

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

.stat-mini-card {
  background: rgba(14, 17, 28, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.stat-mini-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.stat-icon-pill {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.icon-purple { background: rgba(121, 82, 245, 0.18); border: 1px solid rgba(121, 82, 245, 0.35); }
.icon-green { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.35); }
.icon-amber { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.35); }
.icon-slate { background: rgba(107, 114, 128, 0.18); border: 1px solid rgba(107, 114, 128, 0.35); }

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

.stat-val {
  font-size: 1.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.1;
}

.stat-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 5px;
}

.text-success { color: #34d399; }
.text-warning { color: #fbbf24; }

/* Card Studio Form */
.gen-studio-card {
  padding: 28px 32px;
}

.gen-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.gen-studio-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gen-studio-title h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

.gen-badge {
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(121, 82, 245, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(121, 82, 245, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.gen-studio-hint {
  font-size: 0.88rem;
  color: var(--text-dim);
}

.gen-studio-form {
  display: grid;
  grid-template-columns: 290px 1.3fr 1.3fr auto;
  align-items: end;
  gap: 20px;
}

@media (max-width: 1200px) {
  .gen-studio-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .gen-studio-form {
    grid-template-columns: 1fr;
  }
}

.gen-field-group {
  display: flex;
  flex-direction: column;
}

.gen-count-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gen-count-input {
  width: 90px !important;
  height: 44px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 1rem;
}

.quick-preset-btns {
  display: flex;
  gap: 6px;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.preset-pill:hover {
  background: rgba(121, 82, 245, 0.25);
  color: #fff;
  border-color: rgba(121, 82, 245, 0.5);
}

.preset-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(121, 82, 245, 0.4);
}

.gen-btn-wrap {
  margin-top: auto;
}

.btn-sparkle {
  height: 44px;
  padding: 0 26px;
  box-shadow: 0 4px 18px rgba(121, 82, 245, 0.4);
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.toolbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-title-wrap h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.badge-total {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

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

.search-mini-wrap input {
  padding: 9px 14px;
  font-size: 0.86rem;
  width: 240px;
  border-radius: var(--radius-sm);
}

.btn-copy-sm {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 10px;
  transition: all 0.2s;
  white-space: nowrap;
  vertical-align: middle;
}

.btn-copy-sm:hover {
  background: rgba(121, 82, 245, 0.3);
  color: #fff;
  border-color: #a78bfa;
}

.btn-del-sm {
  display: inline-flex;
  align-items: center;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-del-sm:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fff;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 12, 20, 0.35);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  text-align: left;
  min-width: 960px;
}

.data-table th, .data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.data-table th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

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

.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.badge-unused { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-in_use { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-used { background: rgba(107, 114, 128, 0.25); color: #9ca3af; }
.badge-failed { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-success { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-processing, .badge-form_filling, .badge-tg_init, .badge-tg_paying, .badge-uploading_doc {
  background: rgba(121, 82, 245, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(121, 82, 245, 0.25);
}
.badge-waiting, .badge-waiting_email_link {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-pending {
  background: rgba(107, 114, 128, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(107, 114, 128, 0.25);
}

.table-id-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.table-id-cell:hover {
  background: rgba(121, 82, 245, 0.15);
  border-color: rgba(121, 82, 245, 0.4);
  color: #c4b5fd;
}

.table-card-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(121, 82, 245, 0.06);
  border: 1px solid rgba(121, 82, 245, 0.15);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #c4b5fd;
  cursor: pointer;
  transition: all 0.2s;
}
.table-card-cell:hover {
  background: rgba(121, 82, 245, 0.2);
  border-color: rgba(121, 82, 245, 0.5);
  color: #fff;
}

.table-email-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: color 0.2s;
}
.table-email-cell:hover {
  color: var(--primary-light);
}

.copy-subicon {
  font-size: 0.72rem;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.table-id-cell:hover .copy-subicon,
.table-card-cell:hover .copy-subicon {
  opacity: 1;
}

.order-step-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  line-height: 1.4;
}

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

/* Modern Proxy Card & Switch */
.proxy-card-panel {
  background: rgba(12, 14, 24, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.proxy-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.proxy-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proxy-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f3f4f6;
}

.proxy-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch-toggle input {
  display: none;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.switch-toggle input:checked + .switch-slider {
  background: linear-gradient(135deg, #7952f5, #6366f1);
  border-color: #8b5cf6;
  box-shadow: 0 0 12px rgba(121, 82, 245, 0.4);
}

.switch-toggle input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e5e7eb;
}

.proxy-grid-inputs {
  display: grid;
  grid-template-columns: 140px 1fr 120px;
  gap: 14px;
  transition: opacity 0.3s, filter 0.3s;
}

.proxy-grid-inputs.disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.6);
}

.form-sublabel {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.flex-2 {
  grid-column: span 1;
}

/* Telegram Configuration Polish */
.tg-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  gap: 20px;
  flex-wrap: wrap;
}

.tg-header-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tg-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-header-title-wrap h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tg-badge-bot {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 210, 255, 0.35);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.tg-header-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.tg-header-desc code {
  color: #a78bfa;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.tg-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Config Section Cards */
.config-section-card {
  padding: 24px;
}

.section-title-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-num {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: #a78bfa;
  background: rgba(121, 82, 245, 0.15);
  border: 1px solid rgba(121, 82, 245, 0.3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.section-title-bar h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.section-title-bar p {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-at-tag {
  position: absolute;
  left: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-dim);
  pointer-events: none;
}

.input-with-at {
  padding-left: 34px !important;
  font-family: var(--font-mono);
  color: #a78bfa !important;
  font-weight: 600;
}

.underline {
  text-decoration: underline;
}

/* Phone Login Assistant */
.phone-login-box {
  background: rgba(10, 12, 20, 0.7);
  border: 1px solid rgba(121, 82, 245, 0.25);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

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

.phone-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(121, 82, 245, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.phone-box-header h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.phone-box-header p {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.phone-step-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-nowrap {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 12px 22px;
}

.phone-code-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease-out;
}

.form-footer-actions {
  display: flex;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.ml-auto {
  margin-left: auto;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #181b2a;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

/* Multi-Account Pool & Modal Styles */
.account-modal-content {
  max-width: 620px;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

.account-modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 6px;
  margin-top: 14px;
}

.acc-tab-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.acc-tab-btn.active {
  background: rgba(121, 82, 245, 0.25);
  color: #fff;
  border: 1px solid rgba(121, 82, 245, 0.4);
  box-shadow: 0 4px 12px rgba(121, 82, 245, 0.15);
}

.flex-end-align {
  display: flex;
  align-items: flex-end;
}

/* Pool Status Badges */
.badge-pool-active {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-pool-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-pool-busy {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  animation: pulseGlow 1.5s infinite alternate;
}

.badge-pool-disabled {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-pool-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes pulseGlow {
  0% { opacity: 0.8; }
  100% { opacity: 1; filter: brightness(1.2); }
}

.pool-action-btns {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn-xs {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
  border-radius: var(--radius-sm) !important;
}

/* --- Order Query Redesign --- */
.query-card {
  max-width: 680px;
  margin: 0 auto;
}

.query-search-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 24px;
}

.query-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.query-search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.query-input {
  width: 100%;
  background: rgba(10, 12, 22, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 18px 13px 46px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.query-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(14, 17, 30, 0.95);
  box-shadow: 0 0 0 3px rgba(121, 82, 245, 0.25);
}

.query-btn {
  white-space: nowrap !important;
  flex-shrink: 0;
  padding: 0 22px !important;
  font-size: 0.92rem !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.query-results-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Individual Query Order Card */
.q-order-card {
  background: rgba(15, 18, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.q-order-card:hover {
  border-color: rgba(121, 82, 245, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.q-order-card.success-border {
  border-left: 4px solid #10b981;
}

.q-order-card.failed-border {
  border-left: 4px solid #ef4444;
}

.q-order-card.progress-border {
  border-left: 4px solid #7952f5;
}

.q-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.q-card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.q-card-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.q-card-id:hover {
  background: rgba(121, 82, 245, 0.2);
  color: #a78bfa;
}

.q-card-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.q-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.q-meta-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.q-meta-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.q-meta-val {
  font-size: 0.88rem;
  color: #e2e8f0;
  word-break: break-all;
}

.q-status-box {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.q-status-box.success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.q-status-box.success .q-status-title {
  color: #34d399;
  font-weight: 600;
  margin-bottom: 3px;
}

.q-status-box.failed {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.q-status-box.failed .q-status-title {
  color: #f87171;
  font-weight: 600;
  margin-bottom: 3px;
}

.q-status-box.progress {
  background: rgba(121, 82, 245, 0.08);
  border: 1px solid rgba(121, 82, 245, 0.2);
}

.q-status-box.progress .q-status-title {
  color: #a78bfa;
  font-weight: 600;
  margin-bottom: 3px;
}

.q-status-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.q-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.q-order-logs {
  margin-top: 14px;
  background: rgba(5, 7, 14, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.q-log-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.4;
}

.q-log-time {
  color: var(--text-dim);
  flex-shrink: 0;
}

.q-log-msg {
  color: #cbd5e1;
}

.query-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.query-empty-state h4 {
  font-size: 1.05rem;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.query-empty-state p {
  font-size: 0.85rem;
  color: var(--text-dim);
}
