/* =========================================================
   NSTT — GIAO DIỆN MÀU THƯƠNG HIỆU
   v1329 (07/11) gộp từ nhánh ui-calm → v1342 (09/11, chủ DN: "nhạt quá, chữ bị chìm, nút mất nội dung, thông báo chìm"):
   BẢN ĐẬM — trả lại menu xanh đậm + emoji/icon, màu riêng từng ô số, màu viền nút như bản cũ (v1328);
   CHỈ GIỮ phần màu thương hiệu: tiêu đề bảng xanh đậm + vạch vàng, dòng TỔNG, tiêu đề trang, chip/nút chính xanh logo.
   Công tắc 🎨 ở chân menu trái: Giao diện Mới ⇄ Cũ (Cũ = tắt hẳn file này, app y như v1328) — theme-calm.js.
   Lớp này CHỈ ĐÈ màu / chữ / khoảng cách — không đổi logic, không đụng dữ liệu.
   ========================================================= */

:root{
  --font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;   /* phông HỆ THỐNG (v1332): phông web làm trang Đơn hàng đơ gấp đôi */
}

/* ---- Thanh trên: vạch xanh logo ---- */
.topbar{border-bottom:2px solid #339B21!important}   /* KHÔNG dùng backdrop-filter: nhốt khung thông báo (position:fixed) trong thanh trên */

/* ---- Menu trái (v1342 — chủ DN: chữ mảnh khó nhìn): chữ đậm hơn + sáng hơn ---- */
.nav a{font-weight:600!important;color:rgba(255,255,255,.93)!important;-webkit-font-smoothing:auto}
.nav a.active{font-weight:700!important;color:#fff!important}
.nav-section{font-weight:700!important}
/* icon nét mảnh ở menu (như v1340, chủ DN thích) — trên nền xanh đậm: trắng ngà, mục đang chọn trắng */
.nav a .ico{color:rgba(255,255,255,.88);opacity:1!important}
.nav a .ico svg{width:18px;height:18px;display:block}
.nav a.active .ico,.nav a:hover .ico{color:#fff}
.user-block .u1{font-weight:700}

/* ---- Phần đầu trang (v1342 — chủ DN: sát trên / sát dưới quá): nới thêm khoảng thở ---- */
.page-head{margin-top:6px!important;margin-bottom:22px!important}
@media (max-width:640px){ .page-head{margin-top:2px!important;margin-bottom:14px!important} }

/* ---- Tiêu đề trang + khung ---- */
.page-head h1{color:#1B5E20!important}   /* v1342: chỉ tiêu đề trang — trước tô MỌI h1 → lời chào trên dải xanh ở Tổng quan bị chìm */
.panel-head h3{color:#1B5E20!important}
.panel-head{border-bottom:2px solid #E5F3E0!important}

/* ---- Nút chính + chip đang chọn: xanh logo ---- */
.btn-primary{background:#339B21!important;border-color:#339B21!important;color:#fff!important;box-shadow:0 6px 14px -8px rgba(51,155,33,.7)!important}
.btn-primary:hover{background:#1B5E20!important}
.btn-navy{background:#1B5E20!important;border-color:#1B5E20!important}
.chip.active{background:#339B21!important;border-color:#339B21!important;color:#fff!important}
.chip.active *{color:inherit!important}
input[type=checkbox]{accent-color:#339B21}

/* ---- TIÊU ĐỀ BẢNG: nền xanh đậm logo, chữ trắng đậm, vạch vàng mùa gặt ---- */
table thead th,table.cn-tbl thead th,table.cn-tbl thead th.par{background:#1B5E20!important;color:#fff!important;font-weight:700!important;border-color:#2A7A22!important;border-bottom:2px solid #E8A33D!important}
table thead th a,table thead th span,table thead th b,table thead th small,table thead th div{color:inherit!important}
table thead th input[type=checkbox]{accent-color:#E8A33D!important}
table thead tr:nth-child(2) th{background:#2A7A22!important}
.main table thead th[style],table thead th[style],table thead tr th[class]{background:#1B5E20!important;color:#fff!important}
.main table thead tr:nth-child(2) th[style]{background:#2A7A22!important}
table tbody tr:hover td{background:#EEF6EA!important}

/* ---- DÒNG TỔNG: nền xanh lá rất nhạt, chữ số xanh đậm; dòng tổng chính viền xanh logo ---- */
table tfoot td,table tfoot th,table.cn-tbl tfoot td,table.cn-tbl tfoot td.par,
tr.total td,tr.total-row td,tr.totals-row td,tr.tf-total td,tr.sum-row td,tr.tr-total td,
.total-row,.totals-row,.tf-sum,.tf-total,.oi-c-total{background:#F5FAF3!important;color:#1B5E20!important;font-weight:700!important;border-top:1px solid #DCEDD5!important;border-bottom:0!important}
table tfoot td *,table.cn-tbl tfoot td *,tr.total td *,tr.total-row td *,tr.totals-row td *{color:inherit!important}
table tfoot tr:first-child td,table tfoot tr:first-child th,table.cn-tbl tfoot tr:first-child td,table.cn-tbl tfoot tr:first-child td.par{background:#E6F3E0!important;border-top:2px solid #339B21!important;font-weight:800!important;font-size:1.03em}
table tfoot td:first-child,table.cn-tbl tfoot td.par{letter-spacing:.02em}
table tfoot td:first-child small,table tfoot td:first-child span{color:#5E7A63!important;font-weight:500!important}
table tfoot tr:hover td,table.cn-tbl tfoot tr:hover td,table.cn-tbl tfoot tr:hover td.par{background:#E0F0D9!important}
tr.totals-row.grand td,.totals-row.grand,.total-row.big{background:#1B5E20!important;color:#fff!important}
/* v1342: KHÔNG kẻ vạch trên ô tổng từng NGÀY ở Phiếu nhập (.d-sum) — trước dính nhầm thành "gạch trên số tiền" */
.totals,.totals-box,.total-section,.debt-summary,.ksc-sum,.att-summary{border-top:2px solid #339B21!important}
.totals b,.totals-box b,.total-section b,.debt-summary b,.pn_total,.qi_total,.pn-inline-total{color:#1B5E20!important;font-weight:800!important}

/* ---- Biểu đồ cột: xanh logo, hôm nay vàng ---- */
.chart-bar{background:#8CCB7F!important;border-radius:8px 8px 0 0!important}
.chart-bar:hover{background:#339B21!important;filter:none!important}
.chart-bar[style*="E8A33D"]{background:#E8A33D!important}

.tag-vip{background:#FDF0D8!important;color:#A86A0C!important}

/* ---- Nhóm bảng giá (Sản phẩm & Giá): tên nhóm dài → lưới ô đều nhau, 1 dòng, cắt … (chủ DN duyệt v4) ---- */
@media (min-width:561px){
  .tier-btns{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px;flex:1 1 100%;order:2;margin-top:4px}
  .tier-btns .btn{width:100%;min-width:0;justify-content:flex-start;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;text-align:left;height:36px;line-height:20px;padding:7px 12px!important;border-radius:10px!important}
  .tier-btns .btn.btn-ghost{background:#fff!important;border:1px solid #DCEDD5!important;color:#1B5E20!important}
  .tier-btns .btn.btn-ghost:hover{background:#EEF6EA!important;border-color:#339B21!important}
  .tier-btns .btn[onclick*="tierAdd"]{text-align:center;color:#339B21!important;border:1px dashed #339B21!important}
  .tier-label{color:#1B5E20!important;font-size:13px!important}
  .tier-manage{order:1;margin-left:auto}
}

/* ---- Khung thông báo nằm trong nút chuông → không thừa hưởng căn giữa / mờ của nút ---- */
#notif-panel{text-align:left;cursor:default}
#notif-panel .notif-group-h{color:#1B5E20}
.topbar .icon-btn{filter:none!important;opacity:1!important}

/* nút icon nét mảnh (như v1340) */
.calm-ib svg{width:16px;height:16px;display:block;margin:auto;color:#475569}
.calm-ibl svg{display:inline-block;vertical-align:-3px;margin:0}
/* v1345: trả lại cách v1340 — nút chỉ có emoji chưa có icon nét mảnh → xám nhạt cho đồng bộ; ô icon cạnh ô số ẩn (emoji đã bỏ) */
.calm-emo{filter:grayscale(1);opacity:.7}
.topbar .calm-emo{filter:none;opacity:1}
.calm-ib{color:#475569}
.calm-ib:hover svg{color:#1B5E20}
.topbar .icon-btn{color:#64748B}
.topbar .icon-btn svg{width:19px;height:19px;display:block}
