/* Инструмент на одного человека: плотно, быстро, без дизайн-системы. */
:root {
  --bg: #12151a; --panel: #1a1f27; --panel-2: #222935; --line: #2c3444;
  --text: #e6eaf0; --muted: #8b95a6; --accent: #4c8dff; --accent-dim: #2c5aa8;
  --ok: #3fb950; --warn: #d29922; --bad: #f85149;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.top {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
header.top .brand { font-weight: 600; letter-spacing: .3px; }
header.top nav { display: flex; gap: 16px; margin-left: auto; }
header.top nav a { color: var(--muted); padding: 4px 2px; }
header.top nav a.active { color: var(--text); border-bottom: 2px solid var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 24px 0 10px; color: var(--muted); font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .n { font-size: 24px; font-weight: 600; }
.card .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
input[type=text], input[type=password], select, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font: inherit; width: 100%;
}
textarea { resize: vertical; min-height: 84px; font-family: ui-monospace, "JetBrains Mono", monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dim); }
.toolbar input[type=text] { max-width: 320px; }
.toolbar select { width: auto; }

button, .btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent-dim); text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
button.primary:hover { background: #3d7ce8; }
button.ghost { background: transparent; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
     color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #1b212b; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
       background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.on { background: rgba(76,141,255,.15); color: #9dc1ff; border-color: var(--accent-dim); }
.tag.off { opacity: .6; }
.tag.ok { color: var(--ok); border-color: #235c2e; }
.tag.warn { color: var(--warn); border-color: #5c4a15; }
.tag.bad { color: var(--bad); border-color: #6b2b28; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
         padding: 28px; text-align: center; color: var(--muted); }
.empty b { color: var(--text); }

/* модалка */
#modal:empty { display: none; }
#modal { position: fixed; inset: 0; background: rgba(6,8,12,.72);
         display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50;
         overflow-y: auto; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
             width: min(720px, 100%); padding: 22px 24px; }
.modal-box h3 { margin: 0 0 2px; font-size: 17px; }
.modal-box .head-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 500; margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start;
         background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.check input { margin-top: 3px; width: auto; }
.check .t { font-weight: 500; }
.check .d { color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px;
                 padding-top: 16px; border-top: 1px solid var(--line); }
.modal-actions .left { margin-right: auto; }

.login { max-width: 320px; margin: 16vh auto; }
.login .field { margin-bottom: 12px; }
.err { color: var(--bad); font-size: 13px; margin-bottom: 10px; }
.notice { background: rgba(210,153,34,.12); border: 1px solid #5c4a15; color: #e8c877;
          border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.notice code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; }
