/* Клиентски портал на Радар */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0;
  --brand: #1d4ed8; --brand-2: #1e40af; --brand-soft: #e0e7ff; --ok: #0b7a43; --ok-soft: #dcfce7;
  --warn: #a15c00; --warn-soft: #fef3c7; --risk: #b42318; --risk-soft: #fee4e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05); --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --panel: #111a2c; --ink: #e5e9f2; --ink-2: #c3cad8; --muted: #8a96ab; --line: #26324a;
    --brand: #6d8dff; --brand-2: #a5b8ff; --brand-soft: #1b2645; --ok: #4ade80; --ok-soft: #0f2a1b;
    --warn: #fbbf24; --warn-soft: #2b2110; --risk: #f87171; --risk-soft: #2d1414; --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.25; margin: 0; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---- шапка ---- */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
.brand small { font-weight: 500; color: var(--muted); }
.sep { width: 1px; height: 26px; background: var(--line); }
.company { font-weight: 700; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }

/* ---- общи ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line);
  background: var(--panel); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.new { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* ---- вход и покана ---- */
.auth { max-width: 400px; margin: 9vh auto 40px; padding: 0 16px; }
.auth .panel { padding: 26px 24px; }
.auth .brand { margin-bottom: 18px; font-size: 17px; }
.auth h1 { font-size: 21px; margin-bottom: 6px; }
.auth p.lead { margin: 0 0 18px; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-bottom: 14px; }
.field input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 400; }
.field input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field .hint { font-weight: 400; font-size: 13px; color: var(--muted); }
.err { color: var(--risk); min-height: 1.4em; margin: 4px 0 10px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.lock { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; }

/* ---- табло ---- */
.hello { margin-bottom: 18px; }
.hello h1 { font-size: 24px; }
.hello p { margin: 4px 0 0; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--ink-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip b { font-weight: 700; margin-left: 3px; }
.search { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tools select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.card .meta { color: var(--muted); font-size: 14px; }
.card .pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.card .side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card .value { font-weight: 700; font-size: 16px; white-space: nowrap; }
.dl { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dl.soon { color: var(--risk); }
.dl.mid { color: var(--warn); }
.card .act { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px dashed var(--line);
  padding-top: 9px; margin-top: 4px; font-size: 13px; }
footer { max-width: 1100px; margin: 0 auto; padding: 0 16px 30px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { grid-template-columns: minmax(0, 1fr); }
  .card .side { text-align: left; align-items: flex-start; flex-direction: row; gap: 12px; flex-wrap: wrap; }
  .brand small, .sep { display: none; }
  .company { font-size: 15px; }
}
