/* MedDrop — чистый монохромный аналитический стиль:
   верхняя навигация, чёрные кнопки-пилюли, жирные заголовки, цвет только в данных. */
:root {
  --ink: #0b0b0c;
  --text: #52525b;
  --muted: #9b9ba3;
  --bg: #ffffff;
  --surface: #ffffff;
  --line: #ebebed;
  --track: #f4f4f5;
  --dark: #111113;
  --green: #16a34a;
  --green-soft: #e8f6ed;
  --amber: #b45309;
  --amber-soft: #fdf2e3;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --purple: #6d4aff;
  --purple-soft: #efe9ff;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 12, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(11, 11, 12, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- Top navigation ---------- */
.topnav {
  display: flex; align-items: center; gap: 26px;
  height: 60px; padding: 0 30px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 22px; font-weight: 900; letter-spacing: -0.05em; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 13px; border-radius: 8px;
  color: var(--muted); font-size: 14.5px; font-weight: 500; text-decoration: none;
  transition: color 0.12s, background 0.12s;
}
.nav-links a:hover { color: var(--ink); background: var(--track); text-decoration: none; }
.nav-links a.active { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; color: var(--ink); max-width: 200px; }
.uc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }

/* ---------- Buttons (pills) ---------- */
button, .btn, .btn-dark {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--dark); color: #fff; border: 1px solid var(--dark);
  padding: 11px 22px; border-radius: 999px; text-decoration: none; display: inline-block;
  transition: background 0.13s, box-shadow 0.13s, transform 0.07s, border-color 0.13s;
}
button:hover, .btn:hover, .btn-dark:hover { background: #000; border-color: #000; color: #fff; text-decoration: none; box-shadow: var(--shadow-md); }
button:active, .btn:active { transform: translateY(1px); }
.btn-ghost {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 11px 22px; border-radius: 999px; text-decoration: none; display: inline-block;
  transition: background 0.13s, border-color 0.13s;
}
.btn-ghost:hover { background: var(--track); border-color: #dcdce0; color: var(--ink); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.inline { display: inline; margin: 0; }

/* ---------- Layout ---------- */
.container { max-width: 1080px; width: 100%; margin: 0 auto; padding: 34px 30px 10px; }

h1 { font-size: 31px; font-weight: 800; letter-spacing: -0.035em; color: var(--ink); margin: 0 0 18px; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); margin: 34px 0 14px; }
p { margin: 0 0 12px; }
a { color: var(--ink); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0; }

/* ---------- Stat cards (metrics) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 22px 0 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.stat-label { font-size: 12px; color: var(--muted); margin: 0 0 8px; font-weight: 500; }
.stat-val { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.stat-val.green { color: var(--green); }
.stat-val.amber { color: var(--amber); }
.stat-val.red { color: var(--red); }
.stat-val.cyan, .stat-val.gold { color: var(--ink); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }

/* lot cards (order feed) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 18px; }
.lot-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; color: inherit;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.lot-card:hover { border-color: #dcdce0; box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.lc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.lc-deadline { color: var(--amber); font-weight: 600; }
.lc-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 14px; }
.lc-meta { display: flex; gap: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text); }
.lc-meta b { color: var(--ink); font-weight: 700; }
.lc-foot { margin-top: 14px; }
.lc-cta { font-weight: 600; color: var(--ink); font-size: 13.5px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form.narrow { max-width: 100%; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.form input, .form textarea, .form select {
  font: inherit; font-weight: 400; padding: 11px 13px;
  background: #fff; border: 1px solid #dcdce0; border-radius: 10px; color: var(--ink);
  transition: border-color 0.13s, box-shadow 0.13s;
}
.form input::placeholder, .form textarea::placeholder { color: #b3b3ba; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.08); }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.form legend { font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.radio { flex-direction: row !important; align-items: center; gap: 9px; font-weight: 500 !important; cursor: pointer; color: var(--text); }
.radio input { accent-color: var(--ink); width: 16px; height: 16px; }
.qty { width: 100px; }

/* ---------- Tables ---------- */
table.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: #fafafa; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table td { color: var(--ink); }
.table tbody tr:hover { background: #fafafa; }
.table tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.badge-open { background: var(--green-soft); color: var(--green); }
.badge-closed { background: var(--track); color: #6b6b73; }
.badge-bid-pending { background: var(--amber-soft); color: var(--amber); }
.badge-bid-accepted { background: var(--green-soft); color: var(--green); }
.badge-bid-rejected { background: var(--red-soft); color: var(--red); }

/* ---------- Flash ---------- */
.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.flash-success { background: var(--green-soft); color: var(--green); border-color: #c8ebd4; }
.flash-error { background: var(--red-soft); color: var(--red); border-color: #f6cccc; }

/* ---------- Auth ---------- */
.auth { max-width: 400px; margin: 48px auto 0; }
.auth h1 { text-align: center; font-size: 26px; }
.auth > p { text-align: center; }
.auth .card { box-shadow: var(--shadow-md); }

/* ---------- Comparison matrix ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; }
.cmp th, .cmp td { white-space: nowrap; vertical-align: top; }
.cmp .unit-note { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.cmp .best { background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.3); color: var(--green); font-weight: 700; }
.cmp .best strong { color: var(--green); }
.cmp tfoot td { border-top: 1px solid var(--line); border-bottom: none; }
.cmp .total-row td { font-size: 15px; background: #fafafa; }
.cmp tfoot form { margin: 0; }

/* ---------- Hero (dotted pattern) ---------- */
.hero { position: relative; text-align: center; padding: 42px 20px 36px; margin: -34px -30px 12px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(#dcdce2 1px, transparent 1px); background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 75% 95% at 50% -10%, #000, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 95% at 50% -10%, #000, transparent 72%);
}
.hero > * { position: relative; }
.hero h1 { font-size: 34px; margin: 0 0 10px; }
.hero .sub { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 15px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Segmented tabs ---------- */
.tabs { display: inline-flex; background: var(--track); border-radius: 999px; padding: 4px; gap: 2px; margin: 4px 0 18px; flex-wrap: wrap; }
.tabs button { background: transparent; border: none; color: var(--text); font-weight: 600; font-size: 13.5px; padding: 8px 15px; border-radius: 999px; cursor: pointer; transition: background 0.12s, color 0.12s; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Mini bars ---------- */
.bar { height: 5px; border-radius: 999px; background: var(--track); margin-top: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: #cbcbd2; display: block; }
.bar-fill.best { background: var(--green); }

/* ---------- Footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 36px 20px; margin-top: 40px; border-top: 1px solid var(--line); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dcdce0; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #c2c2c8; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topnav { gap: 14px; padding: 0 16px; }
  .nav-links { display: none; }
  .container { padding: 24px 16px 8px; }
  h1 { font-size: 26px; }
  .hero { margin: -24px -16px 10px; padding: 32px 16px 28px; }
  .hero h1 { font-size: 27px; }
}
