/* ==========================================================================
   CNPJ Batch Analytics - Design System (Vanilla CSS)
   Theme: Glassmorphic Dark Premium
   ========================================================================== */

/* Variables & Design Tokens */
:root {
  --bg-main: #06080f;
  --bg-card: rgba(15, 22, 42, 0.55);
  --border-card: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(168, 85, 247, 0.2);
  
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  
  --primary-gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 50%, #d946ef 100%);
  --btn-gradient: linear-gradient(90deg, #06b6d4 0%, #7c3aed 100%);
  
  --color-cyan: #06b6d4;
  --color-purple: #a855f7;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--color-text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glows */
.ambient-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
}

.glow-1 {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 70%);
  animation: float-glow 20s infinite alternate;
}

.glow-2 {
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
  animation: float-glow 25s infinite alternate-reverse;
}

@keyframes float-glow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Layout Utilities */
.app-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

.mt-4 { margin-top: 24px; }
.ml-2 { margin-left: 12px; }
.hide { display: none !important; }
.full-width { width: 100%; }
.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header */
.app-header {
  background: rgba(10, 15, 30, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.api-badge {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #22d3ee;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-cyan);
  border-radius: 50%;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

/* Tabs Navigation */
.tabs-container {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-card);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  max-width: fit-content;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

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

.tab-btn.active {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-icon {
  width: 18px;
  height: 18px;
}

/* Cards & Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card {
  overflow: hidden;
}

.card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-card);
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-header p {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.card-body {
  padding: 28px;
}

/* Views Wrapper */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fade-in 0.4s ease;
}

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

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  color: #fff;
  outline: none;
}

.btn-primary {
  background: var(--btn-gradient);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5), var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.btn-warning:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.25);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--color-danger);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-text-secondary {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

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

.btn-group {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-group .btn {
  flex: 1;
}

/* Form Inputs */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 6px;
  transition: var(--transition-fast);
}

.input-group:focus-within {
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 16px;
  padding: 12px 16px;
  outline: none;
}

.input-group input::placeholder {
  color: var(--color-text-muted);
}

.feedback-msg {
  font-size: 13px;
  min-height: 18px;
  padding-left: 6px;
}

.feedback-msg.error {
  color: var(--color-danger);
}

.feedback-msg.success {
  color: var(--color-success);
}

/* Spinner */
.icon-spin {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  stroke-dasharray: 40;
}

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

/* Status Badge Styles */
.status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.status-badge.ativa,
.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.baixada,
.status-badge.failed,
.status-badge.erro {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.pending,
.status-badge.suspensa {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Single Result Details Card */
.single-result-card {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 24px;
  animation: fade-in var(--transition-normal);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.result-header h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
}

.result-header p {
  color: var(--color-cyan);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grid-item.span-all {
  grid-column: span 3;
}

.grid-label {
  color: var(--color-text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.grid-value {
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

/* Partners QSA list */
.partners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.partner-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.partner-name {
  font-size: 14px;
  font-weight: 600;
}

.partner-role {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

/* Batch View Layout */
.batch-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
}

.upload-card, .progress-card {
  height: 100%;
}

.flex-center-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Drag and Drop Zone */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: var(--transition-fast);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--color-cyan);
  background: rgba(6, 182, 212, 0.04);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--color-text-secondary);
  transition: var(--transition-fast);
}

.upload-zone:hover .upload-icon {
  color: var(--color-cyan);
  transform: translateY(-2px);
}

.upload-text {
  font-size: 15px;
  color: var(--color-text-secondary);
}

.upload-text .highlight {
  color: var(--color-cyan);
  font-weight: 600;
}

.upload-tip {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* File Loaded State Box */
.file-info-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-top: 16px;
  animation: fade-in 0.3s ease;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-icon {
  width: 28px;
  height: 28px;
  color: var(--color-cyan);
}

.file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Column mapping dropdown selectors */
.mapping-container {
  margin-top: 20px;
  background: rgba(6, 182, 212, 0.03);
  border: 1px solid rgba(6, 182, 212, 0.12);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mapping-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.mapping-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-select {
  background-color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text-primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  min-width: 160px;
}

.form-select:focus {
  border-color: var(--color-cyan);
}

.mapping-info {
  font-size: 12px;
  color: var(--color-cyan);
  font-weight: 600;
}

/* Speed adjustment sliders */
.batch-parameters {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

.batch-parameters h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.param-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.param-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.param-value-badge {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: #1e293b;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #06b6d4;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
  transition: background-color 0.15s;
}

.range-slider::-webkit-slider-thumb:hover {
  background: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.slider-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Progress Stats Radial Graphic */
.progress-stats-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 10px 0;
}

.progress-radial {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}

.progress-ring-fill {
  transform: rotate(-90deg);
  transform-origin: 80px 80px;
  transition: stroke-dashoffset 0.35s;
}

.progress-text-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.progress-percent {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.progress-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-top: 4px;
}

/* Stats grid on linear panels */
.stats-linear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-item.span-2 {
  grid-column: span 2;
}

.stat-item.success {
  border-left: 3px solid var(--color-success);
}

.stat-item.failed {
  border-left: 3px solid var(--color-danger);
}

.stat-item.eta {
  border-left: 3px solid var(--color-cyan);
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
}

.stat-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.success .stat-num { color: #34d399; }
.failed .stat-num { color: #f87171; }
.eta .stat-num { color: #22d3ee; }

/* Realtime live logging feed console */
.live-log-console {
  width: 100%;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 150px;
}

.console-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.console-status {
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.console-body {
  padding: 14px 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-y: auto;
  max-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.log-entry {
  color: #38bdf8;
  word-break: break-all;
}

.log-entry.system { color: #64748b; }
.log-entry.success { color: #4ade80; }
.log-entry.error { color: #f87171; }
.log-entry.warning { color: #fbbf24; }

/* Results Shared Table styling */
.results-table-panel {
  padding: 28px;
}

.results-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.title-search {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.title-search h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.table-search-box {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.table-search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 10px 14px 10px 38px;
  color: var(--color-text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.table-search-box input:focus {
  border-color: var(--color-cyan);
}

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

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

.btn-icon {
  width: 16px;
  height: 16px;
}

/* Grid Table UI */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: rgba(10, 15, 30, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Pagination UI */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.pagination-info {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-page {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-page:hover:not(:disabled) {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.btn-page:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-numbers-container {
  display: flex;
  gap: 4px;
}

.page-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-fast);
  color: var(--color-text-secondary);
}

.page-num:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary);
}

.page-num.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

/* Modals Overlay & Box */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  background: #0b1120;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
}

.modal-subtitle {
  color: var(--color-cyan);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--color-text-primary);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Tabs styling */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 16px;
  margin-bottom: 24px;
}

.modal-tab {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 4px;
  cursor: pointer;
  position: relative;
}

.modal-tab:hover {
  color: var(--color-text-primary);
}

.modal-tab.active {
  color: var(--color-text-primary);
}

.modal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-gradient);
}

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

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

/* Modal details data grid */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.details-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.details-field.span-2 {
  grid-column: span 2;
}

.details-field.span-3 {
  grid-column: span 3;
}

.details-section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 14px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.field-label {
  color: var(--color-text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-val {
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
}

/* Secondary Activities & QSA layout */
.activities-qsa-wrapper {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
}

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

.activity-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.activity-item.main-activity {
  background: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.15);
  font-weight: 500;
  margin-top: 10px;
}

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

.qsa-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 12px;
}

.qsa-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.qsa-role {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.qsa-rep {
  font-size: 11px;
  color: var(--color-cyan);
  margin-top: 4px;
}

/* JSON raw formatter tab */
.json-renderer {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 18px;
  max-height: 380px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #38bdf8;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
}

/* App Footer */
.app-footer {
  text-align: center;
  padding: 28px 24px;
  color: var(--color-text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-card);
  margin-top: 40px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #06080f;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Responsive breakpoint scaling */
@media (max-width: 1024px) {
  .batch-grid {
    grid-template-columns: 1fr;
  }
  
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-item.span-all {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .results-table-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .title-search {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  
  .table-search-box {
    max-width: 100%;
  }
  
  .download-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .details-field.span-2,
  .details-field.span-3 {
    grid-column: span 2;
  }
  
  .activities-qsa-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 16px;
  }
  
  .result-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-item.span-all {
    grid-column: span 1;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .details-field.span-2,
  .details-field.span-3 {
    grid-column: span 1;
  }
  
  .tabs-container {
    width: 100%;
    max-width: 100%;
  }
  
  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
    font-size: 13px;
  }
}

/* ==========================================================================
   AUTHENTICATION GATE STYLING
   ========================================================================== */

.login-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card {
  max-width: 420px;
  width: 90%;
  padding: 40px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-header h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-header p {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-toggle-password {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  padding: 0 14px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
  border-color: rgba(239, 68, 68, 0.5) !important;
}
