:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-color-light: #60a5fa;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #06b6d4;
  --background: #f8fafc;
  --card-background: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

body > * {
  flex-shrink: 0;
  width: 100%;
}

/* Header with status bar */
.app-header {
  background: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.header-top {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-left {
  display: flex;
  align-items: center;
}

.app-logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.2s ease;
  margin: 0;
  padding: 0;
  letter-spacing: -0.02em;
}

.app-logo:hover {
  color: var(--primary-color);
}

.app-logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.app-logo i {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.app-logo span {
  font-weight: 600;
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0;
  height: 64px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 64px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.nav-link.nav-active {
  color: var(--text-primary);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.nav-link i {
  font-size: 1rem;
  color: var(--text-tertiary);
}

.nav-link.nav-active i {
  color: var(--primary-color);
}

.nav-label {
  font-size: 0.875rem;
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 64px;
}

.nav-dropdown .nav-link {
  background: none;
  border: none;
  cursor: pointer;
}

.nav-dropdown.nav-active .nav-link {
  color: var(--text-primary);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.nav-dropdown.nav-active .nav-link i:first-child {
  color: var(--primary-color);
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0;
  z-index: 1000;
  margin-top: -2px;
}

/* Show dropdown on hover (desktop) */
.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}

/* Show dropdown when open class is added (mobile/touch) */
.nav-dropdown.open .nav-dropdown-content {
  display: block;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.nav-dropdown-item.active {
  background: var(--background-secondary);
  color: var(--primary-color);
  font-weight: 600;
}

.nav-dropdown-item i {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  width: 1rem;
  text-align: center;
}

.nav-dropdown-item.active i {
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
  .header-top {
    padding: 0 1rem;
    height: 56px;
  }

  .main-nav {
    height: 56px;
  }

  .nav-link {
    height: 56px;
    padding: 0 1rem;
  }

  .nav-dropdown {
    height: 56px;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem;
  }

  .header-left {
    flex: 1;
    min-width: 0;
  }

  .app-logo span {
    display: none;
  }

  .nav-label {
    display: none;
  }

  .nav-link {
    padding: 0 0.875rem;
    height: 48px;
  }

  .main-nav {
    height: 48px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-dropdown {
    height: 48px;
  }

  /* Dropdown content positioning for mobile */
  .nav-dropdown-content {
    left: auto;
    right: 0;
    min-width: 200px;
  }

  /* Header right elements */
  .header-right {
    order: 3;
    width: 100%;
    justify-content: space-between !important;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
  }

  .user-info {
    font-size: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  .header-top {
    padding: 0.25rem;
  }

  .app-logo-image {
    height: 32px;
  }

  .nav-link {
    padding: 0 0.5rem;
  }

  .status-text {
    display: none;
  }
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.status-dot.idle { background: var(--secondary-color); animation: none; }
.status-dot.running { background: var(--info-color); }
.status-dot.error { background: var(--error-color); animation: none; }
.status-dot.completed { background: var(--success-color); animation: none; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  color: var(--text-secondary);
  font-weight: 500;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  width: 100%;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem 2rem;
  }
}

h1 {
  color: var(--text-primary);
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  h1 {
    font-size: 2rem;
  }
}

h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.search-box {
  background: var(--card-background);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .search-box {
    flex-direction: row;
    align-items: stretch;
    padding: 1.5rem;
  }
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  position: relative;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.15s ease;
  background: var(--card-background);
  color: var(--text-primary);
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
  outline: none;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .button-group {
    flex-wrap: nowrap;
  }
}

button {
  padding: 0.625rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  min-height: 38px;
}

button:hover:not(:disabled) {
  background: var(--primary-hover);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.btn-secondary {
  background: var(--card-background);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

button.btn-secondary:hover:not(:disabled) {
  background: var(--background);
  color: var(--text-primary);
  border-color: var(--border-color);
}

button.btn-icon {
  padding: 0.625rem;
  min-width: 38px;
}

/* Results Layout - Two Column */
.results-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Show single column when documents column is hidden */
.results-layout:has(.documents-column:empty),
.results-layout:has(.table-container:empty),
.results-layout:has(table:empty) {
  grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
  .results-layout {
    grid-template-columns: 1fr;
  }
}

/* Applied Filters Display */
.filter-display {
  display: none;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  animation: slideDown 0.3s ease-out;
}

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

.filter-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label i {
  color: var(--primary-color);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--primary-color);
  font-weight: 500;
}

.filter-badge i {
  font-size: 0.75rem;
}

.filter-badge strong {
  font-weight: 600;
}

/* Applied filters - green/success color */
.filter-badge-applied {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: #10b981;
}

/* Removed filters - warning color */
.filter-badge-removed {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: #f59e0b;
  opacity: 0.85;
}

.filter-badge-removed em {
  font-style: italic;
  font-size: 0.8rem;
  opacity: 0.9;
}

.results-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.documents-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .documents-column {
    position: static;
    max-height: none;
  }
}

/* Scrollable table container */
.table-container {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--card-background);
  box-shadow: var(--shadow-sm);
}

/* Hide table container when empty */
.table-container:empty,
.table-container:has(table:empty) {
  display: none;
}

.table-container::-webkit-scrollbar {
  width: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

@media (max-width: 1024px) {
  .table-container {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

#answer {
  background: var(--card-background);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  line-height: 1.6;
  font-size: 0.9375rem;
}

#answer:empty {
  display: none;
}

.meta {
  background: var(--background);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.meta:empty {
  display: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-background);
  font-size: 0.875rem;
  border: none;
}

table:empty {
  display: none;
}

@media (max-width: 767px) {
  table {
    font-size: 0.875rem;
  }

  table thead {
    display: none;
  }

  table tr {
    display: block;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  table td {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
  }

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

  table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 1rem;
  }
}

table th,
table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

table th {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
}

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

table tbody tr {
  transition: all 0.2s ease;
}

table tbody tr:hover {
  background: var(--primary-light);
  transform: scale(1.01);
  box-shadow: var(--shadow-sm);
}

.doc-ref i {
  color: var(--primary-color);
  cursor: pointer;
  margin: 0 0.25rem;
  transition: all 0.2s ease;
}

.doc-ref i:hover {
  color: var(--error-color);
  transform: scale(1.2);
}

table tr.highlight {
  background: #fef3c7;
  transition: background 120ms ease-in-out;
}

table a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

table a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .header-row {
    justify-content: space-between;
  }
}

.header-row h1 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--card-background);
}

@media (min-width: 768px) {
  .header-row h1 {
    font-size: 2.25rem;
  }
}

#loading {
  background: var(--card-background);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  animation: pulse 1.5s infinite ease-in-out;
  font-size: 1.125rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.98);
  }
}

#configForm {
  background: var(--card-background);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

#configForm label {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.9375rem;
}

#configForm label:first-child {
  margin-top: 0;
}

#configForm small {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: block;
  line-height: 1.5;
}

#configForm input[type="text"],
#configForm input[type="number"],
#configForm textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

#configForm textarea {
  min-height: 120px;
  resize: vertical;
  font-family: 'Courier New', monospace;
}

#status {
  background: var(--card-background);
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--success-color);
}

#status.error {
  color: var(--error-color);
}

.container > button {
  display: block;
  margin: 1.5rem auto 0;
}

i.fas {
  color: currentColor;
  cursor: pointer;
}

.admin-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .admin-panel {
    padding: 2.5rem;
  }
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 640px) {
  .action-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .action-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}

.action-btn {
  padding: 1.5rem;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: 30px;
  justify-content: center;
}

.action-btn i {
  font-size: 2rem;
}

.action-btn:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.action-btn:disabled {
  background: var(--secondary-color);
  cursor: not-allowed;
  opacity: 0.6;
}

.status-panel {
  background: var(--card-background);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: 1.5rem 0;
}

.status-panel h2 {
  margin-top: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
}

.status-panel p {
  margin: 0.75rem 0;
  color: var(--text-secondary);
}

.status-panel strong {
  color: var(--text-primary);
}

.progress-bar {
  width: 100%;
  height: 40px;
  background: var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color), #059669);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
}

.status-idle { color: var(--secondary-color); }
.status-running { color: var(--primary-color); font-weight: 600; }
.status-downloading { color: var(--primary-color); font-weight: 600; }
.status-generating_db { color: var(--primary-color); font-weight: 600; }
.status-vectorizing { color: var(--primary-color); font-weight: 600; }
.status-completed { color: var(--success-color); font-weight: 600; }
.status-error { color: var(--error-color); font-weight: 600; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--card-background);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-4px);
}

#notification {
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
}

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

@media (max-width: 767px) {
  .btn-text {
    display: none;
  }

  button.btn-icon {
    padding: 0.875rem 1rem;
  }

  .button-group {
    width: 100%;
  }

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

@media (min-width: 768px) {
  .btn-text {
    display: inline;
  }

  .search-input-wrapper input {
    font-size: 1.0625rem;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

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

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

.fa-spinner {
  animation: spin 1s linear infinite;
}

#answer p {
  margin: 0.75rem 0;
}

#answer ul,
#answer ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

#answer li {
  margin: 0.5rem 0;
}

#answer strong {
  color: var(--text-primary);
  font-weight: 600;
}

#answer code {
  background: var(--border-color);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

scrollbar-width: thin;
scrollbar-color: var(--secondary-color) var(--border-color);

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border-color);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

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

/* Document reference badges in answer text - discreet style */
.doc-ref {
  display: inline;
  padding: 0.125rem 0.25rem;
  background: transparent;
  border-bottom: 1px dotted var(--text-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 400;
  font-size: 0.85em;
  font-style: italic;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.doc-ref:hover {
  background: var(--border-light);
  border-bottom: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.doc-ref i {
  font-size: 0.75em;
  margin-right: 0.25rem;
}

/* Highlighted affair card */
.affair-card {
  transition: all 0.3s ease;
}

.affair-card.highlighted {
  box-shadow: 0 0 0 3px var(--primary-color) !important;
  transform: scale(1.02) !important;
}

/* Loading animation for search box */
@keyframes pulse-border {
  0%, 100% {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
  }
}

.search-box.loading {
  animation: pulse-border 2s ease-in-out infinite;
}

.search-box.loading .search-input-wrapper input {
  border-color: var(--primary-color);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ===================================
   Lucide Icons Styles
   =================================== */

/* Icon sizing (Lucide default is 24px) */
i[data-lucide] {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
}

/* Spinning animation for loaders */
.lucide-spin {
  animation: lucide-spin 1s linear infinite;
}

@keyframes lucide-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Icon in buttons */
button i[data-lucide],
.action-btn i[data-lucide],
.logout-btn i[data-lucide] {
  margin-right: 0.5rem;
}

/* Ensure consistent sizing */
.nav-link i[data-lucide] {
  width: 1.25rem;
  height: 1.25rem;
}

/* ===================================
   Footer
   =================================== */
.app-footer {
  background: var(--card-background);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  text-align: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.footer-version {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .app-footer {
    padding: 1rem;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .footer-left,
  .footer-right {
    justify-content: center;
  }
}
