/* ==========================================================================
   GIAO DIỆN NHÀ MẠNG — lớp phủ lên Index.txt (không sửa file gốc)

   Bật khi <body> có class "nm" (server tự gắn, xem config.json -> giaoDien).
   Muốn quay lại giao diện cũ: đặt "giaoDien": "cu" trong config.json.

   Ý tưởng: phòng điều hành mạng lưới — nền xám xanh lạnh, thanh điều hướng
   xanh navy, MỘT màu nhấn xanh dương cho thao tác, cam chỉ dùng để đánh dấu
   (mục đang chọn, cảnh báo). Số liệu căn thẳng hàng (tabular), góc bo nhỏ,
   đổ bóng gần như không có, mọi khung viền mảnh 1px.
   ========================================================================== */

@import url('/vendor/nm-fonts.css');

body.nm{
  /* bề mặt */
  --bg-base:#EBEFF5; --bg-panel:#FFFFFF; --bg-panel-2:#F6F8FC; --bg-raise:#E6ECF4;
  --line:#DDE4EE; --line-2:#C6D0DF;
  --text-1:#0E1A2E; --text-2:#44536B; --text-3:#71809A;
  /* "teal" là màu nhấn chính của trang -> đổi sang xanh thương hiệu */
  --teal:#1558C0; --teal-2:#0E43A0; --teal-wash:#E5EEFB;
  --violet:#3B4E9B; --violet-2:#2B3B7A; --violet-wash:#E7EAF6;
  --amber:#B86E00; --orange:#E2561A; --red:#C9283E;
  /* màu riêng của lớp này */
  --nm-navy:#0A1B36; --nm-navy-2:#102A52; --nm-navy-3:#183866;
  --nm-cam:#F26A21; --nm-ok:#0E8A5F; --nm-canh-bao:#B86E00; --nm-loi:#C9283E;
  --font-display:'IBM Plex Sans','Segoe UI',Roboto,Arial,sans-serif;
  --font-body:'IBM Plex Sans','Segoe UI',Roboto,Arial,sans-serif;
  --font-mono:'IBM Plex Sans','Segoe UI',Roboto,Arial,sans-serif;
  --nm-ma:'IBM Plex Mono',Consolas,'Courier New',monospace;
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:'tnum' 1,'lnum' 1;
  background:var(--bg-base);
  letter-spacing:0;
}
html:has(body.nm){ background:#EBEFF5; }
body.nm::selection, body.nm ::selection{ background:#1558C0; color:#fff; }
/* Trang cũ ép cả tag Báo cáo về Aptos bằng !important — trả về phông của lớp này */
body.nm #tag0-panel, body.nm #tag0-panel *{ font-family:var(--font-body) !important; }

/* Mã hợp đồng / mã thiết bị: phông đơn cách cho dễ đọc, dễ so */
body.nm td.fpt-contract-link, body.nm span.fpt-contract-link,
body.nm td.fpt-pay-link, body.nm .ma-hd{ font-family:var(--nm-ma) !important; font-size:.94em; letter-spacing:0; }
body.nm td.fpt-contract-link, body.nm span.fpt-contract-link{ color:#1558C0 !important; }
body.nm td.fpt-contract-link:hover{ background:#E5EEFB !important; }

/* ------------------------------------------------------------ THANH ĐIỀU HƯỚNG */
body.nm #nav-rail{
  width:216px; background:var(--nm-navy); color:#D5DEEC;
  box-shadow:1px 0 0 rgba(255,255,255,.04), 6px 0 24px rgba(5,14,30,.28);
  border-right:1px solid #07142A;
}
body.nm #nav-rail::before{ display:none; }
body.nm.nav-pinned .shell{ padding-left:248px; }
body.nm #nav-open-btn{
  width:22px; height:52px; background:var(--nm-navy); border:none; border-left:none;
  border-radius:0 8px 8px 0; box-shadow:2px 0 10px rgba(5,14,30,.3); color:#fff;
}
body.nm #nav-open-btn:hover{ width:28px; background:var(--nm-navy-3); }
body.nm #nav-hotzone::after{ background:var(--nm-cam); opacity:.55; width:3px; }
body.nm #nav-hotzone:hover::after{ opacity:1; width:4px; }

/* thương hiệu */
body.nm .nav-brand{ padding:15px 44px 13px 14px; border-bottom:1px solid rgba(255,255,255,.08); gap:11px; }
body.nm .nav-logo{
  width:36px; height:36px; border-radius:8px; position:relative;
  background:#1558C0; color:#fff; box-shadow:none;
  font-family:var(--font-display); font-weight:700; font-size:13px; letter-spacing:.02em;
}
body.nm .nav-logo::after{
  content:''; position:absolute; right:-1px; bottom:-1px; width:11px; height:11px;
  background:var(--nm-cam); border-radius:8px 0 8px 0;
}
body.nm .nav-title{ font-size:10.5px; letter-spacing:.04em; color:#8FA3C2; font-weight:500; text-transform:none; }
body.nm .nav-sub{ font-size:13px; font-weight:600; color:#fff; }
body.nm .nav-ver{ font-family:var(--nm-ma); font-size:9.5px; font-weight:500; background:rgba(255,255,255,.1); color:#A9BFDD; border-radius:4px; padding:1px 6px; }

/* danh sách */
body.nm .nav-list{ padding:10px 9px 8px; }
body.nm .nav-list::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.18); }
body.nm .nav-group + .nav-group{ margin-top:10px; padding-top:10px; border-top:1px solid rgba(255,255,255,.07); }
body.nm .nav-group-head{
  background:transparent !important; box-shadow:none !important; border-radius:6px;
  padding:5px 8px; margin-bottom:3px; gap:8px;
  color:#8FA3C2; font-size:11px; font-weight:600; letter-spacing:.03em; text-transform:none;
}
body.nm .nav-group-head:hover{ filter:none; background:rgba(255,255,255,.05) !important; color:#C9D6EA; }
body.nm .nav-group-head::before{
  content:''; width:3px; height:12px; border-radius:2px; flex:none;
  background:var(--nav-nhom-vien, #5C7399);
}
body.nm .nav-group-head .nav-ico{ display:none; }
body.nm .nav-caret{ font-size:8px; opacity:.7; }
body.nm .nav-group-items .nav-item{ padding-left:11px; }
body.nm .nav-item{
  padding:6px 9px; gap:10px; border-radius:6px; font-size:12.5px; font-weight:500; color:#BFCCE0;
  transition:background .15s ease, color .15s ease;
}
body.nm .nav-item:hover{ background:rgba(255,255,255,.06); color:#fff; transform:none; }
body.nm .nav-item:hover .nav-ico{ transform:none; }
body.nm .nav-item .nav-ico{ width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; font-size:13px; opacity:.85; }
body.nm .nav-item .nav-ico svg{ width:17px; height:17px; stroke:currentColor; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
body.nm .nav-item.active{
  background:rgba(21,88,192,.34); color:#fff; box-shadow:inset 0 0 0 1px rgba(120,170,255,.28); font-weight:600;
}
body.nm .nav-item.active .nav-ico{ transform:none; opacity:1; color:#9CC4FF; }
body.nm .nav-item.active::after{ left:0; top:5px; bottom:5px; width:3px; background:var(--nm-cam); border-radius:0 3px 3px 0; animation:none; }

/* chân menu: trạng thái dữ liệu, làm mới, tài khoản */
body.nm .nav-foot{ border-top:1px solid rgba(255,255,255,.08); }
body.nm #nav-rail .nav-datasrc{ background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:8px; box-shadow:none; }
body.nm #nav-rail .src-text{ color:#AFC0DA; }
body.nm #nav-rail .src-text b{ color:#fff; font-weight:600; }
body.nm #nav-rail .src-dot.live{ box-shadow:0 0 0 3px rgba(14,138,95,.28); }
body.nm #nav-rail .btn-refresh{ border-radius:6px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); color:#DCE6F5; box-shadow:none; }
body.nm #nav-rail .btn-refresh:hover:not(:disabled){ background:#1558C0; border-color:#1558C0; color:#fff; }
body.nm #nav-rail .view-mode-btn.active{ background:#1558C0; border-color:#1558C0; }
body.nm #nav-pin{ border-radius:6px; background:rgba(255,255,255,.07); border-color:rgba(255,255,255,.14); color:#CFDBEE; }
body.nm.nav-pinned #nav-pin{ background:#1558C0; border-color:#1558C0; color:#fff; }
body.nm .nav-account{ background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:8px; box-shadow:none; }
body.nm .nav-avatar{ background:#1558C0; border-radius:8px; font-size:14px; font-weight:600; }
body.nm .nav-account.is-guest .nav-avatar{ background:#44536B; }
body.nm .nav-acc-text small{ color:#8FA3C2; }

/* ------------------------------------------------------------ NỘI DUNG CHUNG */
body.nm .section-head{ margin:34px 0 14px; padding-bottom:10px; border-bottom:1px solid var(--line-2); align-items:center; gap:8px 12px; }
body.nm .section-head h2{ font-size:18px; font-weight:600; letter-spacing:0; gap:10px; color:var(--text-1); }
body.nm .section-head .swatch{ width:4px; height:20px; border-radius:2px; background:var(--sec-accent, var(--teal)); }
body.nm .section-head .badge{
  font-family:var(--font-body); font-size:12px; font-weight:500; color:var(--text-2);
  border:1px solid var(--line-2); border-radius:4px; padding:2px 9px; background:var(--bg-panel);
}
body.nm .section-head .desc{ font-family:var(--font-body); font-size:12.5px; }

/* nút */
body.nm .btn-export{
  font-family:var(--font-body); font-size:12.5px; font-weight:500; letter-spacing:0;
  padding:6px 13px; border-radius:6px; border:1px solid #1558C0; background:#1558C0; color:#fff;
  box-shadow:0 1px 0 rgba(10,27,54,.12);
  transition:background .15s ease, border-color .15s ease;
}
body.nm .btn-export:hover{ background:#0E43A0; border-color:#0E43A0; }
body.nm .btn-export:disabled{ opacity:.45; }
/* các nút phụ trong thanh công cụ có style inline nền xám -> chỉ chỉnh bo góc + chữ */
body.nm .btn-export[style*="background:#F5F7FA"], body.nm .btn-export[style*="background: #F5F7FA"]{
  border-radius:6px; font-weight:500; box-shadow:none;
}
body.nm .btn-export[style*="background:#F5F7FA"]:hover{ background:#E6ECF4 !important; border-color:var(--line-2) !important; }
body.nm .search-input, body.nm #report-hd-search{
  font-family:var(--font-body) !important; font-size:12.5px; border-radius:6px; border:1px solid var(--line-2); background-color:#fff;
}
body.nm .search-input:focus, body.nm #report-hd-search:focus{ border-color:#1558C0 !important; box-shadow:0 0 0 3px rgba(21,88,192,.16); }
body.nm input[type=date], body.nm input[type=number], body.nm select{ font-family:var(--font-body); border-radius:6px; }
body.nm :focus-visible{ outline:2px solid #1558C0; outline-offset:2px; }

/* thẻ KPI */
body.nm .kpis{ gap:12px; }
body.nm .kpi{
  background:var(--bg-panel); border:1px solid var(--line); border-radius:8px; box-shadow:none;
  padding:15px 18px 14px 20px;
}
body.nm .kpi::before{ top:0; bottom:0; left:0; right:auto; width:4px; height:auto; background:var(--kpi-accent, var(--teal)); }
body.nm .kpi .label, body.nm .kpi .kpi-lbl{
  font-family:var(--font-body); font-size:12.5px; font-weight:500; color:var(--text-2);
  text-transform:none; letter-spacing:0;
}
body.nm .kpi .value, body.nm .kpi .kpi-val{ font-family:var(--font-body); font-weight:600; font-size:30px; letter-spacing:-.01em; margin-top:8px; color:var(--text-1); }
body.nm #tag3-panel .kpi .kpi-val{ font-size:24px; }
body.nm .kpi .kpi-sub, body.nm .kpi .foot{ color:var(--text-3); }

/* khung bảng + bảng dữ liệu chung */
body.nm .report-wrap{ border:1px solid var(--line-2); border-radius:8px; box-shadow:0 1px 2px rgba(10,27,54,.05); }
body.nm table.report-table{ font-family:var(--font-body); }
body.nm table.report-table th, body.nm table.report-table td{ border-right:1px solid #E7ECF3; border-bottom:1px solid #E7ECF3; }
body.nm table.report-table thead th{
  background:#EEF2F8; color:#23344F; font-weight:600; font-size:11.5px; letter-spacing:0; text-transform:none;
  border-bottom:1px solid var(--line-2);
}
/* các khối cột: nền nhạt cùng họ xanh, nhận biết bằng vạch màu ở đáy tiêu đề */
body.nm table.report-table thead th.grp-tk { background:#E6EFFB; color:#0E3F8C; box-shadow:inset 0 -3px 0 #1558C0; }
body.nm table.report-table thead th.grp-bt { background:#E9ECF8; color:#2B3B7A; box-shadow:inset 0 -3px 0 #4C5FB5; }
body.nm table.report-table thead th.grp-ht { background:#E3F3EC; color:#0A5C40; box-shadow:inset 0 -3px 0 #0E8A5F; }
body.nm table.report-table thead th.grp-htm{ background:#FBEFDD; color:#7A4300; box-shadow:inset 0 -3px 0 #D98A1B; }
body.nm table.report-table thead th.grp-nk { background:#E4EEF9; color:#154C82; box-shadow:inset 0 -3px 0 #3B82C4; }
body.nm table.report-table thead th.col-tonns{ background:#0F2A57 !important; color:#fff !important; font-weight:700 !important; letter-spacing:0; box-shadow:none; }
body.nm table.report-table thead th.col-block, body.nm table.report-table thead th.col-nv{ font-weight:700 !important; letter-spacing:0; }
body.nm table.report-table tbody tr:not(.row-dt):not(.row-branch):nth-child(even) td{ background:#F7F9FC; }
body.nm table.report-table tbody tr:not(.row-dt):not(.row-branch):hover td:not(.ton-green):not(.ton-orange):not(.ton-red):not([style*="background"]){ background:#E9F0FB !important; }
/* dòng tổng chi nhánh -> navy; dòng đội trưởng -> xanh nhạt */
body.nm table.report-table tr.row-branch td, body.nm table.report-table tr.row-branch td *,
body.nm #congno-table tr.row-branch td, body.nm #congno-table tr.row-branch td *{
  background:#0F2A57 !important; color:#fff !important; border-top:1px solid #0A1B36; font-weight:600;
}
body.nm table.report-table tr.row-dt td, body.nm #congno-table tr.row-dt td, body.nm #congno-table tr.row-dt td *{
  background:#E3EBF7 !important; color:#12305F !important; font-weight:600;
  border-top:1px solid #B9C8E0; border-bottom:1px solid #B9C8E0;
}
body.nm table.report-table td.col-tonns{ font-weight:700 !important; }
body.nm table.report-table td.col-tonns.ton-green { background:#CBEBDA !important; color:#075A39 !important; }
body.nm table.report-table td.col-tonns.ton-orange{ background:#FAE0B4 !important; color:#6F3B07 !important; }
body.nm table.report-table td.col-tonns.ton-red   { background:#F4C0C4 !important; color:#7E1A24 !important; }
body.nm table.report-table td.col-tonns.tonns-do, body.nm table.report-table tr.row-dt td.col-tonns.tonns-do{ color:#B3121F !important; }

/* bảng datatable kiểu danh sách */
body.nm table.datatable .pill{ border-radius:4px; font-weight:600; }

/* ------------------------------------------------------------ KHÁC */
body.nm #gate-cover{ background:var(--nm-navy); }
body.nm .gate-box{ border-radius:10px; }
body.nm .gate-logo{ font-family:var(--font-display); }
body.nm .hero{ display:none; }

/* ------------------------------------------------------------ KHUNG / THẺ */
body.nm .panel{ border-radius:8px; box-shadow:none; border:1px solid var(--line); padding:18px 18px 14px; }
body.nm .panel h3, body.nm .panel .panel-title{ font-weight:600; letter-spacing:0; }
body.nm table.report-table thead th{ font-weight:600 !important; }
body.nm table.report-table thead th.col-block, body.nm table.report-table thead th.col-nv, body.nm table.report-table thead th.col-tonns{ font-weight:700 !important; }

/* ------------------------------------------------------------ THU HỒI TB */
body.nm #thuhoi-table tr.thuhoi-group-row{
  background:#E3EBF7 !important; color:#12305F; font-weight:600;
  border-top:1px solid #B9C8E0; border-bottom:1px solid #B9C8E0; box-shadow:none;
}
body.nm #thuhoi-table tr.thuhoi-group-row:hover{ background:#D6E2F4 !important; }
body.nm #thuhoi-table tr.thuhoi-group-row td{ background:#E3EBF7 !important; color:#12305F !important; }
body.nm #thuhoi-table tr.thuhoi-branch-row{
  background:#0F2A57 !important; color:#fff; font-weight:700; border-top:1px solid #0A1B36; border-bottom:1px solid #0A1B36; box-shadow:none;
}
body.nm #thuhoi-table tr.thuhoi-branch-row td{ background:#0F2A57 !important; color:#fff !important; font-weight:700; }
body.nm #thuhoi-table tr.thuhoi-branch-row td.num{ font-weight:700; }
body.nm #thuhoi-table td.num{ font-family:var(--font-body); }
body.nm #thuhoi-detail-table, body.nm #thuhoi-detail-table th, body.nm #thuhoi-detail-table td{ font-family:var(--font-body) !important; }
body.nm #thuhoi-kpi .panel > div:first-child{ font-size:11.5px !important; letter-spacing:.01em; }
body.nm #thuhoi-kpi .panel > div:nth-child(2){ font-weight:600 !important; font-size:26px !important; }

/* ------------------------------------------------------------ KPIs */
body.nm #kpis-report-table{ font-family:var(--font-body); }
body.nm #kpis-report-table th{ background:#0F2A57; color:#fff; border:1px solid #1B3A6E; font-weight:600; }
body.nm #kpis-report-table td{ border:1px solid #DDE4EE; }
body.nm #kpis-report-table tr.kpis-branch td{ background:#0F2A57; color:#fff; font-weight:600; }
body.nm #kpis-report-table tr.kpis-group td{ background:#1E4F9E; color:#fff; font-weight:600; }
body.nm #kpis-report-table tr.kpis-nv:nth-child(even) td{ background:#F7F9FC; }

/* ------------------------------------------------------------ CÔNG NỢ */
body.nm #congno-table thead th[style*="background"]{ background:#0F2A57 !important; color:#fff !important; box-shadow:none; }

/* ------------------------------------------------------------ BẢNG DANH SÁCH CHUNG */
body.nm table.datatable thead th, body.nm .cll-t thead th, body.nm #ns-bang thead th{
  background:#EEF2F8; color:#23344F; font-weight:600; letter-spacing:0; text-transform:none;
}

/* ------------------------------------------------------------ IMPORT DATA / HỘP THOẠI */
body.nm .import-group-header{
  background:#12305F !important; box-shadow:none !important; border-radius:6px !important;
  border-left:4px solid var(--nm-cam); letter-spacing:0 !important; text-transform:none !important;
}
body.nm #app-modal .modal-head{ background:#0F2A57; font-weight:600; letter-spacing:0; }
body.nm #app-modal button.mbtn.primary{ background:#1558C0; }
body.nm #app-modal button.mbtn.primary:hover{ background:#0E43A0; }
body.nm #app-modal .modal-box, body.nm #app-modal > div{ border-radius:8px; }
