/* Search Results Table Optimization */
.search-results-table {
  table-layout: fixed;
  font-size: 0.875rem;
  width: 100%;
}

.search-results-table th,
.search-results-table td {
  padding: 0.5rem 0.25rem;
  vertical-align: middle;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
}

/* Optimized column widths for search results */
.search-results-table th:nth-child(1), .search-results-table td:nth-child(1) { width: 18px; min-width: 18px; max-width: 18px; } /* Expand/Collapse */
.search-results-table th:nth-child(2), .search-results-table td:nth-child(2) { width: 22px; min-width: 22px; max-width: 22px; } /* Checkbox */
.search-results-table th:nth-child(3), .search-results-table td:nth-child(3) { width: 3%; min-width: 30px; } /* # */
.search-results-table th:nth-child(4), .search-results-table td:nth-child(4) { width: 20%; } /* Code */
.search-results-table th:nth-child(5), .search-results-table td:nth-child(5) { width: 40%; } /* Product name */
.search-results-table th:nth-child(6), .search-results-table td:nth-child(6) { width: 8%; } /* Sold */
.search-results-table th:nth-child(7), .search-results-table td:nth-child(7) { width: 8%; } /* Stock */
.search-results-table th:nth-child(8), .search-results-table td:nth-child(8) { width: 10%; text-align: center; } /* Quantity */
.search-results-table th:nth-child(9), .search-results-table td:nth-child(9) { width: 8%; text-align: center; } /* Unit */
.search-results-table th:nth-child(10), .search-results-table td:nth-child(10) { width: 25px; min-width: 25px; max-width: 25px; text-align: center; } /* Comment */
.search-results-table th:nth-child(11), .search-results-table td:nth-child(11) { width: 25px; min-width: 25px; max-width: 25px; text-align: right; } /* Icon */

/* Compact form controls */
.search-results-table .form-control-sm,
.search-results-table .form-select-sm {
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  height: auto;
  min-height: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure select dropdowns are fully visible */
.search-results-table .form-select-sm {
  padding-right: 1.5rem; /* Space for dropdown arrow */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.375rem center;
  background-size: 0.75rem;
}

/* Dashboard Widget Width Control */
.dashboard-cell {
  max-width: 100% !important;
  overflow: hidden !important;
}

.dashboard-cell .card {
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
}

.dashboard-cell .list-group-item {
  max-width: 100% !important;
  overflow: visible !important;
  padding-bottom: 0.75rem !important;
}

.dashboard-cell .text-truncate {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Job Vacancy Image Styling */
.image-container {
  transition: transform 0.2s ease;
}

.image-container:hover {
  transform: scale(1.02);
}

.image-overlay {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.image-overlay .btn {
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Job Vacancy Modal Image Hover Effect */
.vacancy-image:hover > div[style*="position: absolute"] {
  opacity: 1 !important;
}

/* Permissions Accordion Styling */
.permissions-accordion .accordion-button {
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.permissions-accordion .accordion-button:not(.collapsed) {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.permissions-accordion .accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.permissions-accordion .accordion-collapse {
  transition: height 0.35s ease;
  overflow: hidden;
}

.permissions-accordion .accordion-collapse.collapse {
  height: 0;
}

.permissions-accordion .accordion-collapse:not(.collapse) {
  height: auto;
}

.permissions-accordion .accordion-body {
  padding: 1rem;
  background-color: #fafafa;
}

.permissions-accordion .form-check {
  margin-bottom: 0.5rem;
}

.permissions-accordion .form-check-label {
  font-size: 0.9rem;
  cursor: pointer;
}

.permissions-accordion .badge {
  font-size: 0.75rem;
  font-weight: 500;
}

.permissions-accordion .btn-group-sm .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Compact buttons */
.search-results-table .btn-sm {
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  line-height: 1.2;
}


/* Numeric columns alignment */
.search-results-table .text-end {
  text-align: right;
  font-family: monospace;
  font-size: 0.8rem;
}

/* Ensure checkboxes are always visible */
.search-results-table input[type="checkbox"] {
  width: auto !important;
  min-width: 16px;
  margin: 0;
}


/* Ensure first column stays exactly 20px */
.search-results-table th:nth-child(1),
.search-results-table td:nth-child(1) {
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  padding: 0.5rem 0 !important;
  box-sizing: border-box;
  overflow: hidden;
}

.search-results-table td:nth-child(1) {
  background-color: transparent;
  border-right: none;
}

/* Ensure first column stays exactly 20px in all screen sizes */
@media (max-width: 768px) {
  .search-results-table th:nth-child(1),
  .search-results-table td:nth-child(1) {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
  }
}

@media (max-width: 576px) {
  .search-results-table th:nth-child(1),
  .search-results-table td:nth-child(1) {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
  }
}

/* AI Parsing Result Table */
.ai-parsing-table {
  table-layout: fixed;
  font-size: 0.875rem;
}

.ai-parsing-table th,
.ai-parsing-table td {
  padding: 0.5rem 0.25rem;
  vertical-align: middle;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
}

/* AI table column widths - minimal icon columns, larger name */
.ai-parsing-table th:nth-child(1), .ai-parsing-table td:nth-child(1) { width: 5%; min-width: 30px; } /* # */
.ai-parsing-table th:nth-child(2), .ai-parsing-table td:nth-child(2) { width: 40%; } /* Product name */
.ai-parsing-table th:nth-child(3), .ai-parsing-table td:nth-child(3) { width: 8%; min-width: 30px; } /* Attributes icon */
.ai-parsing-table th:nth-child(4), .ai-parsing-table td:nth-child(4) { width: 12%; } /* Quantity */
.ai-parsing-table th:nth-child(5), .ai-parsing-table td:nth-child(5) { width: 10%; } /* Unit */
.ai-parsing-table th:nth-child(6), .ai-parsing-table td:nth-child(6) { width: 15%; min-width: 80px; } /* Actions */
.ai-parsing-table th:nth-child(7), .ai-parsing-table td:nth-child(7) { width: 10%; min-width: 30px; } /* Info icon */

/* Numeric columns alignment for AI table */
.ai-parsing-table .text-end {
  text-align: right;
  font-family: monospace;
  font-size: 0.8rem;
}

/* Icon columns centered */
.ai-parsing-table th:nth-child(3),
.ai-parsing-table td:nth-child(3),
.ai-parsing-table th:nth-child(6),
.ai-parsing-table td:nth-child(6),
.ai-parsing-table th:nth-child(7),
.ai-parsing-table td:nth-child(7) {
  text-align: center;
}

/* Icon styling */
.ai-parsing-table .fa {
  font-size: 0.875rem;
  cursor: help;
}

/* Action buttons styling */
.ai-parsing-table .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.ai-parsing-table .btn-sm i {
  font-size: 0.75rem;
}

/* Optimize main email list table rendering */
.email-registry-table {
  table-layout: fixed;
}

.email-registry-table th,
.email-registry-table td {
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
}

/* Email Registry List Table - specific column widths */
.email-registry-table th:nth-child(1),
.email-registry-table td:nth-child(1) { width: 3%; } /* Checkbox */
.email-registry-table th:nth-child(2),
.email-registry-table td:nth-child(2) { width: 12%; } /* Received */
.email-registry-table th:nth-child(3),
.email-registry-table td:nth-child(3) { width: 18%; } /* From */
.email-registry-table th:nth-child(4),
.email-registry-table td:nth-child(4) { width: 25%; } /* Subject */
.email-registry-table th:nth-child(5),
.email-registry-table td:nth-child(5) { width: 15%; } /* To */
.email-registry-table th:nth-child(6),
.email-registry-table td:nth-child(6) { width: 10%; } /* Category */
.email-registry-table th:nth-child(7),
.email-registry-table td:nth-child(7) { width: 8%; } /* Language */
.email-registry-table th:nth-child(8),
.email-registry-table td:nth-child(8) { width: 8%; } /* Status */
.email-registry-table th:nth-child(9),
.email-registry-table td:nth-child(9) { width: 8%; } /* Search Done */
.email-registry-table th:nth-child(10),
.email-registry-table td:nth-child(10) { width: 13%; } /* Actions */

/* Table headers with ellipsis */
.email-registry-table th,
.search-results-table th,
.ai-parsing-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Allow text truncation with tooltips */
.text-truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Optimize form controls */
.form-select-sm {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

/* Loading states */
.opacity-50 {
  opacity: 0.5;
  pointer-events: none;
}

/* Sortable column indicators */
.sortable {
  cursor: pointer;
  user-select: none;
}

.sortable:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Responsive table improvements */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.875rem;
  }

  .table th:nth-child(5), .table td:nth-child(5) { display: none; } /* Hide To column on mobile */
  .table th:nth-child(7), .table td:nth-child(7) { display: none; } /* Hide Language column on mobile */
}

/* Root and variables */
:root {
  /* Volinik color scheme */
  --volinik-primary: #005aa3;
  --volinik-primary-hover: #004080;
  --volinik-bg: #EEF8FF;
  --volinik-card-bg: #ffffff;
  --volinik-border: #e0e0e0;
  --volinik-text: #333333;

  /* Legacy variables (keeping for compatibility) */
  --primary-color: var(--volinik-primary);
  --primary-hover: var(--volinik-primary-hover);
  --bg-color: var(--volinik-bg);
  --white: var(--volinik-card-bg);
  --border-color: var(--volinik-border);
  --text-color: var(--volinik-text);
  --label-color: #555555;
  --input-bg: var(--volinik-card-bg);

  /* Bootstrap color overrides */
  --bs-primary: var(--volinik-primary);
  --bs-primary-rgb: 0, 90, 163;
  --bs-primary-bg-subtle: #e6f2ff;
  --bs-primary-border-subtle: #b3d9ff;
}

/* Extra small button size */
.btn-xs {
  padding: 0.125rem 0.25rem;
  font-size: 0.75rem;
  line-height: 1.2;
  border-radius: 0.2rem;
}

/* Close icon (×) for modals */
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Base styles */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f0f8fe !important;
  color: var(--volinik-text);
}

/* Main container-fluid padding - override Bootstrap */
.container-fluid {
  padding: 10px 30px !important;
}

/* Volinik Bootstrap overrides */
.btn-primary {
  background-color: var(--volinik-primary);
  border-color: var(--volinik-primary);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--volinik-primary-hover);
  border-color: var(--volinik-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 90, 163, 0.3);
}

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

/* Links and navigation */
a, .nav-link {
  color: var(--volinik-primary);
  text-decoration: none;
}

a:hover, .nav-link:hover {
  color: var(--volinik-primary-hover);
  text-decoration: none;
}

.nav-link.active {
  color: var(--volinik-primary-hover);
  font-weight: bold;
}

/* Cards and containers */
.card {
  background-color: var(--volinik-card-bg);
  border: 1px solid var(--volinik-border);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.container {
  background-color: var(--volinik-card-bg);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--volinik-border);
}

/* Tables */
.table {
  background-color: var(--volinik-card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table thead th {
  background-color: #f8f9fa;
  color: #6b7280;
  font-weight: 600;
  border-bottom: 2px solid var(--volinik-border);
}

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

/* Badges and status indicators */
.badge {
  border-radius: 12px;
  font-weight: 500;
}

.bg-success {
  background-color: #4caf50 !important;
}

.bg-danger {
  background-color: #d32f2f !important;
}

.bg-warning {
  background-color: #ff9800 !important;
}

.bg-info {
  background-color: var(--volinik-primary) !important;
}

/* Form controls */
.form-control:focus,
.form-select:focus {
  border-color: var(--volinik-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 90, 163, 0.25);
}

/* Pagination */
.page-link {
  color: var(--volinik-primary);
  border-color: var(--volinik-border);
}

.page-link:hover {
  color: var(--volinik-primary-hover);
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--volinik-primary);
}

.page-item.active .page-link {
  background-color: var(--volinik-primary);
  border-color: var(--volinik-primary);
}

/* General list/table styling */
.general-container {
  background-color: var(--volinik-card-bg);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin-bottom: 20px;
}

.general-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--volinik-border);
}

.general-title {
  color: var(--volinik-primary);
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  margin: 0;
}

/* Consistent page title styling - same as general-title */
.page-title {
  color: var(--volinik-primary);
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  margin: 0;
}

/* Reporting view chart title styling */
.report-section .report-title {
  font-size: 1.5rem;
  margin: 40px 0 20px;
}

.report-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.report-section canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 450px !important;
}

/* Chart container for better responsive sizing */
.report-section .chart-container {
  width: 100%;
  max-width: 100%;
}

/* Mobile adjustments for chart height */
@media (max-width: 768px) {
  .report-section .chart-container {
    height: 300px !important;
  }

  .report-section canvas {
    max-height: 300px !important;
  }
}

.report-section .time-selector {
  margin-top: 10px;
  font-size: 0.9rem;
}

.report-section .time-selector a {
  margin: 0 5px;
}

.report-section .time-selector a.active {
  font-weight: bold;
  text-decoration: underline;
}

.general-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.general-actions .btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.general-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Statistics cards */
.general-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.general-stat-card {
  background: var(--volinik-card-bg);
  border: 1px solid var(--volinik-border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.general-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.general-stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--volinik-primary);
  margin-bottom: 5px;
}

.general-stat-label {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
}

/* General table styling */
.general-table {
  margin-top: 20px;
}

.general-table .table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.general-table .table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-bottom: 0;
}

.general-table .table thead {
  background: lightgray;
  color: #6b7280;
}

.general-table .table thead th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
}

.general-table .table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.general-table .table tbody tr:hover {
  background: #f8fafc;
}

.general-table .table tbody td {
  padding: 15px;
  vertical-align: top;
  line-height: 1.5;
}

/* General filters */
.general-filters {
  background: var(--volinik-card-bg);
  border: 1px solid var(--volinik-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.general-filters .form-select {
  border-radius: 8px;
  border: 1px solid var(--volinik-border);
  transition: all 0.3s ease;
}

.general-filters .form-select:focus {
  border-color: var(--volinik-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 90, 163, 0.25);
}

/* Category badges styling (Volinik style) */
.category-badge {
  display: inline-block;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 4px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.category-badge:last-child {
  margin-right: 0;
}

/* Category colors (pastel with darker text) */
.category-badge.age {
  background-color: #ffb3b3;
  color: #cc0000;
}

.category-badge.gender {
  background-color: #b3e5e0;
  color: #00695c;
}

.category-badge.race {
  background-color: #b3d9f0;
  color: #01579b;
}

.category-badge.religion {
  background-color: #c8e6c9;
  color: #1b5e20;
}

.category-badge.disability {
  background-color: #fff3e0;
  color: #e65100;
}

.category-badge.sexual-orientation {
  background-color: #f8bbd9;
  color: #880e4f;
}

.category-badge.nationality {
  background-color: #bbdefb;
  color: #0d47a1;
}

.category-badge.other {
  background-color: #d1c4e9;
  color: #4a148c;
}

/* Pagination spacing - ensure proper margin between table and pager */
.general-container .pagination {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* Ensure consistent spacing for all pagers in general containers */
.general-container .pager {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* Category highlight in text */
.category-highlight {
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin: 0 2px;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Detection status badges */
.detection-status {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detection-status.detected {
  background-color: #ffebee;
  color: #c62828;
}

.detection-status.not-detected {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.detection-status.pending {
  background-color: #fff3e0;
  color: #ef6c00;
}

.detection-status.error {
  background-color: #ffebee;
  color: #c62828;
}

/* Analysis history phrase comparison cards */
.analysis-phrase-card {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.analysis-phrase-card__text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  margin-bottom: 6px;
  line-height: 1.4;
}

.analysis-phrase-card__field {
  font-size: 0.8rem;
  margin-top: 4px;
  line-height: 1.35;
}

.analysis-phrase-card--removed {
  background: #fdecea;
  border-color: #f5c2c7;
}

.analysis-phrase-card--added {
  background: #e8f5e9;
  border-color: #badbcc;
}

.analysis-phrase-card--changed {
  background: #fff8e1;
  border-color: #ffe082;
}

.analysis-phrase-card--same {
  background: #f8f9fa;
  border-color: #dee2e6;
}

/* Volinik loading spinners */
.volinik-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--volinik-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: volinik-spin 1s linear infinite;
  margin: 0 auto;
}

.volinik-spinner-large {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

.volinik-spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

@keyframes volinik-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loading overlay with Volinik styling */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(238, 248, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20000;
}

.loader-content {
  background: var(--volinik-card-bg);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
}

.loader-content h2 {
  color: var(--volinik-primary);
  margin: 20px 0 10px 0;
  font-size: 1.5rem;
}

.loader-content p {
  color: #666;
  margin: 0;
  font-size: 1rem;
}

/* Bootstrap spinner override */
.spinner-border {
  border-color: var(--volinik-primary);
  border-right-color: transparent;
}

.spinner-border.text-primary {
  color: var(--volinik-primary) !important;
}

/* Highlight row on drag over in importable fields */
tr.drag-over {
  background-color: #e9ecef;
}

/* Guide cards styling */
.guide-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border: 1px solid #dee2e6;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--volinik-primary);
}

.guide-card .card-body {
  padding: 1.25rem;
}

.guide-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--volinik-primary);
}

.guide-card .badge {
  font-size: 0.75rem;
}
.container {
  position: relative;
  max-width: none !important;
  margin: 50px auto;
  background-color: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* Login form specific width */
.login-container {
	max-width: 400px !important;
}

/* Login header with logo */
.login-header {
	text-align: center;
	margin-bottom: 30px;
}

.login-logo {
	height: 80px;
	margin-bottom: 20px;
	display: block;
	margin-left: auto;
	margin-right: auto;
}
h1 {
  margin-top: 0;
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  color: var(--text-color);
}

/* Form styles */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.form-group label {
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--label-color);
}
/* Align all Bootstrap form controls to small button height */
.form-control,
.form-control-sm,
.form-select,
.form-select-sm {
  padding: .25rem .5rem;
  line-height: 1.5;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  font-size: .875rem;
  transition: border-color 0.2s;
}
/* Reserve space for select arrow */
.form-select,
.form-select-sm {
  padding-right: 2rem;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}
.form-actions {
  display: flex;
  justify-content: center;
}
.submit-btn {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}
.submit-btn:hover {
  background-color: var(--primary-hover);
}

/* Results table */
#results {
  margin-top: 30px;
}

/* Full-page loader overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  /* overlay above modals */
  z-index: 20000 !important;
}
#results table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
#results th,
#results td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
#results th {
  background-color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
}
#results tbody tr:hover {
  background-color: #fafafa;
  cursor: pointer;
}
#results input[type='number'] {
  width: 70px;
  padding: 6px;
}
#results input[type='checkbox'] {
  transform: scale(1.2);
  margin-right: 8px;
}

/* Dashboard grid layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.dashboard-cell {
  position: relative;
}

/* ensure dropdown menus on dashboard are visible above the grid */
.dashboard-cell .dropdown {
  z-index: 10;
}

/* Action button */
.action-btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 20px;
}
/* Filters row */
.filters {
  display: flex;
  gap: 1em;
  margin-bottom: 1em;
  align-items: center;
}
/* List grid rows */
.list {
  display: grid;
  grid-template-rows: auto;
  gap: 0.5em;
}
.list .row {
  display: grid;
  grid-template-columns: 50px 150px 1fr 200px 150px 200px;
  gap: 1em;
  padding: 0.5em;
  background: var(--white);
  border-radius: 4px;
  align-items: center;
}
.list .header {
  font-weight: 600;
  background: none;
  border-bottom: 2px solid var(--border-color);
}
/* Modal */
/* Modal overlay and container styles (generic modal) */
.modal:not(.fade) {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex !important;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal:not(.fade).hidden {
  display: none !important;
}
.modal-content {
  background: var(--white);
  padding: 2em;
  border-radius: 8px;
  min-width: 500px;
  max-width: 90%;
  position: relative;
}
/* Allow scrolling when content exceeds viewport height */
.modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Hide textarea until TinyMCE is ready */
.guide-editor-textarea {
  visibility: hidden;
}
/* Show TinyMCE editor once it's initialized */
.guide-editor-textarea + .tox-tinymce,
.tox-tinymce {
  visibility: visible !important;
}

/* Preserve line breaks in email body */
.email-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 1em;
}
/* Sticky footer for Create Document button in email details */
/* Footer slot in GenericModal: always sticky at bottom */
.modal-footer {
  position: sticky;
  bottom: 0;
  background-color: var(--white);
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  z-index: 10;
}
.action-btn:hover {
  background-color: var(--primary-hover);
}
/* Sortable table headers indicators */
th.sortable {
  cursor: pointer;
}
th.sortable::after {
  content: '\2195';
  font-size: .75rem;
  margin-left: .25rem;
  opacity: .5;
}
th.sortable[aria-sort="asc"]::after {
  content: '\2191';
}
th.sortable[aria-sort="desc"]::after {
  content: '\2193';
}
/* Toast notifications container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  /* ensure toasts always overlay modals */
  z-index: 20000 !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
/* Toast common style */
.toast {
  min-width: 200px;
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: 4px;
  color: #000;
  opacity: 0.95;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 14px;
  /* ensure visibility above bootstrap defaults */
  display: block !important;
}
.toast.success { background-color: #D4EDDA; color: #155724; }
.toast.error   { background-color: #F8D7DA; color: #721C24; }
.toast.warning { background-color: #FFF3CD; color: #856404; }
.toast.info    { background-color: #D1ECF1; color: #0C5460; }

/* Database connection status */
#connection-status {
  margin-bottom: 1em;
  font-weight: bold;
}
#connection-status.success { color: #155724; }
#connection-status.error   { color: #721C24; }
/* Logout button (in top-right of container) */
.logout-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}
.logout-btn:hover {
  color: var(--primary-hover);
}
/* Volinik Navbar styling */
.volinik-navbar {
  background-color: var(--volinik-card-bg) !important;
  border-bottom: 1px solid var(--volinik-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
}

.volinik-navbar .navbar-brand {
  color: var(--volinik-primary) !important;
  font-weight: bold;
  font-size: 1.2rem;
}

.volinik-navbar .navbar-brand:hover {
  color: var(--volinik-primary-hover) !important;
}

.volinik-navbar .nav-link {
  color: var(--volinik-primary) !important;
  font-weight: 500;
  padding: 8px 16px !important;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.volinik-navbar .nav-link:hover {
  color: var(--volinik-primary-hover) !important;
  background-color: var(--bs-primary-bg-subtle);
}

.volinik-navbar .nav-link.active {
  color: var(--volinik-primary-hover) !important;
  font-weight: bold;
  background-color: var(--bs-primary-bg-subtle);
}

/* User avatar styling */
.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--volinik-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 50%;
  font-size: 0.9rem;
}

/* Header navigation (legacy) */
nav {
  background-color: var(--primary-color);
  padding: 0.5em;
}
nav .header-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}
nav .header-menu li {
  margin-right: 1em;
}
nav .header-menu li a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
}
nav .header-menu li a:hover {
  text-decoration: underline;
}
nav .header-menu li.active a {
  text-decoration: underline;
}
/* Slide toggle containers */
.slidable {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.slidable.open {
  max-height: 1000px;
}

/* Comment field styling */
.comment-field {
  position: relative;
  width: 100%;
}

.comment-preview {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f8f9fa;
  cursor: pointer;
  font-size: 0.875rem;
  color: #6c757d;
  min-height: 32px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}

.comment-preview:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.comment-preview:not(:empty) {
  color: #495057;
  background-color: #ffffff;
}

.comment-textarea {
  resize: vertical;
  min-height: 60px;
  font-size: 0.875rem;
}

/* Document items table layout */
.document-items-table {
  table-layout: fixed;
  width: 100%;
}

.document-items-table th.col-number,
.document-items-table td:first-child {
  width: 40px;
  text-align: center;
}

.document-items-table th.col-code,
.document-items-table td:nth-child(2) {
  width: 120px;
}

.document-items-table th.col-name,
.document-items-table td:nth-child(3) {
  width: 200px;
}

.document-items-table th.col-quantity,
.document-items-table td:nth-child(4) {
  width: 100px;
}

.document-items-table th.col-unit,
.document-items-table td:nth-child(5) {
  width: 80px;
}

.document-items-table th.col-price,
.document-items-table td:nth-child(6) {
  width: 100px;
}

.document-items-table th.col-discount,
.document-items-table td:nth-child(7) {
  width: 100px;
}

.document-items-table th.col-comment,
.document-items-table td:nth-child(8) {
  width: 200px;
}

.document-items-table th.col-actions,
.document-items-table td:last-child {
  width: 50px;
  text-align: center;
}

/* Ensure inputs fit within their columns */
.document-items-table input,
.document-items-table select {
  width: 100%;
  min-width: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
  .document-items-table th.col-name,
  .document-items-table td:nth-child(3) {
    width: 150px;
  }

  .document-items-table th.col-comment,
  .document-items-table td:nth-child(8) {
    width: 150px;
  }
}

@media (max-width: 992px) {
  .document-items-table th.col-code,
  .document-items-table td:nth-child(2) {
    width: 100px;
  }

  .document-items-table th.col-name,
  .document-items-table td:nth-child(3) {
    width: 120px;
  }

  .document-items-table th.col-comment,
  .document-items-table td:nth-child(8) {
    width: 120px;
  }
}

/*
 * Vacancy detail Bootstrap modal: same viewport centering/size as .vacancy-overlay
 * (letter draft). Generic .modal-content rules above must not win here.
 */
#vacancyModal.show {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  margin: 0 !important;
  overflow: hidden !important;
}

#vacancyModal .modal-dialog.modal-vacancy-detail {
  --bs-modal-width: min(1400px, 96vw);
  width: min(1400px, 96vw) !important;
  max-width: min(1400px, 96vw) !important;
  height: calc(100vh - 2rem) !important;
  max-height: calc(100vh - 2rem) !important;
  margin: 0 !important;
  transform: none !important;
  pointer-events: auto;
}

#vacancyModal .modal-dialog.modal-vacancy-detail .modal-content {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#vacancyModal .modal-dialog.modal-vacancy-detail .modal-body {
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
}

/* Vacancy Bootstrap modal stays visible under letter/correct overlays */
#vacancyModal.vacancy-modal-beneath-overlay {
  pointer-events: none;
}

/* Letter draft: custom overlay (avoids Bootstrap modal focus-trap / pointer-events:none) */
.vacancy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1065;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.vacancy-overlay-panel {
  width: min(1400px, 96vw);
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--bs-body-bg, #fff);
  border: var(--bs-border-width, 1px) solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.175));
  border-radius: var(--bs-border-radius-lg, 0.5rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  overflow: hidden;
  pointer-events: auto;
}

.vacancy-overlay-header,
.vacancy-overlay-footer {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 1rem;
  gap: 0.5rem;
}

.vacancy-overlay-header {
  justify-content: space-between;
  border-bottom: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6);
}

.vacancy-overlay-footer {
  border-top: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6);
}

.vacancy-overlay-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  pointer-events: auto;
  user-select: text;
}

/* Draft vs sent letter comparison */
.letter-diff-added {
  background-color: #d1e7dd;
  color: #0f5132;
}

.letter-diff-removed {
  background-color: #f8d7da;
  color: #842029;
  text-decoration: line-through;
}

/* Environment banner (test / demo environment notice) */
.environment-banner {
  background-color: #fff3cd;
  border-bottom: 1px solid #ffe69c;
  color: #664d03;
  font-size: 0.875rem;
  padding: 0.35rem 1rem;
  text-align: center;
}

/* Final override to ensure body background and container padding persist */
body {
  background-color: #f0f8fe !important;
}

.container-fluid {
  padding: 10px 30px !important;
}