/* =========================================================
   APP.CSS — BaoBiDaiDuong
   clean • rõ ràng • chống báo nhầm bảng giá
   ========================================================= */

/* =========================
   BASE
========================= */
:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;

  --nav-bg: rgba(17,24,39,.92);
  --nav-border: rgba(255,255,255,.08);

  --warn-bg: #fff7ed;
  --warn-border: #f59e0b;
  --warn-text: #7c2d12;
}

*{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a{ color: inherit; text-decoration: none; }
a:hover{ opacity: .92; }

main.container{
  max-width: 1200px;
}

/* =========================
   NAVBAR (BOOTSTRAP DEFAULT – CHỈ TINH GỌN)
========================= */
.navbar{
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--nav-border);
}

.navbar.bg-dark{
  background: var(--nav-bg) !important;
}

.navbar .navbar-brand{
  font-weight: 800;
  letter-spacing: .2px;
}

.navbar .nav-link{
  color: rgba(255,255,255,.78) !important;
  font-weight: 600;
  padding: .55rem .75rem;
  border-radius: 10px;
}

.navbar .nav-link:hover{
  background: rgba(255,255,255,.08);
  color: #fff !important;
}

.navbar .nav-link.active{
  background: rgba(255,255,255,.12);
  color: #fff !important;
}

.navbar .navbar-text{
  color: rgba(255,255,255,.75) !important;
}

/* =========================
   DASHBOARD CARD
========================= */
.dashboard-card{
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 8px 22px rgba(17,24,39,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}

.dashboard-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(17,24,39,.12);
}

.icon-box{
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.icon-ncc{ background: #0d6efd; }
.icon-paper{ background: #20c997; }
.icon-type{ background: #6f42c1; }
.icon-product{ background: #0dcaf0; }
.icon-price{ background: #f59e0b; }

/* =========================
   TABLE – CHUNG & BẢNG GIÁ
========================= */
.table{
  background: #fff;
}

.table thead th{
  font-weight: 700;
  color: #111827;
  border-bottom: 2px solid var(--border);
}

.table td,
.table th{
  border-color: var(--border);
}

.table.table-sm td,
.table.table-sm th{
  padding: .55rem .55rem;
}

.col-index{
  width: 46px;
}

.col-pack{
  width: 1%;
  white-space: nowrap;
  text-align: center;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

.col-pack-header{
  width: 1%;
  white-space: normal;
  line-height: 1.1;
  text-align: center;
  padding-left: 6px !important;
  padding-right: 6px !important;
}

/* =========================================================
   CUSTOMER PRICE BADGE — TO, Ở GIỮA, KHÔNG THỂ BỎ QUA
   ========================================================= */
#customerPriceBadge{
  position: fixed;
  top: 78px;                /* ngay dưới navbar */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 420px;
  max-width: calc(100vw - 24px);

  background: linear-gradient(135deg, #fff3cd, #ffe8a1);
  border: 2px solid #f59e0b;
  color: #7c2d12;

  padding: 14px 18px;
  border-radius: 16px;

  font-weight: 900;
  font-size: 15px;
  line-height: 1.3;
  text-align: center;

  box-shadow: 0 18px 50px rgba(17,24,39,.25);
}

/* Icon cảnh báo */
#customerPriceBadge .cpb-icon{
  width: 36px;
  height: 36px;
  border-radius: 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(245,158,11,.25);
  border: 1px solid rgba(245,158,11,.45);

  font-size: 18px;
  flex-shrink: 0;
}

/* Text */
#customerPriceBadge .cpb-content{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#customerPriceBadge .cpb-title{
  font-size: 13px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

#customerPriceBadge .cpb-name{
  font-size: 16px;
}

#customerPriceBadge .cpb-id{
  font-size: 13px;
  opacity: .75;
}

/* Nhịp đập nhẹ — nhìn là biết “NGUY HIỂM” */
@keyframes cpbPulse{
  0%   { box-shadow: 0 0 0 0 rgba(245,158,11,.55); }
  70%  { box-shadow: 0 0 0 14px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

#customerPriceBadge{
  animation: cpbPulse 1.8s infinite;
}

/* Mobile */
@media (max-width: 576px){
  #customerPriceBadge{
    min-width: unset;
    width: calc(100vw - 24px);
    padding: 12px 14px;
    font-size: 14px;
  }
}
/* =========================
   OPTIONAL: PIN STRIP TRONG PAGE
========================= */
#customerPricePin{
  position: sticky;
  top: 72px;
  z-index: 1020;
  padding: 8px 0;
}

#customerPricePin .alert{
  border: 1px solid rgba(245,158,11,.45);
  background: rgba(255,247,237,.95);
  color: var(--warn-text);
  box-shadow: 0 10px 24px rgba(17,24,39,.10);
  border-radius: 14px;
}

/* Login history modal polish */
#loginHistoryModal .modal-content { border-radius: 14px; }
#loginHistoryModal .modal-header { border-bottom: 1px solid #eef2f7; }
#loginHistoryModal .modal-body { background: #fff; }
#loginHistoryModal .table td, 
#loginHistoryModal .table th { vertical-align: middle; }
#loginHistoryModal .text-truncate { max-width: 520px; }