:root {
  --bg: #f7f7f8;
  --surface: #fcfcfd;
  --ink: #17181c;
  --ink-2: #454854;
  --muted: #5c6070;
  --muted-2: #8f93a3;
  --line: #e3e4e8;
  --line-2: #c7c9d1;
  --accent: #1b7f6b;
  --green: #3bb888;
  --green-dark: #2fa87c;
  --green-soft: #e9f7f2;
  --header: #2f3039;
  --header-2: #26272e;
  --radius: 11px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink);
       background: var(--bg); line-height: 1.55; font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.spacer { flex: 1; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* шапка */
.top { background: var(--header); position: sticky; top: 0; z-index: 20;
       box-shadow: 0 2px 10px rgba(23,24,28,.18); }
.top-inner { max-width: 1320px; margin: 0 auto; padding: 12px 24px;
             display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brandline { display: flex; gap: 10px; align-items: center; color: #fff;
             margin-right: auto; }
.brandline:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
              background: var(--green); color: #142620; font-weight: 800;
              font-size: 18px; display: flex; align-items: center;
              justify-content: center; }
.brand { font-size: 17px; font-weight: 700; white-space: nowrap; color: #fff; }
.brand small { display: block; font-size: 11.5px; font-weight: 400;
               color: #b6bac4; letter-spacing: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-right .btn.outline { background: transparent; color: #fff;
                             border-color: rgba(255,255,255,.35); }
.topbar-right .btn.outline:hover { background: rgba(255,255,255,.12); }
.topbar-right .who { color: #fff; font-size: 13px; }
.topbar-right .who small { display: block; color: #b6bac4; font-size: 11px; }
nav.tabs { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex;
           gap: 2px; flex-wrap: wrap; border-bottom: 1px solid #3b3d47; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent;
       padding: 11px 16px; font-size: 13.5px; color: #b6bac4; cursor: pointer;
       margin-bottom: -1px; }
.tab:hover { background: rgba(255,255,255,.06); color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--green); font-weight: 600; }

/* кнопки */
.btn { border: 1px solid var(--header-2); border-radius: 7px;
       background: var(--header-2); color: #fff; padding: 8px 15px;
       font-size: 13px; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.green { background: var(--green); border-color: var(--green);
             color: #142620; font-weight: 600; }
.btn.green:hover { background: var(--green-dark); border-color: var(--green-dark);
                   filter: none; }
.btn.outline { background: #fff; color: var(--header-2);
               border-color: var(--line-2); }
.btn.outline:hover { background: #f2f3f5; filter: none; }
.btn.danger { background: #fff; color: #b4232a; border-color: #f0c3c6; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }

/* контент */
main { max-width: 1320px; margin: 0 auto; padding: 22px 24px 60px; }
h1 { font-size: 24px; margin: 0 0 10px; line-height: 1.25; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius);
        background: var(--surface); padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.hero { border: 1px solid var(--line); border-radius: 13px; padding: 20px 22px;
        background: linear-gradient(135deg, #f7f7f8, #ffffff 62%, #e9f7f2); }
.hero-kicker { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
               color: var(--accent); font-weight: 700; }
.hero p { color: var(--ink-2); font-size: 14px; max-width: 850px; margin: 6px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
         gap: 12px; }
.metric { border: 1px solid var(--line); border-radius: 11px; background: #fff;
          padding: 14px 16px; }
.metric .label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
                 color: var(--muted); }
.metric .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.metric .sub { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* формы */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--muted);
               text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 7px;
  padding: 8px 10px; background: #fff; color: var(--ink); font-size: 13.5px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid #b9e7da; border-color: var(--header-2);
}
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row .field { flex: 1 1 220px; margin-bottom: 0; }

/* таблицы */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px;
              background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase;
     letter-spacing: .07em; color: var(--muted); padding: 9px 12px;
     background: #f2f3f5; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfc; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
         border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
                 background: currentColor; }
.badge.ok { color: #116b4d; background: #dff5ec; }
.badge.warn { color: #8a5a12; background: #fdf3dd; }
.badge.bad { color: #a3242b; background: #fbe4e6; }
.badge.info { color: #1b4f8a; background: #e6effa; }
.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px;
        background: #f2f3f5; padding: 2px 6px; border-radius: 5px; }

/* вход */
.login-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center;
              padding: 30px 16px; }
.login-card { width: 100%; max-width: 430px; background: #fff;
              border: 1px solid var(--line); border-radius: 14px;
              box-shadow: 0 14px 40px rgba(23,24,28,.12); padding: 28px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card .brand-mark { width: 46px; height: 46px; border-radius: 12px;
                          font-size: 24px; margin-bottom: 12px; }
.error { background: #fbe4e6; border: 1px solid #f0c3c6; color: #a3242b;
         border-radius: 8px; padding: 9px 11px; font-size: 12.5px;
         margin-bottom: 12px; }
.notice { background: var(--green-soft); border: 1px solid #b9e7da;
          border-radius: 9px; padding: 10px 12px; font-size: 12.5px;
          color: #142620; margin-bottom: 14px; }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 100;
              display: flex; flex-direction: column; gap: 8px; }
.toast { background: #17181c; color: #fff; border-radius: 9px; padding: 10px 14px;
         font-size: 13px; max-width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.ok { background: #116b4d; }
.toast.bad { background: #a3242b; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }
pre.json { background: #f2f3f5; border: 1px solid var(--line); border-radius: 8px;
           padding: 12px; font-size: 12px; overflow: auto; max-height: 280px; }
.topbar-logout { background: transparent !important; color: #fff !important; border-color: rgba(255,255,255,.35) !important; }
.topbar-logout:hover { background: rgba(255,255,255,.12) !important; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions { flex-wrap: nowrap; }
table td:last-child { white-space: nowrap; }
