/* ============ Tokenlar ============ */
:root {
  --bg: #F3F2EE;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --border: #E8E6E0;
  --border-2: #DDDBD4;
  --line: #EFEEEA;
  --text: #141414;
  --text-2: #5C5B56;
  --muted: #95938D;
  --track: #EDECE7;

  --ink: #151515;
  --yellow: #FFC531;
  --yellow-soft: #FFF7DD;
  --red: #D93A3A;
  --red-soft: #FDEBEB;
  --red-text: #C42B2B;
  --green: #1E9E50;
  --green-soft: #E4F5E9;
  --green-text: #17803D;
  --amber: #B96B00;
  --amber-soft: #FFF0D6;
  --blue: #1C8FE0;
  --blue-soft: #E7F2FC;

  --sb: #16171A;
  --sb-hover: #1F2024;
  --sb-active: #2A2B30;
  --sb-line: #2C2D32;
  --sb-text: #C9C9CF;
  --sb-muted: #8C8D94;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--track); padding: 1px 5px; border-radius: 5px; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.good-text { color: var(--green-text); font-weight: 600; }
.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
.ic.inline { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ============ Karkas ============ */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--sb); color: var(--sb-text);
  display: flex; flex-direction: column; padding: 22px 16px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 24px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--yellow); color: #1A1A1A; display: grid; place-items: center;
}
.brand-mark .ic { width: 20px; height: 20px; stroke-width: 2; }
.brand-name { display: block; font-weight: 700; font-size: 17px; color: #fff; line-height: 1.15; }
.brand-sub { display: block; font-size: 12px; color: var(--sb-muted); margin-top: 2px; }

.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 11px;
  border-radius: 9px; color: var(--sb-text); font-size: 14.5px; font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--sb-hover); color: #fff; }
.nav a.active { background: var(--sb-active); color: #fff; font-weight: 600; }
.nav a.active .ic { color: var(--yellow); }
.nav .count {
  margin-left: auto; font: 500 11.5px var(--mono); color: #A2A3AA;
  background: #26272C; border-radius: 999px; padding: 2px 9px;
}
.nav .count.alert {
  background: var(--red); color: #fff; min-width: 21px; height: 21px; padding: 0 6px;
  display: grid; place-items: center; font-weight: 600;
}

.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; padding-top: 24px; }
.worker { border: 1px solid var(--sb-line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.worker-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; color: #fff; }
.worker-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--sb-muted); }
.worker-row b { font: 500 13px var(--mono); color: #EDEDF0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.green { background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px rgba(217, 58, 58, 0.2); }

.me { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--sb-line); padding: 16px 4px 0; }
.me-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #2A2B30; color: var(--yellow);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.me-text { display: grid; line-height: 1.25; min-width: 0; }
.me-text b { color: #fff; font-size: 14px; }
.me-text span { color: var(--sb-muted); font-size: 12.5px; }
.me form { margin-left: auto; }
.me-out { background: none; border: 0; color: var(--sb-muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.me-out:hover { color: #fff; background: var(--sb-hover); }

.main { padding: 28px 30px 36px; min-width: 0; }

/* ============ Sarlavha va tugmalar ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 340px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs span { margin: 0 4px; color: #C2C0BA; }
h1 { font-size: 29px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.page-sub { color: var(--text-2); font-size: 14.5px; margin-top: 6px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }

.btn {
  height: 40px; padding: 0 14px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13.5px var(--sans); color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #F8F7F4; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #2A2A2A; }
.btn-dark .ic { color: var(--yellow); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: #1A1A1A; }
.btn-yellow:hover { background: #F5B91E; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #C33030; }
.btn-on { border-color: var(--ink); background: #F6F5F1; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm { height: 34px; width: 34px; border-radius: 9px; }
.btn-wide { width: 100%; }
.btn-danger-outline { color: var(--red); border-color: #F0C6C6; }
.btn-danger-outline:hover { background: var(--red-soft); }
.link {
  color: var(--blue); font-weight: 600; font-size: 13.5px; text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.link .ic { width: 15px; height: 15px; }
.link:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; }
.icon-btn:hover { background: var(--track); color: var(--text); }

.search {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; min-width: 270px;
}
.search .ic { color: var(--muted); }
.search input { border: 0; outline: 0; flex: 1; font: 14px var(--sans); background: none; min-width: 0; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search kbd { font: 500 11px var(--mono); color: var(--muted); }
.search:focus-within { border-color: var(--ink); }
.search-inline { min-width: 220px; height: 38px; }

/* ============ Menyular, toast, dialog ============ */
.menu-wrap { position: relative; }
.menu {
  display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 30px rgba(20, 20, 20, 0.12);
}
.menu.right { left: auto; right: 0; }
.menu.open { display: grid; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 8px;
  background: none; border: 0; text-align: left; text-decoration: none; cursor: pointer; font-size: 13.5px; color: var(--text);
}
.menu a:hover, .menu button:hover { background: #F4F3EF; }
.menu a.on { font-weight: 600; }
.menu a .ic:last-child:not(:first-child) { margin-left: auto; width: 16px; height: 16px; stroke-width: 2.5; }
.menu .danger { color: var(--red); }
.menu form { margin: 0; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px;
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transition: opacity 0.3s, transform 0.3s;
}
.toast .ic { color: #4ADE80; margin-top: 1px; }
.toast.error .ic { color: #FF8A8A; }
.toast.hide { opacity: 0; transform: translateY(8px); pointer-events: none; }

.dialog { border: 0; border-radius: 16px; padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
.dialog::backdrop { background: rgba(20, 20, 20, 0.45); }
.dialog h3 { font-size: 18px; margin-bottom: 4px; }
.dialog p { margin: 0 0 14px; font-size: 13px; }
.dialog textarea {
  width: 100%; border: 1px solid var(--border-2); border-radius: 10px; padding: 12px;
  font: 14px/1.5 var(--sans); resize: vertical; color: var(--text);
}
.dialog textarea:focus { outline: 0; border-color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ============ Kartalar, belgilar, jadvallar ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 22px 14px; }
.card-label { font-size: 15px; color: var(--text-2); }
.count-pill {
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--red-soft); color: var(--red-text);
  font: 600 12.5px var(--mono); display: grid; place-items: center;
}
.empty-state { color: var(--muted); padding: 26px 22px; text-align: center; display: flex; gap: 8px; align-items: center; justify-content: center; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--green-soft); color: var(--green-text); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red-text); }
.badge.muted { background: #EEEDE9; color: #6A6964; }

.av {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 600; font-size: 13.5px;
}
.av.lg { width: 54px; height: 54px; font-size: 17px; }
.av.round { font-weight: 700; font-size: 14px; }

.seg { display: inline-flex; background: #F4F3EF; border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px;
  color: #55544F; font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap;
}
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); }
.seg .n { font: 500 12px var(--mono); color: var(--muted); }
.seg .n.red { color: var(--red); }

.table-card { min-width: 0; display: flex; flex-direction: column; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .btn { height: 36px; padding: 0 12px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 13px 10px; background: var(--surface-2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font: 600 11.5px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: #8A8883; white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table .person { min-width: 175px; }
.table.compact td { font-size: 13.5px; }
.table.compact td.mono { font-size: 12.5px; }
.table.compact .person { min-width: 165px; }
.table td.mono { font-size: 13.5px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #FCFBF8; }
.table tr.selected td { background: var(--yellow-soft); }
.table tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.actions-cell { width: 48px; text-align: right; }
.person { display: flex; align-items: center; gap: 13px; text-decoration: none; min-width: 0; }
.person > span:last-child { display: grid; line-height: 1.3; min-width: 0; }
.person b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person b + span, .person b + a { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-link { color: var(--blue) !important; text-decoration: none; }
.tg-link:hover { text-decoration: underline; }

.switch {
  width: 46px; height: 27px; border-radius: 999px; background: #DEDDD7; border: 0; position: relative; cursor: pointer; padding: 0;
  transition: background 0.15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(19px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }
td form { margin: 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; margin-top: auto; flex-wrap: wrap; }
.pager-nums { display: flex; align-items: center; gap: 4px; }
.pager-nums a, .pager-nums span {
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px; display: grid; place-items: center;
  text-decoration: none; font-size: 14px; color: var(--text-2);
}
.pager-nums a:hover { background: var(--track); }
.pager-nums .cur { background: var(--ink); color: #fff; font-weight: 600; }
.pager-nums .off { opacity: 0.35; }
.pager-nums .ic { width: 16px; height: 16px; }

.progress { display: block; height: 4px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.progress.first i { background: var(--yellow); }

.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin: 10px 0 0; }
.note .ic { width: 16px; height: 16px; margin-top: 1px; }
.note.warn { background: var(--amber-soft); color: var(--amber); }
.note.bad { background: var(--red-soft); color: var(--red-text); }

.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); gap: 22px; align-items: start; margin-top: 22px; }
.split-wide { grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); margin-top: 0; }
.side-col { display: grid; gap: 22px; }

/* ============ Boshqaruv ============ */
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.chart-card { grid-column: span 2; padding: 22px 26px 18px; display: flex; flex-direction: column; }
.chart-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.big-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.big-num { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; font-weight: 500; }
.delta .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.delta.up { color: var(--green-text); }
.delta.down { color: var(--red-text); }
.legend { display: flex; gap: 18px; font-size: 13.5px; color: var(--text-2); padding-top: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.ink { background: var(--ink); } .sw.red { background: var(--red); } .sw.yellow { background: var(--yellow); }

.bars { display: flex; align-items: flex-end; flex: 1; min-height: 280px; margin-top: 22px; border-bottom: 1px solid var(--border); padding: 0 18px; gap: 6px; }
.bar-col { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.bar-val { font: 500 13.5px var(--mono); color: var(--text-2); margin-bottom: 8px; white-space: nowrap; }
.bar-stack { width: min(56px, 100%); display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.bar-err { display: block; background: var(--red); flex: none; min-height: 3px; }
.bar-ok { display: block; background: var(--ink); flex: 1; }
.bar-stack.today .bar-ok { background: var(--yellow); }
.bars.dense { gap: 3px; padding: 0 6px; }
.bars.dense .bar-val { font-size: 11px; }
.bar-axis { display: flex; padding: 12px 18px 0; gap: 6px; }
.bars.dense + .bar-axis { gap: 3px; padding: 12px 6px 0; }
.bar-axis div { flex: 1 1 0; display: grid; text-align: center; gap: 2px; min-width: 0; }
.bar-axis b { font-weight: 500; font-size: 14px; color: var(--text-2); }
.bar-axis span { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.bar-axis .today b { font-weight: 700; color: var(--text); }

.attention { display: flex; flex-direction: column; }
.att-item { display: flex; gap: 14px; padding: 18px 22px; border-top: 1px solid var(--line); }
.att-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.att-icon .ic { width: 17px; height: 17px; }
.att-icon.bad { background: var(--red-soft); color: var(--red); }
.att-icon.warn { background: var(--amber-soft); color: #D58A00; }
.att-title { font-weight: 600; font-size: 15px; }
.att-text { color: var(--text-2); font-size: 14px; margin: 2px 0 6px; }
.att-item form { margin: 0; }

.toplist { padding-bottom: 12px; }
.top-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 10px; align-items: center;
  padding: 10px 22px 12px; text-decoration: none;
}
a.top-row:hover { background: #FCFBF8; }
.rank { font: 13px var(--mono); color: var(--muted); }
.top-main { display: grid; line-height: 1.3; min-width: 0; }
.top-main b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-main span { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-num { font: 600 14px var(--mono); white-space: nowrap; }
.top-row .progress { grid-column: 1 / -1; }

.live-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-text); font-weight: 600; font-size: 13px;
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.feed-list { list-style: none; margin: 0; padding: 4px 0 14px; }
.feed-item { display: grid; grid-template-columns: 74px 14px minmax(0, 1fr); align-items: start; gap: 10px; padding: 9px 22px; }
.feed-time { font: 13px var(--mono); color: var(--muted); padding-top: 1px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: 7px; }
.feed-item.warn .feed-dot { background: #D58A00; }
.feed-item.bad .feed-dot { background: var(--red); }
.feed-body { display: grid; line-height: 1.3; min-width: 0; }
.feed-body b { font-weight: 600; font-size: 15px; }
.feed-body span { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item.warn .feed-body span { color: var(--amber); }
.feed-item.bad .feed-body span { color: var(--red-text); }

/* ============ Haydovchilar ============ */
.stats-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.55fr); }
.stat { padding: 20px 26px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-label { font-size: 14px; color: var(--text-2); }
.stat-value { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 8px 0 6px; }
.stat-value small { font-size: 19px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.stat-value.bad { color: var(--red); }
.stat-sub { font-size: 14px; font-weight: 500; }
.stat-sub.good { color: var(--green-text); }
.stat-sub.bad { color: var(--red-text); }
.stat-sub.muted { color: var(--muted); }
.stat-chart { display: flex; flex-direction: column; }
.stat-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mini-bars { flex: 1; display: flex; align-items: flex-end; gap: 4px; min-height: 64px; margin-top: 12px; }
.mini-bars i { flex: 1; background: #DCDAD3; border-radius: 2px 2px 0 0; min-height: 3px; }
.mini-bars i.peak { background: var(--ink); }
.mini-bars i.now { background: var(--yellow); }
.mini-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 8px; }

.detail { position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.detail-head { display: flex; align-items: center; gap: 14px; padding: 22px 22px 16px; }
.detail-id { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.detail-id b { font-size: 19px; }
.detail-id span { font-size: 13.5px; color: var(--text-2); }
.session-bar {
  display: flex; align-items: center; gap: 10px; margin: 0 22px 18px; padding: 11px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 500;
}
.session-bar.good { background: var(--green-soft); color: var(--green-text); }
.session-bar.warn { background: var(--amber-soft); color: var(--amber); }
.session-bar.bad { background: var(--red-soft); color: var(--red-text); }
.session-bar.muted { background: #EEEDE9; color: #6A6964; }
.session-bar .mono { margin-left: auto; font-size: 12.5px; opacity: 0.85; white-space: nowrap; }
.detail-body { border-top: 1px solid var(--line); padding: 4px 22px 18px; overflow-y: auto; flex: 1; }
.sec-head {
  display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px;
  font: 600 12px var(--sans); letter-spacing: 0.07em; text-transform: uppercase; color: #8A8883;
}
.sec-head .link { text-transform: none; letter-spacing: 0; font-size: 14px; }
.camp-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.camp-tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--border-2); text-decoration: none; color: var(--text-2);
}
.camp-tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.camp-tabs .dot { width: 6px; height: 6px; box-shadow: none; }
.bubble-wrap { background: #E4ECF4; border-radius: 14px; padding: 16px; }
.bubble { background: #fff; border-radius: 12px 12px 12px 4px; padding: 12px 14px 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); }
.bubble-name { color: #2E8BD6; font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.bubble-text { white-space: pre-line; font-size: 15px; line-height: 1.55; word-break: break-word; }
.bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font: 12px var(--mono); color: var(--muted); margin-top: 6px; }
.bubble-meta .ic { width: 15px; height: 15px; color: #4FA3E5; }
.sched { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sched div { padding: 10px 12px; display: grid; gap: 3px; border-left: 1px solid var(--border); min-width: 0; }
.sched div:first-child { border-left: 0; }
.sched span { font-size: 12.5px; color: var(--muted); }
.sched b { font: 600 13px var(--mono); white-space: nowrap; }
.glist { list-style: none; margin: 0; padding: 0; display: grid; }
.glist li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.g-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.g-icon.bad { background: var(--red-soft); color: var(--red); }
.g-main { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.g-main b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-main span { font-size: 13px; color: var(--text-2); }
.g-state { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.g-state.bad { color: var(--red-text); font-weight: 600; }
.g-state.warn { color: var(--amber); font-weight: 600; }
.detail-actions { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.detail-actions form { margin: 0; }
.detail-actions .grow { flex: 1; }
.detail-actions .btn { height: 44px; }

/* ============ Guruhlar ============ */
.regions { padding: 22px 24px 12px; }
.regions h2 { margin-bottom: 14px; }
.region { display: grid; gap: 9px; margin-bottom: 14px; }
.region-row { display: flex; justify-content: space-between; font-size: 15px; }
.region-row .mono { color: var(--text-2); font-size: 14px; }
.region .progress { height: 5px; }
.rules { background: #FFF8E4; border-color: #F3E2B2; padding: 22px 24px; }
.rules h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.rules h2 .ic { color: #D59300; }
.rules ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rules li { display: flex; gap: 10px; font-size: 14.5px; color: #4A4535; line-height: 1.5; }
.rules li .ic { color: #D59300; width: 17px; height: 17px; margin-top: 2px; stroke-width: 2.2; }

/* ============ Sessiyalar ============ */
.alert-banner {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 22px;
  background: var(--red-soft); border: 1px solid #F4C7C7; border-radius: var(--radius); color: var(--red-text);
}
.alert-banner > .ic { width: 22px; height: 22px; color: var(--red); }
.alert-banner div { display: grid; flex: 1; gap: 2px; }
.alert-banner b { font-size: 15px; }
.alert-banner span { font-size: 14px; }
.steps-card { padding: 22px 24px; }
.steps-card > p { margin: 4px 0 16px; font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.steps li:last-child::before { display: none; }
.steps li.done::before { background: var(--ink); }
.steps i {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 13px var(--mono); font-style: normal;
  border: 1.5px solid var(--border-2); background: #fff; color: var(--text-2); position: relative;
}
.steps li.done i { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.current i { background: var(--yellow); border-color: var(--yellow); color: #1A1A1A; }
.steps div { display: grid; line-height: 1.35; }
.steps b { font-size: 15px; }
.steps span { font-size: 13.5px; color: var(--text-2); }
.donut-card { padding: 22px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { position: relative; width: 124px; height: 124px; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-size: 25px; font-weight: 700; line-height: 1.1; }
.donut-center span { font-size: 13px; color: var(--text-2); }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 12px; min-width: 150px; }
.legend-list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.legend-list i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend-list b { margin-left: auto; color: var(--text); font-weight: 600; }
.security { background: var(--sb); border-color: var(--sb); color: #C7C7CC; padding: 22px 24px; }
.security h2 { color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.security h2 .ic { color: var(--yellow); }
.security p { margin: 0; font-size: 14.5px; line-height: 1.65; }

/* ============ Loglar ============ */
.logs-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 22px; align-items: start; }
.log-filters { padding: 20px 22px; display: grid; gap: 4px; position: sticky; top: 20px; }
.f-title { font: 600 12px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: #8A8883; margin: 14px 0 6px; }
.f-title:first-child { margin-top: 0; }
.check { display: flex; align-items: center; gap: 11px; padding: 7px 0; font-size: 15px; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-2); display: grid; place-items: center; flex: none; background: #fff;
}
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box::after {
  content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg);
}
.check.radio .box { border-radius: 50%; }
.check input:focus-visible + .box { outline: 2px solid var(--blue); outline-offset: 2px; }
.check b { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 13px; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; }
.lv-dot.error { background: #FF6464; } .lv-dot.warn { background: #F2B33D; } .lv-dot.info { background: #4EA8FF; } .lv-dot.debug { background: #9A9AA2; }

.terminal { background: #131417; border-radius: var(--radius); min-height: calc(100vh - 170px); display: flex; flex-direction: column; overflow: hidden; }
.term-bar { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid #222328; }
.term-search {
  flex: 1; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 10px; background: #1C1D21; border: 1px solid #26272C;
}
.term-search .ic { color: #7A7B83; }
.term-search input { flex: 1; background: none; border: 0; outline: 0; color: #E6E6E9; font: 14px var(--mono); min-width: 0; }
.term-search input::placeholder { color: #6D6E76; }
.term-live {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px;
  background: #16321F; color: #4ADE80; font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.term-live i { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; animation: pulse 1.6s ease-in-out infinite; }
.term-live.paused { background: #2A2B30; color: #A2A3AA; }
.term-live.paused i { background: #A2A3AA; animation: none; }
.term-rows { flex: 1; overflow-y: auto; padding: 8px 0 16px; font: 13.5px/1.5 var(--mono); }
.term-row { display: grid; grid-template-columns: 112px 64px 76px minmax(0, 1fr); gap: 16px; padding: 7px 22px; color: #E3E3E7; }
.term-row .t { color: #6F7078; }
.term-row .lv.INFO { color: #4EA8FF; }
.term-row .lv.WARN { color: #F2B33D; }
.term-row .lv.ERROR { color: #FF6464; }
.term-row .lv.DEBUG { color: #9A9AA2; }
.term-row .src { color: #A9AAB1; }
.term-row .msg { white-space: pre-wrap; word-break: break-word; }
.term-row.ERROR { background: #24161A; box-shadow: inset 2px 0 0 #E5484D; }
.term-row.ERROR .msg { color: #FFB4B4; }
.term-empty { color: #7A7B83; padding: 24px 22px; }

/* ============ Sozlamalar va login ============ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }
.settings-card { padding: 22px 24px; }
.settings-card h2 { margin-bottom: 10px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row span { display: grid; gap: 4px; font-size: 14.5px; }
.setting-row code { justify-self: start; font-size: 11.5px; color: var(--text-2); }
.setting-row b { font-size: 14px; text-align: right; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(400px, 100%); padding: 30px; display: grid; gap: 16px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand > span:last-child { display: grid; line-height: 1.2; }
.login-brand b { font-size: 17px; }
.login-brand span span { font-size: 12.5px; color: var(--muted); }
.login-card h1 { font-size: 22px; margin-top: 4px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field input {
  height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-2); font: 14px var(--sans); color: var(--text); background: #fff;
}
.field input:focus { outline: 0; border-color: var(--ink); }
.login-card .note { margin: 0; }

/* ============ Moslashuvchanlik ============ */
@media (max-width: 1280px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card { grid-column: 1 / -1; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-left: 0; border-top: 1px solid var(--border); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--border); }
  .stat-chart { grid-column: 1 / -1; border-left: 0 !important; }
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .detail { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 14px 16px; }
  .sidebar .nav { grid-auto-flow: column; overflow-x: auto; }
  .sidebar-bottom { display: none; }
  .brand { padding-bottom: 12px; }
  .main { padding: 20px 16px 28px; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .logs-layout { grid-template-columns: minmax(0, 1fr); }
  .log-filters { position: static; }
  .search { min-width: 0; flex: 1 1 260px; }
  .term-row { grid-template-columns: 1fr; gap: 2px; }
}
.table.groups .person { min-width: 215px; }
