/* =========================================================
   Trang Tổng quan (dashboard) — tiền tố .oxd-
   ========================================================= */
.oxd { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Tiêu đề trang */
.oxd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.oxd-head h1 { font-size: 26px; line-height: 1.2; }
.oxd-head .ox-muted { margin-top: 4px; font-size: 13.5px; }
.oxd-head .ox-btn { gap: 8px; }

/* Ô số liệu lớn */
.oxd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.oxd-kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.oxd-kpi {
    position: relative;
    display: flex; align-items: center; gap: 14px;
    min-width: 0;
    padding: 18px 20px;
    background: var(--ox-surface);
    border: 1px solid var(--ox-border);
    border-radius: 18px;
    box-shadow: var(--ox-shadow);
    color: var(--ox-text) !important;
    transition: transform .2s, box-shadow .2s;
}
.oxd-kpi .ox-ic { width: 46px; height: 46px; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.oxd-kpi:hover .ox-ic { transform: scale(1.08) rotate(-8deg); }
.oxd-kpi__body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.oxd-kpi__label { color: var(--ox-muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oxd-kpi__value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oxd-kpi small { color: var(--ox-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oxd-kpi--link { padding-right: 36px; }
.oxd-kpi--link:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -16px rgba(23, 32, 46, .3); }
.oxd-kpi--link > .ox-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ox-slate); transition: color .15s, right .15s; }
.oxd-kpi--link:hover > .ox-icon { color: var(--ox-primary); right: 11px; }
.oxd-kpi--sm { padding: 14px 16px; gap: 12px; }
.oxd-kpi--sm.oxd-kpi--link { padding-right: 32px; }
.oxd-kpi--sm .ox-ic { width: 40px; height: 40px; }
.oxd-kpi--sm .oxd-kpi__value { font-size: 21px; }

/* Bố cục chính: trái (tình trạng + biểu đồ) | phải (việc cần làm + server) */
.oxd-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.oxd-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.oxd .ox-card { border-radius: 18px; }
.oxd .ox-card__head { margin-bottom: 14px; }
.oxd .ox-card__head h2 { white-space: nowrap; }

/* Website theo tình trạng: thanh tỉ lệ + chip */
.oxd-stack { display: flex; gap: 3px; height: 14px; border-radius: 99px; overflow: hidden; background: var(--ox-gray-soft); }
.oxd-stack__seg { display: block; min-width: 6px; flex-basis: 0; transition: filter .15s; }
.oxd-stack__seg:hover { filter: brightness(1.12) saturate(1.1); }
.oxd-c--red { background: var(--ox-red); }
.oxd-c--amber { background: #e39a2b; }
.oxd-c--green { background: var(--ox-green); }
.oxd-c--gray { background: var(--ox-gray); }
.oxd-c--slate { background: var(--ox-slate); }
.oxd-c--blue { background: var(--ox-blue); }
.oxd-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 4px; margin-top: 14px; }
.oxd-chip {
    display: grid; grid-template-columns: auto 1fr; align-items: baseline; align-content: start; column-gap: 6px; row-gap: 1px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--ox-text) !important;
    transition: background .15s, transform .15s;
}
.oxd-chip .ox-dot { transform: none; }
.oxd-chip b { order: -1; grid-column: 1 / -1; font-size: 20px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.oxd-chip span { font-size: 11.5px; font-weight: 500; line-height: 1.3; color: var(--ox-muted); }
.oxd-chip:hover { background: var(--ox-surface-2); transform: translateY(-1px); }
.oxd-chip.is-zero b { color: var(--ox-slate); }
.oxd-chips__sep { display: none; }
.oxd-chip.is-other { border-left: 1px solid var(--ox-border); border-radius: 0 12px 12px 0; }
/* Biểu đồ: tiêu đề + chú giải cùng một hàng */
.oxd-chart .ox-card__head { flex-wrap: wrap; row-gap: 6px; }
.oxd-chart .ox-legend { margin: 0; gap: 14px; font-size: 12.5px; }
.oxd-col > .oxd-chart { flex: 1; display: flex; flex-direction: column; }
.oxd-chart .ox-bchart { margin-top: 4px; min-height: 230px; max-height: 420px; }
.oxd-chart .ox-details { margin-top: 10px; font-size: 13px; }
.oxd-unit { color: var(--ox-muted); font-weight: 400 !important; }

/* Việc cần làm */
.oxd-grp + .oxd-grp { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ox-border); }
.oxd-grp__head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.oxd-grp__head .ox-ic { width: 26px; height: 26px; }
.oxd-ic--gray { background: var(--ox-gray-soft); color: var(--ox-gray); }
.oxd-grp__head h3 { flex: 1; font-size: 13px; font-weight: 600; color: var(--ox-muted); }
.oxd-grp__head em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ox-muted); }
.oxd-rows { list-style: none; margin: 0; padding: 0; }
.oxd-rows li { display: flex; align-items: center; gap: 8px; padding: 6px 0 6px 34px; min-height: 40px; }
.oxd-rows li + li { border-top: 1px dashed var(--ox-border); }
.oxd-rows__main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; color: var(--ox-text) !important; }
.oxd-rows__main strong { min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oxd-rows__main strong.is-wrap { white-space: normal; font-weight: 500; line-height: 1.4; }
.oxd-rows__main small { flex: none; color: var(--ox-muted); font-size: 12px; white-space: nowrap; }
.oxd-rows__main:hover strong { color: var(--ox-primary); }
.oxd-rows .ox-badge { flex: none; padding: 3px 9px; font-size: 11.5px; white-space: nowrap; }
.oxd-rows .ox-icon-btn { flex: none; }
.oxd-rows form { display: contents; }
.oxd-act { flex: none; padding: 4px 10px; border-radius: 99px; background: var(--ox-amber-soft); color: var(--ox-amber) !important; font-size: 12px; font-weight: 600; white-space: nowrap; }
.oxd-act:hover { filter: brightness(.96); }
.oxd-todo .ox-restore-checks { margin-top: 8px; padding-left: 34px; }
.oxd-todo .ox-more { margin: 2px 0 0 34px; font-size: 12.5px; }
.oxd-date { flex: none; color: var(--ox-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Server */
.oxd-servers .ox-bars { gap: 0; }
.oxd-servers .ox-bars a { grid-template-columns: minmax(0, 1.3fr) minmax(50px, 1fr) 26px; padding: 5px 0; font-size: 13px; }

/* Theo kỳ */
.oxd .oxd-period { gap: 14px; margin-top: 8px; }
.oxd-period__head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.oxd-period__head h2 { font-size: 16.5px; }
.oxd-period__head h2::before { content: ""; display: inline-block; width: 4px; height: 17px; margin-right: 10px; border-radius: 4px; background: var(--ox-grad); vertical-align: -2px; }
.oxd-period__head .ox-muted { margin: 2px 0 0 14px; font-size: 12.5px; }
.oxd-period__pills { position: relative; overflow: visible; }
.oxd-period__pills a { padding: 7px 12px; font-size: 13px; }
.oxd-more { position: relative; }
.oxd-more summary { display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px 7px 12px; border-radius: 10px; color: var(--ox-muted); font: 600 13px/1.2 var(--ox-font); cursor: pointer; list-style: none; white-space: nowrap; }
.oxd-more summary::-webkit-details-marker { display: none; }
.oxd-more summary .ox-icon { transform: rotate(90deg); transition: transform .15s; }
.oxd-more[open] summary .ox-icon { transform: rotate(-90deg); }
.oxd-more summary:hover { background: var(--ox-surface-2); color: var(--ox-text); }
.oxd-more summary.is-active { background: var(--ox-grad); color: #fff; box-shadow: 0 6px 14px -8px rgba(232, 64, 28, .8); }
.oxd-more__menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
    width: 280px; padding: 12px;
    background: #fff; border: 1px solid var(--ox-border); border-radius: 16px;
    box-shadow: 0 18px 40px -18px rgba(23, 32, 46, .35);
}
.oxd-more__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.oxd-more__grid a { justify-content: center; padding: 7px 8px; }
.oxd-more__custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ox-border); }
.oxd-more__label { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; color: var(--ox-muted); font-size: 12px; font-weight: 600; }
.oxd-more__custom input[type="date"] { min-width: 0; width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--ox-border); border-radius: 10px; font: 500 12.5px var(--ox-font); color: var(--ox-text); background: #fff; }
.oxd-more__custom .ox-btn { grid-column: 1 / -1; justify-content: center; }
.ox-pills .oxd-more__custom .ox-btn--primary { padding: 0 14px; border-radius: 10px; background: var(--ox-grad); color: #fff !important; box-shadow: 0 8px 18px -10px rgba(232, 64, 28, .75); }

.oxd-period__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.oxd-period__grid > .ox-card { display: flex; flex-direction: column; }
.oxd-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 4px; }
.oxd-sub + .ox-empty { padding: 4px 0 8px; font-size: 13px; }
.oxd-sub h3 { font-size: 12px; font-weight: 600; color: var(--ox-muted); text-transform: uppercase; letter-spacing: .04em; }
.oxd-sub a { font-size: 12.5px; font-weight: 600; }
.oxd-lost .ox-bars + .oxd-sub { margin-top: 14px; }
.oxd-lost .ox-bars { font-size: 13px; }
.oxd-lost .oxd-rows li { padding-left: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .oxd-kpi__value { font-size: 21px; }
    .oxd-kpis--5 .oxd-kpi { padding-left: 14px; gap: 10px; }
}
@media (max-width: 900px) {
    .oxd-kpis--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .oxd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .oxd-main, .oxd-period__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .oxd { gap: 16px; }
    .oxd-head h1 { font-size: 22px; }
    .oxd-head .ox-btn { display: none; }
    .oxd-kpis, .oxd-kpis--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .oxd-kpis--5 > :last-child { grid-column: 1 / -1; }
    .oxd-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .oxd-chip { padding: 6px; }
    .oxd-chip.is-other { border-left: 0; }
    .oxd-kpi { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .oxd-kpi .ox-ic, .oxd-kpi--sm .ox-ic { width: 36px; height: 36px; }
    .oxd-kpi--link, .oxd-kpi--sm.oxd-kpi--link { padding-right: 14px; }
    .oxd-kpi--link > .ox-icon { top: 24px; transform: none; }
    .oxd-kpi__value, .oxd-kpi--sm .oxd-kpi__value { font-size: 18px; }
    .oxd-kpi__label, .oxd-kpi small { white-space: normal; }
    .oxd-rows li { padding-left: 0; }
    .oxd-todo .ox-restore-checks, .oxd-todo .ox-more { padding-left: 0; margin-left: 0; }
    .oxd-rows__main { flex-direction: column; gap: 0; }
    .oxd-period__pills { width: 100%; }
    .oxd-more { position: static; }
    .oxd-more__menu { left: 0; right: 0; width: auto; }
    .oxd .ox-card__head h2 { white-space: normal; }
}

/* Bảng số liệu dự báo: điện thoại dùng danh sách theo tháng thay bảng */
.oxd-fc { display: none; list-style: none; margin: 10px 0 0; padding: 0; }
.oxd-fc__row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; padding: 12px 2px; border-top: 1px solid var(--ox-border); }
.oxd-fc__row:first-child { border-top: 0; }
.oxd-fc__m { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.oxd-fc__m b { font-size: 14px; font-weight: 700; white-space: nowrap; }
.oxd-fc__m small { color: var(--ox-muted); font-size: 12px; white-space: nowrap; }
.oxd-fc__t { font-size: 15px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.oxd-fc__bar { grid-column: 1 / -1; display: flex; height: 6px; border-radius: 99px; background: var(--ox-surface-2); overflow: hidden; }
.oxd-fc__bar i { display: block; height: 100%; }
.oxd-fc i.is-host { background: var(--ox-blue); }
.oxd-fc i.is-domain { background: var(--ox-green); }
.oxd-fc__d { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--ox-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.oxd-fc__d > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.oxd-fc__d i { width: 7px; height: 7px; border-radius: 2px; }
.oxd-fc__row.is-zero { padding: 9px 2px; }
.oxd-fc__row.is-zero .oxd-fc__bar { display: none; }
.oxd-fc__row.is-zero b, .oxd-fc__row.is-zero .oxd-fc__t { color: var(--ox-muted); font-weight: 600; }
.oxd-fc__sum { margin-top: 4px; padding: 12px; border: 0; border-radius: 12px; background: #fff4ee; }
.oxd-fc__sum .oxd-fc__t { color: #e8401c; font-size: 16px; }
@media (max-width: 760px) {
    .oxd-chart .ox-details .ox-table-wrap { display: none; }
    .oxd-fc { display: block; }
}