/* ============================================================================
   ASYCUDA PERMIT TO XML CONVERTER — Next-Gen Customs Terminal UI
   Regime 5500 / QIP / SAD Automation
   ============================================================================ */

:root {
  /* Core Obsidian Palette (Dark Theme Default) */
  --bg-primary: #06080f;
  --bg-secondary: #0b0f19;
  --bg-tertiary: #111726;
  --bg-card: rgba(11, 15, 25, 0.82);
  --bg-card-hover: rgba(16, 23, 38, 0.92);
  --bg-input: rgba(8, 12, 20, 0.75);
  --bg-subcard: rgba(13, 19, 32, 0.6);

  /* Border & Glass */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(56, 189, 248, 0.28);
  --border-focus: #06b6d4;

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Vivid Neons & Semantic Accents */
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  /* Lighting & Shadows */
  --glass-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08),
    0 16px 36px -10px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  
  --card-hover-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.12),
    0 24px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(6, 182, 212, 0.1);

  --glow-cyan: 0 0 24px rgba(6, 182, 212, 0.25), 0 0 60px rgba(6, 182, 212, 0.08);
  --glow-emerald: 0 0 24px rgba(16, 185, 129, 0.25), 0 0 60px rgba(16, 185, 129, 0.08);
  --glow-indigo: 0 0 24px rgba(99, 102, 241, 0.25), 0 0 60px rgba(99, 102, 241, 0.08);

  /* Radius & Fonts */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Global Reset ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* Ambient Radial Glow Lighting */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
  opacity: 0.45;
  transition: opacity 0.5s ease;
}

.glow-1 {
  width: 600px;
  height: 600px;
  top: -150px;
  left: 10%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
}

.glow-2 {
  width: 700px;
  height: 700px;
  top: 35%;
  right: -100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}

.glow-3 {
  width: 800px;
  height: 800px;
  bottom: -200px;
  left: 20%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
}

/* Tech Micro-Grid Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================================
   HEADER — Sleek Floating Command Bar
   ============================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  background: rgba(6, 8, 15, 0.82);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.6), rgba(99, 102, 241, 0.6), transparent);
}

.header-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  gap: 1.25rem;
}

/* Brand Section */
.brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0ea5e9, #4f46e5, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  pointer-events: none;
}

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

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.18rem 0.65rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-emerald-light);
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald-light);
  box-shadow: 0 0 10px var(--accent-emerald-light);
  animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.brand-text p {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ============================================================================
   BUTTONS — Elevated Tactile Micro-Interactions
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb 50%, #4f46e5 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(2, 132, 199, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(2, 132, 199, 0.55);
  transform: translateY(-1.5px);
}

.btn-secondary {
  background: rgba(17, 24, 39, 0.75);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-template {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.25));
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

.btn-template:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.4));
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(16, 185, 129, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-success:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(16, 185, 129, 0.55);
  transform: translateY(-1.5px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-sm {
  padding: 0.38rem 0.8rem;
  font-size: 0.76rem;
  border-radius: var(--radius-xs);
}

/* Sample Demo Button */
.btn-sample-demo {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  color: var(--accent-amber-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
  font-weight: 700;
}

.btn-sample-demo:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.4));
  color: #ffffff;
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.btn-sample-inside {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  font-size: 0.84rem;
}

.btn-sample-inside:hover {
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.5);
  transform: translateY(-1.5px);
}

.dropzone-quick-actions {
  margin: 0.85rem 0 0.5rem;
  display: flex;
  justify-content: center;
}

/* ============================================================================
   WORKFLOW STEPPER BAR — Guided 3-Stage Progress
   ============================================================================ */
.workflow-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.35rem 1.5rem;
  min-height: 44px;
  background: rgba(11, 15, 25, 0.78);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  gap: 1rem;
}

.stepper-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 3px 5px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
}

.step-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.32rem 0.85rem;
  height: 32px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  flex: 0 0 auto;
  user-select: none;
}

.step-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-0.5px);
}

.step-nav-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28), rgba(37, 99, 235, 0.38));
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.step-nav-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.step-nav-btn:hover .step-nav-num {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.step-nav-btn.active .step-nav-num {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.6);
}

.step-nav-btn.completed .step-nav-num {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.step-nav-info {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.step-nav-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.step-nav-btn:hover .step-nav-title {
  color: var(--text-primary);
}

.step-nav-btn.active .step-nav-title {
  color: #ffffff;
  font-weight: 700;
}

.step-nav-sub {
  display: none;
}

.step-nav-badge {
  font-size: 0.62rem;
  padding: 0.12rem 0.48rem;
  border-radius: 9999px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  line-height: 1.2;
}

.step-nav-btn.active .step-nav-badge {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.step-nav-divider {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  opacity: 0.35;
  padding: 0 0.05rem;
}

.step-nav-divider svg {
  width: 11px;
  height: 11px;
}

.stepper-mode-control {
  position: absolute;
  right: 1.5rem;
  display: flex;
  align-items: center;
}

@media (max-width: 900px) {
  .workflow-stepper-bar {
    justify-content: center;
  }
  .stepper-mode-control {
    position: static;
  }
}


.flow-mode-switch {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
  user-select: none;
}

.flow-mode-switch input {
  display: none;
}

.flow-slider {
  width: 32px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  position: relative;
  transition: var(--transition);
}

.flow-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.flow-mode-switch input:checked + .flow-slider {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.flow-mode-switch input:checked + .flow-slider::after {
  transform: translateX(14px);
  background: #ffffff;
}

/* Pane Visibility Control */
[data-view-mode="stepped"] .step-pane {
  display: none;
  animation: fadeInPane 0.25s ease-out forwards;
}

[data-view-mode="stepped"] .step-pane.active {
  display: block;
}

[data-view-mode="continuous"] .step-pane {
  display: block !important;
  margin-bottom: 2rem;
}

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

/* Step Footer Navigation Bars */
.step-footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1.25rem;
}

.step-footer-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.step-footer-bar .btn-next-step {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  padding: 0.48rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.step-footer-bar .btn-next-step:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-1.5px);
}

.step-footer-bar .btn-next-step svg {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-footer-bar .btn-next-step:hover svg {
  transform: translateX(3px);
}

.step-footer-bar .btn-prev-step {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.48rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.step-footer-bar .btn-prev-step:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1.5px);
}

.step-footer-bar .btn-prev-step svg {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-footer-bar .btn-prev-step:hover svg {
  transform: translateX(-3px);
}

/* Floating Sticky Action Bar */
.floating-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 0.75rem 2rem;
  background: rgba(6, 8, 15, 0.88);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
}

.floating-bar-container {
  max-width: 1540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.floating-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.summary-pill-items {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan-light);
}

.summary-pill-items .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan-light);
  box-shadow: 0 0 6px var(--accent-cyan-light);
}

.summary-pill-weight {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald-light);
}

.summary-pill-value {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--accent-amber-light);
}

.floating-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-floating-download {
  padding: 0.6rem 1.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

/* ============================================================================
   MAIN LAYOUT & STEP CARDS
   ============================================================================ */
.app-container {
  max-width: 1540px;
  margin: 1.75rem auto;
  padding: 0 2rem 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 1.65rem 1.85rem;
  transition: var(--transition);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--card-hover-shadow);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.85rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.badge-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
  position: relative;
}

.badge-step::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(14, 165, 233, 0.25);
  animation: stepRing 3s ease-in-out infinite;
}

@keyframes stepRing {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

.step-heading {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.step-heading h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.step-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================================
   STEP 1: 3-FUNCTION DOCUMENT INGESTION HUBS & PORTALS
   1. Permit File (PDF) | 2. Excel Declaration (.xlsx) | 3. Invoice/PL/BL
   ============================================================================ */
.upload-portals-section {
  position: relative;
  overflow: hidden;
}

.upload-portals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.upload-portals-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

@media (max-width: 900px) {
  .upload-portals-nav {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .upload-portals-nav {
    grid-template-columns: 1fr;
  }
}

.portal-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.portal-tab-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.85);
}

.portal-tab-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.portal-tab-badge.badge-permit {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid #06b6d4;
}

.portal-tab-badge.badge-excel {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid #10b981;
}

.portal-tab-badge.badge-commercial {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid #8b5cf6;
}

.portal-tab-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.portal-tab-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-tab-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-tab-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Active tab states */
.portal-tab-btn[data-portal="permit"].active {
  border-color: #06b6d4;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.portal-tab-btn[data-portal="excel"].active {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.portal-tab-btn[data-portal="commercial"].active {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.portal-tab-btn.portal-tab-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.85rem 1.15rem;
}

.portal-tab-btn.portal-tab-all.active {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

/* Portals Grid & Visibility Switching */
.upload-portals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  transition: all 0.3s ease;
}

/* Single Portal View Modes */
.upload-portals-grid[data-view="permit"] #portal-card-permit { display: flex; }
.upload-portals-grid[data-view="permit"] #portal-card-excel,
.upload-portals-grid[data-view="permit"] #portal-card-commercial { display: none !important; }

.upload-portals-grid[data-view="excel"] #portal-card-excel { display: flex; }
.upload-portals-grid[data-view="excel"] #portal-card-permit,
.upload-portals-grid[data-view="excel"] #portal-card-commercial { display: none !important; }

.upload-portals-grid[data-view="commercial"] #portal-card-commercial { display: flex; }
.upload-portals-grid[data-view="commercial"] #portal-card-permit,
.upload-portals-grid[data-view="commercial"] #portal-card-excel { display: none !important; }

/* All 3 Portals View Mode */
.upload-portals-grid[data-view="all"] {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1080px) {
  .upload-portals-grid[data-view="all"] {
    grid-template-columns: 1fr;
  }
}

.upload-portals-grid[data-view="all"] .portal-card {
  display: flex !important;
}

/* Individual Portal Cards */
.portal-card {
  display: flex;
  flex-direction: column;
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.portal-card.portal-permit {
  border-color: rgba(6, 182, 212, 0.3);
  background: linear-gradient(175deg, rgba(6, 182, 212, 0.04) 0%, rgba(11, 15, 25, 0.85) 100%);
}

.portal-card.portal-excel {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(175deg, rgba(16, 185, 129, 0.04) 0%, rgba(11, 15, 25, 0.85) 100%);
}

.portal-card.portal-commercial {
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(175deg, rgba(139, 92, 246, 0.04) 0%, rgba(11, 15, 25, 0.85) 100%);
}

.portal-card-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.portal-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-icon-permit {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #06b6d4;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

.portal-icon-excel {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.portal-icon-commercial {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #a78bfa;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.portal-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.portal-label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.portal-badge.badge-permit { background: rgba(6, 182, 212, 0.2); color: #06b6d4; }
.portal-badge.badge-excel { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.portal-badge.badge-commercial { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

.portal-format-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tag-cyan { color: #38bdf8; }
.tag-emerald { color: #34d399; }
.tag-indigo { color: #c084fc; }

.portal-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.portal-card-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Features Grid */
.portal-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.portal-feat-item {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
}

.feat-check {
  font-weight: 800;
  color: #10b981;
  font-size: 0.85rem;
}

/* Dedicated Portal Dropzones */
.portal-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.portal-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.portal-drop-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  transition: transform 0.25s, box-shadow 0.25s;
}

.icon-permit {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.icon-excel {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.icon-commercial {
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.portal-dropzone:hover .portal-drop-icon,
.portal-dropzone.dragover .portal-drop-icon {
  transform: translateY(-3px) scale(1.05);
}

.dropzone-permit:hover, .dropzone-permit.dragover {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.2);
}

.dropzone-excel:hover, .dropzone-excel.dragover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.2);
}

.dropzone-commercial:hover, .dropzone-commercial.dragover {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.2);
}

.portal-drop-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.portal-drop-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 480px;
}

.portal-drop-pill {
  margin-top: 0.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.portal-drop-pill.loaded {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  font-weight: 700;
}

/* Action toolbars */
.portal-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-emerald {
  background: #059669;
  color: #ffffff;
  border: none;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-emerald:hover {
  background: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  color: #ffffff;
}

.btn-indigo {
  background: #6366f1;
  color: #ffffff;
  border: none;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-indigo:hover {
  background: #8b5cf6;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
  color: #ffffff;
}

.commercial-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.mode-toggle-option input {
  cursor: pointer;
  accent-color: #8b5cf6;
}

/* Light Theme Overrides for Portals */
[data-theme-mode="light"] .portal-tab-btn {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme-mode="light"] .portal-tab-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
[data-theme-mode="light"] .portal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
[data-theme-mode="light"] .portal-card.portal-permit {
  background: linear-gradient(175deg, #f0fdfa 0%, #ffffff 100%);
  border-color: #99f6e4;
}
[data-theme-mode="light"] .portal-card.portal-excel {
  background: linear-gradient(175deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #bbf7d0;
}
[data-theme-mode="light"] .portal-card.portal-commercial {
  background: linear-gradient(175deg, #faf5ff 0%, #ffffff 100%);
  border-color: #ddd6fe;
}
[data-theme-mode="light"] .portal-features-grid {
  background: #f8fafc;
  border-color: #e2e8f0;
}
[data-theme-mode="light"] .portal-dropzone {
  background: #f8fafc;
  border-color: #cbd5e1;
}
[data-theme-mode="light"] .dropzone-permit:hover,
[data-theme-mode="light"] .dropzone-permit.dragover {
  background: #f0fdfa;
  border-color: #0d9488;
}
[data-theme-mode="light"] .dropzone-excel:hover,
[data-theme-mode="light"] .dropzone-excel.dragover {
  background: #f0fdf4;
  border-color: #059669;
}
[data-theme-mode="light"] .dropzone-commercial:hover,
[data-theme-mode="light"] .dropzone-commercial.dragover {
  background: #faf5ff;
  border-color: #7c3aed;
}
[data-theme-mode="light"] .commercial-mode-switch {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Legacy dropzone backward compatibility */
.dropzone {
  border: 2px dashed rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 2.75rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(11, 15, 25, 0.6) 0%, rgba(6, 10, 18, 0.85) 100%);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.05);
  box-shadow: var(--glow-cyan);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.dropzone-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
  transition: var(--transition);
}

.dropzone-icon {
  color: var(--accent-cyan-light);
  transition: var(--transition);
}

.dropzone:hover .dropzone-icon-wrapper {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--accent-cyan-light);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
}

.dropzone-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dropzone-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.5;
}

.dropzone-formats-strip {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.format-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.format-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-pdf { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
.dot-excel { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }

.format-pill code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--accent-cyan-light);
}

.dropzone-template-hint {
  margin-top: 0.85rem;
  padding: 0.55rem 1.15rem;
  background: rgba(6, 182, 212, 0.06);
  border: 1px dashed rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: #bae6fd;
  flex-wrap: wrap;
  justify-content: center;
}

.template-quicklink {
  color: var(--accent-cyan-light);
  font-weight: 700;
  text-decoration: underline;
  transition: var(--transition);
}

.template-quicklink:hover {
  color: #ffffff;
}

.hint-separator {
  color: var(--text-muted);
}

.hint-notes {
  color: var(--text-secondary);
}

/* ============================================================================
   VALIDATION & GENERATION BANNER
   ============================================================================ */
.validation-banner {
  margin-top: 1.35rem;
  padding: 1.25rem 1.45rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(6, 182, 212, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), var(--glow-emerald);
  animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.validation-banner-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.validation-status-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.validation-shield-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.validation-headline {
  font-weight: 800;
  color: var(--accent-emerald-light);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.validation-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--mono);
}

.validation-actions-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auto-download-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auto-download-toggle-label input[type="checkbox"] {
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

.validation-checks-strip {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(16, 185, 129, 0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================================================
   STEP 2: DECLARATION REFERENCES — Modular Subcards
   ============================================================================ */
.streamlined-notice-box {
  margin-bottom: 1.35rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.15);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.notice-icon-box {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.notice-content {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.55;
}

.text-highlight {
  color: var(--accent-emerald-light);
  font-weight: 700;
}

/* Tier 1: Primary Document References Hero Banner (Wide Full-Detail) */
.declaration-featured-banner {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.06) 0%, rgba(11, 16, 28, 0.85) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.55rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 25px rgba(6, 182, 212, 0.08);
  transition: var(--transition);
}

.declaration-featured-banner:hover {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), var(--glow-cyan);
}

.featured-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.featured-banner-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: #ffffff;
}

.featured-banner-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.featured-banner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

/* Tier 2: Cargo & Traders Secondary Grid */
.declaration-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.declaration-subcard {
  background: var(--bg-subcard);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: var(--transition);
}

.declaration-subcard:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(16, 24, 40, 0.7);
}

.subcard-traders {
  border-color: rgba(16, 185, 129, 0.2);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, rgba(13, 19, 32, 0.6) 100%);
}

.subcard-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.subcard-icon {
  font-size: 1.05rem;
}

.subcard-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.subcard-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-grid-subcard-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.form-grid-subcard-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group-prominent {
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group-prominent label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.label-badge {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
}

.badge-required {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-commercial {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-manifest {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.label-badge.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.label-badge.badge-container {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan-light);
}

.label-badge.badge-office {
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
}

.label-badge.badge-importer {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 48px;
  font-family: inherit;
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.input-with-icon {
  width: 100%;
  display: block;
}

.form-control-prominent:hover {
  border-color: var(--accent-cyan-light);
}

.form-control-prominent:focus {
  border-color: var(--accent-cyan-light);
  background: rgba(8, 15, 28, 0.98);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25), var(--glow-cyan);
}

.form-control::placeholder {
  color: var(--text-dim);
}

.form-control:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(11, 17, 30, 0.95);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), var(--glow-cyan);
}

.form-control-accent {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-emerald-light);
  letter-spacing: 0.02em;
}

.input-helper-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Collapsible Drawer for Optional System Defaults */
.advanced-drawer {
  margin-top: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(8, 12, 20, 0.6);
  overflow: hidden;
  transition: var(--transition);
}

.advanced-drawer-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.advanced-drawer-summary::-webkit-details-marker {
  display: none;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.summary-gear-icon {
  font-size: 1.15rem;
}

.summary-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.summary-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.summary-chevron {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.advanced-drawer[open] .summary-chevron {
  transform: rotate(90deg);
  color: var(--accent-cyan);
}

.drawer-content {
  padding: 1.15rem 1.35rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 9, 16, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-grid-dense {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.form-grid-addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 52px;
  font-size: 0.8rem;
  line-height: 1.4;
}

#exporterDetails {
  min-height: 110px;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
}

/* ============================================================================
   STEP 3: ITEMS SECTION & EXECUTIVE KPI STATS
   ============================================================================ */
.items-card-header {
  flex-wrap: wrap;
  gap: 0.85rem;
}

.items-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Segmented View Switcher (Cards vs Table) */
.view-toggle-group {
  display: inline-flex;
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

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

.view-toggle-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(99, 102, 241, 0.2));
  color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

/* Executive Metric Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.stat-item {
  background: var(--bg-subcard);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: var(--transition);
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
}

.stat-cyan::before { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.stat-indigo::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.stat-emerald::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-rose::before { background: linear-gradient(90deg, #10b981, #06b6d4); }

.stat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-cyan .stat-value { color: var(--accent-cyan-light); }
.stat-indigo .stat-value { color: #a5b4fc; }
.stat-emerald .stat-value { color: var(--accent-emerald-light); }
.stat-amber .stat-value { color: var(--accent-amber-light); }
.stat-rose .stat-value { color: #34d399; }

/* Filter & Search Toolbar */
.items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.items-search-box {
  position: relative;
  flex: 1;
  max-width: 480px;
  min-width: 250px;
}

.items-search-box input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  transition: var(--transition);
}

.items-search-box input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
  background: rgba(11, 17, 30, 0.95);
}

.items-search-box .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
}

.items-count-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-family: var(--mono);
}

/* ============================================================================
   PREMIUM CARDS GRID & ITEM CARDS
   ============================================================================ */
.items-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.items-empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subcard);
}

[data-theme="light"] .items-empty-state {
  background: #ffffff;
  border-color: #cbd5e1;
}

.item-card {
  position: relative;
  background: linear-gradient(165deg, rgba(16, 23, 40, 0.8) 0%, rgba(10, 14, 25, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  opacity: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: opacity 0.22s ease;
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow:
    0 16px 36px -8px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(6, 182, 212, 0.1);
}

.item-card:hover::before {
  opacity: 1;
}

/* Card Header */
.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.item-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.item-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-family: var(--mono);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.cpc-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan-light);
}

.cpc-pill.cpc-duty-free {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald-light);
}

.cpc-pill.cpc-commercial {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--accent-amber-light);
}

.card-cpc-select {
  padding: 2px 5px;
  font-size: 0.68rem;
  background: rgba(8, 12, 20, 0.8);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}

.item-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  transition: var(--transition);
}

.card-action-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan-light);
}

.card-btn-delete:hover {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
  color: var(--accent-rose) !important;
}

/* Card Field Label */
.card-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  display: block;
}

/* Commercial Description in Card */
.card-desc-input {
  width: 100%;
  font-weight: 600;
  font-size: 0.88rem;
  color: #ffffff;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  transition: var(--transition);
}

.card-desc-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(11, 17, 30, 0.95);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

/* HS Code Section in Card */
.item-card-hs-section {
  background: rgba(8, 12, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-hs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-hs-desc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.card-hs-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.card-hs-input {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-cyan-light);
  letter-spacing: 0.04em;
  background: rgba(11, 17, 28, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  flex: 1;
}

.card-hs-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.card-btn-hs-lookup {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.card-btn-hs-lookup:hover {
  background: rgba(6, 182, 212, 0.22);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Card Metrics Grid */
.item-card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 0.2rem;
}

.card-metric-cell {
  background: rgba(8, 12, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-metric-cell-usd {
  grid-column: span 1;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(8, 12, 20, 0.7));
  border-color: rgba(16, 185, 129, 0.25);
}

.metric-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-metric-input {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--mono);
  width: 100%;
}

.card-metric-input:focus {
  outline: none;
  border-bottom: 1.5px solid var(--accent-cyan);
}

.metric-unit {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.usd-currency-prefix {
  color: var(--accent-emerald-light);
  font-weight: 800;
  font-size: 1.05rem;
}

.usd-value-input {
  color: var(--accent-emerald-light) !important;
  font-size: 1.12rem !important;
  font-weight: 800 !important;
}

/* ============================================================================
   DATA TABLE — Compact Alternative View
   ============================================================================ */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(8, 12, 20, 0.5);
  scrollbar-width: thin;
}

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

.data-table th {
  background: rgba(17, 24, 39, 0.9);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.04);
}

/* License No and DQ Column visibility control (Step 2) */
#items-table.hide-license-cols .col-license-no,
#items-table.hide-license-cols .col-dq,
#items-cards-container.hide-license-cols .col-license-no,
#items-cards-container.hide-license-cols .col-dq {
  display: none !important;
}

#btn-toggle-license-cols.cols-hidden {
  opacity: 0.8;
  border-style: dashed;
}

#btn-toggle-license-cols.cols-visible {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.table-input {
  width: 100%;
  background: rgba(6, 9, 16, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  transition: var(--transition);
}

.table-input:focus {
  border-color: var(--accent-cyan);
  outline: none;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
  background: rgba(11, 17, 30, 0.9);
}

/* Step 2 Table Column Sizing: Smaller Commercial Description, Larger HS Code */
#items-table th.col-desc,
#items-table td.col-desc {
  width: 180px !important;
  max-width: 210px !important;
}

#items-table th.col-hs,
#items-table td.col-hs {
  width: 195px !important;
  min-width: 185px !important;
}

#items-table td.col-hs .table-input.item-hs {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

#items-table td.col-desc .table-input.item-desc {
  width: 100%;
}

/* ============================================================================
   STEP 4: Customs XML OUTPUT & CODE PREVIEW WINDOW
   ============================================================================ */
.xml-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Multi-CPC Split Alert */
.cpc-alert-banner {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.cpc-alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.cpc-alert-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cpc-alert-icon {
  font-size: 1.4rem;
}

.cpc-alert-title {
  color: var(--accent-amber-light);
  font-size: 0.92rem;
}

.cpc-alert-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.cpc-buttons-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.cpc-tab-pills-strip {
  margin-top: 0.95rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* IDE Code Window Frame */
.xml-preview-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #04060d;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.xml-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.15rem;
  background: rgba(15, 20, 32, 0.95);
  border-bottom: 1px solid var(--border-color);
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ctrl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.window-tab-title {
  margin-left: 0.45rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.window-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.schema-badge {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan-light);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.xml-preview {
  margin: 0;
  padding: 1.25rem 1.45rem;
  max-height: 480px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #93c5fd;
  tab-size: 2;
  scrollbar-width: thin;
}

/* ASYCUDA Guide Card */
.asycuda-guide-card {
  margin-top: 1.25rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #93c5fd;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.guide-step-item {
  background: rgba(8, 12, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.guide-step-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-cyan-light);
  text-transform: uppercase;
  font-family: var(--mono);
}

.guide-step-body {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.code-pill {
  color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--mono);
}

/* ============================================================================
   TOAST NOTIFICATION
   ============================================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(11, 16, 28, 0.95);
  backdrop-filter: blur(20px);
  color: #ffffff;
  border: 1px solid var(--accent-emerald);
  padding: 0.95rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), var(--glow-emerald);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================================
   HS CODE FINDER MODAL
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.show {
  display: flex;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9), var(--glow-cyan);
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalCardPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalCardPop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.15rem 1.65rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 12, 20, 0.7);
}

.modal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-hs-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  font-family: var(--mono);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.modal-body {
  padding: 1.35rem 1.65rem;
  overflow-y: auto;
  flex: 1;
}

.hs-modal-wide {
  max-width: 980px !important;
  max-height: 88vh !important;
}

.hs-source-bar-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.75rem;
}

.hs-source-tabs {
  display: flex;
  background: rgba(6, 9, 16, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.hs-source-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.hs-source-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.hs-source-tab.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(99, 102, 241, 0.35));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hs-source-tab.hs-tab-my-codes.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef3c7;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.hs-tab-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hs-tab-count.badge-amber {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.hs-source-meta-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.hs-search-bar-modern {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.hs-search-input-wrap {
  position: relative;
  flex: 1;
}

.hs-modern-input {
  width: 100%;
  padding: 0.75rem 2.4rem 0.75rem 2.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.hs-modern-input:focus {
  border-color: #38bdf8;
  background: rgba(12, 18, 32, 0.95);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.search-lead-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}

.hs-search-clear-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
}

.hs-search-clear-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.hs-online-search-btn {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.hs-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.76rem;
}

.results-count-text {
  font-weight: 700;
  color: var(--text-secondary);
}

.results-priority-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.category-pills-bar {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  scrollbar-width: thin;
}

.category-pill {
  padding: 0.32rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.category-pill:hover {
  background: rgba(6, 182, 212, 0.08);
  color: #ffffff;
  border-color: rgba(6, 182, 212, 0.25);
}

.category-pill.active {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.4);
}

.hs-results-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

/* User Priority Card */
.hs-card-custom {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(18, 23, 34, 0.85) 100%) !important;
  border-left: 4px solid #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.hs-card-custom:hover {
  border-color: #f59e0b !important;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.2) !important;
}

.badge-user-priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.badge-master-catalog {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.hs-official-portals {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.portals-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.portal-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  transition: var(--transition);
}

.portal-chip:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  transform: translateY(-1px);
}

/* ============================================================================
   HS DROPDOWN INLINE SUGGESTIONS
   ============================================================================ */
.hs-input-wrapper {
  position: relative;
  width: 100%;
}

.hs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 360px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(11, 16, 28, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--glow-cyan);
  z-index: 999;
  display: none;
  scrollbar-width: thin;
}

.hs-dropdown.show {
  display: block;
  animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hs-item {
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background 0.15s ease;
}

.hs-item:hover,
.hs-item.selected {
  background: rgba(6, 182, 212, 0.08);
}

.hs-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hs-code-badge {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.hs-unit-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-emerald-light);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.hs-item-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============================================================================
   THEME TOGGLE BUTTON
   ============================================================================ */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.theme-toggle-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  position: relative;
}

.theme-toggle-icon-wrap svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Light Mode Theme Toggle Button */
[data-theme-mode="light"] .theme-toggle-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

[data-theme-mode="light"] .theme-toggle-btn:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

[data-theme-mode="light"] .theme-toggle-btn .icon-sun {
  display: inline-block !important;
  color: #d97706 !important;
  filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.4));
}

[data-theme-mode="light"] .theme-toggle-btn .icon-moon {
  display: none !important;
}

/* Dark Mode Theme Toggle Button */
[data-theme-mode="dark"] .theme-toggle-btn {
  background: rgba(17, 24, 39, 0.82) !important;
  color: #f1f5f9 !important;
  border: 1px solid var(--border-color) !important;
}

[data-theme-mode="dark"] .theme-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: var(--accent-cyan) !important;
}

[data-theme-mode="dark"] .theme-toggle-btn .icon-sun {
  display: none !important;
}

[data-theme-mode="dark"] .theme-toggle-btn .icon-moon {
  display: inline-block !important;
  color: #38bdf8 !important;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

/* Legacy .theme-toggle fallback */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.44rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}

/* ============================================================================
   BADGE TAGS
   ============================================================================ */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.badge-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ============================================================================
   LIGHT MODE OVERRIDES — Crisp, High-Contrast & Easy on the Eyes
   ============================================================================ */
[data-theme="light"] {
  /* Soft, comfortable canvas */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-subcard: #f8fafc;

  /* Crisp structural borders */
  --border-color: rgba(15, 23, 42, 0.12);
  --border-subtle: rgba(15, 23, 42, 0.06);
  --border-hover: rgba(2, 132, 199, 0.4);
  --border-focus: #0284c7;

  /* High-legibility typography */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Vibrant, clear accents */
  --accent-cyan: #0284c7;
  --accent-cyan-light: #0369a1;
  --accent-emerald: #059669;
  --accent-emerald-light: #10b981;
  --accent-amber: #d97706;
  --accent-amber-light: #f59e0b;
  --accent-rose: #e11d48;

  /* Gentle, natural elevation */
  --glass-shadow:
    0 1px 3px 0 rgba(15, 23, 42, 0.05),
    0 8px 24px -4px rgba(15, 23, 42, 0.07),
    0 0 0 1px rgba(15, 23, 42, 0.08);

  --card-hover-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.05),
    0 16px 36px -6px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(2, 132, 199, 0.25);
}

/* Light Mode Background & Grid */
[data-theme-mode="light"] body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme-mode="light"] body::before {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

[data-theme-mode="light"] .ambient-glow {
  opacity: 0.12;
}

/* Header */
[data-theme-mode="light"] .app-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

[data-theme-mode="light"] .brand-text h1,
[data-theme="light"] .brand-text h1,
[data-theme="nordic-snow"] .brand-text h1,
[data-theme="emerald-customs"] .brand-text h1,
[data-theme="royal-gold"] .brand-text h1,
[data-theme="rose-blossom"] .brand-text h1,
[data-theme="desert-sand"] .brand-text h1,
[data-theme="solarized-light"] .brand-text h1 {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
  color: #0f172a !important;
  font-weight: 800 !important;
}

[data-theme-mode="light"] .brand-text p {
  color: #475569;
}

[data-theme-mode="light"] .system-status-pill {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

/* Header Buttons */
[data-theme-mode="light"] .btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

[data-theme-mode="light"] .btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

[data-theme-mode="light"] .btn-ghost {
  color: #64748b;
}

[data-theme-mode="light"] .btn-ghost:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Cards */
[data-theme-mode="light"] .card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: var(--glass-shadow);
}

[data-theme-mode="light"] .card::before {
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.04), transparent);
}

[data-theme-mode="light"] .card:hover {
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: var(--card-hover-shadow);
}

[data-theme-mode="light"] .card-header {
  border-bottom-color: #f1f5f9;
}

[data-theme-mode="light"] .step-heading h2 {
  color: #0f172a;
}

[data-theme-mode="light"] .step-sub {
  color: #475569;
}

/* Step 1: Dropzone */
[data-theme-mode="light"] .dropzone {
  background: #ffffff;
  border-color: #93c5fd;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

[data-theme-mode="light"] .dropzone:hover,
[data-theme-mode="light"] .dropzone.dragover {
  background: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 0 0 24px rgba(2, 132, 199, 0.15);
}

[data-theme-mode="light"] .dropzone-icon-wrapper {
  background: #e0f2fe;
  border-color: #bae6fd;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.12);
}

[data-theme-mode="light"] .dropzone-icon {
  color: #0284c7;
}

[data-theme-mode="light"] .dropzone-title {
  color: #0f172a;
}

[data-theme-mode="light"] .dropzone-sub {
  color: #334155;
}

[data-theme-mode="light"] .format-pill {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .format-pill code {
  background: #e2e8f0;
  color: #0369a1;
}

[data-theme-mode="light"] .dropzone-template-hint {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

[data-theme-mode="light"] .template-quicklink {
  color: #15803d;
}

[data-theme-mode="light"] .template-quicklink:hover {
  color: #047857;
}

[data-theme-mode="light"] .hint-separator {
  color: #86efac;
}

[data-theme-mode="light"] .hint-notes {
  color: #166534;
}

/* Validation Banner */
[data-theme-mode="light"] .validation-banner {
  background: #f0fdf4;
  border-color: #86efac;
  box-shadow: 0 4px 16px rgba(22, 101, 52, 0.08);
}

[data-theme-mode="light"] .validation-headline {
  color: #15803d;
}

[data-theme-mode="light"] .validation-subtext {
  color: #166534;
}

[data-theme-mode="light"] .validation-checks-strip {
  border-top-color: #bbf7d0;
}

[data-theme-mode="light"] .auto-download-toggle-label {
  color: #334155;
}

/* Step 2: Declaration References */
[data-theme-mode="light"] .streamlined-notice-box {
  background: #f0f9ff;
  border-color: #bae6fd;
}

[data-theme-mode="light"] .notice-content {
  color: #0369a1;
}

[data-theme-mode="light"] .text-highlight {
  color: #047857;
}

[data-theme-mode="light"] .declaration-featured-banner {
  background: #f0f9ff;
  border: 1.5px solid #93c5fd;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
}

[data-theme-mode="light"] .declaration-featured-banner:hover {
  border-color: #0284c7;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15);
}

[data-theme-mode="light"] .featured-banner-header {
  border-bottom-color: #bae6fd;
}

[data-theme-mode="light"] .featured-banner-title {
  color: #0f172a;
}

[data-theme-mode="light"] .featured-banner-hint {
  color: #0369a1;
}

[data-theme-mode="light"] .declaration-secondary-grid .declaration-subcard {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

[data-theme-mode="light"] .declaration-secondary-grid .declaration-subcard:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

[data-theme-mode="light"] .subcard-traders {
  border-color: #86efac;
  background: #f0fdf4;
}

[data-theme-mode="light"] .subcard-header {
  border-bottom-color: #f1f5f9;
}

[data-theme-mode="light"] .subcard-title {
  color: #0f172a;
}

[data-theme-mode="light"] .form-group label {
  color: #475569;
}

[data-theme-mode="light"] .label-badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

[data-theme-mode="light"] .badge-required {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

[data-theme-mode="light"] .badge-commercial {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

[data-theme-mode="light"] .badge-manifest {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

[data-theme-mode="light"] .label-badge.badge-success {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

[data-theme-mode="light"] .label-badge.badge-container {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

[data-theme-mode="light"] .label-badge.badge-office {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #ddd6fe;
}

[data-theme-mode="light"] .label-badge.badge-importer {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

[data-theme-mode="light"] .form-control {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  padding: 0.75rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 48px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme-mode="light"] .form-control:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

[data-theme-mode="light"] .form-control:hover {
  border-color: #94a3b8;
}

[data-theme-mode="light"] .form-control:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

[data-theme-mode="light"] .form-control-accent {
  color: #047857;
}

[data-theme-mode="light"] .input-helper-text {
  color: #64748b;
}

/* Advanced Drawer */
[data-theme-mode="light"] .advanced-drawer {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .advanced-drawer-summary {
  background: #f8fafc;
}

[data-theme-mode="light"] .summary-title {
  color: #1e293b;
}

[data-theme-mode="light"] .summary-sub {
  color: #64748b;
}

[data-theme-mode="light"] .summary-chevron {
  color: #64748b;
}

[data-theme-mode="light"] .drawer-content {
  background: #ffffff;
  border-top-color: #e2e8f0;
}

/* Step 3: Stats KPI Bar */
[data-theme-mode="light"] .stat-item {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme-mode="light"] .stat-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .stat-label {
  color: #475569;
}

[data-theme-mode="light"] .stat-cyan .stat-value { color: #0284c7; }
[data-theme-mode="light"] .stat-indigo .stat-value { color: #4338ca; }
[data-theme-mode="light"] .stat-emerald .stat-value { color: #047857; }
[data-theme-mode="light"] .stat-amber .stat-value { color: #b45309; }
[data-theme-mode="light"] .stat-rose .stat-value { color: #059669; }

/* Segmented View Switcher */
[data-theme-mode="light"] .view-toggle-group {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme-mode="light"] .view-toggle-btn {
  color: #475569;
}

[data-theme-mode="light"] .view-toggle-btn:hover {
  color: #0f172a;
}

[data-theme-mode="light"] .view-toggle-btn.active {
  background: #ffffff;
  color: #0284c7;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

/* Filter Toolbar */
[data-theme-mode="light"] .items-search-box input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme-mode="light"] .items-search-box input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

[data-theme-mode="light"] .items-count-badge {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* Item Cards */
[data-theme-mode="light"] .item-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

[data-theme-mode="light"] .item-card:hover {
  border-color: #0284c7;
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.14);
}

[data-theme-mode="light"] .card-action-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme-mode="light"] .card-action-btn:hover {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

[data-theme-mode="light"] .card-btn-delete:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

[data-theme-mode="light"] .cpc-pill.cpc-duty-free {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

[data-theme-mode="light"] .cpc-pill.cpc-commercial {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}

[data-theme-mode="light"] .card-cpc-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .card-field-label {
  color: #475569;
}

[data-theme-mode="light"] .card-desc-input {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme-mode="light"] .card-desc-input:focus {
  background: #ffffff;
  border-color: #0284c7;
}

[data-theme-mode="light"] .item-card-hs-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .card-hs-desc-label {
  color: #475569;
}

[data-theme-mode="light"] .card-hs-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0369a1;
}

[data-theme-mode="light"] .card-hs-input:focus {
  border-color: #0284c7;
}

[data-theme-mode="light"] .card-btn-hs-lookup {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

[data-theme-mode="light"] .card-btn-hs-lookup:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

[data-theme-mode="light"] .card-metric-cell {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .card-metric-cell-usd {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

[data-theme-mode="light"] .card-metric-input {
  color: #0f172a;
}

[data-theme-mode="light"] .metric-label {
  color: #475569;
}

[data-theme-mode="light"] .metric-unit {
  color: #64748b;
}

[data-theme-mode="light"] .usd-currency-prefix,
[data-theme-mode="light"] .usd-value-input {
  color: #047857 !important;
}

/* Compact Table View */
[data-theme-mode="light"] .table-responsive {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .data-table th {
  background: #f8fafc;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
}

[data-theme-mode="light"] .data-table td {
  border-bottom-color: #f1f5f9;
}

[data-theme-mode="light"] .data-table tbody tr:hover {
  background: #f0f9ff;
}

[data-theme-mode="light"] .table-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme-mode="light"] .table-input:focus {
  background: #ffffff;
  border-color: #0284c7;
}

/* Step 4: XML Preview */
[data-theme-mode="light"] .cpc-alert-banner {
  background: #fffbeb;
  border-color: #fcd34d;
}

[data-theme-mode="light"] .cpc-alert-title {
  color: #92400e;
}

[data-theme-mode="light"] .cpc-alert-desc {
  color: #78350f;
}

[data-theme-mode="light"] .xml-preview-container {
  border-color: #1e293b;
  background: #0f172a;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15);
}

[data-theme-mode="light"] .xml-preview-header {
  background: #1e293b;
  border-bottom-color: #334155;
}

[data-theme-mode="light"] .window-tab-title {
  color: #f8fafc;
}

[data-theme-mode="light"] .xml-preview {
  color: #93c5fd;
}

/* ASYCUDA Guide */
[data-theme-mode="light"] .asycuda-guide-card {
  background: #f0f9ff;
  border-color: #bae6fd;
}

[data-theme-mode="light"] .guide-header {
  color: #0369a1;
}

[data-theme-mode="light"] .guide-step-item {
  background: #ffffff;
  border-color: #e0f2fe;
}

[data-theme-mode="light"] .guide-step-num {
  color: #0284c7;
}

[data-theme-mode="light"] .guide-step-body {
  color: #1e293b;
}

[data-theme-mode="light"] .code-pill {
  background: #e0f2fe;
  color: #0369a1;
}

[data-theme-mode="light"] kbd {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Toast */
[data-theme-mode="light"] .toast {
  background: #ffffff;
  color: #0f172a;
  border-color: #10b981;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
}

/* HS Code Modal */
[data-theme-mode="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.6);
}

[data-theme-mode="light"] .modal-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
}

[data-theme-mode="light"] .modal-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .modal-title {
  color: #0f172a;
}

[data-theme-mode="light"] .modal-sub {
  color: #64748b;
}

[data-theme-mode="light"] .modal-close-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme-mode="light"] .modal-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

[data-theme-mode="light"] .hs-source-toggle-group {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme-mode="light"] .hs-source-btn {
  color: #475569;
}

[data-theme-mode="light"] .hs-source-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .hs-source-status {
  color: #64748b;
}

[data-theme-mode="light"] .category-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme-mode="light"] .category-pill:hover {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
}

[data-theme-mode="light"] .category-pill.active {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
}

[data-theme-mode="light"] .hs-modal-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

[data-theme-mode="light"] .hs-modal-card:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.1) !important;
}

[data-theme-mode="light"] .hs-modal-card div {
  color: #0f172a;
}

[data-theme-mode="light"] .hs-dropdown {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
}

[data-theme-mode="light"] .hs-item {
  border-bottom-color: #f1f5f9;
}

[data-theme-mode="light"] .hs-item:hover,
[data-theme-mode="light"] .hs-item.selected {
  background: #f0f9ff;
}

[data-theme-mode="light"] .hs-item-desc {
  color: #334155;
}

[data-theme-mode="light"] .portals-label {
  color: #334155;
}

[data-theme-mode="light"] .portal-chip {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

[data-theme-mode="light"] .portal-chip:hover {
  background: #e0f2fe;
  color: #0284c7;
}

/* Badge Tags in Light Mode */
[data-theme-mode="light"] .badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

[data-theme-mode="light"] .badge-green {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

[data-theme-mode="light"] .badge-amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

/* Light Mode Overrides for Workflow Stepper & Floating Action Bar */
[data-theme-mode="light"] .workflow-stepper-bar {
  background: rgba(248, 250, 252, 0.94);
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .stepper-inner {
  background: #f1f5f9;
  border-color: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme-mode="light"] .step-nav-btn {
  background: transparent;
  border-color: transparent;
}

[data-theme-mode="light"] .step-nav-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: transparent;
}

[data-theme-mode="light"] .step-nav-btn.active {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15), 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme-mode="light"] .step-nav-num {
  background: #e2e8f0;
  color: #64748b;
}

[data-theme-mode="light"] .step-nav-btn.active .step-nav-num {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
}

[data-theme-mode="light"] .step-nav-title {
  color: #64748b;
}

[data-theme-mode="light"] .step-nav-btn.active .step-nav-title {
  color: #0284c7;
  font-weight: 700;
}

[data-theme-mode="light"] .step-nav-btn.active .step-nav-badge {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0284c7;
}

[data-theme-mode="light"] .step-footer-bar .btn-prev-step {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme-mode="light"] .step-footer-bar .btn-prev-step:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme-mode="light"] .floating-action-bar {
  background: rgba(255, 255, 255, 0.96);
  border-top-color: #e2e8f0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .summary-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme-mode="light"] .summary-pill-items {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

[data-theme-mode="light"] .summary-pill-weight {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

[data-theme-mode="light"] .summary-pill-value {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

[data-theme-mode="light"] .btn-sample-demo {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

[data-theme-mode="light"] .btn-sample-demo:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

[data-theme-mode="light"] .data-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .step-footer-bar {
  border-top-color: #e2e8f0;
}

/* ============================================================================
   RESPONSIVE MEDIA QUERIES
   ============================================================================ */
@media (max-width: 1200px) {
  .featured-banner-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .declaration-secondary-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .guide-steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .form-grid-subcard-3,
  .form-grid-subcard-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1.25rem;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-container {
    padding: 0 1rem 3rem;
  }

  .card {
    padding: 1.25rem;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .items-cards-grid {
    grid-template-columns: 1fr;
  }
}

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

  .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }
}

/* ============================================================================
   PERMIT DATABASE STORAGE STYLES
   ============================================================================ */

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-cyan);
  color: #041019;
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: 5px;
  letter-spacing: 0;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* ─── Step 1 Database Auto-Save Banner ─── */
.db-saved-banner {
  margin-top: 1.25rem;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.db-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.db-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

.db-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.db-banner-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pill.badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* ─── Database Fullscreen Modal ─── */
.db-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease forwards;
}

.db-modal-card {
  width: 100%;
  max-width: 1220px;
  height: 88vh;
  max-height: 850px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.db-modal-header {
  padding: 1.15rem 1.6rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subcard);
}

.db-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.35);
  flex-shrink: 0;
}

.db-modal-heading h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-modal-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

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

/* ─── Database Stats Strip ─── */
.db-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.db-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-stat-lbl {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.db-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--accent-cyan);
}

/* ─── Database Toolbar ─── */
.db-modal-toolbar {
  padding: 0.85rem 1.6rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-subcard);
}

.db-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.db-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.db-tab-btn.active {
  background: var(--accent-cyan);
  color: #041019;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
}

.db-tab-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
}

.db-tab-btn.active .db-tab-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #041019;
}

.db-search-field {
  position: relative;
  width: 380px;
  max-width: 100%;
}

.db-search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.db-search-field input {
  width: 100%;
  padding: 0.48rem 2.2rem 0.48rem 2.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.84rem;
  outline: none;
  transition: var(--transition);
}

.db-search-field input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.2);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

/* ─── Modal Body & Tables ─── */
.db-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.6rem;
  position: relative;
}

.db-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.db-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.db-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.db-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
}

.db-file-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--text-primary);
}

.db-file-cell svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.db-code-pill {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  color: var(--accent-cyan-light);
}

.db-money-cell {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-emerald-light);
}

.db-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.db-empty-msg {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Details Drawer ─── */
.db-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 14, 0.75);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}

.db-drawer-card {
  width: 820px;
  max-width: 95%;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.db-drawer-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subcard);
}

.db-drawer-title-group h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.db-drawer-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.db-drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.db-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
}

/* Light Theme Overrides for Database Components */
[data-theme-mode="light"] .db-modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme-mode="light"] .db-modal-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
}

[data-theme-mode="light"] .db-modal-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .db-stats-strip {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .db-stat-box {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .db-modal-toolbar {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .db-search-field input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme-mode="light"] .db-table th {
  background: #f1f5f9;
  color: #475569;
  border-bottom-color: #cbd5e1;
}

[data-theme-mode="light"] .db-table td {
  border-bottom-color: #f1f5f9;
  color: #334155;
}

[data-theme-mode="light"] .db-table tr:hover td {
  background: #f8fafc;
  color: #0f172a;
}

[data-theme-mode="light"] .db-code-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #0369a1;
}

[data-theme-mode="light"] .db-money-cell {
  color: #047857;
}

[data-theme-mode="light"] .db-saved-banner {
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border-color: #a7f3d0;
  box-shadow: 0 10px 25px -10px rgba(16, 185, 129, 0.15);
}

[data-theme-mode="light"] .db-drawer-card {
  background: #ffffff;
  border-left-color: #cbd5e1;
}

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

@keyframes slideLeft {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ============================================================================
   DATABASE SECURITY PASSCODE MODAL (Ctrl + Alt + Shift + D)
   ============================================================================ */
#modal-change-passcode,
#modal-db-passcode {
  z-index: 10050 !important;
}

.passcode-card {
  max-width: 440px !important;
  width: 90% !important;
  height: auto !important;
  max-height: 90vh !important;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-color);
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}

.passcode-icon {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
}

.passcode-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.passcode-prompt {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.passcode-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.passcode-body .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.passcode-input {
  width: 100%;
  padding: 0.65rem 2.75rem 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: var(--transition);
}

.passcode-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.passcode-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.btn-toggle-eye {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-eye:hover {
  color: var(--text-primary);
}

.passcode-error-msg {
  font-size: 0.78rem;
  color: #f87171;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.passcode-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.passcode-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

.passcode-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.passcode-shake {
  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

[data-theme-mode="light"] .passcode-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

[data-theme-mode="light"] .passcode-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme-mode="light"] .passcode-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme-mode="light"] .passcode-hint kbd {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* ─── Database Form: Store Uploads Toggle Switch ─── */
.db-store-toggle-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.32rem 0.75rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  user-select: none;
  transition: var(--transition);
}

.db-store-toggle-box:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--border-hover);
}

.db-store-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.db-store-toggle-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

.db-store-toggle-title svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.db-store-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-block;
  width: fit-content;
  padding: 1px 6px;
  border-radius: 999px;
  transition: var(--transition);
}

.db-store-badge.badge-on {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.db-store-badge.badge-off {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.db-toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.db-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.db-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.db-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.db-toggle-switch input:checked + .db-toggle-slider {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.db-toggle-switch input:focus + .db-toggle-slider {
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.4);
}

.db-toggle-switch input:checked + .db-toggle-slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* Light Theme Overrides */
[data-theme-mode="light"] .db-store-toggle-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme-mode="light"] .db-store-toggle-box:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

[data-theme-mode="light"] .db-toggle-slider {
  background: #cbd5e1;
  border-color: #94a3b8;
}

[data-theme-mode="light"] .db-store-badge.badge-off {
  background: #e2e8f0;
  color: #64748b;
  border-color: #cbd5e1;
}

/* ─── International Customs Tariff (HS) Finder Tools ─── */
.hs-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-gdce-official {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(220, 38, 38, 0.3) !important;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-gdce-official:hover {
  background: rgba(220, 38, 38, 0.22) !important;
  border-color: rgba(220, 38, 38, 0.5) !important;
  color: #ffffff !important;
}

.hs-tool-panel {
  margin-bottom: 1rem;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hs-tool-panel-inner {
  background: var(--bg-subcard);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.hs-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}

.hs-tool-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.hs-tool-title svg {
  color: var(--accent-cyan);
}

.hs-tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-panel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-close-panel:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* HS Import Dropzone */
.hs-import-dropzone {
  border: 2px dashed rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: rgba(6, 182, 212, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.hs-import-dropzone:hover,
.hs-import-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.hs-import-dropzone svg {
  color: var(--accent-cyan);
}

.hs-import-drop-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hs-import-main-msg {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hs-import-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hs-import-status-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.hs-import-status-msg.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hs-import-status-msg.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* HS Add Single Form */
.hs-add-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.hs-col-span-2 {
  grid-column: span 2;
}

.hs-col-span-3 {
  grid-column: span 3;
}

.hs-duty-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.hs-source-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.portal-official {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
  font-weight: 600;
}

.portal-official:hover {
  background: rgba(220, 38, 38, 0.22) !important;
  color: #ffffff !important;
}

/* Light Theme Overrides for HS Tools */
[data-theme-mode="light"] .hs-tool-panel-inner {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .hs-import-dropzone {
  background: #f8fafc;
  border-color: #94a3b8;
}

[data-theme-mode="light"] .hs-source-badge {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* ─── Quick Daily Commodities Presets Bar ─── */
.hs-daily-presets-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0.35rem 0 0.6rem 0;
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 0.6rem;
}

.daily-presets-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 4px;
}

.daily-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.daily-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.daily-chip.active {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
  font-weight: 600;
}

[data-theme-mode="light"] .daily-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
/* ─── Container Size Quick-Select Pills ─── */
.container-size-pills {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.container-size-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.container-size-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  transform: translateY(-1px);
}

.container-size-pill.active {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(129, 140, 248, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

[data-theme-mode="light"] .container-size-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .container-size-pill:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #4338ca;
}

[data-theme-mode="light"] .container-size-pill.active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ─── Delivery Terms & Place Quick-Select Pills ─── */
.delivery-term-pills {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.delivery-term-pill,
.delivery-place-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.delivery-term-pill:hover,
.delivery-place-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  transform: translateY(-1px);
}

.delivery-term-pill.active {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(129, 140, 248, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

.delivery-place-pill {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

.delivery-place-pill:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
  color: #ffffff;
}

.delivery-place-pill.active {
  background: rgba(16, 185, 129, 0.32);
  border-color: rgba(52, 211, 153, 0.7);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.delivery-pill-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 0.15rem;
}

[data-theme-mode="light"] .delivery-term-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .delivery-term-pill:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #4338ca;
}

[data-theme-mode="light"] .delivery-term-pill.active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

[data-theme-mode="light"] .delivery-place-pill {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

[data-theme-mode="light"] .delivery-place-pill:hover {
  background: #d1fae5;
  border-color: #34d399;
  color: #047857;
}

[data-theme-mode="light"] .delivery-place-pill.active {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* ─── Place of Loading Quick-Select Pills ─── */
.loading-place-pills {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.loading-place-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.loading-place-pill:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.45);
  color: #bae6fd;
  transform: translateY(-1px);
}

.loading-place-pill.active {
  background: rgba(14, 165, 233, 0.28);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.35);
}

[data-theme-mode="light"] .loading-place-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .loading-place-pill:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

[data-theme-mode="light"] .loading-place-pill.active {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* ─── Place of Discharge Quick-Select Pills ─── */
.discharge-place-pills {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.discharge-place-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.discharge-place-pill:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
  transform: translateY(-1px);
}

.discharge-place-pill.active {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(251, 191, 36, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

[data-theme-mode="light"] .discharge-place-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .discharge-place-pill:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

[data-theme-mode="light"] .discharge-place-pill.active {
  background: #d97706;
  border-color: #b45309;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

/* ─── Transport Departure Quick-Select Pills ─── */
.transport-departure-pills {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.transport-departure-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.transport-departure-pill:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
  transform: translateY(-1px);
}

.transport-departure-pill.active {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(192, 132, 252, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

[data-theme-mode="light"] .transport-departure-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .transport-departure-pill:hover {
  background: #f3e8ff;
  border-color: #c084fc;
  color: #7e22ce;
}

[data-theme-mode="light"] .transport-departure-pill.active {
  background: #9333ea;
  border-color: #7e22ce;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.3);
}

/* ─── Clearance Office Code Quick-Select Pills ─── */
.office-code-pills {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.office-code-pill {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.office-code-pill:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.45);
  color: #99f6e4;
  transform: translateY(-1px);
}

.office-code-pill.active {
  background: rgba(20, 184, 166, 0.28);
  border-color: rgba(45, 212, 191, 0.65);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.35);
}

[data-theme-mode="light"] .office-code-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .office-code-pill:hover {
  background: #ccfbf1;
  border-color: #2dd4bf;
  color: #0f766e;
}

[data-theme-mode="light"] .office-code-pill.active {
  background: #0d9488;
  border-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* ─── Grouped Clearance Office Container ─── */
.form-office-group {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 8px);
  padding: 0.9rem 1rem;
  margin-top: 0.25rem;
}

.office-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.office-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.office-group-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.office-group-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.3fr);
  gap: 1rem;
  align-items: flex-start;
}

@media (max-width: 820px) {
  .office-group-grid {
    grid-template-columns: 1fr;
  }
}

[data-theme-mode="light"] .form-office-group {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* ============================================================================
   MAIN FUNCTIONS EXECUTIVE SHORTCUTS & DEDICATED FORMS SYSTEM
   ============================================================================ */

/* ─── Hero Container ─── */
.main-functions-hero {
  margin-bottom: 1.75rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75), rgba(30, 41, 59, 0.45));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.main-functions-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.6), rgba(16, 185, 129, 0.6), rgba(99, 102, 241, 0.6), transparent);
}

.hero-header-row {
  margin-bottom: 1.25rem;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.hero-headline {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.hero-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ─── 3 Big Shortcuts Deck Grid ─── */
.big-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .big-shortcuts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ─── Big Shortcut Card ─── */
.big-shortcut-card {
  position: relative;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 16px);
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  user-select: none;
}

.big-shortcut-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.big-shortcut-card.card-permit::before {
  background: linear-gradient(90deg, #06b6d4, #0284c7);
}

.big-shortcut-card.card-excel::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.big-shortcut-card.card-commercial::before {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.big-shortcut-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

/* Variant Hover & Glow */
.big-shortcut-card.card-permit:hover {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 16px 36px rgba(6, 182, 212, 0.2), 0 0 25px rgba(6, 182, 212, 0.12);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.big-shortcut-card.card-excel:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.2), 0 0 25px rgba(16, 185, 129, 0.12);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.big-shortcut-card.card-commercial:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.2), 0 0 25px rgba(99, 102, 241, 0.12);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

/* Active Selected State */
.big-shortcut-card.active {
  box-shadow: 0 0 0 2px var(--card-accent-border, #38bdf8), 0 16px 36px rgba(0, 0, 0, 0.3);
}

.big-shortcut-card.card-permit.active {
  --card-accent-border: #06b6d4;
  border-color: #06b6d4;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.big-shortcut-card.card-excel.active {
  --card-accent-border: #10b981;
  border-color: #10b981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.big-shortcut-card.card-commercial.active {
  --card-accent-border: #6366f1;
  border-color: #6366f1;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
}

/* Shortcut Card Elements */
.shortcut-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shortcut-num-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs, 6px);
  text-transform: uppercase;
}

.badge-permit {
  background: rgba(6, 182, 212, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

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

.badge-commercial {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.shortcut-type-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.shortcut-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.big-shortcut-card:hover .shortcut-icon-wrap {
  transform: scale(1.08) rotate(-2deg);
}

.icon-cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(2, 132, 199, 0.35));
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.icon-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.icon-indigo {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.35));
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.shortcut-content {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.shortcut-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin: 0;
}

.shortcut-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.shortcut-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.sc-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
}

.shortcut-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-permit .shortcut-action-bar { color: #38bdf8; }
.card-excel .shortcut-action-bar { color: #34d399; }
.card-commercial .shortcut-action-bar { color: #a5b4fc; }

.btn-shortcut-arrow {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.big-shortcut-card:hover .btn-shortcut-arrow {
  transform: translateX(5px);
}

.shortcut-active-indicator {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  position: absolute;
  bottom: 0.75rem;
  right: 1.25rem;
}

.big-shortcut-card.active .shortcut-active-indicator {
  display: flex;
}

.ind-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: livePulse 1.8s infinite ease-in-out;
}

.card-permit .ind-dot { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }
.card-excel .ind-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }
.card-commercial .ind-dot { background: #6366f1; box-shadow: 0 0 8px #6366f1; }

/* ─── Dedicated Form Switcher Bar ─── */
.forms-view-switch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 1.25rem;
  position: sticky;
  top: 72px;
  z-index: 45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.forms-switch-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.forms-segmented-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs, 6px);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.form-switch-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.form-switch-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.form-switch-btn[data-form="permit"].active {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.45);
  color: #38bdf8;
}

.form-switch-btn[data-form="excel"].active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.form-switch-btn[data-form="commercial"].active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
}

.form-switch-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
}

/* ─── Forms Workspace Display Controller: Always Show All Forms ─── */
.forms-workspace-container .function-form-card {
  display: block !important;
  margin-bottom: 2rem;
}

.forms-workspace-container[data-focused-form="permit"] #form-section-permit {
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.4), 0 8px 32px rgba(6, 182, 212, 0.15);
}

.forms-workspace-container[data-focused-form="excel"] #form-section-excel {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 8px 32px rgba(16, 185, 129, 0.15);
}

.forms-workspace-container[data-focused-form="commercial"] #form-section-commercial {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4), 0 8px 32px rgba(99, 102, 241, 0.15);
}

.form-switch-btn[data-form="all"].active,
.form-switch-btn.form-switch-all.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.5);
  color: #c7d2fe;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

/* ─── Function Form Card Aesthetics ─── */
.function-form-card {
  border-radius: var(--radius-lg, 16px);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.function-form-card.form-permit {
  border-left: 4px solid #06b6d4;
}

.function-form-card.form-excel {
  border-left: 4px solid #10b981;
}

.function-form-card.form-commercial {
  border-left: 4px solid #6366f1;
}

.function-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.form-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-heading-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-heading-row h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

/* ─── Fast Jump Card (In Excel Form) ─── */
.excel-jump-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.4rem;
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.5));
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.jump-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.jump-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #34d399;
}

.jump-card-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-jump-items {
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid #34d399;
  color: #ffffff;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-jump-items:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ─── Smooth Highlight Pulse ─── */
@keyframes formHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.8);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.35), 0 0 35px rgba(56, 189, 248, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.form-highlight-pulse {
  animation: formHighlightPulse 1.2s ease-out;
}

/* ─── Form Fields Deck ─── */
.form-fields-deck {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.form-deck-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.form-col-full {
  grid-column: 1 / -1;
}

/* ─── Light Mode Overrides ─── */
[data-theme-mode="light"] .main-functions-hero {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .big-shortcut-card {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

[data-theme-mode="light"] .big-shortcut-card:hover {
  background: #ffffff;
}

[data-theme-mode="light"] .big-shortcut-card.card-permit:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

[data-theme-mode="light"] .big-shortcut-card.card-excel:hover {
  background: #f0fdf4;
  border-color: #059669;
}

[data-theme-mode="light"] .big-shortcut-card.card-commercial:hover {
  background: #eef2ff;
  border-color: #4f46e5;
}

[data-theme-mode="light"] .big-shortcut-card.active {
  background: #ffffff;
}

[data-theme-mode="light"] .big-shortcut-card.card-permit.active {
  background: #f0f9ff;
  border-color: #0284c7;
}

[data-theme-mode="light"] .big-shortcut-card.card-excel.active {
  background: #f0fdf4;
  border-color: #059669;
}

[data-theme-mode="light"] .big-shortcut-card.card-commercial.active {
  background: #eef2ff;
  border-color: #4f46e5;
}

[data-theme-mode="light"] .sc-tag {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme-mode="light"] .forms-view-switch-bar {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme-mode="light"] .forms-segmented-nav {
  background: #e2e8f0;
}

[data-theme-mode="light"] .form-switch-btn {
  color: #475569;
}

[data-theme-mode="light"] .form-switch-btn.active {
  background: #ffffff;
  color: #0f172a;
}

[data-theme-mode="light"] .excel-jump-card {
  background: #f0fdf4;
  border-color: #86efac;
}

[data-theme-mode="light"] .jump-card-title {
  color: #065f46;
}

[data-theme-mode="light"] .jump-card-sub {
  color: #374151;
}

/* ============================================================================
   HIGH-TECH CUSTOMS FUNCTION SHORTCUTS POPUP (CYBER HUD MATRIX)
   ============================================================================ */

/* ─── Header & Hero Launcher Buttons ─── */
.btn-tech-glow {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.22);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-tech-glow:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.32), rgba(99, 102, 241, 0.4));
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tech-kbd-badge-nav {
  font-family: var(--mono, monospace);
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-xs, 4px);
  color: #a5f3fc;
  letter-spacing: 0.05em;
}

.hero-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.btn-tech-hero-launcher {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #10b981 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-tech-hero-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.55);
}

.tech-kbd-badge {
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-xs, 4px);
  color: #ffffff;
  letter-spacing: 0.05em;
}

/* ─── Executive Gateway Modal Overlay (New UI, No Close Button) ─── */
.gateway-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(3, 7, 18, 0.9);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: gatewayFadeIn 0.28s ease-out;
}

@keyframes gatewayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gateway-modal-card {
  position: relative;
  width: 100%;
  max-width: 1120px;
  max-height: 94vh;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.97) 0%, rgba(8, 12, 24, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(6, 182, 212, 0.16);
  display: flex;
  flex-direction: column;
  animation: gatewayCardScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gateway-modal-card::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

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

/* ─── Gateway Header (Close Button Enabled) ─── */
.gateway-header {
  position: relative;
  padding: 1.35rem 4.5rem 1.15rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}

.gateway-close-btn {
  position: absolute;
  top: 1.15rem;
  right: 1.35rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
}

.gateway-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffffff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.4);
}

.gateway-close-btn:active {
  transform: scale(0.95);
}

.gateway-emblem-badge {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, #0284c7, #06b6d4, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.emblem-halo {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1.5px dashed rgba(6, 182, 212, 0.45);
  animation: gatewayRotateRing 14s linear infinite;
  pointer-events: none;
}

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

.gateway-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gateway-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono, monospace);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-cyan, #06b6d4);
  text-transform: uppercase;
}

.gateway-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
  animation: livePulse 1.6s infinite ease-in-out;
}

.gateway-hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.gateway-hero-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* ─── Gateway Portals Grid ─── */
.gateway-portals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 1.35rem 2rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gateway-portals-grid::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 980px) {
  .gateway-portals-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
}

/* ─── Gateway Portal Card ─── */
.gateway-portal-card {
  position: relative;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.95rem;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.gateway-portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.gateway-portal-card:focus-visible {
  outline: 2px solid #00f0ff;
  outline-offset: 3px;
}

/* Color Variant Hover States */
.portal-card-permit {
  border-color: rgba(6, 182, 212, 0.35);
}
.portal-card-permit:hover {
  border-color: #06b6d4;
  box-shadow: 0 20px 45px rgba(6, 182, 212, 0.25), 0 0 35px rgba(6, 182, 212, 0.15);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.portal-card-excel {
  border-color: rgba(16, 185, 129, 0.35);
}
.portal-card-excel:hover {
  border-color: #10b981;
  box-shadow: 0 20px 45px rgba(16, 185, 129, 0.25), 0 0 35px rgba(16, 185, 129, 0.15);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.portal-card-commercial {
  border-color: rgba(99, 102, 241, 0.35);
}
.portal-card-commercial:hover {
  border-color: #6366f1;
  box-shadow: 0 20px 45px rgba(99, 102, 241, 0.25), 0 0 35px rgba(99, 102, 241, 0.15);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%);
}

/* ─── Portal Card Elements ─── */
.portal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs, 4px);
  text-transform: uppercase;
}

.badge-permit-glow { background: rgba(6, 182, 212, 0.2); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.4); }
.badge-excel-glow { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-commercial-glow { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.4); }

.portal-format-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Portal Hero Icon ─── */
.portal-icon-hero {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0.15rem 0;
  transition: transform 0.28s ease;
}

.gateway-portal-card:hover .portal-icon-hero {
  transform: scale(1.1) rotate(-3deg);
}

.icon-permit-hero {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(2, 132, 199, 0.38));
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.3);
}

.icon-excel-hero {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(5, 150, 105, 0.38));
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.icon-commercial-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(79, 70, 229, 0.38));
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
}

/* ─── Portal Info & Khmer Subtitle ─── */
.portal-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.portal-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.015em;
}

.portal-khmer {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.01em;
}

.portal-card-excel .portal-khmer { color: #34d399; }
.portal-card-commercial .portal-khmer { color: #a5b4fc; }

.portal-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.42;
  margin: 0.25rem 0 0;
}

/* ─── Portal Chips ─── */
.portal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.p-chip {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* ─── Portal Action Buttons ─── */
.btn-gateway-action {
  width: 100%;
  padding: 0.68rem 1rem;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.22s ease;
  border: 1px solid transparent;
}

.btn-act-permit {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(2, 132, 199, 0.35));
  border-color: rgba(6, 182, 212, 0.5);
  color: #38bdf8;
}
.gateway-portal-card.portal-card-permit:hover .btn-act-permit {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.45);
}

.btn-act-excel {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}
.gateway-portal-card.portal-card-excel:hover .btn-act-excel {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
}

.btn-act-commercial {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.35));
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
}
.gateway-portal-card.portal-card-commercial:hover .btn-act-commercial {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}

.btn-act-arrow {
  font-size: 1.05rem;
  transition: transform 0.2s ease;
}

.gateway-portal-card:hover .btn-act-arrow {
  transform: translateX(4px);
}

/* ─── Gateway Footer (No Close Button) ─── */
.gateway-footer {
  padding: 0.85rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.gateway-footer-hints {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.gateway-footer-hints kbd {
  font-family: var(--mono, monospace);
  font-size: 0.72rem;
  padding: 0.12rem 0.38rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: var(--text-primary);
}

.gateway-manual-link {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.gateway-manual-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.gateway-link-arrow {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.gateway-manual-link:hover .gateway-link-arrow {
  transform: translateX(3px);
}

.gateway-promo-link {
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}

.gateway-promo-link:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.promo-nav-link {
  border-color: rgba(0, 240, 255, 0.35) !important;
  color: #f1f5f9 !important;
  background: rgba(0, 240, 255, 0.08) !important;
  transition: all 0.2s ease !important;
}

.promo-nav-link:hover {
  background: rgba(0, 240, 255, 0.18) !important;
  border-color: #00f0ff !important;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35) !important;
}

/* ─── Light Mode Overrides for Gateway Modal ─── */
[data-theme-mode="light"] .gateway-modal-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.25);
}

[data-theme-mode="light"] .gateway-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme-mode="light"] .gateway-hero-title {
  color: #0f172a;
}

[data-theme-mode="light"] .gateway-hero-sub {
  color: #475569;
}

[data-theme-mode="light"] .gateway-portal-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .gateway-portal-card:hover {
  background: #ffffff;
}

[data-theme-mode="light"] .portal-card-permit:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

[data-theme-mode="light"] .portal-card-excel:hover {
  background: #f0fdf4;
  border-color: #059669;
}

[data-theme-mode="light"] .portal-card-commercial:hover {
  background: #eef2ff;
  border-color: #4f46e5;
}

[data-theme-mode="light"] .p-chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme-mode="light"] .gateway-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme-mode="light"] .gateway-manual-link {
  color: #0284c7;
}

/* ============================================================================
   USER AUTHENTICATION, CREDIT PILL, AND DASHBOARD STYLING
   ============================================================================ */

/* Top Navigation Auth Bar */
.user-auth-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  z-index: 5;
}

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-auth-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  padding: 0.22rem 0.45rem 0.22rem 0.35rem;
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

[data-theme-mode="light"] .user-profile-badge {
  background: rgba(241, 245, 249, 0.95);
  border-color: #94a3b8;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Glowing Credit Pill Button */
.credit-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

.credit-pill-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.35));
  border-color: #10b981;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.credit-spark {
  color: #fbbf24;
  animation: pulseSpark 2s infinite ease-in-out;
}

@keyframes pulseSpark {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #f59e0b); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 6px #fbbf24); }
}

.credit-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: #34d399;
}

[data-theme-mode="light"] .credit-count {
  color: #059669;
}

.credit-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* User Name / Role Launcher Button */
.user-name-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.user-name-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme-mode="light"] .user-name-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.user-display-name {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
}

.user-avatar-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.user-role-badge.role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
}

.btn-logout {
  color: var(--text-muted);
  padding: 0.35rem;
  border-radius: 50%;
}

.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

/* ============================================================================
   PREMIUM AUTH MODAL STYLES (EXECUTIVE GRADE)
   ============================================================================ */
.auth-modal-card {
  max-width: 440px;
  width: 92%;
  height: auto !important;
  max-height: 90vh !important;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(8, 14, 26, 0.98) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 35px rgba(2, 132, 199, 0.2);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  overflow: hidden;
  position: relative;
  animation: authModalEntrance 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authModalEntrance {
  0% { transform: scale(0.96) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.auth-modal-header {
  padding: 1.5rem 1.5rem 1.15rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.12) 0%, transparent 100%);
  position: relative;
}

.auth-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.4), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}

.auth-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}

.auth-tabs-nav {
  display: flex;
  padding: 0.5rem 1.25rem;
  background: rgba(3, 7, 18, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 0.5rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.auth-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(56, 189, 248, 0.15));
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
}

.auth-form-body {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.auth-form .form-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}

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

.auth-input-icon {
  position: absolute;
  left: 0.85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.auth-input-group:focus-within .auth-input-icon {
  color: #38bdf8;
}

.auth-input-group .form-control {
  width: 100%;
  padding: 0.72rem 2.6rem 0.72rem 2.5rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #f8fafc;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.auth-input-group .form-control:focus {
  outline: none;
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 0 15px rgba(2, 132, 199, 0.15);
}

.auth-pw-toggle-btn {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: #64748b;
  padding: 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 2;
}

.auth-pw-toggle-btn:hover {
  color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
}

.auth-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(3, 7, 18, 0.3);
}

.auth-btn-cancel {
  padding: 0.65rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-btn-cancel:hover {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.auth-btn-submit {
  flex: 1;
  margin-left: 0.75rem;
  padding: 0.72rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #00f0ff 100%);
  background-size: 200% 200%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}

.auth-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(2, 132, 199, 0.5);
  background-position: 100% 0;
}

.auth-btn-submit:active {
  transform: translateY(0);
}

.auth-register-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.8rem;
  line-height: 1.45;
}

.auth-register-note strong {
  color: #ffffff;
}

.auth-error-msg {
  padding: 0.75rem 0.95rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-success-msg {
  padding: 0.75rem 0.95rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 600;
}

[data-theme-mode="light"] .auth-modal-card {
  background: #ffffff !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.25), 0 0 25px rgba(2, 132, 199, 0.12) !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-modal-header {
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.08) 0%, #f8fafc 100%) !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme-mode="light"] .auth-modal-card #auth-modal-title {
  color: #0f172a !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-tabs-nav {
  background: #f1f5f9 !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-tab-btn {
  color: #64748b !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-tab-btn.active {
  color: #0284c7 !important;
  background: #ffffff !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-form .form-label {
  color: #475569 !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-input-group .form-control {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-input-group .form-control:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-footer {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-btn-cancel {
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}

[data-theme-mode="light"] .auth-modal-card .auth-btn-cancel:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* ============================================================================
   DASHBOARD MODAL STYLES (User & Admin)
   ============================================================================ */
.dashboard-modal-card {
  max-width: 960px;
  width: 95%;
  max-height: 88vh;
}

.dashboard-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.05);
}

/* User Credit Hero */
.dash-credit-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
}

.credit-hero-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.credit-hero-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.credit-hero-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hero-spark {
  font-size: 2rem;
  color: #fbbf24;
}

.credit-hero-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.credit-hero-unit {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.credit-hero-policy {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  display: inline-block;
}

.credit-hero-profile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  border-left: 1px solid var(--border-color);
  padding-left: 1.25rem;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
}

.profile-row .p-label {
  color: var(--text-muted);
  font-weight: 600;
  width: 70px;
}

.profile-row .p-val {
  color: var(--text-primary);
  font-weight: 700;
}

.profile-notice {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  padding: 0.45rem 0.65rem;
  border-radius: 4px;
}

/* Dashboard Section & Tables */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dash-section-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tx-table-wrap, .admin-table-wrap {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* ============================================================================
   PREMIUM EXECUTIVE ADMIN DASHBOARD STYLES
   ============================================================================ */
.admin-dash-card {
  max-width: 1140px;
  width: 96%;
  max-height: 90vh;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(9, 14, 26, 0.99) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.85), 0 0 50px rgba(6, 182, 212, 0.1);
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding: 1.1rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-badge-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.25) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.admin-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  color: #34d399;
}

.admin-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: adminPulse 1.8s infinite;
}

@keyframes adminPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 12px #34d399; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Executive 5-Card KPI Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.admin-kpi-card {
  position: relative;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5);
}

.admin-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-glow, linear-gradient(90deg, #38bdf8, #818cf8));
}

.admin-kpi-card.kpi-users::before { --kpi-glow: linear-gradient(90deg, #38bdf8, #0284c7); }
.admin-kpi-card.kpi-active::before { --kpi-glow: linear-gradient(90deg, #34d399, #059669); }
.admin-kpi-card.kpi-spent::before { --kpi-glow: linear-gradient(90deg, #fbbf24, #d97706); }
.admin-kpi-card.kpi-permits::before { --kpi-glow: linear-gradient(90deg, #a78bfa, #7c3aed); }
.admin-kpi-card.kpi-usd::before { --kpi-glow: linear-gradient(90deg, #38bdf8, #10b981); }

.admin-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.admin-kpi-title {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.admin-kpi-icon {
  font-size: 1.1rem;
  opacity: 0.85;
}

.admin-kpi-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  color: #f8fafc;
}

.admin-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Executive Navigation Tabs */
.admin-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0 0.75rem 0;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-tab-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.22) 0%, rgba(6, 182, 212, 0.15) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.admin-tab-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.admin-tab-btn.active .admin-tab-badge {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

/* Smart Admin Toolbars */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 280px;
}

.admin-search-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

.admin-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  padding: 0.48rem 0.85rem 0.48rem 2.35rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.84rem;
  transition: border-color 0.18s ease;
}

.admin-search-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.admin-filter-select {
  padding: 0.48rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
}

.admin-filter-select:focus {
  outline: none;
  border-color: #38bdf8;
}

.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* User & Permit Rows Styling */
.admin-table-wrap {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 28, 0.6);
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 2;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 0.75rem 0.9rem;
  border-bottom: 2px solid rgba(56, 189, 248, 0.25);
}

.data-table tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  font-size: 0.83rem;
}

.data-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

/* User cell */
.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.admin-avatar.avatar-admin {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: rgba(245, 158, 11, 0.4);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
}

.admin-user-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #f1f5f9;
}

.admin-user-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Quick 1-Click Credit Buttons */
.admin-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-quick-topup {
  padding: 0.22rem 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-topup:hover {
  background: #10b981;
  color: #042f2e;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.btn-quick-topup.topup-100 {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.btn-quick-topup.topup-100:hover {
  background: #38bdf8;
  color: #082f49;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Permit Badges & Styles */
.permit-num-pill {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: inline-block;
}

.permit-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  margin-left: 0.35rem;
}

.type-pdf {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.type-excel {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.permit-item-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  display: inline-block;
}

/* Add User Form Presets */
.preset-credit-pills {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.preset-pill-btn {
  padding: 0.25rem 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Inspector Modal for Permit Items */
.inspect-permit-card {
  max-width: 980px;
  width: 95%;
  max-height: 88vh;
  background: linear-gradient(180deg, #0f172a 0%, #0a0f1d 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.inspect-header-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1rem;
}

.inspect-header-cell .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.inspect-header-cell .val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 0.15rem;
}

/* Adjust Credits Popover Dialog */
.credit-adjust-card {
  max-width: 500px;
  width: 92%;
  background: linear-gradient(180deg, #0f172a 0%, #0a0f1d 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.adjust-user-summary {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  font-size: 0.85rem;
}

.adjust-user-summary .val.highlight {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: #34d399;
  font-size: 1.15rem;
}

.adjust-mode-selector {
  display: flex;
  gap: 0.5rem;
}

.mode-radio-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.mode-radio-btn input {
  display: none;
}

.mode-radio-btn.active {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.adjust-form-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.adjust-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

.badge-tx-deduct {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.badge-tx-add {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.btn-credit-action {
  padding: 0.25rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 4px;
}

@media (max-width: 992px) {
  .admin-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dash-credit-hero {
    grid-template-columns: 1fr;
  }
  .credit-hero-profile {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 1rem;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .create-form-grid {
    grid-template-columns: 1fr;
  }
  .inspect-header-info {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── ASYCUDA XML Item Setup Modal & Triggers ─── */
.xml-setup-modal-card {
  max-width: 980px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.xml-setup-modal-body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  max-height: calc(90vh - 170px);
}

.xml-setup-item-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.75rem 1.5rem;
}

.target-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.target-banner-icon {
  font-size: 1.2rem;
}

.target-desc-preview {
  font-weight: 600;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xml-preset-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.xml-preset-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.xml-preset-dropdown {
  flex: 1;
  min-width: 260px;
  max-width: 520px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
}

.xml-preset-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.xml-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.xml-setup-card {
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 10px);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.xml-setup-card-hscode {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), rgba(217, 119, 6, 0.02));
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.12), 0 2px 8px rgba(245, 158, 11, 0.08);
  grid-column: span 2;
}

.xml-setup-card-hscode .xml-setup-fields {
  grid-template-columns: 1fr 1fr;
}

.xml-setup-card-hscode .xml-setup-card-header {
  border-bottom-color: rgba(245, 158, 11, 0.25);
}

.btn-save-user-hs:hover {
  opacity: 1 !important;
  transform: scale(1.2);
}

.user-hs-pill {
  animation: userHsPulse 2s ease-in-out infinite;
}

@keyframes userHsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.xml-setup-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-sec-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.card-sec-title h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.card-sec-title p {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.xml-setup-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.xml-tag-hint {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  color: var(--accent-indigo, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 0.35rem;
  font-weight: 500;
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: block;
}

.xml-setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-left-actions,
.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-item-xml-setup {
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-item-xml-setup:hover {
  transform: scale(1.08);
  color: var(--accent-indigo, #6366f1) !important;
}

@media (max-width: 820px) {
  .xml-setup-grid {
    grid-template-columns: 1fr;
  }
  .xml-setup-card-hscode {
    grid-column: span 1;
  }
  .xml-setup-card-hscode .xml-setup-fields {
    grid-template-columns: 1fr;
  }
  .xml-setup-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .footer-right-actions {
    justify-content: flex-end;
  }
}

/* ============================================================================
   LIQUID GLASS, ULTRA-SMOOTH, FAST, SAFETY & PROFESSIONAL DESIGN SYSTEM
   Customs SAD Enterprise Tier — Next-Gen GDCE Terminal UI
   ============================================================================ */

/* ─── Global Liquid Glass Token Variables ─── */
:root {
  --lg-glass-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.72) 0%, rgba(10, 15, 29, 0.85) 100%);
  --lg-glass-bg-hover: linear-gradient(135deg, rgba(22, 33, 58, 0.82) 0%, rgba(15, 23, 42, 0.92) 100%);
  --lg-glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --lg-glass-border-hover: 1px solid rgba(56, 189, 248, 0.45);
  --lg-glass-specular: inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2);
  --lg-glass-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --lg-glass-hover-shadow: 0 24px 55px -10px rgba(0, 0, 0, 0.65), inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.35), 0 0 30px rgba(6, 182, 212, 0.18);
  --lg-glass-blur: blur(24px) saturate(190%) contrast(105%);
  --lg-input-bg: rgba(8, 13, 24, 0.72);
  --lg-input-border: 1.5px solid rgba(255, 255, 255, 0.12);
  --lg-input-focus: 0 0 0 3.5px rgba(6, 182, 212, 0.25), 0 6px 20px rgba(6, 182, 212, 0.18), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  --lg-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --lg-fast-ease: cubic-bezier(0.2, 0, 0, 1);
}

[data-theme-mode="light"] {
  --lg-glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.82) 0%, rgba(248, 250, 252, 0.9) 100%);
  --lg-glass-bg-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.96) 100%);
  --lg-glass-border: 1px solid rgba(255, 255, 255, 0.9);
  --lg-glass-border-hover: 1px solid rgba(2, 132, 199, 0.5);
  --lg-glass-specular: inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.04);
  --lg-glass-shadow: 0 14px 35px -6px rgba(15, 23, 42, 0.07), inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --lg-glass-hover-shadow: 0 20px 45px -8px rgba(15, 23, 42, 0.12), inset 0 2px 2px 0 #ffffff, 0 0 22px rgba(2, 132, 199, 0.15);
  --lg-glass-blur: blur(20px) saturate(180%) contrast(100%);
  --lg-input-bg: rgba(255, 255, 255, 0.9);
  --lg-input-border: 1.5px solid #cbd5e1;
  --lg-input-focus: 0 0 0 3.5px rgba(2, 132, 199, 0.22), 0 4px 16px rgba(2, 132, 199, 0.14), inset 0 1px 1px 0 rgba(255, 255, 255, 0.9);
}

/* ─── Hardware Acceleration & Smooth Motion Defaults ─── */
.card, .btn, .portal-dropzone, .form-control, .data-table, .modal-card, .stat-item {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
}

/* ─── Ambient Liquid Background Glows (Breathing Light Physics) ─── */
.ambient-glow {
  animation: ambientFloat 14s infinite alternate ease-in-out;
}

.glow-1 {
  animation-duration: 16s;
  animation-delay: 0s;
}

.glow-2 {
  animation-duration: 20s;
  animation-delay: -4s;
}

.glow-3 {
  animation-duration: 18s;
  animation-delay: -8s;
}

@keyframes ambientFloat {
  0% { transform: translate(0, 0) scale(1); opacity: 0.42; }
  50% { transform: translate(30px, 20px) scale(1.08); opacity: 0.58; }
  100% { transform: translate(-20px, -15px) scale(0.96); opacity: 0.38; }
}

/* ─── Customs Enterprise Security & Safety Strip ─── */
.customs-safety-strip {
  position: relative;
  z-index: 95;
  background: rgba(10, 15, 26, 0.65);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.25s var(--lg-ease);
}

[data-theme-mode="light"] .customs-safety-strip {
  background: rgba(248, 250, 252, 0.85);
  border-bottom-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.safety-strip-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 0.45rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.safety-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: all 0.2s var(--lg-ease);
  user-select: none;
}

.safety-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

[data-theme-mode="light"] .safety-badge {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme-mode="light"] .safety-badge:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.safety-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.safety-text {
  letter-spacing: -0.01em;
}

.safety-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

.safety-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

[data-theme-mode="light"] .safety-divider {
  background: rgba(15, 23, 42, 0.2);
}

.safety-badge-cyan {
  border-color: rgba(6, 182, 212, 0.25);
}
.safety-badge-cyan:hover {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.safety-badge-emerald {
  border-color: rgba(16, 185, 129, 0.25);
}
.safety-badge-emerald:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.safety-badge-indigo {
  border-color: rgba(99, 102, 241, 0.25);
}
.safety-badge-indigo:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.safety-badge-gold {
  border-color: rgba(245, 158, 11, 0.25);
}
.safety-badge-gold:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

/* Dropzone In-Memory Security Note */
.portal-drop-security-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  user-select: none;
}

[data-theme-mode="light"] .portal-drop-security-note {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.security-lock-icon {
  font-size: 0.82rem;
  animation: safetyLockPulse 2.5s infinite ease-in-out;
}

@keyframes safetyLockPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.4)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.8)); }
}

/* ─── Premium Liquid Glass Header Upgrades ─── */
.app-header {
  background: rgba(6, 8, 15, 0.75) !important;
  backdrop-filter: var(--lg-glass-blur) !important;
  -webkit-backdrop-filter: var(--lg-glass-blur) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
}

[data-theme-mode="light"] .app-header {
  background: rgba(255, 255, 255, 0.82) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
}

.brand-icon {
  background: linear-gradient(135deg, #0284c7 0%, #3b82f6 45%, #6366f1 100%) !important;
  box-shadow: 0 0 25px rgba(2, 132, 199, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
  transition: transform 0.28s var(--lg-ease), box-shadow 0.28s var(--lg-ease);
}

.brand-icon:hover {
  transform: rotate(-4deg) scale(1.06);
  box-shadow: 0 0 35px rgba(2, 132, 199, 0.6), inset 0 1.5px 1.5px rgba(255, 255, 255, 0.6) !important;
}

/* ─── Liquid Glass Cards & Step Panes ─── */
.card,
.step-section,
.function-form-card {
  background: var(--lg-glass-bg) !important;
  backdrop-filter: var(--lg-glass-blur) !important;
  -webkit-backdrop-filter: var(--lg-glass-blur) !important;
  border: var(--lg-glass-border) !important;
  box-shadow: var(--lg-glass-shadow) !important;
  border-radius: var(--radius-lg, 16px) !important;
  transition: transform 0.25s var(--lg-ease), box-shadow 0.25s var(--lg-ease), border-color 0.25s var(--lg-ease) !important;
}

.card:hover,
.function-form-card:hover {
  border: var(--lg-glass-border-hover) !important;
  box-shadow: var(--lg-glass-hover-shadow) !important;
  transform: translateY(-2px);
}

.card::before,
.function-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 4%;
  right: 4%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), rgba(6, 182, 212, 0.35), transparent);
  pointer-events: none;
}

[data-theme-mode="light"] .card::before,
[data-theme-mode="light"] .function-form-card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), rgba(2, 132, 199, 0.3), transparent);
}

/* ─── Liquid Glass Dropzone ─── */
.portal-dropzone {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.5) 0%, rgba(6, 182, 212, 0.04) 50%, rgba(99, 102, 241, 0.04) 100%) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 2px dashed rgba(255, 255, 255, 0.16) !important;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12), 0 12px 30px -8px rgba(0, 0, 0, 0.35) !important;
  border-radius: var(--radius-md, 12px) !important;
  transition: all 0.25s var(--lg-ease) !important;
}

.portal-dropzone:hover,
.portal-dropzone.dragover {
  border-color: var(--accent-cyan-light, #22d3ee) !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65) 0%, rgba(6, 182, 212, 0.1) 50%, rgba(99, 102, 241, 0.08) 100%) !important;
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.25), inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px) scale(1.004);
}

[data-theme-mode="light"] .portal-dropzone {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(240, 249, 255, 0.9) 100%) !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 1.5px 1.5px 0 #ffffff, 0 10px 25px -6px rgba(15, 23, 42, 0.06) !important;
}

[data-theme-mode="light"] .portal-dropzone:hover,
[data-theme-mode="light"] .portal-dropzone.dragover {
  border-color: #0284c7 !important;
  background: linear-gradient(135deg, #ffffff 0%, rgba(224, 242, 254, 0.85) 100%) !important;
  box-shadow: 0 0 25px rgba(2, 132, 199, 0.18), inset 0 2px 2px 0 #ffffff !important;
}

/* ─── Translucent Liquid Glass Inputs ─── */
.form-control,
input.table-input,
select.form-control,
textarea.form-control {
  background: var(--lg-input-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: var(--lg-input-border) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 1px 1px 0 rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-sm, 8px) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  transition: all 0.2s var(--lg-ease) !important;
}

.form-control:hover,
input.table-input:hover,
select.form-control:hover {
  border-color: rgba(56, 189, 248, 0.4) !important;
}

.form-control:focus,
input.table-input:focus,
select.form-control:focus,
textarea.form-control:focus {
  outline: none !important;
  border-color: var(--accent-cyan, #06b6d4) !important;
  box-shadow: var(--lg-input-focus) !important;
  transform: translateY(-0.5px);
}

[data-theme-mode="light"] .form-control,
[data-theme-mode="light"] input.table-input,
[data-theme-mode="light"] select.form-control,
[data-theme-mode="light"] textarea.form-control {
  background: var(--lg-input-bg) !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), inset 0 1px 1px 0 #ffffff !important;
}

[data-theme-mode="light"] .form-control:focus,
[data-theme-mode="light"] input.table-input:focus,
[data-theme-mode="light"] select.form-control:focus,
[data-theme-mode="light"] textarea.form-control:focus {
  border-color: #0284c7 !important;
  box-shadow: var(--lg-input-focus) !important;
}

/* ─── Ultra-Smooth Buttons with Liquid Sheen ─── */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--lg-ease), box-shadow 0.2s var(--lg-ease), background 0.2s ease, border-color 0.2s ease !important;
  border-radius: var(--radius-sm, 8px) !important;
}

.btn:active {
  transform: translateY(1px) scale(0.98) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 55%, #4f46e5 100%) !important;
  box-shadow: inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.35), 0 8px 24px -4px rgba(37, 99, 235, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.btn-primary:hover {
  box-shadow: inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.5), 0 12px 30px -4px rgba(37, 99, 235, 0.6) !important;
  transform: translateY(-1.5px);
}

/* Liquid Specular Light Wave Sweep */
.btn-primary::after,
.btn-success::after,
.btn-tech-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

.btn-primary:hover::after,
.btn-success:hover::after,
.btn-tech-glow:hover::after {
  transform: translateX(100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px);
}

[data-theme-mode="light"] .btn-secondary {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), inset 0 1px 1px 0 #ffffff !important;
}

[data-theme-mode="light"] .btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12) !important;
}

/* ─── Liquid Glass Metric Stats Bar ─── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-item {
  background: var(--lg-glass-bg) !important;
  backdrop-filter: var(--lg-glass-blur) !important;
  -webkit-backdrop-filter: var(--lg-glass-blur) !important;
  border: var(--lg-glass-border) !important;
  box-shadow: var(--lg-glass-shadow) !important;
  border-radius: var(--radius-md, 12px) !important;
  padding: 1rem 1.15rem !important;
  transition: all 0.22s var(--lg-ease) !important;
  position: relative;
  overflow: hidden;
}

.stat-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan-light) !important;
  box-shadow: var(--lg-glass-hover-shadow) !important;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.6;
}

/* ─── Frosted Glass Items Table ─── */
.table-responsive {
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  border: var(--lg-glass-border);
  box-shadow: var(--lg-glass-shadow);
  backdrop-filter: var(--lg-glass-blur);
  -webkit-backdrop-filter: var(--lg-glass-blur);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  background: rgba(10, 15, 28, 0.88) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.65rem;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 5;
}

[data-theme-mode="light"] .data-table thead th {
  background: rgba(241, 245, 249, 0.95) !important;
  color: #475569;
  border-bottom-color: #cbd5e1;
}

.data-table tbody tr {
  background: rgba(15, 23, 42, 0.35);
  transition: all 0.16s var(--lg-ease);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.55);
}

.data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.12) !important;
  box-shadow: inset 3px 0 0 0 var(--accent-cyan);
}

[data-theme-mode="light"] .data-table tbody tr {
  background: rgba(255, 255, 255, 0.7);
}

[data-theme-mode="light"] .data-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.85);
}

[data-theme-mode="light"] .data-table tbody tr:hover {
  background: rgba(224, 242, 254, 0.75) !important;
  box-shadow: inset 3px 0 0 0 #0284c7;
}

.data-table tbody td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

[data-theme-mode="light"] .data-table tbody td {
  border-bottom-color: rgba(226, 232, 240, 0.8);
}

/* ─── Floating Liquid Glass Modals ─── */
.modal-overlay {
  background: rgba(2, 4, 10, 0.76) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  transition: opacity 0.24s var(--lg-ease), visibility 0.24s var(--lg-ease) !important;
}

.modal-card {
  background: var(--lg-glass-bg) !important;
  backdrop-filter: var(--lg-glass-blur) !important;
  -webkit-backdrop-filter: var(--lg-glass-blur) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.25) !important;
  border-radius: var(--radius-xl, 20px) !important;
  animation: modalLiquidPop 0.26s var(--lg-ease) forwards;
}

@keyframes modalLiquidPop {
  0% { transform: translateY(16px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

[data-theme-mode="light"] .modal-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  border-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 25px 70px -10px rgba(15, 23, 42, 0.18), inset 0 2px 2px 0 #ffffff !important;
}

/* ─── Workflow Stepper Glass Upgrades ─── */
.workflow-stepper-bar {
  background: rgba(10, 15, 28, 0.6) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme-mode="light"] .workflow-stepper-bar {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: #e2e8f0 !important;
}

.step-nav-btn {
  border-radius: 9999px !important;
  padding: 0.45rem 1.1rem !important;
  transition: all 0.22s var(--lg-ease) !important;
}

.step-nav-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(37, 99, 235, 0.35)) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.25), inset 0 1px 1px 0 rgba(255, 255, 255, 0.3) !important;
}

[data-theme-mode="light"] .step-nav-btn.active {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15) !important;
}

/* ─── Quick Smooth Scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.5);
}

[data-theme-mode="light"] ::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.2);
}

[data-theme-mode="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 132, 199, 0.5);
}




