* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.5;
}
a { color: var(--brand-bright-blue); }
h1, h2, h3 { color: var(--brand-navy-text); font-weight: 700; letter-spacing: -0.02em; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: var(--header-bg, white); border-bottom: 1px solid var(--border-card); box-shadow: 0 8px 24px rgba(8, 40, 64, 0.04); position: sticky; top: 0; z-index: 2; }
.portal-banner {
  min-height: 120px;
  background-size: cover;
  background-position: center;
  background-color: var(--brand-deep-navy);
}
.theme-colors { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.theme-preview { margin: 16px 0; box-shadow: var(--card-shadow); }
.tender-layout-cards .tender-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tender-layout-cards .tender-results .table-wrap { display: none; }
.tender-layout-list .tender-card-grid { display: none; }
.card, form.card { box-shadow: var(--card-shadow, 0 8px 24px rgba(8, 40, 64, 0.04)); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand-navy-text); font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.nav a { text-decoration: none; font-size: 14px; }
.nav a[aria-current="page"] { font-weight: 700; color: var(--brand-navy-text); }
.nav a.btn, .nav a.btn[aria-current="page"] { color: white; }
.account-menu { position: relative; }
.account-toggle { color: white; }
.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 8px;
  background: white;
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(8, 40, 64, 0.08);
  z-index: 3;
}
.account-panel[hidden] { display: none; }
.account-panel a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--brand-navy-text); }
.account-panel a:hover { background: var(--bg-alt); }
.menu-toggle { display: none; }
.hero {
  background: linear-gradient(100deg, var(--brand-deep-navy), var(--brand-corporate-blue));
  color: white;
  border-radius: var(--radius);
  padding: 42px 36px;
  margin: 24px 0;
}
.hero h1, .hero p { color: white; }
.eyebrow { color: var(--text-caption); letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; font-weight: 700; margin: 0 0 6px; }
.hero .eyebrow { color: var(--brand-yellow); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card, form.card, .table-wrap {
  background: white;
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(8, 40, 64, 0.04);
}
.card, form.card { padding: 18px; }
.table-wrap { margin-top: 16px; overflow-x: auto; }
.btn, button {
  background: var(--brand-corporate-blue);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.secondary, button.secondary { background: var(--button-secondary, white); color: var(--brand-corporate-blue); border: 1px solid var(--border-card); }
.btn.yellow { background: var(--brand-yellow); color: var(--brand-deep-navy); }
label { display: block; font-size: 13px; color: var(--text-caption); margin: 12px 0 4px; }
.hint { margin: 4px 0 0; color: var(--text-caption); font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--brand-navy-text);
  background: white;
}
textarea { min-height: 90px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flash {
  padding: 12px 14px 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  border: 1px solid transparent;
  border-left-width: 4px;
}
.flash.ok {
  background: #eef7f1;
  color: #0d5c32;
  border-color: #cfe8d8;
  border-left-color: #1a7f4b;
}
.flash.error {
  background: #fdf0f0;
  color: #7a1f1f;
  border-color: #f0d0d0;
  border-left-color: #b43333;
}
.error-panel {
  max-width: 520px;
  margin: 40px 0 24px;
  padding: 28px 28px 24px;
  background: white;
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--brand-corporate-blue);
  border-radius: 8px;
}
.error-panel h1 { margin: 0 0 8px; }
.error-panel p { margin: 0 0 8px; }
.page-lead { margin: 0 0 20px; color: var(--text-caption); max-width: 52rem; }
input[type="color"] {
  width: 100%;
  min-width: 64px;
  height: 42px;
  padding: 3px;
  border-radius: 8px;
  cursor: pointer;
  background: white;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-card);
  border-radius: 5px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0 20px;
  padding: 4px;
  border-bottom: 1px solid var(--border-card);
}
.tabs a {
  text-decoration: none;
  color: var(--text-caption);
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-bottom: 0;
}
.tabs a:hover { color: var(--brand-navy-text); background: var(--bg-alt); }
.tabs a[aria-current="page"] {
  color: var(--brand-navy-text);
  background: white;
  border-color: var(--border-card);
  margin-bottom: -1px;
}
table { width: 100%; border-collapse: collapse; }
th { text-align: left; background: var(--brand-deep-navy); color: white; padding: 10px; font-size: 13px; }
td { padding: 10px; border-bottom: 1px solid var(--border-card); vertical-align: top; }
tr:nth-child(even) td { background: var(--bg-alt); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 8px; background: var(--bg-alt); color: var(--brand-navy-text); font-size: 12px; margin-right: 4px; }
.pill.warn { background: var(--brand-yellow); }
main { flex: 1 0 auto; padding-bottom: 36px; }
main h1 { margin: 28px 0 8px; }
main h2 { margin: 28px 0 10px; }
form.card + form.card, .table-wrap, .grid { margin-top: 16px; }
form.narrow { max-width: 520px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-corporate-blue); border-color: var(--brand-corporate-blue); }
.tender-card h3 { margin: 0 0 8px; }
.tender-card h3 a { color: var(--brand-navy-text); text-decoration: none; }
.tender-card .pills { margin-top: 12px; }
a.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: white;
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(8, 40, 64, 0.04);
  text-decoration: none;
  color: var(--text-body);
}
a.stat strong { font-size: 2rem; line-height: 1; color: var(--brand-navy-text); }
a.stat em { color: var(--brand-bright-blue); font-style: normal; font-weight: 600; }
.link-list { padding-left: 18px; }
tbody tr:hover td { background: var(--bg-alt); }
.footer { margin-top: 0; flex-shrink: 0; background: var(--footer-bg, var(--brand-deep-navy)); color: white; padding: 28px 0; }
.footer a { color: white; }
.legal h2 { margin: 1.4em 0 0.4em; font-size: 1.25rem; }
.legal h3 { margin: 1.1em 0 0.3em; font-size: 1.05rem; }
.legal p, .legal ul { margin: 0.6em 0; }
.legal ul { padding-left: 1.2em; }
.legal-table { overflow-x: auto; margin: 12px 0; }
.legal-table table { min-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.check input { width: auto; margin-top: 4px; }
.password-field {
  position: relative;
  display: block;
  width: 100%;
}
.password-field input {
  width: 100%;
  padding-right: 44px;
}
.password-field .password-toggle,
button.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-caption);
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  line-height: 0;
}
.password-field .password-toggle:hover,
button.password-toggle:hover {
  background: var(--bg-alt);
  color: var(--brand-navy-text);
}
.password-field .password-toggle:focus-visible,
button.password-toggle:focus-visible {
  outline: 2px solid var(--brand-corporate-blue);
  outline-offset: 1px;
}
.password-field .password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.catalog-block { margin-top: 16px; }
.catalog-nested { margin: 8px 0 20px; padding: 14px 16px; }
.catalog-nested h4 { margin: 0 0 10px; font-size: 1rem; }
.catalog-list { list-style: none; padding: 0; margin: 0 0 12px; }
.catalog-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border-card);
}
.catalog-list li:first-child { border-top: 0; }
.catalog-subitem form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.catalog-subitem input[name="name"] { min-width: 160px; flex: 1; }
.inline-actions { margin: 0 0 8px; }
body.staff {
  background: #eef3f7;
}
body.staff .topbar {
  box-shadow: none;
  border-bottom: 1px solid #d5e0e8;
}
body.staff .bar { min-height: 64px; }
body.staff .nav a {
  font-size: 13px;
  color: var(--text-body);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
body.staff .nav a[aria-current="page"] {
  border-bottom-color: var(--brand-corporate-blue);
  color: var(--brand-navy-text);
}
body.staff .btn,
body.staff button {
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 14px;
}
body.staff .card,
body.staff form.card,
body.staff .table-wrap {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(8, 40, 64, 0.04);
}
body.staff main h1 { margin: 22px 0 6px; font-size: 1.65rem; }
body.staff main h2 { margin: 22px 0 10px; font-size: 1.15rem; }
body.staff th {
  background: #0d3550;
  font-weight: 600;
  letter-spacing: 0.01em;
}
body.staff a.stat {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(8, 40, 64, 0.04);
  border-left: 3px solid var(--brand-corporate-blue);
}
body.staff .pill { border-radius: 4px; }
body.staff input,
body.staff select,
body.staff textarea { border-radius: 6px; }
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
  .hero { padding: 28px 18px; }
  .bar { flex-wrap: wrap; padding: 10px 0; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .nav { display: none; width: 100%; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .account-panel { position: static; box-shadow: none; width: 100%; }
  table { display: block; overflow-x: auto; }
}
