@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #002366;
  --primary-hover: #082d7a;
  --primary-light: #e0f2fe;
  --accent: #1da8eb;
  --accent-hover: #0ea5e9;
  --accent-glow: rgba(29, 168, 235, 0.25);
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
}

.navbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0, 35, 102, 0.04);
}

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

.logo-badge {
  background: linear-gradient(135deg, #002366 0%, #0d3b82 100%);
  color: white;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0, 35, 102, 0.25);
  border: 1px solid rgba(29, 168, 235, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.logo-badge .badge-dot {
  color: #1da8eb;
}

.nav-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.nav-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.status-tag {
  background: var(--success-light);
  color: var(--success);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--accent-hover);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom: 2.5px solid var(--accent);
  font-weight: 700;
}

/* Content Area */
.tab-pane {
  display: none;
}

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

.card {
  background: var(--card-bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #ffffff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* File list badges */
.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  margin: 4px 6px 4px 0;
  border: 1px solid var(--border);
}

/* Results table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-main);
  font-weight: 600;
}

#eracuni-preview-table-container .data-table th,
#eracuni-preview-table-wrapper .data-table th {
  color: #ffffff !important;
  position: sticky;
  top: 0;
  z-index: 3;
}

.banner-success {
  background: var(--success-light);
  border: 1px solid #86efac;
  color: #166534;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

pre.proposal-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  margin-top: 16px;
}

.table-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
}

.table-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.table-input-alert {
  border-color: #f59e0b !important;
  background-color: #fffbeb !important;
}

.badge-alert {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
  border: 1px solid #fde68a;
}

.badge-new {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #bbf7d0;
}

.badge-ignored {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-top: 16px;
  font-size: 0.9rem;
}


/* Status badges for Auction Filter */
.tag-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-apo { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.status-za-avtonet { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.status-avtonet { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.status-prevzeto { background: #ccfbf1; color: #115e59; border: 1px solid #99f6e4; }
.status-prodano { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-kriticen { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.filter-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-search-box {
  flex: 1;
  min-width: 240px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
}
.pill-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}
.pill-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.editable-status-select {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
}
.decision-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.decision-auction {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.decision-exclude {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Two-way Reconciliation Styling */
.recon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.recon-card {
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}
.recon-card.recon-success {
  border-left: 5px solid #16a34a;
  background: #f0fdf4;
}
.recon-card.recon-warning {
  border-left: 5px solid #d97706;
  background: #fffbeb;
}
.recon-card.recon-danger {
  border-left: 5px solid #dc2626;
  background: #fef2f2;
}

.pill-tab.pill-warning {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}
.pill-tab.pill-warning.active {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}
.pill-tab.pill-danger {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}
.pill-tab.pill-danger.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.pill-tab.pill-info {
  border-color: #0284c7;
  color: #0369a1;
  background: #f0f9ff;
}
.pill-tab.pill-info.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-info {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* 8-Step Invoicing Stepper */
.stepper-nav {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 24px 0 32px 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}
.stepper-nav::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}
.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 90px;
  cursor: pointer;
}
.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.step-item.completed .step-circle {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}
.step-item.active .step-circle {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
}
.step-label {
  font-size: 0.75rem;
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}
.step-item.active .step-label {
  color: #0284c7;
  font-weight: 700;
}
.step-item.completed .step-label {
  color: #166534;
}

/* Step Card & Section */
.step-pane {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.step-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.step-pane-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}
.step-pane-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 4px;
}
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .grid-2col, .grid-3col {
    grid-template-columns: 1fr;
  }
}
.mini-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}
.mini-card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
}
.clause-preview {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 14px;
  font-size: 0.85rem;
  color: #854d0e;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ==========================================
   TAB 1: FILE MANAGEMENT & PROCESS HUB
   ========================================== */
.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 14px 0;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.files-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.category-pill {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.category-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.file-search-input {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.85rem;
  min-width: 220px;
}

.files-table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

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

.files-table th {
  background: #f8fafc;
  color: #475569;
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.files-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.files-table tr:hover {
  background-color: #f8fafc;
}

.files-table tr.custom-override {
  background-color: #eff6ff;
}

.file-role-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  background-color: white;
  cursor: pointer;
  outline: none;
  max-width: 260px;
}

.file-role-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 76, 129, 0.15);
}

.badge-auto-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}

.badge-custom-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Quick Hub Grid */
.quick-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.hub-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.05);
  border-color: #cbd5e1;
}

.hub-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hub-card-icon {
  font-size: 1.5rem;
  background: #f8fafc;
  padding: 6px;
  border-radius: 8px;
}

.hub-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.hub-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 12px;
}

.hub-card-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}

.auction-quick-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

/* ==============================================================================
   TABLE RESPONSIVENESS WRAPPER
   ============================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

/* ==============================================================================
   MOBILE & TABLET RESPONSIVENESS (AutoNLB)
   ============================================================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-brand {
    gap: 10px;
  }

  .logo-badge {
    font-size: 0.95rem;
    padding: 5px 10px;
  }

  .nav-title {
    font-size: 1.08rem;
  }

  .nav-subtitle {
    font-size: 0.74rem;
  }

  .navbar > div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .user-profile-badge {
    max-width: 100%;
    gap: 8px;
    padding: 4px 10px;
  }

  #userEmail {
    max-width: 150px !important;
  }

  .container {
    margin: 14px auto;
    padding: 0 10px;
  }

  .card {
    padding: 16px 12px;
    margin-bottom: 16px;
    border-radius: 8px;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-desc {
    font-size: 0.82rem;
    margin-bottom: 14px;
    line-height: 1.45;
  }

  /* Universal Responsive Grid Stacking (both classes and inline grid styles) */
  .grid-2col, .grid-3col,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(180px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Touch-friendly horizontal tab navigation with kinetic momentum */
  .tabs-nav {
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 6px !important;
    padding-bottom: 4px !important;
    margin-bottom: 18px !important;
    border-bottom: 2px solid var(--border) !important;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none !important;
  }

  .tab-btn {
    flex-shrink: 0 !important;
    padding: 10px 14px !important;
    font-size: 0.85rem !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Category pill horizontal scroll strips */
  div[style*="margin: 18px 0 22px 0"],
  .category-pill-strip,
  .files-filter-group {
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 6px !important;
  }

  div[style*="margin: 18px 0 22px 0"]::-webkit-scrollbar,
  .files-filter-group::-webkit-scrollbar {
    display: none !important;
  }

  .category-pill {
    flex-shrink: 0 !important;
    min-height: 42px !important;
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
  }

  /* Form controls & iOS Safari auto-zoom prevention (font-size >= 16px) */
  .form-input, .form-select, .form-textarea,
  input, select, textarea,
  .file-role-select, .file-search-input {
    font-size: 16px !important;
    padding: 10px 12px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Touch buttons minimum target zones */
  .btn, button, .btn-primary, .btn-secondary, .btn-success {
    min-height: 44px;
    font-size: 0.88rem;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Folder input bar in Tab 1 */
  div[style*="gap: 10px; flex-wrap: wrap"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #input-folder-path {
    min-width: 0 !important;
    width: 100% !important;
  }

  #btn-sync-drive, #btn-open-drive {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Stepper navigation (Tab 7/8) */
  .stepper-nav {
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 0 12px 0 !important;
    margin: 16px 0 20px 0 !important;
  }

  .stepper-nav::-webkit-scrollbar {
    display: none !important;
  }

  .stepper-nav::before {
    top: 16px;
    left: 16px;
    right: 16px;
  }

  .step-item {
    min-width: 76px !important;
    flex: 0 0 auto !important;
  }

  .step-circle {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.8rem !important;
  }

  .step-label {
    font-size: 0.68rem !important;
    margin-top: 6px !important;
  }

  /* Tables & data cells kinetic horizontal scrolling */
  .table-responsive,
  .files-table-container,
  div[id$="-table-container"],
  #eracuni-vehicles-table-container,
  #eracuni-comm-table-container,
  #eracuni-intake-table-container,
  #eracuni-sales-table-container,
  #inv-cases-table-container,
  #eracuni-preview-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }

  .data-table,
  .files-table {
    min-width: 580px !important;
  }

  .data-table th, .data-table td,
  .files-table th, .files-table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .file-role-select {
    max-width: 100%;
    font-size: 16px !important;
  }

  /* Toolbars, filters & batch actions */
  .files-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .file-search-input {
    min-width: 0 !important;
    width: 100% !important;
  }

  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-search-box {
    min-width: 0 !important;
    width: 100% !important;
  }

  .batch-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .batch-bar .btn {
    width: 100%;
    justify-content: center;
  }

  .banner-success {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .banner-success .btn {
    width: 100%;
    justify-content: center;
  }

  .recon-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .step-pane {
    padding: 14px 10px;
  }

  .step-pane-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  pre.proposal-box {
    padding: 12px;
    font-size: 0.78rem;
    max-width: 100%;
    overflow-x: auto;
  }

  /* PDF Drag & Drop / Intake on Mobile */
  #eracuni-intake-dropzone {
    padding: 18px 12px !important;
  }

  /* Modals: adaptive viewport fitting without window blowout */
  div[id$="-modal"] {
    padding: 10px 8px !important;
    box-sizing: border-box !important;
  }

  div[id$="-modal"] > div {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 94vh !important;
    margin: auto !important;
    border-radius: 12px !important;
  }

  div[id$="-modal"] .btn {
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
  }

  /* Active Case Workspace Header (Tab 7) */
  div[style*="justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 16px;"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

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

  .stats-grid .stat-card:first-child {
    grid-column: 1 / -1 !important;
  }

  .stat-card {
    padding: 12px 10px !important;
  }

  .stat-title {
    font-size: 0.72rem !important;
  }

  .stat-value {
    font-size: 1.25rem !important;
  }

  .card {
    padding: 14px 10px !important;
  }

  .card-title {
    font-size: 1rem !important;
  }

  .quick-hub-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .auction-quick-box {
    padding: 12px !important;
  }
/* ==========================================================================
   e-Računi Export Mode Switcher (Production vs Test / Sandbox)
   ========================================================================== */
.eracuni-mode-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 35, 102, 0.04);
}

.eracuni-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.mode-toggle-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  gap: 4px;
}

.btn-mode-pill {
  border: none;
  outline: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-mode-pill:hover {
  color: var(--text-main);
}

.btn-mode-pill.active-prod {
  background: #ffffff;
  color: #166534;
  box-shadow: 0 1px 4px rgba(22, 101, 52, 0.15);
  border: 1px solid #bbf7d0;
}

.btn-mode-pill.active-test {
  background: #ffffff;
  color: #b45309;
  box-shadow: 0 1px 4px rgba(180, 83, 9, 0.15);
  border: 1px solid #fde68a;
}

.mode-status-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mode-status-badge.badge-prod {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.mode-status-badge.badge-test {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.mode-status-badge.badge-dry {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.test-mode-banner {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 0.83rem;
  color: #92400e;
  display: none;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.test-mode-banner.active {
  display: flex;
}

/* ==============================================================================
   HEADER MODE DROPDOWN (AutoNLB Environment Selector)
   ============================================================================== */
.header-mode-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  padding: 4px 6px 4px 12px;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.header-mode-container:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.header-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.header-mode-dot {
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.header-mode-dot.prod {
  color: #16a34a;
}

.header-mode-dot.test-real {
  color: #d97706;
}

.header-mode-dot.test-dry {
  color: #64748b;
}

.header-mode-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-mode-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 6px 30px 6px 12px;
  border-radius: 18px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  outline: none;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.3;
}

.header-mode-select:focus {
  box-shadow: 0 0 0 3px rgba(29, 168, 235, 0.25);
}

/* Color states for select */
.header-mode-select.prod {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.header-mode-select.test-real {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.header-mode-select.test-dry {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

/* Dropdown option text colors */
.header-mode-select option {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  padding: 8px 12px;
}

.header-mode-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.header-mode-select.prod + .header-mode-arrow {
  color: #166534;
}

.header-mode-select.test-real + .header-mode-arrow {
  color: #92400e;
}

.header-mode-select.test-dry + .header-mode-arrow {
  color: #334155;
}

.nav-mode-pill {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-mode-pill.prod {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.nav-mode-pill.test {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

/* Autopoint Official Footer Styling */
.app-footer {
  max-width: 1200px;
  margin: 48px auto 0 auto;
  padding: 24px 20px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.footer-brand .accent-dot {
  color: var(--accent);
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .app-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin-top: 30px;
    padding-bottom: 24px;
  }
  .footer-info {
    flex-direction: column;
    gap: 8px;
  }
}

