/* ===================================================================
   2CRM – Bộ nhận diện thương hiệu 2ID
   Font: Inter (hỗ trợ tốt tiếng Việt có dấu) — tải qua Google Fonts CDN,
   có fallback hệ thống đầy đủ khi không có Internet.
   Tông màu: lấy từ logo 2ID (tím #6C4CF5 → xanh dương #3E7BFA → cyan #14C6F4),
   tinh chỉnh độ bão hòa/độ sáng để phù hợp môi trường doanh nghiệp (không dùng
   gradient tràn lan, ưu tiên màu đặc + điểm nhấn để trông chuyên nghiệp, dễ đọc).
   =================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand-purple: #6C4CF5;
  --brand-blue:   #2F6FE4;
  --brand-cyan:   #0EA5C4;
  --ink:          #0F172A;   /* màu chữ chính - navy đậm gần đen, dễ đọc hơn đen thuần */
  --ink-soft:     #475569;   /* chữ phụ */
  --sidebar-bg:   #10162B;   /* navy đậm đồng nhất, KHÔNG gradient để trông trang trọng hơn */
  --sidebar-line: rgba(255,255,255,.08);
  --bg:           #F5F7FB;
  --border:       #E4E8F1;
  --radius:       .55rem;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  color: var(--ink);
  margin: 0;
  font-size: .94rem;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Trang đăng nhập ---------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% 15%, rgba(108,76,245,.35), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 25%, rgba(14,165,196,.28), transparent 55%);
  font-family: 'Inter', 'Segoe UI', sans-serif;
}
.login-wrap { width: 100%; padding: 2rem; }
.login-card {
  background: #fff; max-width: 408px; margin: 0 auto; padding: 2.4rem 2.2rem;
  border-radius: 1rem; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-card .form-label { font-weight: 600; font-size: .84rem; color: var(--ink-soft); }
.login-card .form-control { border-radius: .5rem; padding: .6rem .8rem; border-color: var(--border); }

/* ---------- Khung ứng dụng: Sidebar trái ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 258px; flex-shrink: 0; color: #CBD3E8;
  background: var(--sidebar-bg);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding-bottom: 2rem;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.35rem 1.25rem 1.1rem; border-bottom: 1px solid var(--sidebar-line); margin-bottom: .4rem; }
.sidebar-brand img { height: 32px; }
.sidebar-brand .name { font-weight: 800; font-size: 1.2rem; line-height: 1; color: #fff; letter-spacing: -.02em; }
.sidebar-brand .sub { font-size: .65rem; color: #6B7494; letter-spacing: .08em; font-weight: 600; margin-top: .15rem; }

.sidebar-user { margin: .8rem 1.1rem 1.1rem; padding: .65rem .85rem; background: rgba(255,255,255,.05); border: 1px solid var(--sidebar-line); border-radius: .5rem; font-size: .8rem; }
.sidebar-user .fw-semibold { color: #fff; }
.sidebar-user .role { color: var(--brand-cyan); font-size: .7rem; font-weight: 600; }

.nav-group-title { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: #5B6485; font-weight: 700; padding: 1rem 1.25rem .35rem; }
.side-link {
  display: flex; align-items: center; gap: .65rem; padding: .5rem 1.25rem; color: #A9B1CC; font-size: .87rem;
  font-weight: 500; border-left: 3px solid transparent; transition: all .12s ease;
}
.side-link:hover { background: rgba(255,255,255,.045); color: #fff; }
.side-link.active { background: rgba(46,111,228,.16); color: #fff; border-left-color: var(--brand-cyan); font-weight: 600; }
.side-link .ic { width: 1.05rem; text-align: center; opacity: .85; font-size: .92em; }

.main-area { flex: 1; min-width: 0; }
.topbar-mini {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.75rem; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar-mini .fw-semibold { color: var(--ink); font-size: 1.02rem; }
.content-wrap { padding: 1.6rem 1.75rem 2.2rem; }

/* ---------- Component dùng chung ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.card-header {
  background: #fff; color: var(--ink); border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0 !important; font-weight: 700; font-size: .92rem;
  padding: .75rem 1.1rem;
}
.kpi-card { border-left: 3px solid var(--brand-blue); }
.kpi-value { font-size: 1.55rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.kpi-label { color: var(--ink-soft); font-size: .8rem; font-weight: 500; }

.table { font-size: .89rem; margin-bottom: 0; }
.table thead { background: #F8FAFD; }
.table thead th { font-weight: 700; color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border) !important; }
.table td, .table th { padding: .65rem .9rem; vertical-align: middle; }

.btn { font-weight: 600; font-size: .87rem; border-radius: .45rem; }
.btn-primary { background: var(--brand-blue); border-color: var(--brand-blue); }
.btn-primary:hover, .btn-primary:focus { background: #2559BD; border-color: #2559BD; }
.btn-outline-primary { color: var(--brand-blue); border-color: var(--brand-blue); }
.btn-outline-primary:hover { background: var(--brand-blue); border-color: var(--brand-blue); }

.badge-status { font-size: .74rem; font-weight: 600; }
.section-title { color: var(--ink); font-weight: 800; font-size: 1.3rem; letter-spacing: -.015em; border-bottom: none; padding-bottom: 0; margin-bottom: 1.2rem; }
.section-title::after { content: ''; display: block; width: 42px; height: 3px; background: var(--brand-cyan); border-radius: 2px; margin-top: .5rem; }
.text-brand { color: var(--brand-blue); }
.badge-cyan { background: var(--brand-cyan); color: #fff; }
.badge-purple { background: var(--brand-purple); color: #fff; }
.barcode-box { background: #fff; padding: .7rem; border: 1px solid var(--border); border-radius: .5rem; display: inline-block; }

.form-label { font-weight: 600; font-size: .84rem; color: var(--ink-soft); }
.form-control, .form-select { border-color: var(--border); border-radius: .45rem; font-size: .89rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 .2rem rgba(47,111,228,.12); }

.list-group-item { font-size: .89rem; border-color: var(--border); }
.alert { border-radius: var(--radius); font-size: .89rem; }

footer.text-muted { color: #94A0BD !important; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -270px; z-index: 40; transition: left .2s; }
  .sidebar.open { left: 0; }
}
