/* Админка Lahma — те же цвета, что у приложения: тёплый чёрный и янтарь. */
:root {
  --bg: #0c0b0a;
  --bg-2: #100f0d;
  --surface: #151311;
  --surface-2: #1b1815;
  --line: rgba(255, 233, 214, 0.07);
  --line-2: rgba(255, 233, 214, 0.13);
  --text: #f4ede6;
  --text-2: #a89e94;
  --text-3: #6f665e;
  --text-4: #4a433d;
  --ember: #ff5a1f;
  --ember-2: #ffb03a;
  --ember-soft: rgba(255, 90, 31, 0.12);
  --good: #7fe3a0;
  --warn: #ffc65c;
  --bad: #ff5468;
  --f-display: "Unbounded", "Segoe UI", sans-serif;
  --f-body: "Onest", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Martian Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ember-2); text-decoration: none; }
::selection { background: rgba(255, 90, 31, 0.35); }

/* --- Вход --- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(60% 50% at 20% 0%, rgba(255, 90, 31, 0.10), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--ember); box-shadow: 0 0 18px rgba(255, 90, 31, 0.6); }
.brand-name { font-family: var(--f-display); font-weight: 700; letter-spacing: 3px; font-size: 15px; }
.brand-sub { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.auth h1 { font-family: var(--f-display); font-weight: 600; font-size: 22px; margin: 0 0 6px; letter-spacing: -0.2px; }
.auth p.lead { margin: 0 0 22px; color: var(--text-2); }

/* --- Оболочка --- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--bg-2); position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; margin-bottom: 22px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.nav:hover { color: var(--text); background: rgba(255, 233, 214, 0.03); }
.nav.on { color: var(--text); background: var(--ember-soft); }
.nav .count { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ember-2); }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.side-foot .who { color: var(--text-2); word-break: break-all; margin-bottom: 8px; }
.main { padding: 30px 34px 60px; min-width: 0; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { font-family: var(--f-display); font-weight: 600; font-size: 24px; margin: 0; letter-spacing: -0.3px; }
.head .sub { color: var(--text-3); margin-top: 4px; }
.head .grow { flex: 1; min-width: 200px; }

/* --- Элементы --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0.2px; }
.eyebrow { font-family: var(--f-mono); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-3); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tile .v { font-family: var(--f-display); font-weight: 600; font-size: 26px; margin-top: 6px; }
.tile .c { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.tile.hot .v { color: var(--ember-2); }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.btn:hover { border-color: rgba(255, 233, 214, 0.25); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { border: 0; color: #1a0a03; font-weight: 600; background: linear-gradient(135deg, var(--ember-2), var(--ember) 65%); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger { color: var(--bad); border-color: rgba(255, 84, 104, 0.3); background: rgba(255, 84, 104, 0.06); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-block { width: 100%; justify-content: center; height: 42px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-2); }
.input, select.input, textarea.input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); outline: none; width: 100%; }
textarea.input { height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: rgba(255, 140, 60, 0.55); box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12); }
.input.mono { font-family: var(--f-mono); font-size: 13px; }
.input.code { font-family: var(--f-mono); font-size: 22px; letter-spacing: 8px; text-align: center; height: 52px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); cursor: pointer; user-select: none; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin: -4px 0 10px; }
.hint { color: var(--text-3); font-size: 12px; }
.muted { color: var(--text-3); }
.mono { font-family: var(--f-mono); font-size: 12px; }
.search { width: 280px; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: rgba(255, 233, 214, 0.02); }
.t td.num { font-family: var(--f-mono); font-size: 12px; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill.good { color: var(--good); border-color: rgba(127, 227, 160, 0.25); background: rgba(127, 227, 160, 0.06); }
.pill.bad { color: var(--bad); border-color: rgba(255, 84, 104, 0.28); background: rgba(255, 84, 104, 0.06); }
.pill.warn { color: var(--warn); border-color: rgba(255, 198, 92, 0.28); background: rgba(255, 198, 92, 0.06); }
.pill.ember { color: var(--ember-2); border-color: rgba(255, 140, 60, 0.3); background: rgba(255, 90, 31, 0.07); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); display: inline-block; }
.dot.on { background: var(--good); box-shadow: 0 0 8px var(--good); }

.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.srv { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.srv .top { display: flex; align-items: center; gap: 8px; }
.srv .name { font-weight: 600; }
.srv .addr { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.srv .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.srv .stats div { font-size: 11px; color: var(--text-3); }
.srv .stats b { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 13px; color: var(--text); margin-top: 2px; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-word; }
.back { color: var(--text-3); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 14px; background: none; border: 0; padding: 0; }
.back:hover { color: var(--text); }
.empty { padding: 34px 10px; text-align: center; color: var(--text-3); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--text-3); font-size: 12px; }

.token-box { font-family: var(--f-mono); font-size: 12px; background: var(--bg); border: 1px dashed rgba(255, 140, 60, 0.4); border-radius: 10px; padding: 12px; word-break: break-all; color: var(--ember-2); }
pre.cmd { font-family: var(--f-mono); font-size: 11.5px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; color: var(--text-2); margin: 8px 0 0; }

/* --- Модальное окно и уведомления --- */
.backdrop { position: fixed; inset: 0; background: rgba(5, 4, 3, 0.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px 22px 18px; max-height: calc(100vh - 40px); overflow: auto; }
.modal h2 { margin: 0 0 16px; font-family: var(--f-display); font-weight: 600; font-size: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.toast { background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--good); border-radius: 10px; padding: 10px 14px; max-width: 360px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .8); }
.toast.err { border-left-color: var(--bad); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .side .brand, .side-foot { display: none; }
  .nav { width: auto; }
  .main { padding: 20px 16px 50px; }
  .grid2 { grid-template-columns: 1fr; }
  .search { width: 100%; }
}
