
:root {
  --bg-main: #020617;
  --bg-panel: rgba(15, 23, 42, 0.9);
  --border-soft: rgba(148, 163, 184, 0.4);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  background: radial-gradient(circle at top, #020617, #020617 45%, #020617);
  color: var(--text-main);
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-shell.wide .main-content,
.app-shell.wide .app-header {
  max-width: 100%;
}

.glassy {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(18px);
}

.app-header {
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-header h1 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem 0;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-stats {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stat-card {
  padding: 0.6rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-value {
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 600;
}

.lang-switch {
  display: flex;
  gap: 0.3rem;
}

.lang-btn {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.lang-btn.active {
  background: rgba(37, 99, 235, 0.9);
}

.main-content {
  padding: 0.9rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.main-content.wide {
  margin: 0;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 220px;
}

.search-box input {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.8);
  color: inherit;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 150px;
}

.filter-group.small {
  min-width: 120px;
}

.filter-group label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.filter-group select {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.8);
  color: inherit;
  font-size: 0.8rem;
}

.table-wrapper {
  margin-top: 0.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  overflow: hidden;
}

.tender-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.tender-table thead {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
}

.tender-table th,
.tender-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.35);
  vertical-align: top;
}

.tender-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
}

.tender-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.7);
}

.tender-table tbody tr:hover {
  background: rgba(30, 64, 175, 0.35);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.chip-small {
  font-size: 0.62rem;
  padding-inline: 0.38rem;
}

.chip-accent {
  border-color: #38bdf8;
  color: #e0f2fe;
  background: radial-gradient(circle at top, rgba(8, 47, 73, 0.9), rgba(15, 23, 42, 0.95));
}

.chip-success {
  border-color: #22c55e;
  color: #bbf7d0;
}

.chip-warning {
  border-color: #f97316;
  color: #fed7aa;
}

.chip-danger {
  border-color: #ef4444;
  color: #fecaca;
}

.amount-stack {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.amount-row {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
}

.amount-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.amount-value {
  font-size: 0.75rem;
  font-weight: 500;
}

.amount-bar {
  margin-top: 0.15rem;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.amount-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, #22d3ee, #0ea5e9);
}

.amount-bar-fill.chip-success {
  background: #22c55e;
}

.amount-bar-fill.chip-warning {
  background: #f97316;
}

.amount-bar-fill.chip-danger {
  background: #ef4444;
}

/* Calendar-style date icon */
.date-badge {
  width: 42px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.date-top {
  background: #ef4444;
  color: #f9fafb;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 600;
  padding: 2px 0;
}

.date-bottom {
  background: #f9fafb;
  color: #0f172a;
  text-align: center;
  padding: 3px 0 4px;
}

.date-main {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.date-sub {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.flag-row {
  display: flex;
  gap: 0.25rem;
}

.flag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.flag-chip.chip-success {
  border-color: #22c55e;
  color: #bbf7d0;
}

.flag-chip.chip-warning {
  border-color: #f97316;
  color: #fed7aa;
}

.flag-chip.chip-danger {
  border-color: #ef4444;
  color: #fecaca;
}

.pagination-row {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.page-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
}

.btn.secondary {
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.link {
  color: #38bdf8;
  text-decoration: none;
}

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

.tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.7rem;
  background: rgba(15,23,42,0.98);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.8);
  pointer-events: none;
}

/* Insights & heatmap styles – compact */
.insights-shell {
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.insights-shell.compact {
  margin-top: 0.1rem;
}

.insights-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.filter-group.tiny {
  min-width: 90px;
}

.filter-group.tiny select {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

.insights-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.insight-card {
  padding: 0.45rem 0.6rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, rgba(15,23,42,0.95), rgba(15,23,42,0.9));
}

.insight-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.insight-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.insights-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ranking-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ranking-main {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.ranking-name {
  font-weight: 500;
  min-width: 0;
}

.ranking-name .link {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: inline-block;
  max-width: 260px;
}

.ranking-stats {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.heat-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
}

.heat-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(to right, #22d3ee, #0ea5e9);
}

.insights-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .app-header {
    padding: 1rem;
  }
  .header-main {
    flex-direction: column;
    align-items: flex-start;
  }
  .app-shell {
    padding-inline: 0.75rem;
  }
}
