/* ==========================================================================
   DocuScan Enterprise — Ultra-Sleek Corporate Black Design System
   ========================================================================== */

/* --- Color Tokens & Variables (Corporate Black & Monochromatic Shades) --- */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Theme: Dark Obsidian / Corporate Black */
  --bg-app: #000000;
  --bg-card: #09090b;
  --bg-surface: #121216;
  --bg-surface-elevated: #18181f;
  --bg-surface-hover: #22222b;

  --border-subtle: #1c1c24;
  --border-medium: #272732;
  --border-strong: #3f3f4e;
  --border-focus: #ffffff;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverted: #000000;

  --accent-primary: #ffffff;
  --accent-primary-hover: #e4e4e7;
  --accent-primary-subtle: rgba(255, 255, 255, 0.06);

  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.1);

  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.1);

  --accent-rose: #ef4444;
  --accent-rose-subtle: rgba(239, 68, 68, 0.1);

  --accent-indigo: #818cf8;
  --accent-indigo-subtle: rgba(129, 140, 248, 0.1);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.85);
  --shadow-drawer: -12px 0 40px rgba(0, 0, 0, 0.9);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --bg-navbar: rgba(9, 9, 11, 0.88);
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-navbar: rgba(255, 255, 255, 0.96);
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-surface-elevated: #e2e8f0;
  --bg-surface-hover: #cbd5e1;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #0f172a;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverted: #ffffff;

  --accent-primary: #0f172a;
  --accent-primary-hover: #1e293b;
  --accent-primary-subtle: rgba(15, 23, 42, 0.06);

  --accent-emerald-subtle: rgba(16, 185, 129, 0.1);
  --accent-amber-subtle: rgba(245, 158, 11, 0.1);
  --accent-rose-subtle: rgba(239, 68, 68, 0.1);
  --accent-indigo-subtle: rgba(99, 102, 241, 0.1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-drawer: -12px 0 40px rgba(0, 0, 0, 0.12);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Navigation Bar (Minimal Corporate)
   ========================================================================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 2rem;
  background-color: var(--bg-navbar);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.brand-logo svg {
  width: 20px;
  height: 20px;
}

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

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

.brand-name {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.brand-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Buttons & Micro-Components
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--text-inverted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  color: #ffffff;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.btn-export-excel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}
.btn-export-excel:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
}
.btn-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.6875rem;
  height: 26px;
  min-width: 26px;
}

.btn-icon-svg {
  width: 14px;
  height: 14px;
}

/* Theme Icons Toggle */
[data-theme="dark"] .theme-icon.moon { display: none; }
[data-theme="dark"] .theme-icon.sun { display: block; }
[data-theme="light"] .theme-icon.sun { display: none; }
[data-theme="light"] .theme-icon.moon { display: block; }

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 2rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   Unified Command Hub (Tabs & Inputs)
   ========================================================================== */
.command-hub-card {
.command-hub-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 0.875rem;
  overflow: hidden;
}

/* Dropzone */
.dropzone-area {
  border: 1.5px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 2.75rem 2rem;
  background-color: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  text-align: center;
}
.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface-elevated);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.dropzone-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropzone-icon-wrap svg {
  width: 24px;
  height: 24px;
}

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

.dropzone-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}
}

/* ==========================================================================
   Real-Time Progress Banner
   ========================================================================== */
.progress-banner {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.progress-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.progress-title-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pulse-loader {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-medium);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin-pulse 0.8s linear infinite;
}

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

.progress-main-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-sub-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-metrics-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric-pct {
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.metric-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 4px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* ==========================================================================
   KPI Metrics Ribbon (Corporate Monochrome)
   ========================================================================== */
.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  transition: border-color var(--transition-fast);
}
.kpi-card:hover {
  border-color: var(--border-medium);
}

.kpi-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
}

.kpi-badge.success {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.2);
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-sans);
}

.kpi-value.highlight-green { color: #f4f4f5; }
.kpi-value.highlight-gold { color: #f4f4f5; }

.kpi-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ==========================================================================
   Sequential Invoice Numbers Text Output Card (Alt Alta Tek Metin)
   ========================================================================== */
.invoice-text-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.35rem;
  transition: border-color var(--transition-normal);
}

.invoice-text-card:hover {
  border-color: var(--border-medium);
}

.invoice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

.invoice-header-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.invoice-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.invoice-header-icon svg {
  width: 18px;
  height: 18px;
}

.invoice-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.invoice-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.badge-invoice-count {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.invoice-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.invoice-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-copy-hero {
  background-color: #ffffff;
  color: #000000;
  font-weight: 700;
  padding: 0.55rem 1.125rem;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.btn-copy-hero:hover {
  background-color: #e4e4e7;
  transform: translateY(-1px);
}

.btn-copy-hero.copied {
  background-color: var(--accent-emerald) !important;
  color: #ffffff !important;
}

.invoice-toolbar-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.65rem;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.invoice-format-pills {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.toolbar-sub-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.inv-fmt-pill {
  padding: 0.3rem 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.inv-fmt-pill:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-elevated);
}

.inv-fmt-pill.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-medium);
  font-weight: 600;
}

.invoice-options-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.inv-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.inv-checkbox-label input {
  accent-color: #ffffff;
  cursor: pointer;
}

.invoice-output-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #050507;
  overflow: hidden;
}

.invoice-numbers-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background-color: #050507;
  color: #f4f4f5;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  border: none;
  resize: vertical;
  min-height: 130px;
  max-height: 380px;
  outline: none;
  box-sizing: border-box;
}

.invoice-numbers-textarea:focus {
  background-color: #08080b;
}

.invoice-output-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.6875rem;
}

.statusbar-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.statusbar-dot {
  opacity: 0.4;
}

.statusbar-info.text-success {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   Workspace Section & Data Grid
   ========================================================================== */
.workspace-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.workspace-toolbar {
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.toolbar-search-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 300px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

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

.table-search-input {
  width: 100%;
  padding: 0.45rem 2rem 0.45rem 2.15rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}
.table-search-input:focus {
  outline: none;
  border-color: var(--border-strong);
  background-color: var(--bg-surface-elevated);
}

.search-shortcut-badge {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 4px;
  border-radius: 3px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  font-size: 0.625rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.filter-pills-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background-color: var(--bg-surface);
  padding: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.filter-pill {
  padding: 0.3rem 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-pill:hover {
  color: var(--text-primary);
}
.filter-pill.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-button-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Corporate Table */
.table-scroll-container {
  width: 100%;
  overflow-x: auto;
  max-height: 600px;
}

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

.corporate-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #0c0c10;
  border-bottom: 1px solid var(--border-medium);
}

.corporate-table th {
  padding: 0.65rem 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6875rem;
  white-space: nowrap;
  user-select: none;
  border-bottom: 1px solid var(--border-medium);
}

.corporate-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.corporate-table tbody tr:hover {
  background-color: var(--bg-surface-elevated);
}

.corporate-table tbody tr.row-failed {
  opacity: 0.6;
}

.corporate-table td {
  padding: 0.65rem 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.mono-cell {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.doc-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.6875rem;
  font-weight: 600;
}

.badge-irsaliye {
  background-color: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-fatura {
  background-color: rgba(129, 140, 248, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.25);
}

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

.table-status-bar {
  padding: 0.65rem 1.25rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.table-tip-text {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tip-icon {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   Side Inspection Drawer
   ========================================================================== */
.inspection-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 620px;
  max-width: 90vw;
  height: 100vh;
  background-color: #09090b;
  border-left: 1px solid var(--border-medium);
  box-shadow: var(--shadow-drawer);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

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

.drawer-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.drawer-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.drawer-filename {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.nav-page-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-surface);
  padding: 2px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.drawer-page-ind {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  padding: 0 0.25rem;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.document-stage-wrapper {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stage-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.stage-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zoom-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.document-canvas-container {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 420px;
  background-color: #050507;
}

.image-with-overlay {
  position: relative;
  display: inline-block;
}

.rendered-page-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xs);
  transition: transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.qr-target-box {
  position: absolute;
  border: 2px solid var(--accent-emerald);
  background-color: rgba(16, 185, 129, 0.15);
  pointer-events: none;
}

.qr-target-pill {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background-color: var(--accent-emerald);
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
}

.qr-target-corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--accent-emerald);
}
.qr-target-corner.top-left { top: -2px; left: -2px; border-top: 2px solid; border-left: 2px solid; }
.qr-target-corner.top-right { top: -2px; right: -2px; border-top: 2px solid; border-right: 2px solid; }
.qr-target-corner.bottom-left { bottom: -2px; left: -2px; border-bottom: 2px solid; border-left: 2px solid; }
.qr-target-corner.bottom-right { bottom: -2px; right: -2px; border-bottom: 2px solid; border-right: 2px solid; }

.field-inspector-pane {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

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

.pane-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pane-tag {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fields-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.field-metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.field-metric-lbl {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.field-metric-val {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
  word-break: break-all;
}

.raw-inspector-box {
  background-color: #050507;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.raw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.raw-title {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.raw-pre {
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 140px;
  overflow-y: auto;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.corporate-modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

.modal-search-box {
  padding: 0.75rem 1.25rem 0.5rem;
}

.modal-body-scroll {
  padding: 0.5rem 1.25rem 1rem;
  overflow-y: auto;
  flex: 1;
}

.columns-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.column-check-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background-color: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}
.column-check-card:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-medium);
}
.column-check-card input {
  accent-color: #ffffff;
  width: 14px;
  height: 14px;
}

.modal-foot {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}

.modal-presets {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: #121216;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f4f4f5;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  animation: toast-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-slide-in {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.toast-success { border-left: 3px solid var(--accent-emerald); }
.toast.toast-info { border-left: 3px solid var(--text-primary); }
.toast.toast-error { border-left: 3px solid var(--accent-rose); }

/* Helpers */
.hidden { display: none !important; }
