/* DNS Alerter — общий стиль */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --muted: #6b7280;
  --primary: #3b82f6;
  --side-bg: #15181d;
  --side-text: #aab1bd;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
  margin: 0;
  min-height: 100vh;
}

a { color: var(--primary); }

/* ----- Auth pages -------------------------------------------------- */
body.auth-page {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
body.auth-page .container-app { max-width: 600px; padding: 24px; }

.auth-card {
  background: var(--card); border-radius: 14px; padding: 32px 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4); width: 100%;
}
.auth-card-wide { max-width: 720px; }
.auth-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 18px;
}
.auth-brand h1 { font-size: 22px; font-weight: 700; margin: 0; color: #0f172a; }
.logo-dot {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 8px; display: inline-flex; align-items: center;
  justify-content: center; color: #fff; font-size: 18px;
}

.flash-stack { margin-bottom: 14px; }

.qr-box {
  background: #fff; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; display: inline-block; width: 220px; height: 220px;
}
.qr-box svg { width: 100%; height: 100%; }
.secret-block {
  background: #f1f5f9; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 14px; font-family: ui-monospace, Consolas, monospace;
  font-size: 14px; letter-spacing: 1px; word-break: break-all; user-select: all;
}
.recovery-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.recovery-code {
  background: #0f172a; color: #e2e8f0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 16px; letter-spacing: 1px; padding: 10px 14px;
  border-radius: 6px; text-align: center; user-select: all;
}

/* ----- App layout -------------------------------------------------- */
body.app .container-app { display: none; }  /* base-обёртка не нужна */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; flex-shrink: 0; min-height: 100vh;
}
.sidebar .brand {
  padding: 18px 20px; font-weight: 700; color: #fff; font-size: 15px;
  border-bottom: 1px solid #262b34; display: flex; align-items: center; gap: 10px;
}
.sidebar .nav-section {
  padding: 14px 16px 8px; font-size: 11px; letter-spacing: .6px;
  color: #6b7280; text-transform: uppercase;
}
.sidebar .snav a {
  display: flex; align-items: center; padding: 9px 20px;
  color: var(--side-text); text-decoration: none; font-size: 14px;
  gap: 10px; border-left: 3px solid transparent;
}
.sidebar .snav a:hover { background: #1f242c; color: #fff; }
.sidebar .snav a.active { background: #1f242c; color: #fff; border-left-color: var(--primary); }
.sidebar .snav i { font-size: 16px; width: 18px; text-align: center; }
.sidebar .nav-badge {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
}
.sidebar-foot {
  margin-top: auto; padding: 14px 20px; border-top: 1px solid #262b34;
  font-size: 12px; color: #6b7280;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 24px; display: flex; justify-content: space-between;
  align-items: center; gap: 16px;
}
.topbar h5 { margin: 0; font-weight: 600; font-size: 18px; }
.topbar-right {
  display: flex; gap: 14px; align-items: center; font-size: 14px;
}
.role-pill {
  padding: 3px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 600; letter-spacing: .3px;
}
.role-pill.admin { background: #fee2e2; color: #991b1b; }
.role-pill.user { background: #dbeafe; color: #1e40af; }

.page-body { padding: 22px 24px; overflow-x: auto; }

/* ----- Cards / KPI ------------------------------------------------- */
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-weight: 700; font-size: 26px; margin-top: 4px; }
.kpi .delta { font-size: 12px; margin-top: 6px; }
.delta.up { color: #16a34a; } .delta.down { color: #dc2626; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.card-h {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.card-b { padding: 0; }

table.table { margin: 0; }
table.table th {
  font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.table td { vertical-align: middle; font-size: 14px; }

/* ----- Status / chips / fields ------------------------------------- */
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.dot.online { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }
.dot.offline { background: #9ca3af; }
.dot.warn { background: #f59e0b; }

/* Pastel chip palette — used by services/colors.py */
.v {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.v-empty { color: #cbd5e1; font-size: 12px; }
.v.c1 { background: #e0f2fe; color: #075985; }
.v.c2 { background: #fce7f3; color: #9d174d; }
.v.c3 { background: #dcfce7; color: #166534; }
.v.c4 { background: #fef3c7; color: #854d0e; }
.v.c5 { background: #ede9fe; color: #5b21b6; }
.v.c6 { background: #ffedd5; color: #9a3412; }
.v.c7 { background: #cffafe; color: #155e75; }
.v.c8 { background: #ffe4e6; color: #9f1239; }
.v.c9 { background: #e2e8f0; color: #334155; }
.v.c10 { background: #f3e8ff; color: #6b21a8; }

.chip {
  display: inline-block; padding: 2px 8px; background: #f1f5f9;
  color: #475569; border-radius: 6px; font-size: 11px;
  margin-right: 4px; margin-bottom: 2px;
}
.chip-add {
  background: transparent; border: 1px dashed #cbd5e1;
  color: #64748b; cursor: pointer;
}

/* ----- Bot detail layout ------------------------------------------ */
.field-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.field-row .f { display: flex; align-items: center; gap: 8px; }
.field-row .f-name {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; font-weight: 600;
}

.admin-comment {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 12px 14px; display: flex; gap: 14px; align-items: flex-start;
}
.admin-comment .ic { color: #b45309; font-size: 18px; }
.admin-comment-empty {
  background: #f9fafb; border: 1px dashed var(--border);
  color: var(--muted); font-style: italic;
}

/* ----- Filters ----------------------------------------------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .form-control,
.filters .form-select { max-width: 220px; }

/* ----- Pagination -------------------------------------------------- */
.paginator {
  padding: 12px 18px; display: flex; justify-content: space-between;
  align-items: center; color: var(--muted); font-size: 13px;
}

.breadcrumb {
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
  background: transparent; padding: 0;
}
.breadcrumb a { text-decoration: none; }

/* ----- Install command block -------------------------------------- */
.install-cmd {
  background: #0f172a; color: #e2e8f0; padding: 14px;
  border-radius: 8px; font-family: ui-monospace, Consolas, monospace;
  font-size: 13px; display: flex; justify-content: space-between;
  align-items: center; gap: 10px;
}
.install-cmd code { color: #fbbf24; flex: 1; overflow-x: auto; white-space: nowrap; }

/* ----- Stub / coming-soon ----------------------------------------- */
.stub-page {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 60px 40px; text-align: center; color: var(--muted);
}
.stub-page i { font-size: 48px; color: #cbd5e1; }
.stub-page h3 { margin-top: 16px; color: #1f2937; }
