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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

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

/* Header */
header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
}

.subtitle {
  font-size: 13px;
  color: #64748b;
}

/* Summary bar */
.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.summary-item {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #64748b;
}

.summary-value {
  font-weight: 600;
  color: #1e293b;
}

/* Search */
.search-bar {
  margin-bottom: 12px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: #94a3b8;
}

/* Filter section */
.filter-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

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

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.filter-sep {
  color: #94a3b8;
  font-size: 13px;
}

/* Filter buttony */
.filter-btn {
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
}

.filter-btn:hover {
  background: #f1f5f9;
}

.filter-btn.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}

/* Dropdowny */
.filter-select {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  outline: none;
}

/* Date inputs */
.filter-date {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

/* Reset button */
.reset-btn {
  padding: 6px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #64748b;
  transition: all 0.15s;
  margin-left: auto;
}

.reset-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* Error */
.error-message {
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Tabulka */
.tender-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}

.tender-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.tender-table th:hover {
  background: #f1f5f9;
}

.tender-table th.sorted-asc::after {
  content: ' \2191';
}

.tender-table th.sorted-desc::after {
  content: ' \2193';
}

.tender-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.tender-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

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

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

/* Truncated nazev */
.title-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hodnota */
.value-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.value-none {
  color: #94a3b8;
  font-style: italic;
}

/* No data */
.no-data {
  text-align: center;
  padding: 48px;
  color: #94a3b8;
}

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-active {
  background: #dbeafe;
  color: #1e40af;
}

.status-awarded {
  background: #dcfce7;
  color: #166534;
}

.status-cancelled {
  background: #fef2f2;
  color: #991b1b;
}

.status-completed {
  background: #e2e8f0;
  color: #475569;
}

/* Typ badge */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.type-vzmr {
  background: #f1f5f9;
  color: #475569;
}

.type-podlimitni {
  background: #fef9c3;
  color: #854d0e;
}

.type-nadlimitni {
  background: #fce7f3;
  color: #9d174d;
}

.type-unknown {
  background: #f1f5f9;
  color: #94a3b8;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
}

.page-btn.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

/* Popup backdrop */
.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Popup container */
.popup-container {
  background: #fff;
  border-radius: 12px;
  width: 800px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Popup header */
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.popup-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  padding-right: 12px;
}

.popup-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
}

.popup-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* Popup content */
.popup-content {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Popup metadata tabulka */
.meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.meta-table td {
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  vertical-align: top;
}

.meta-table td:first-child {
  font-weight: 500;
  color: #64748b;
  width: 140px;
  white-space: nowrap;
}

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

/* Popup popis */
.description-text {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.description-none {
  color: #94a3b8;
  font-style: italic;
  font-size: 14px;
}

/* CPV tagy */
.cpv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cpv-tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 0;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 12px;
  color: #475569;
}

/* Deadline colorization */
.deadline-soon {
  color: #b45309;
  font-weight: 500;
}

.deadline-past {
  color: #6b7280;
}

/* Link */
.tender-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 14px;
  word-break: break-all;
}

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

.link-none {
  color: #94a3b8;
  font-style: italic;
  font-size: 14px;
}

/* Nav bar */
.nav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.nav-btn {
  padding: 8px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: #64748b;
  transition: all 0.15s;
}

.nav-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.nav-btn.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}

/* Role badge (ucastnici souteze) */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-winner {
  background: #dcfce7;
  color: #166534;
}

.role-selected {
  background: #dbeafe;
  color: #1e40af;
}

.role-bidder {
  background: #f1f5f9;
  color: #475569;
}

/* SME badge */
.sme-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fef9c3;
  color: #854d0e;
  white-space: nowrap;
}

/* Section header v detailu */
.section-header {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 20px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Contracts table */
.contracts-table thead th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 12px 6px 0;
  border-bottom: 2px solid #e2e8f0;
}

.contracts-table tbody td {
  padding: 6px 12px 6px 0;
  font-size: 13px;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}

/* Platby a dodatky radky */
.payments-row,
.amendments-row {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
}

.payment-item,
.amendment-item {
  display: inline-block;
  margin-right: 8px;
  white-space: nowrap;
}

/* Ucastnici */
.participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.participant-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 160px;
  max-width: 240px;
}

.participant-header {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.participant-name {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  word-break: break-word;
  margin-bottom: 2px;
}

.participant-meta {
  font-size: 12px;
  color: #94a3b8;
}
