/* Khung: sidebar trái kiểu macOS, thanh tiêu đề + bộ lọc (nhóm luồng, kỳ, SLA), vùng nội dung cuộn, thanh trạng thái.
   Điện thoại: sidebar thành dải mục cuộn ngang ở trên, bộ lọc xuống dòng. */
.dash { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; padding: 14px 10px 12px; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; color: var(--ink); }
.side-brand svg { width: 28px; height: 28px; flex: none; }
.side-brand .bm-bg { fill: var(--ink); }
.side-brand .bm-dots { stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.side-brand b { display: block; font-size: 13.5px; font-weight: 700; }
.side-brand small { display: block; font-size: 11px; color: var(--ink-2); }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-sec { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 14px 8px 5px; }
.side-nav a { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13px; cursor: pointer; }
.side-nav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.side-nav a[aria-current="page"] { background: var(--sel); color: var(--on-sel); }
.side-nav a .val { margin-left: auto; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.side-nav a[aria-current="page"] .val { color: rgba(255, 255, 255, 0.85); }
.side-nav a .val.is-bad { color: var(--red); font-weight: 600; }
.side-nav a[aria-current="page"] .val.is-bad { color: #fff; }
.nav-chip { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; background: var(--c, var(--gray)); flex: none; }
.nav-chip svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; padding: 14px 8px 0; font-size: 11.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.side-foot b { display: block; color: var(--ink); font-size: 12px; font-weight: 600; }
.side-foot .warn { color: var(--orange); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px 12px; }
.head-title { min-width: 0; }
.head-title b { display: block; font-size: 15px; font-weight: 700; }
.head-title span { display: block; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.seg { display: inline-flex; background: var(--seg-bg); border-radius: 8px; padding: 2px; gap: 1px; }
.seg button { white-space: nowrap; border: 0; background: transparent; font-size: 12px; padding: 3px 10px; border-radius: 6px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: var(--seg-shadow); font-weight: 600; }
.scope-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 26px 0 9px; border-radius: 8px; background: var(--seg-bg); color: var(--ink); max-width: 240px; }
.scope-pick::after { content: ''; position: absolute; right: 10px; top: 11px; width: 5px; height: 5px; border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: rotate(45deg); pointer-events: none; }
.scope-pick svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linejoin: round; flex: none; }
.scope-pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-size: 12.5px; font-weight: 600; outline: none; cursor: pointer; min-width: 0; max-width: 190px; text-overflow: ellipsis; }
.scope-pick.is-scoped { background: var(--blue-s); color: var(--blue); }
.scope-pick.is-scoped svg { stroke: var(--blue); }
.scope-pick.is-scoped::after { border-color: var(--blue); }
.tools { display: inline-flex; background: var(--seg-bg); border-radius: 8px; padding: 2px; gap: 1px; }
.tool { width: 30px; height: 24px; border: 0; border-radius: 6px; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.tool:hover { background: var(--seg-on); }
.tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page { flex: 1; overflow-y: auto; padding: 4px 24px 28px; }
.statusbar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 18px; padding: 7px 20px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.statusbar i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.statusbar b { color: var(--ink); font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }

.tip { position: fixed; z-index: 60; max-width: 300px; padding: 7px 10px; border-radius: 8px; background: var(--tip-bg); color: var(--tip-ink); font-size: 12px; line-height: 1.45; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22); }
.tip b { font-weight: 600; }
.tip span { opacity: 0.75; }

@media (max-width: 1100px) {
  .head { flex-wrap: wrap; }
  .head-tools { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .dash { display: block; height: auto; }
  .side { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; flex-direction: row; align-items: center; gap: 8px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--side-line); overflow-x: auto; overflow-y: hidden; }
  .side-brand { padding: 0 4px 0 0; } .side-brand span, .side-sec, .side-foot { display: none; }
  .side-nav { flex-direction: row; gap: 4px; }
  .side-nav a { white-space: nowrap; padding: 5px 9px; } .side-nav a .val { display: none; }
  .main { height: auto; }
  .head { padding: 12px 16px 8px; }
  .page { overflow: visible; padding: 4px 16px 24px; }
  .head-tools { width: 100%; min-width: 0; }
  .scope-pick { flex: 1 1 100%; max-width: none; }
  .scope-pick select { max-width: none; width: 100%; }
  .statusbar { justify-content: flex-start; padding: 7px 16px; }
}
