:root {
  --bg: #eef5f8;
  --panel: #ffffff;
  --panel-soft: #f7fbfd;
  --card-bg: #fbfdff;
  --ink: #162333;
  --brand: #0c5d7a;
  --line: #d6e0e8;
  --muted: #617786;
  --success: #0f8a5f;
  --warning: #996114;
  --danger: #b13838;
  --font-body: "Aptos", "Segoe UI", "Helvetica Neue", "Arial Nova", "Noto Sans", Arial, sans-serif;
  --font-heading: "Aptos Display", "Bahnschrift", "Trebuchet MS", "Arial Nova", "Segoe UI", sans-serif;
}
[data-theme="night"] {
  --bg: #0f1722;
  --panel: #172231;
  --panel-soft: #1c2a3a;
  --card-bg: #213042;
  --ink: #d9e6f2;
  --brand: #3aa9d6;
  --line: #2a3a4d;
  --muted: #98a9ba;
  --success: #54c48f;
  --warning: #e4b35e;
  --danger: #f07b7b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #d6edf6 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, #ffe5c8 0%, transparent 30%),
    var(--bg);
  line-height: 1.55;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
p { margin: 0 0 10px; }
[data-theme="night"] body {
  background:
    radial-gradient(circle at 12% 8%, #1a2b3d 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, #2b2533 0%, transparent 30%),
    var(--bg);
}
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-wrap { display: flex; gap: 10px; align-items: center; }
.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0d6382, #1f9f70);
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.brand { font-size: 1.2rem; font-weight: 700; color: var(--brand); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.nav-hamburger { display: none; }
.nav {
  padding: 10px 20px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
}
.container { max-width: 1200px; margin: 18px auto; padding: 0 12px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(10, 34, 60, 0.04);
}
.hero {
  background: linear-gradient(125deg, var(--panel-soft) 0%, var(--panel) 100%);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card, .mini-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--card-bg);
}
.stat-card strong { color: var(--brand); font-size: 1.4rem; }
.field-grid {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 10px 16px;
  align-items: center;
}
.filter-grid { align-items: end; }
.form-stack {
  display: grid;
  gap: 10px;
  max-width: 560px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tender-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 12px;
}
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  align-items: center;
}
.hero-image-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-soft);
}
.hero-image {
  width: 100%;
  height: auto;
  display: block;
}
.hero-image-inline {
  aspect-ratio: 980 / 620;
}
.hero-image-inline svg {
  width: 100%;
  height: auto;
  display: block;
}
.filter-sidebar {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-soft);
  max-height: 680px;
  overflow: auto;
}
.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.filter-sidebar.collapsed .filter-content {
  display: none;
}
.filter-toggle {
  padding: 6px 10px;
  font-size: 12px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.filter-group {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}
.filter-group summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  list-style: none;
}
.filter-group summary::-webkit-details-marker {
  display: none;
}
.filter-group summary::before {
  content: "▾";
  margin-right: 6px;
}
.filter-group:not([open]) summary::before {
  content: "▸";
}
.btn-heart {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;
}
.btn-heart.active {
  color: #d14662;
  border-color: #e7a3b1;
  background: #fff1f4;
}
[data-theme="night"] .btn-heart.active {
  background: #3c2230;
  border-color: #7d4157;
}
.full-line { grid-column: 1 / -1; }
input, select, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
label { font-size: 13px; color: var(--muted); font-weight: 600; }
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}
button {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.field-grid > label {
  color: var(--ink);
  margin: 0;
}
.field-grid > input,
.field-grid > select,
.field-grid > textarea {
  width: 100%;
}
.field-grid > button {
  grid-column: 2;
  width: fit-content;
}
.field-grid > .full-line {
  grid-column: 1 / -1;
}
.field-grid > .full-line label,
.field-grid > .full-line input,
.field-grid > .full-line select,
.field-grid > .full-line textarea {
  display: block;
}
.field-grid > .full-line input,
.field-grid > .full-line select,
.field-grid > .full-line textarea {
  margin-top: 6px;
  width: 100%;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table { width: 100%; border-collapse: collapse; min-width: 840px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.badge {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 2px 8px;
  font-size: 12px;
  text-transform: capitalize;
}
.badge-open, .badge-submitted, .badge-sent, .badge-roadmap { background: #eaf4fb; color: #165f87; border-color: #abd3e8; }
.badge-awarded, .badge-paid, .badge-active { background: #e8f7f0; color: #156948; border-color: #9dd8bc; }
.badge-closed, .badge-cancelled, .badge-blocked { background: #fbeceb; color: #9f3434; border-color: #e7b0ae; }
.badge-score-high { background: #e8f7f0; color: #156948; border-color: #9dd8bc; }
.badge-score-mid { background: #fff5e7; color: #8a5913; border-color: #efcf9b; }
.badge-score-low { background: #fbeceb; color: #9f3434; border-color: #e7b0ae; }
.badge-priority-high { background: #fbeceb; color: #9f3434; border-color: #e7b0ae; }
.badge-priority-medium { background: #fff5e7; color: #8a5913; border-color: #efcf9b; }
.badge-priority-low { background: #eaf4fb; color: #165f87; border-color: #abd3e8; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 12px; }
.login-panel { width: min(440px, 100%); }
.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.user-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  background: var(--panel-soft);
}
.muted { color: var(--muted); }
.home-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px;
}
.kpi strong {
  display: block;
  font-size: 1.45rem;
  color: var(--brand);
}
.msg-error { color: var(--danger); font-weight: 600; }
.msg-ok { color: var(--success); font-weight: 600; }
.msg-info { color: #165f87; font-weight: 600; }
[data-theme="night"] .msg-info { color: #7ec8ef; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cta-row a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  background: var(--panel);
  color: var(--ink);
}
.comparison-table table {
  min-width: 720px;
}
.action-card h3 {
  margin-top: 4px;
}
.wizard-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}
.wizard-step-indicator {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 7px 10px;
  text-align: center;
  font-weight: 700;
}
.wizard-step-indicator.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, var(--panel) 86%);
}
.wizard-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.tender-step > .field-grid {
  margin-top: 8px;
}
.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.footer-inner {
  padding: 14px 12px;
}
.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 820px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .topbar-right { width: 100%; flex-wrap: wrap; }
  .nav-hamburger { display: inline-grid; }
  .nav {
    display: none;
    width: 100%;
  }
  body.mobile-nav-open .nav {
    display: flex;
  }
  .tender-layout { grid-template-columns: 1fr; }
  .hero-split { grid-template-columns: 1fr; }
  .filter-sidebar {
    max-height: none;
  }
  .field-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .field-grid > button,
  .field-grid > .full-line {
    grid-column: 1;
  }
}
