:root {
  --ink: #17191C; --muted: #5F6670; --line: #E6E7EA; --line2: #EFF0F2; --field: #D5D8DD;
  --bg: #F7F7F8; --card: #FFFFFF; --acc: #C8451F; --acc-ink: #B03A17; --acc-bg: #FDEEE9; --acc-bd: #D9593A;
  --ok: #1F9D62; --off: #C9CDD3; --err: #C0392B; --err-ink: #B42318; --warn: #C98A00; --info: #B3B8C0;
  --unread: #FFFBF9;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
#app { min-height: 100vh; min-height: 100dvh; }
body { font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: var(--ink); font-size: 14px;
  font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.muted { color: var(--muted); }
.sm { font-size: 13px; } .xs { font-size: 12px; }
.min0 { min-width: 0; }
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-sizing: border-box;
  box-shadow: 0 8px 32px rgba(23, 25, 28, .06); }
@media (max-width: 480px) {
  .login { align-items: center; padding: 16px; }
  .login-box { border: 0; box-shadow: none; background: transparent; padding: 8px; }
}
.login-box h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.login-box p { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; }
.field input { min-height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: 10px; background: #fff; font-size: 16px; }
.form-err { margin: 0; color: var(--err-ink); font-weight: 500; }
.btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--field); border-radius: 10px; background: #fff; font-weight: 500; }
.btn-primary { border: 0; background: var(--acc); color: #fff; font-weight: 600; min-height: 48px; }
.btn-primary:disabled { background: #E3A897; }
.btn-sm { font-weight: 600; color: var(--acc-ink); }
.btn-sm:disabled, .btn:disabled { color: var(--muted); }
.link-btn { flex: none; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-size: 13px; }
.link-btn.accent { color: var(--acc-ink); font-weight: 500; }
.center { align-self: center; }
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.bar { flex: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 8px 0 16px;
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top); }
.bar-title { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.title { font-size: 17px; font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs-top { display: none; }
.banner { flex: none; padding: 8px 16px; background: #FFF4E5; color: #7A4A00; font-size: 13px; border-bottom: 1px solid #F3DDBB;
  position: sticky; top: 56px; z-index: 19; }
.body { flex: 1 1 auto; padding: 16px 16px calc(76px + env(safe-area-inset-bottom)); }
.body-in { width: 100%; max-width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.body-in > div { display: flex; flex-direction: column; gap: 12px; }
.body-in > .chips { flex-direction: row; }
.tabs-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(23, 25, 28, .04); }
.tabs-bottom button { flex: 1 1 0; min-height: 60px; border: 0; background: none; font-size: 12px; font-weight: 500; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tabs-bottom button[aria-current="page"] { color: var(--acc-ink); font-weight: 600; }
.tabs-bottom svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico { position: relative; display: flex; }
.badge { position: absolute; top: -6px; left: 12px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--acc); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.wide-only { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.big { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.num { font-size: 17px; font-weight: 600; }
.sep { padding-top: 12px; border-top: 1px solid var(--line2); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; }
.grid4 > div, .grid3 > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row2 { display: flex; gap: 8px; } .row2 .btn { flex: 1 1 0; min-height: 44px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 4px; background: var(--off); display: inline-block; }
.dot.on { background: var(--ok); }
.status-line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.progress { height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.progress i { display: block; height: 4px; width: 0; background: var(--acc); transition: width .3s; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.more { align-self: center; min-width: 160px; }
.m-card { display: flex; flex-direction: column; }
.m-open { padding: 16px 16px 12px; border: 0; background: none; text-align: left; display: flex; flex-direction: column; gap: 12px; border-radius: 12px 12px 0 0; }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.m-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.m-name.unnamed { color: var(--muted); }
.m-stats { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 8px; }
.m-stats > span { display: flex; flex-direction: column; gap: 2px; }
.m-stats b { font-size: 16px; font-weight: 600; }
.m-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 4px 16px; border-top: 1px solid var(--line2); }
.m-foot .link-btn { font-weight: 600; color: var(--acc-ink); }
.m-foot .link-btn:disabled { color: var(--muted); }
.a-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.a-card.stale { opacity: .55; }
.a-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.a-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-st { flex: none; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.a-rev { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.a-rev b { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.a-rev b.zero { color: var(--muted); }
.a-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line2); }
.a-nums > div { display: flex; flex-direction: column; gap: 2px; }
.a-nums b { font-size: 15px; font-weight: 600; }
.a-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.a-foot .bad { color: var(--err-ink); font-weight: 600; }
.chips { flex: none; display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field); background: #fff; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--acc-bg); color: var(--acc-ink); border-color: var(--acc-bd); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input { flex: 1 1 140px; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--field); border-radius: 10px; background: #fff; }
.list { display: flex; flex-direction: column; overflow: hidden; }
.n-row { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line2); background: #fff; text-align: left; display: flex; gap: 12px; align-items: flex-start; }
.n-row:last-child { border-bottom: 0; }
.n-row.unread { background: var(--unread); }
.n-row .dot { margin-top: 7px; }
.n-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.n-top { display: flex; justify-content: space-between; gap: 8px; }
.n-row.unread .n-title { font-weight: 600; }
.n-at { flex: none; font-size: 12px; color: var(--muted); }
.n-reason { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.n-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-error { background: var(--err); } .lv-warn { background: var(--warn); } .lv-success { background: var(--ok); } .lv-info { background: var(--info); }
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; z-index: 10; }
.toast { max-width: 420px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.18); pointer-events: auto; }
.toast.error { background: var(--err-ink); }
.w-ctl { padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
.w-ctl .progress, .w-ctl .w-note { grid-column: 1 / -1; }
.btn-cta { min-height: 44px; padding: 0 16px; }
.kpi-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; }
.ks { padding: 12px 16px; border-bottom: 1px solid var(--line2); min-width: 0; }
.ks.main { grid-column: 1 / -1; }
.ks:nth-child(2n+1):not(.main) { border-left: 1px solid var(--line2); }
.ks-lbl { font-size: 12px; color: var(--muted); }
.ks-val { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 2px 0; }
.ks.main .ks-val { font-size: 26px; }
.ks-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-bar, .ntf-filters { display: flex; flex-direction: column; gap: 8px; }
.search { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; width: 100%; }
.pills { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.pill { flex: none; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: #fff; white-space: nowrap; font-size: 13px; }
.pill b { font-weight: 600; }
.pill.active { background: var(--acc-bg); color: var(--acc-ink); border-color: var(--acc-bd); }
.mon-tools, .ntf-selects { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-lbl select, .pager select { min-height: 40px; padding: 0 8px; border: 1px solid var(--field); border-radius: 10px; background: #fff; color: var(--ink); }
.mode-toggle { display: inline-flex; border: 1px solid var(--field); border-radius: 10px; overflow: hidden; margin-left: auto; }
.mode-toggle button { min-height: 40px; padding: 0 14px; border: 0; background: #fff; font-size: 13px; color: var(--muted); }
.mode-toggle button.active { background: var(--acc-bg); color: var(--acc-ink); font-weight: 600; }
.table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFAFB; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-size: 13px; font-weight: 400; } 
.tbl .c-vp, .tbl .c-sid, .tbl .c-mach { white-space: nowrap; }
.tbl tr.stale td { opacity: .55; }
.mon-table { min-width: 1080px; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; }
.th-sort.on { color: var(--acc-ink); font-weight: 600; }
.acc-name { font-weight: 600; }
a.link { color: var(--acc-ink); text-decoration: none; }
a.link:hover { text-decoration: underline; }
.cell-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; display: block; }
.mon-rev { font-weight: 600; }
.mon-rev.zero { color: var(--muted); font-weight: 500; }
.vp-ok { color: var(--muted); }
.vp-bad { color: var(--err-ink); font-weight: 600; }
.mc { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mc.stale { opacity: .55; }
.mc-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.mc-dur { flex: none; color: var(--muted); }
.mc-rev { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); font-size: 13px; }
.mc-rev .mon-rev { font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }
.mc-rev .mon-rev.zero { color: var(--muted); }
.mc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line2); }
.mc-stats div { display: flex; flex-direction: column; gap: 2px; }
.mc-stats b { font-size: 15px; font-weight: 600; }
.mc-stats span { font-size: 12px; color: var(--muted); }
.mc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pager:empty { display: none; }
.pager .btn { min-width: 44px; }
.ntf-table tr.unread td { background: var(--unread); }
.ntf-table tr.unread .ntf-title { font-weight: 600; }
.ntf-ev { display: flex; gap: 10px; align-items: flex-start; }
.ntf-ev .dot { margin-top: 6px; }
.ntf-title { display: block; }
.ntf-sub { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .ntf-table thead { display: none; }
  .ntf-table, .ntf-table tbody, .ntf-table tr, .ntf-table td { display: block; width: 100%; box-sizing: border-box; }
  .ntf-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line2); }
  .ntf-table tr.unread { background: var(--unread); }
  .ntf-table td { padding: 2px 0 2px 17px; border: 0; background: none !important; }
  .ntf-table td:first-child { padding-left: 0; }
  .ntf-table td[hidden] { display: none; }
  .ntf-table td:last-child:empty { display: none; }
  .ntf-table .cell-sub { max-width: none; }
}
@media (min-width: 900px) {
  .bar { padding: 0 24px; }
  .bar-title { flex: 0 0 260px; width: 260px; }
  .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs-top { display: flex; gap: 4px; margin-left: 24px; margin-right: auto; }
  .tabs-top button { min-height: 56px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 500; color: var(--muted); }
  .tabs-top button[aria-current="page"] { color: var(--acc-ink); font-weight: 600; border-bottom-color: var(--acc); }
  .wide-only { display: inline-block; }
  .narrow-only, .tabs-bottom { display: none !important; }
  .body { padding: 24px; }
  .body-in { max-width: 1200px; }
  .filters select { flex: 0 1 240px; }
  .kpi-strip { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); }
  .ks { border-bottom: 0; border-left: 1px solid var(--line2); }
  .ks.main { grid-column: auto; border-left: 0; }
  .mon-bar, .ntf-filters { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .mon-bar .search, .ntf-filters .search { flex: 0 1 300px; }
  .pills { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .mon-tools { margin-left: auto; }
  .chips { margin: 0; padding: 0; flex-wrap: wrap; }
  .toasts { bottom: 24px; }
}
