/* styles.css — Modern, Mobile-Friendly Styles for EuroTender */
/* Covers: index.php, alerts.php, tender.php, dashboard.php */

/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
  --primary: #1a237e;
  --primary-light: #283593;
  --primary-dark: #0d144d;
  --purple: #6d4aff;
  --purple-light: #5a3acc;
  --accent-green: #25D366;
  --accent-green-hover: #128C7E;
  --accent-red: #d32f2f;
  --accent-red-hover: #b71c1c;
  --accent-yellow: #fff3cd;
  --accent-yellow-text: #856404;
  --bg-body: #f8f9fa;
  --bg-body-alt: #f0f0f5;
  --bg-card: #ffffff;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --border-color: #dee2e6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --line-height-base: 1.6;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ========================================
   Header (all pages)
   ======================================== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: var(--spacing-lg) var(--spacing-sm);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header--purple {
  background: var(--purple);
}

.header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: var(--spacing-xs);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.header .subtitle {
  font-size: clamp(0.875rem, 2vw, 1rem);
  opacity: 0.95;
}

.header a {
  color: #bbdefb;
  text-decoration: none;
}

.header a:hover {
  color: white;
  text-decoration: underline;
}

/* Dashboard header (flex layout) */
.header--dashboard {
  background: var(--purple);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  position: relative;
  z-index: 10;
}

.header--dashboard h1 {
  font-size: 1.25rem;
  margin: 0;
}

.header-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-xs);
  width: 100%;
  flex-direction: column;
}

@media (min-width: 768px) {
  .header-controls {
    width: auto;
    flex-direction: row;
    align-items: center;
  }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.control-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-sm);
}

.container--narrow {
  max-width: 600px;
}

.container--wide {
  max-width: 1200px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  border: 1px solid rgba(0,0,0,0.04);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Tender detail card */
.detail-card {
  background: white;
  max-width: 800px;
  margin: var(--spacing-sm) auto;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.back-link {
  display: inline-block;
  margin-bottom: var(--spacing-sm);
  color: var(--purple);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* ========================================
   Typography
   ======================================== */
h1 { margin-bottom: var(--spacing-xs); }
h2 {
  margin-bottom: var(--spacing-md);
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 700;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ========================================
   Forms
   ======================================== */
label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background-color: white;
  transition: all 0.2s ease;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

/* Alerts page input margins */
input[type="email"],
input[type="text"] {
  margin-bottom: var(--spacing-sm);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

/* ========================================
   Buttons
   ======================================== */
.btn,
.btn-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover,
.btn-search:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: white;
  text-decoration: none;
}

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

.btn-danger {
  background: var(--accent-red);
}

.btn-danger:hover {
  background: var(--accent-red-hover);
}

/* Dashboard back button (white on purple) */
.btn-back-dashboard {
  background: white;
  color: var(--purple);
}

.btn-back-dashboard:hover {
  background: #f0f0f0;
  color: var(--purple);
}

.btn-reset {
  background: white;
  color: var(--purple);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-reset:hover {
  background: #f0f0f0;
  text-decoration: none;
}

/* ========================================
   Search Form (index.php)
   ======================================== */
.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-sm);
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.small {
  flex: 0 0 150px;
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.results-info {
  margin-bottom: var(--spacing-md);
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: var(--spacing-sm);
  background: var(--bg-body);
  border-radius: var(--radius-sm);
}

.results-info strong { color: var(--primary); }

/* ========================================
   Tender Cards (index.php)
   ======================================== */
.tender-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  transition: all 0.3s ease;
}

.tender-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.tender-title {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
}

.tender-title a {
  color: inherit;
  text-decoration: none;
}

.tender-title a:hover { text-decoration: underline; }

.tender-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
  line-height: 1.5;
}

.tender-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tender-desc {
  color: var(--text-primary);
  margin: var(--spacing-sm) 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.tender-actions {
  margin-top: var(--spacing-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.action-btn {
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}

.action-btn:hover {
  background: #e9ecef;
  border-color: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.wa-share {
  background: var(--accent-green);
  color: white;
  border-color: var(--accent-green);
}

.wa-share:hover {
  background: var(--accent-green-hover);
  color: white;
  border-color: var(--accent-green-hover);
}

.copy-success {
  background: var(--accent-green) !important;
  color: white !important;
  border-color: var(--accent-green) !important;
}

/* Alert button on tender.php */
.alert-btn {
  background: var(--purple);
  color: white;
  border: 1px solid var(--purple);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
  cursor: pointer;
}

.alert-btn:hover {
  background: var(--purple-light);
  color: white;
  text-decoration: none;
}

/* FTS link on tender.php */
.fts-link {
  display: inline-block;
  margin-top: var(--spacing-sm);
  padding: 0.5rem 1rem;
  background: var(--purple);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.fts-link:hover {
  background: var(--purple-light);
  color: white;
  text-decoration: none;
}

/* ========================================
   Tender Detail (tender.php)
   ======================================== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #d4edda;
  color: #155724;
  margin-bottom: var(--spacing-sm);
}

.meta-row {
  color: #777;
  font-size: 0.9rem;
  margin: 5px 0;
}

.meta-label {
  font-weight: 600;
  color: #555;
}

.description {
  margin-top: var(--spacing-sm);
  color: #444;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.actions {
  margin-top: var(--spacing-md);
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

/* Award section */
.award-section {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: #f0fdf4;
  border-radius: var(--radius-md);
  border-left: 4px solid #2e7d32;
}

.pending-section {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--accent-yellow);
  border-radius: var(--radius-md);
  border-left: 4px solid #ffc107;
}

/* Documents grid */
.doc-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.doc-item {
  padding: 8px 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doc-item:hover {
  border-color: var(--purple);
  background: #fafafa;
}

.doc-title {
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.doc-meta {
  font-size: 0.75rem;
  color: #888;
}

/* ========================================
   Alerts Page
   ======================================== */
.example-tag {
  display: inline-block;
  background: #e8eaf6;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin: 0.125rem;
  color: #3949ab;
  cursor: pointer;
  transition: all 0.2s ease;
}

.example-tag:hover {
  background: #c5cae9;
}

.success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.error {
  background: #ffebee;
  color: #c62828;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.alert-item {
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-sm) 0;
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-keywords {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.alert-mode {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.unsubscribe-section {
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-lg);
}

.unsubscribe-section .btn {
  background: var(--accent-red);
}

.unsubscribe-section .btn:hover {
  background: var(--accent-red-hover);
}

.tender-preview {
  background: var(--bg-body);
  border-left: 3px solid var(--primary);
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-xs) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9rem;
}

.tender-preview .title {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--primary);
}

.tender-preview .meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ========================================
   Dashboard
   ======================================== */
.segment-select,
.supplier-search-input {
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: white;
  color: #333;
  cursor: pointer;
  min-width: 220px;
}

.supplier-search-input {
  cursor: text;
}

.segment-select:focus,
.supplier-search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(109,74,255,0.1);
}

.supplier-search-wrapper {
  position: relative;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.kpi-card {
  background: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.kpi-val {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--purple);
  margin: 5px 0;
}

.kpi-label {
  font-size: 0.8rem;
  color: #777;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

@media (min-width: 768px) {
  .charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

.chart-card {
  background: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  height: 350px;
}

.chart-card canvas {
  max-height: 300px !important;
  width: 100% !important;
}

.chart-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

/* Tables */
.table-container {
  background: white;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.suppliers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 600px;
}

.suppliers-table th,
.suppliers-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.suppliers-table th {
  background: #f8f9fa;
  font-weight: 600;
  white-space: nowrap;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sort-toggle {
  display: flex;
  gap: 5px;
}

.btn-sort {
  background: #f0f0f5;
  color: var(--purple);
  border: 1px solid var(--purple);
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sort.active {
  background: var(--purple);
  color: white;
}

/* Filter bar */
.filter-bar {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.supplier-tag {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.supplier-tag a {
  color: #ef6c00;
  text-decoration: none;
  font-weight: bold;
}

/* Status badges (dashboard) */
.status-badge {
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
}

.status-active { background: #e3f2fd; color: #1565c0; }
.status-planned { background: #fff3e0; color: #ef6c00; }
.status-cancelled { background: #ffebee; color: #c62828; }
.status-awarded { background: #e8f5e9; color: #2e7d32; }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.95);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--purple);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-sm);
}

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

.loading-text {
  font-size: 1rem;
  color: var(--purple);
  font-weight: 600;
}

.cache-badge {
  font-size: 0.7rem;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-left: 5px;
}

/* Autocomplete (dashboard) */
.autocomplete-results {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: #f0f0f5;
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item .ac-name {
  font-weight: 600;
  color: #333;
}

.autocomplete-item .ac-stats {
  font-size: 0.75rem;
  color: #888;
}

.autocomplete-loading {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #888;
  text-align: center;
}

.autocomplete-empty {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #999;
  text-align: center;
}

/* ========================================
   Pagination (shared)
   ======================================== */
.pagination {
  display: flex;
  gap: 6px;
  margin: var(--spacing-md) 0;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination a,
.page-link {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--primary);
  background: white;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  min-width: 2.5rem;
  text-align: center;
}

.pagination a:hover,
.page-link:hover {
  background: #f8f9fa;
  border-color: var(--primary-light);
  text-decoration: none;
}

.pagination a.current,
.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* ========================================
   Highlighting
   ======================================== */
mark {
  background: var(--accent-yellow);
  color: var(--accent-yellow-text);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95em;
}

/* ========================================
   Status Messages
   ======================================== */
.no-results {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
  font-size: 1rem;
}

.last-updated {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: var(--spacing-sm);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .container {
    padding: var(--spacing-md) var(--spacing-sm);
  }

  .card {
    padding: var(--spacing-md);
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .form-group.small {
    flex: 1;
    min-width: auto;
  }

  .tender-actions {
    flex-direction: column;
  }

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

  .pagination a,
  .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: 2rem;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }

  .header { padding: var(--spacing-md) var(--spacing-sm); }
  .header h1 { font-size: 1.5rem; }

  .container { padding: var(--spacing-sm); }
  .card { padding: var(--spacing-sm); margin-bottom: var(--spacing-sm); }
  .tender-card { padding: var(--spacing-sm); }
  .tender-title { font-size: 1.1rem; }
  .tender-desc { font-size: 0.9rem; }
  .btn-search { width: 100%; padding: 0.875rem; }
  .action-btn { font-size: 0.8rem; padding: 0.5rem 0.75rem; }
}

@media (min-width: 1200px) {
  .container { max-width: 1400px; }
}

/* Print */
@media print {
  .header, .search-form, .tender-actions, .pagination,
  .last-updated, .loading-overlay, .header-controls {
    display: none;
  }

  .tender-card {
    break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  body { background: white; color: black; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border-color: #000;
    --text-secondary: #333;
  }
  .action-btn, .pagination a, .page-link {
    border-width: 2px;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}