/* PHOEBE . Cong nha cung cap (/ncc). Khung = khung CRM (dashboard.html): nap shop.css + loader.css + mobile.css + ui-v2.css
   truoc file nay (sidebar, mobile-topbar, drawer, page-title, u-ib, u-tabbar, toast). File nay chi them phan rieng cong NCC.
   Quy chuan 00-QUY-CHUAN-THIET-KE-PHOEBE: kem + vang + navy, KHONG box, tab gach chan, nut chinh champagne chu navy. */
html, body { background: var(--c-cream); -webkit-text-size-adjust: 100%; }
body { color: var(--c-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
.np { min-height: 100vh; }

/* Dang tai: nhu #authGuard CRM */
.np-boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--c-cream); z-index: 999; }

/* Dang nhap / cho cap quyen: nhu trang dang nhap CRM (index.html) */
.np-gate { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; text-align: center; }
.np-gate .np-gbox { width: 100%; max-width: 340px; }
.np-glogo { width: 216px; max-width: 70%; height: auto; margin-bottom: 14px; }
.np-gtitle { font-family: var(--f-serif); font-size: 14px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--c-gold-ink); margin-bottom: 32px; }
.np-h1 { font-family: var(--f-serif); font-size: 28px; font-weight: 500; color: var(--c-navy); margin: 0 0 8px; line-height: 1.2; }
.np-gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border: 1px solid var(--c-line); background: var(--c-white); border-radius: 8px; padding: 12px 24px; font-size: 14px; font-weight: 600; color: var(--c-navy); cursor: pointer; transition: border-color .15s, background .15s; }
.np-gbtn:hover { border-color: var(--c-champ); background: var(--c-gold-tint); }
.np-or { height: 1px; background: var(--c-line); margin: 26px 0 22px; }
.np-gate form { text-align: left; }
.np-msg { margin-top: 16px; font-size: 13px; color: var(--c-muted); line-height: 1.6; min-height: 18px; }
.np-msg.err { color: var(--c-err); }
.np-email { display: inline-block; margin: 12px 0 20px; font-size: 13px; color: var(--c-ink); background: var(--c-white); border: 1px solid var(--c-line); border-radius: 999px; padding: 6px 14px; }

/* Tieu de muc: dung .page-title h1 cua CRM (ui-v2: nhan nho viet hoa). Chi tiet PO: serif nhu .ncs-h ben CRM */
.np-dtitle { font-family: var(--f-serif); font-size: 26px; font-weight: 500; color: var(--c-navy); margin: 4px 0 4px; line-height: 1.2; overflow-wrap: anywhere; }
.main-content .ncx-search { margin: 0 0 4px; }

/* Bo cuc may tinh: danh sach + chi tiet */
@media (min-width: 900px) {
  .np-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); gap: 36px; align-items: start; }
  .np-split .np-dpane { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 4px; }
}

/* Thanh tab day: lop .u-tabbar / .u-tab cua ui-v2.css; badge so don chua xac nhan */
.u-tab .u-tbadge { background: var(--c-champ) !important; color: var(--c-navy) !important; }

/* Chuong: giong .pn-bell cua CRM (notify.js tu chen CSS ben CRM; cong NCC chep lai) */
.pn-wrap { position: relative; flex: none; }
.pn-bell { position: relative; border: 1px solid var(--c-line); background: var(--c-white); color: var(--c-navy); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pn-bell:hover { border-color: var(--c-champ); background: var(--c-gold-tint); }
.pn-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--c-champ); color: var(--c-navy); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.sidebar-footer .pn-wrap { order: 1; }
.sidebar-footer .pn-badge { top: 2px; right: 0; }
.pn-panel { position: fixed; width: 372px; max-width: 88vw; background: var(--c-white); border: 1px solid var(--c-line); border-radius: 12px; box-shadow: 0 8px 28px rgba(31,58,95,.10); z-index: 210; overflow: hidden; }
.np-notice { left: 16px; bottom: 120px; }
body.sidebar-collapsed .np-notice { left: 76px; }
.pn-phead { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--c-line); font-family: var(--f-serif); font-size: 20px; font-weight: 600; color: var(--c-navy); }
.pn-list { max-height: 420px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pn-list .ncx-empty { padding: 26px 16px; text-align: center; font-size: 13px; }
.pn-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--c-line); background: var(--c-white); padding: 12px 14px; cursor: pointer; }
.pn-item:last-child { border-bottom: 0; }
.pn-item:hover { background: var(--c-cream); }
.pn-item.unread { background: var(--c-gold-tint); }
.pn-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pn-title { font-size: 14px; color: var(--c-navy); font-weight: 600; line-height: 1.35; }
.pn-item:not(.unread) .pn-title { font-weight: 500; }
.pn-text { font-size: 13px; color: var(--c-ink); line-height: 1.35; overflow-wrap: anywhere; }
.pn-time { font-size: 12px; color: var(--c-muted); margin-top: 1px; }
.pn-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c-champ); margin-top: 6px; }

/* Sheet thao tac */
.np-sheetwrap { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.np-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.np-sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--c-cream); border-radius: 12px; padding: 24px; }

/* Toast: nhu .toast CRM */
.np-toast { position: fixed; bottom: 24px; right: 24px; background: var(--c-navy); color: var(--c-white); padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 9999; box-shadow: 0 4px 16px rgba(31,58,95,.12); opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; max-width: 90vw; }
.np-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
  #npBellM { width: 44px; height: 44px; border: 0; background: none; }
  #npBellM .pn-badge { top: 2px; right: 2px; }
  .sidebar-footer .pn-bell { width: 44px !important; height: 44px !important; }
  .np-notice { top: calc(54px + env(safe-area-inset-top)); left: 8px; right: 8px; bottom: auto; width: auto; max-width: none; }
  .np-notice .pn-list { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); padding-bottom: env(safe-area-inset-bottom); }
  .np-sheetwrap { align-items: flex-end; }
  .np-sheet { border-radius: 12px 12px 0 0; padding: 18px 16px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .np-toast { top: calc(64px + env(safe-area-inset-top)); bottom: auto; left: 16px; right: 16px; max-width: none; transform: translateY(-12px); }
  .np-toast.show { transform: translateY(0); }
  .np-dtitle { font-size: 24px; }
}

/* 10/11/2026: tren dien thoai mobile-topbar + .main-content min-height 100vh lam trang dai hon man hinh
   (cuon duoc, hien khoang trong duoi thanh tab). Bo min-height cua main-content, .np giu chieu cao toi thieu. */
@media (max-width: 768px) {
  .main-content { min-height: 0 !important; }
  .np { min-height: 0; }
}
