/* =====================================================================
   Distribution ERP — global theme (v2)
   Layout: full-height dark sidebar + light content area with a clean topbar.
   Every page keeps its existing Bootstrap markup; --brand-* variables still
   drive the brand colour everywhere.
   ===================================================================== */
:root {
  --brand-primary: #0f8a6c;
  --brand-primary-dark: #0a5c49;
  --brand-accent: #14b886;
  --brand-glow: rgba(20, 184, 134, .35);
  --sidebar-width: 268px;
  --topbar-height: 70px;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --line: #e7ecf3;
  --surface: #ffffff;
  --canvas: #f4f7fb;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .35);

  --bs-body-font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --bs-body-color: var(--ink-700);
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand-primary);
  --bs-link-color-rgb: 15, 138, 108;
  --bs-link-hover-color: var(--brand-primary-dark);
  --bs-link-hover-color-rgb: 10, 92, 73;
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: 15, 138, 108;
  --bs-success-rgb: 16, 163, 117;
  --bs-border-radius: 10px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink-700);
  font-family: var(--bs-body-font-family);
  font-size: .925rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink-900); font-weight: 700; letter-spacing: -.02em; }
h4 { font-size: 1.4rem; }
h6 { font-size: .95rem; }
.text-muted { color: var(--ink-500) !important; }
a { text-decoration: none; }
::selection { background: var(--brand-glow); }

* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =====================================================================
   App shell
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(420px 260px at -10% -5%, rgba(20, 184, 134, .22), transparent 70%),
    radial-gradient(380px 300px at 120% 105%, rgba(56, 189, 248, .10), transparent 70%),
    #0b1220;
  color: #cbd5e1;
  z-index: 1045;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(#0b1220 70%, rgba(11, 18, 32, 0));
}
.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary-dark));
  box-shadow: 0 8px 20px -4px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
  flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-brand-name { color: #fff; font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-sub { color: #64748b; font-size: .72rem; font-weight: 500; }

.sidebar-section-label {
  color: #475569;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .4rem 1.5rem .5rem;
}
.sidebar-nav { padding: 0 .85rem 2rem; }

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  color: #94a3b8;
  border-radius: 11px;
  padding: .62rem .85rem;
  margin-bottom: 3px;
  font-size: .88rem;
  font-weight: 500;
  position: relative;
  transition: background .18s ease, color .18s ease;
}
.app-sidebar .nav-link i.fa-fw { width: 1.3em; font-size: .95rem; opacity: .85; }
.app-sidebar .nav-link:hover { color: #f1f5f9; background: rgba(148, 163, 184, .10); }
.app-sidebar .nav-link.active {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary));
  box-shadow: 0 10px 24px -8px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.app-sidebar .nav-link.active i { opacity: 1; }

/* collapsible groups */
.nav-group-toggle { cursor: pointer; }
.nav-group-chevron { font-size: .62rem; transition: transform .25s ease; opacity: .6; }
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron { transform: rotate(180deg); }
.app-sidebar .nav-group-toggle { color: #cbd5e1; }
.app-sidebar .nav-group-toggle[aria-expanded="true"] { color: #fff; background: rgba(148, 163, 184, .08); }
.app-sidebar .nav-group .nav {
  margin: 4px 0 8px 1.35rem;
  padding: 0 0 0 .6rem !important;
  border-left: 1px dashed rgba(148, 163, 184, .22);
}
.app-sidebar .nav-group .nav .nav-link { font-size: .85rem; padding: .45rem .7rem; font-weight: 500; }
.app-sidebar .nav-group .nav .nav-link i.fa-fw { font-size: .8rem; }
.app-sidebar .nav-group .nav .nav-link.active {
  background: rgba(20, 184, 134, .14);
  color: #5eead4;
  box-shadow: none;
}
.app-sidebar .nav-group .nav .nav-link.active::before {
  content: "";
  position: absolute;
  left: -.68rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 134, .2);
}

.sidebar-backdrop { display: none; }

/* ---------- Topbar ---------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 0 2rem;
  background: rgba(244, 247, 251, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(231, 236, 243, .9);
}
.topbar-title { min-width: 0; }
.topbar-page { color: var(--ink-900); font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date { color: var(--ink-500); font-size: .76rem; font-weight: 500; }
.topbar-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  transition: all .18s ease;
}
.topbar-icon-btn:hover { color: var(--brand-primary); border-color: rgba(15, 138, 108, .35); box-shadow: 0 6px 16px -6px var(--brand-glow); }
.topbar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: .3rem .75rem .3rem .3rem;
  box-shadow: var(--shadow-xs);
  transition: all .18s ease;
}
.topbar-user:hover, .topbar-user[aria-expanded="true"] { border-color: rgba(15, 138, 108, .35); box-shadow: 0 6px 16px -6px var(--brand-glow); }
.topbar-user::after { margin-left: .25rem; color: var(--ink-400); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #14b886);
  letter-spacing: .02em;
}
.topbar-user-name { color: var(--ink-900); font-weight: 600; font-size: .84rem; }
.topbar-user-role { color: var(--ink-500); font-size: .72rem; }

/* ---------- Content ---------- */
.app-content {
  flex: 1;
  padding: 1.75rem 2rem 2.5rem;
  min-width: 0;
  animation: pageIn .4s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* page heading rows: "<div class='d-flex justify-content-between ...'><h4>Title</h4> [buttons]</div>" */
.app-content > .d-flex > h4.fw-bold,
.app-content > h4.fw-bold {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.app-content > .d-flex > h4.fw-bold::before,
.app-content > h4.fw-bold::before {
  content: "";
  width: 6px;
  height: 1.35rem;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-primary-dark));
  flex-shrink: 0;
}

/* section labels like "TEAM", "INVENTORY & STOCK" */
h6.text-uppercase {
  display: flex;
  align-items: center;
  gap: .6rem;
  letter-spacing: .1em;
  font-size: .7rem !important;
  color: var(--ink-500) !important;
  margin-top: .5rem;
}
h6.text-uppercase::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------- Hero banner (dashboards) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(500px 220px at 85% -20%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(400px 260px at 0% 120%, rgba(99, 102, 241, .35), transparent 60%),
    linear-gradient(120deg, var(--brand-primary-dark), var(--brand-primary) 55%, var(--brand-accent));
  box-shadow: 0 20px 40px -18px var(--brand-glow);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent 40%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000);
  pointer-events: none;
}
.page-hero-body { position: relative; z-index: 1; min-width: 0; }
.page-hero-eyebrow { font-size: .8rem; font-weight: 600; opacity: .85; margin-bottom: .25rem; }
.page-hero-title { color: #fff; font-weight: 800; font-size: 1.65rem; margin-bottom: .35rem; letter-spacing: -.03em; }
.page-hero-sub { color: rgba(255, 255, 255, .85); font-size: .9rem; }
.page-hero-art {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  border-radius: 24px;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(6px);
  transform: rotate(-6deg);
  flex-shrink: 0;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink-900);
  padding: 1rem 1.25rem;
}
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-footer { background: #fafbfd; border-top: 1px solid var(--line); }
.card-body { padding: 1.25rem; }
.card-body h6.fw-bold { color: var(--ink-900); }

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.row > [class*="col"] > .stat-card:hover,
a > .stat-card:hover,
.row > [class*="col"] > a > .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #dbe3ee;
}
/* decorative corner glow only on the small KPI tiles (cards that contain an icon) */
.stat-card:has(.stat-icon)::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 134, .10), transparent 70%);
  pointer-events: none;
}
.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
  /* keeps each tile's own inline colour, adds a glossy highlight on top */
  background-image: linear-gradient(145deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .12)) !important;
  box-shadow: 0 10px 20px -8px rgba(15, 23, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.stat-card .text-muted.small { font-weight: 600; font-size: .76rem; letter-spacing: .01em; }
.stat-card .fs-4 { color: var(--ink-900); font-weight: 800 !important; letter-spacing: -.03em; font-size: clamp(1.05rem, 1.25vw, 1.4rem) !important; white-space: nowrap; }
.stat-card .card-body > div:last-child { min-width: 0; }
.stat-card .fs-5 { color: var(--ink-900); font-weight: 700; letter-spacing: -.02em; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink-700); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .9rem; border-bottom-color: #eef2f7; vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th {
  background: #f8fafc;
  color: var(--ink-500);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table thead tr:first-child th:first-child { border-top-left-radius: 10px; }
.table thead tr:first-child th:last-child { border-top-right-radius: 10px; }
.table tbody td { font-size: .87rem; }
.table-hover > tbody > tr { transition: background .15s ease; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f3faf7; }
.table tfoot td, .table tfoot th { background: #f8fafc; font-weight: 700; color: var(--ink-900); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #fafcfe; }
.table-bordered > :not(caption) > * > * { border-color: var(--line); }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 11px;
  font-weight: 600;
  font-size: .87rem;
  padding: .5rem 1rem;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-sm { border-radius: 9px; font-size: .8rem; padding: .36rem .75rem; }
.btn-lg { border-radius: 13px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { box-shadow: 0 0 0 .25rem var(--brand-glow); }

.btn.text-white[style*="brand-primary"], .btn-primary {
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary)) !important;
  border: 0;
  color: #fff !important;
  box-shadow: 0 8px 18px -8px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn.text-white[style*="brand-primary"]:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -8px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .2);
  filter: brightness(1.04);
}
.btn-success { background: linear-gradient(135deg, #22c55e, #10a375); border: 0; box-shadow: 0 8px 18px -10px rgba(16, 163, 117, .6); }
.btn-danger { background: linear-gradient(135deg, #f87171, #dc2626); border: 0; box-shadow: 0 8px 18px -10px rgba(220, 38, 38, .55); }
.btn-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b); border: 0; color: #422006; }
.btn-info { background: linear-gradient(135deg, #38bdf8, #0ea5e9); border: 0; color: #fff; }
.btn-outline-secondary { color: var(--ink-700); border-color: #dbe2ea; background: #fff; }
.btn-outline-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--ink-900); }
.btn-outline-primary { color: var(--brand-primary); border-color: rgba(15, 138, 108, .4); }
.btn-outline-primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-outline-danger { background: #fff; border-color: #fecaca; color: #dc2626; }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-outline-success { background: #fff; border-color: #bbf7d0; color: #15803d; }
.btn-outline-success:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-outline-warning { background: #fff; border-color: #fde68a; color: #b45309; }
.btn-outline-info { background: #fff; border-color: #bae6fd; color: #0369a1; }
.btn-light { background: #f1f5f9; border-color: #f1f5f9; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: 11px;
  border: 1px solid #dbe2ea;
  background-color: #fff;
  color: var(--ink-900);
  padding: .58rem .9rem;
  font-size: .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control::placeholder { color: var(--ink-400); }
.form-control:hover, .form-select:hover { border-color: #c5d0dc; }
.form-control-sm, .form-select-sm { border-radius: 9px; padding: .36rem .65rem; font-size: .82rem; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 134, .14);
}
.form-control:disabled, .form-control[readonly] { background: #f8fafc; }
.form-label { font-weight: 600; font-size: .8rem; color: var(--ink-700); margin-bottom: .35rem; }
.form-text { color: var(--ink-500); font-size: .76rem; }
.form-check-input { border-color: #cbd5e1; }
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(20, 184, 134, .14); border-color: var(--brand-accent); }
.form-switch .form-check-input { width: 2.4em; }
.input-group-text { border-radius: 11px; background: #f8fafc; border-color: #dbe2ea; color: var(--ink-500); }

/* ---------- Badges ---------- */
.badge { border-radius: 999px; font-weight: 600; padding: .42em .8em; letter-spacing: .01em; font-size: .72em; }
.badge.text-bg-success, .badge.bg-success { background: #dcfce7 !important; color: #15803d !important; }
.badge.text-bg-danger,  .badge.bg-danger  { background: #fee2e2 !important; color: #b91c1c !important; }
.badge.text-bg-warning, .badge.bg-warning { background: #fef3c7 !important; color: #b45309 !important; }
.badge.text-bg-info,    .badge.bg-info    { background: #e0f2fe !important; color: #0369a1 !important; }
.badge.text-bg-primary, .badge.bg-primary { background: #d1fae5 !important; color: var(--brand-primary-dark) !important; }
.badge.text-bg-secondary, .badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.badge.text-bg-dark, .badge.bg-dark { background: #1e293b !important; color: #fff !important; }
.badge.text-bg-light { background: #f1f5f9 !important; color: #334155 !important; border: 1px solid #e2e8f0; }

/* ---------- Alerts ---------- */
.alert {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: .9rem 1.1rem;
  font-weight: 500;
  font-size: .88rem;
  position: relative;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-secondary { background: #f8fafc; color: #334155; border-color: #e2e8f0; }

/* ---------- Overlays & navigation widgets ---------- */
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line); padding: 1.1rem 1.4rem; }
.modal-header .modal-title { font-weight: 700; color: var(--ink-900); }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top-color: var(--line); padding: .9rem 1.4rem; }
.modal-backdrop.show { opacity: .45; }

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: .45rem;
  font-size: .87rem;
  min-width: 13rem;
}
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-weight: 500; color: var(--ink-700); }
.dropdown-item:hover { background: #f1f5f9; color: var(--ink-900); }
.dropdown-item.text-danger:hover { background: #fef2f2; }

.pagination { gap: 4px; }
.pagination .page-link { border-radius: 9px !important; color: var(--ink-700); border-color: var(--line); font-weight: 600; font-size: .82rem; }
.pagination .page-link:hover { background: #f1f5f9; color: var(--brand-primary); }
.pagination .active > .page-link { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; box-shadow: 0 6px 14px -6px var(--brand-glow); }

.nav-tabs { border-bottom: 1px solid var(--line); gap: .25rem; }
.nav-tabs .nav-link {
  color: var(--ink-500);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 600;
  font-size: .87rem;
  padding: .7rem 1rem;
  margin-bottom: -1px;
}
.nav-tabs .nav-link:hover { color: var(--ink-900); border-bottom-color: #cbd5e1; }
.nav-tabs .nav-link.active { color: var(--brand-primary); background: transparent; border-bottom-color: var(--brand-primary); }
.nav-pills .nav-link { border-radius: 10px; color: var(--ink-700); font-weight: 600; }
.nav-pills .nav-link.active { background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary)); box-shadow: 0 8px 18px -8px var(--brand-glow); }

.list-group-item { border-color: var(--line); }
.list-group-item:first-child { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.list-group-item:last-child { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
.progress { border-radius: 999px; background: #e9eef5; height: .6rem; }
.progress-bar { background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary)); border-radius: 999px; }
.toast { border-radius: 14px; box-shadow: var(--shadow-md); }
hr { border-color: var(--line); opacity: 1; }
.border, .border-top, .border-bottom { border-color: var(--line) !important; }
code { color: #be185d; background: #fdf2f8; padding: .1em .35em; border-radius: 5px; }

/* =====================================================================
   Auth pages (login / forgot / reset / license expired)
   ===================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 500px at 10% 10%, rgba(20, 184, 134, .45), transparent 60%),
    radial-gradient(600px 500px at 95% 90%, rgba(99, 102, 241, .35), transparent 60%),
    radial-gradient(500px 400px at 80% 10%, rgba(56, 189, 248, .18), transparent 60%),
    #0b1220;
}
.auth-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}
.auth-wrapper::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 80px rgba(255, 255, 255, .015), 0 0 0 160px rgba(255, 255, 255, .01);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .55);
  position: relative;
  z-index: 1;
  animation: authIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes authIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 1rem;
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary-dark));
  box-shadow: 0 16px 32px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.auth-card h4 { font-weight: 800; letter-spacing: -.03em; }
.auth-card .form-control { padding: .72rem 1rem; background: #f8fafc; }
.auth-card .form-control:focus { background: #fff; }
.auth-card .btn-signin {
  padding: .78rem;
  font-weight: 700;
  font-size: .95rem;
  border-radius: 13px;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary));
  box-shadow: 0 14px 28px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.auth-card .btn-signin:hover { transform: translateY(-1px); filter: brightness(1.05); color: #fff; }
.auth-card a:not(.btn) { color: var(--brand-primary); font-weight: 600; }
.auth-card a:not(.btn):hover { text-decoration: underline; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .app-sidebar.show { transform: translateX(0); box-shadow: 20px 0 50px rgba(0, 0, 0, .35); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .app-topbar { padding: 0 1rem; }
  .app-content { padding: 1.25rem 1rem 2rem; }
  .page-hero { padding: 1.4rem 1.4rem; border-radius: 18px; }
  .page-hero-title { font-size: 1.35rem; }
}
@media (max-width: 575.98px) {
  .stat-card .stat-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 1rem; }
  .stat-card .fs-4 { font-size: 1.2rem !important; }
  .stat-card .card-body { padding: 1rem; }
  .stat-card .card-body.d-flex:has(> .stat-icon) { flex-direction: column; align-items: flex-start !important; gap: .7rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app-content, .auth-card { animation: none; }
  * { transition: none !important; }
}

/* =====================================================================
   Print — documents (invoices, ledgers, reports) print clean
   ===================================================================== */
@media print {
  .app-sidebar, .app-topbar, .sidebar-backdrop, .no-print { display: none !important; }
  .app-shell, .app-main { display: block; }
  .app-content { padding: 0 !important; animation: none; }
  body { background: #fff; }
  .card, .stat-card { box-shadow: none !important; }
  .page-hero { color: #000; background: none; box-shadow: none; border: 1px solid #ddd; }
  .page-hero-title { color: #000; }
}

/* =====================================================================
   Growth features (2026-10-22): WhatsApp button, progress meters, payslip
   ===================================================================== */
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  border: 0;
  color: #fff !important;
  box-shadow: 0 8px 18px -10px rgba(18, 140, 126, .7);
}
.btn-whatsapp:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-whatsapp .fa-whatsapp { font-size: 1.05em; }

.meter { height: .55rem; border-radius: 999px; background: #e9eef5; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary)); }
.meter.meter-warn > span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.meter.meter-low > span { background: linear-gradient(90deg, #f87171, #dc2626); }

.rank-badge {
  width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; background: #f1f5f9; color: var(--ink-700);
}
.rank-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank-3 { background: linear-gradient(135deg, #fed7aa, #c2410c); color: #fff; }

.payslip-sheet { max-width: 820px; margin: 0 auto; }
.payslip-sheet .table td, .payslip-sheet .table th { padding: .55rem .8rem; }
.payslip-net { background: linear-gradient(120deg, var(--brand-primary-dark), var(--brand-primary)); color: #fff; border-radius: 14px; }
