/* Trang quản trị admin.petos.vn (admin.js). Dùng chung bảng màu, thẻ, nút, tab của style.css. */
#app.wide { max-width: 1240px; }

/* thanh trên: trạng thái hệ thống */
.a-status { flex: none; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.a-status.ok { background: var(--ok-soft); color: var(--ok); }
.a-status.warn { background: var(--warn-soft); color: var(--warn); }
.a-status.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
@media (max-width: 959px) { .top { position: static; } }
@media (max-width: 640px) { .top { flex-wrap: wrap; } .top .title { flex-basis: calc(100% - 52px); } .a-status { margin-right: auto; } }

/* bố cục: cột mục bên trái (máy tính), thanh trượt ngang (điện thoại) */
.a-layout { display: grid; gap: 4px; }
.a-main { min-width: 0; }
.a-nav { position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.a-nav .tab { text-decoration: none; }
.a-nav .count { font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 5px; background: var(--warn); color: #fff; }
.a-nav .count.bad { background: var(--danger); }
@media (min-width: 960px) {
  .a-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
  .a-nav {
    flex-direction: column; gap: 2px; overflow: visible; top: 84px; padding: 10px; margin: 0;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .a-nav .tab { border: 0; border-radius: 12px; background: transparent; padding: 8px 10px; width: 100%; font-size: 15px; }
  .a-nav .tab:hover { background: var(--sunk); }
  .a-nav .count { margin-left: auto; }
}
.a-sec { scroll-margin-top: 64px; }
@media (min-width: 960px) { .a-sec { scroll-margin-top: 84px; } }
.a-sec > h2 { margin: 30px 0 6px; font-size: 20px; }
.a-sec:first-child > h2 { margin-top: 14px; }

/* ô số */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 12px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tile .v { font-size: 28px; font-weight: 800; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.t-ico { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; font-size: 15px; flex: none; }
.grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1240px) { .grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile.big { padding: 16px 18px 12px; }
.tile.big .v { font-size: 34px; margin-top: 8px; }
.spark { display: block; width: 100%; height: 32px; margin-top: 10px; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { fill: color-mix(in srgb, var(--brand) 14%, transparent); }

/* kiểm tra hệ thống */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks li > div { flex: 1; min-width: 0; }
.checks li > .btn { flex: none; }
.a-sec > .card + .card { margin-top: 14px; }
.card > h3 { margin: 0 0 6px; font-size: 16px; }
.checks .ic { flex: none; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.st-ok .ic { background: var(--ok-soft); color: var(--ok); }
.st-warn .ic { background: var(--warn-soft); color: var(--warn); }
.st-bad .ic { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.st-info .ic { background: var(--brand-soft); color: var(--text); }
.checks b { display: block; font-weight: 700; }
.checks span { color: var(--muted); font-size: 13.5px; }
.ok-list { border-top: 1px solid var(--line); padding-top: 10px; }
.checks:empty + .ok-list { border-top: 0; padding-top: 0; }
.ok-list summary { cursor: pointer; font-weight: 700; color: var(--ok); font-size: 14px; }
.ok-list[open] summary { margin-bottom: 4px; }

/* chọn gói Cloudflare */
.plan { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg-btn { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.usage { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.usage i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.usage.warn i { background: var(--warn); }
.usage.bad i { background: var(--danger); }

/* biểu đồ */
.charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.charts .card { margin: 0; }
.chart h3 { font-size: 14px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chart h3 small { color: var(--muted); font-weight: 600; }
.chart h3 + .small { margin-top: 2px; }
.chart svg { display: block; width: 100%; height: 110px; margin-top: 10px; overflow: visible; }
.chart .bar { fill: var(--brand); pointer-events: none; }
.chart .hit:hover + .bar, .chart .bar.on { fill: color-mix(in srgb, var(--brand) 70%, var(--text)); }
.chart .axis { stroke: var(--line); }
.chart .lbl { fill: var(--muted); font-size: 10px; }
.tip { position: fixed; pointer-events: none; z-index: 20; background: var(--text); color: var(--bg); font-size: 12.5px;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .1s; }
.tip.show { opacity: 1; }

/* bảng */
.scroll { overflow-x: auto; }
.tables { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); margin-top: 12px; }
.tables .card { margin: 0; }
.tables h3 { margin-bottom: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 12px; border-top: 0; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover td { background: var(--sunk); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.a-sec input[type=search] { max-width: 360px; }

/* phiên bản app */
.vers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vers li { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.vn { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.vn em { font-style: normal; }
.vbar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.vbar i { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.vc { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* hạn dùng */
.dl-row { display: grid; grid-template-columns: 1.3fr 160px 1.5fr auto auto; gap: 8px; align-items: center; margin: 8px 0; }
.dl-row input { width: 100%; }
.dl-row .badge { white-space: nowrap; justify-self: start; }
@media (max-width: 720px) { .dl-row { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); } .dl-row .note { grid-column: 1 / -1; } }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.ok::before { display: none; }
