:root {
  --bg: #0b0f19;
  --panel: #131b2e;
  --panel2: #1e293b;
  --border: #2e3c54;
  --text: #f1f5f9;
  --sub: #94a3b8;
  --brand: #3b82f6;
  --brand-light: #60a5fa;
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.15);
  --warn: #f59e0b;
  --purple: #8b5cf6;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --panel2: #f1f5f9;
    --border: #cbd5e1;
    --text: #0f172a;
    --sub: #475569;
    --brand: #2563eb;
    --brand-light: #1d4ed8;
    --accent: #059669;
    --accent-soft: rgba(5, 150, 105, 0.12);
    --warn: #d97706;
    --purple: #7c3aed;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.brand { font-size: 1.25rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-badge { background: var(--brand); color: #fff; font-size: 0.7rem; font-weight: 800; padding: 0.2rem 0.5rem; border-radius: 4px; text-transform: uppercase; }
.sub { font-size: 0.85rem; color: var(--sub); }

nav.main { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
nav.main a {
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: var(--sub);
  background: transparent;
  transition: all 0.15s ease;
}
nav.main a:hover, nav.main a[aria-current="page"] {
  color: var(--text);
  background: var(--panel2);
  text-decoration: none;
  font-weight: 600;
}

.hero { padding: 2rem 0 1.5rem; }
.hero h1 { font-size: 1.85rem; font-weight: 800; line-height: 1.25; margin-bottom: 0.5rem; }
.hero p.lead { font-size: 1.05rem; color: var(--sub); max-width: 800px; margin-bottom: 1.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  box-shadow: var(--card-shadow);
}
.stat-num { font-size: 1.75rem; font-weight: 800; color: var(--brand-light); }
.stat-num.green { color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--sub); text-transform: uppercase; font-weight: 600; letter-spacing: 0.03em; }

.controls-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
}
.search-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-input {
  flex: 1;
  min-width: 260px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  color: var(--text);
}
.search-input:focus { outline: 2px solid var(--brand); border-color: transparent; }

.filters-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.select-filter {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
}
.btn-export {
  margin-left: auto;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-export:hover { background: var(--border); }

.pill-group { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pill {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--sub);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { color: var(--text); }
.pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tenders-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.tender-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease;
}
.tender-card:hover { border-color: var(--brand); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.buyer-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.buyer-name { font-weight: 700; font-size: 0.95rem; }
.badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.b-blue { background: rgba(59, 130, 246, 0.15); color: var(--brand-light); }
.b-green { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
.b-purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.b-amber { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.b-gray { background: var(--panel2); color: var(--sub); }

.card-subject { font-size: 1.05rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.card-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.budget-box { display: flex; align-items: baseline; gap: 0.5rem; }
.budget-val { font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.budget-na { font-size: 0.95rem; font-weight: 600; color: var(--sub); }
.budget-label { font-size: 0.85rem; color: var(--sub); }
.meta-info { font-size: 0.8rem; color: var(--sub); }

.btn-doc {
  background: var(--brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}
.btn-doc:hover { background: var(--brand-light); text-decoration: none; }

.cta-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  margin: 3rem 0;
  text-align: center;
}
.cta-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.5rem; }
.cta-card p { font-size: 0.95rem; color: var(--sub); max-width: 600px; margin: 0 auto 1.25rem; }
.lead-form { display: flex; gap: 0.5rem; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.lead-input {
  flex: 1;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}
.btn-lead {
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
}
.btn-lead:hover { background: var(--brand-light); }
.lead-msg { margin-top: 0.75rem; font-size: 0.85rem; color: var(--sub); }

.content-page { padding: 2rem 0; }
.content-page h1 { font-size: 1.85rem; font-weight: 800; margin-bottom: 1rem; }
.content-page h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.content-page p { margin-bottom: 1rem; color: var(--sub); font-size: 1rem; line-height: 1.7; }
.content-page ul, .content-page ol { margin: 1rem 0 1.5rem 1.5rem; color: var(--sub); }
.content-page li { margin-bottom: 0.5rem; }

.empty-msg { padding: 2rem 0; color: var(--sub); }
.actor-card { margin: 1.5rem 0; background: var(--panel); padding: 1.5rem; border-radius: 10px; border: 1px solid var(--border); }
.actor-desc { color: var(--sub); font-size: 0.9rem; margin-bottom: 0.75rem; }

.mt-2 { margin-top: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-05 { margin-top: 0.5rem; }
.mb-05 { margin-bottom: 0.5rem; }

.tw { width: 100%; overflow-x: auto; margin: 1.5rem 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--panel); border-radius: 8px; overflow: hidden; }
table.t th, table.t td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
table.t th { background: var(--panel2); font-weight: 700; color: var(--text); }

details { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.75rem; padding: 0.75rem 1rem; }
details summary { font-weight: 600; cursor: pointer; color: var(--text); }
details p { margin-top: 0.5rem; color: var(--sub); font-size: 0.925rem; }

footer.site {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
  font-size: 0.85rem;
  color: var(--sub);
  text-align: center;
}
footer.site a { color: var(--sub); text-decoration: underline; }
footer.site a:hover { color: var(--text); }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .wrap { padding: 0 0.85rem; }
  .controls-card { padding: 0.85rem; }
  .search-input { min-width: 0; width: 100%; }
  .filters-row { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .select-filter { width: 100%; }
  .btn-export { width: 100%; margin-left: 0; justify-content: center; }
  .stat-card { padding: 1rem; }
  .stat-num { font-size: 1.5rem; }
  .card-top { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .card-bottom { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .btn-doc { width: 100%; justify-content: center; }
  .brand-logo { font-size: 1rem; }
  .nav-links { gap: 0.5rem; }
  .nav-link { font-size: 0.775rem; padding: 0.35rem 0.6rem; }
}
