/* =====================================================================
   Distribution ERP — global theme (v4 "Soft violet")
   Light sidebar, flat surfaces, one dark header band per dashboard.
   Colour: truck-blue for actions, marigold only for "where you are" and focus.
   Type: Bricolage Grotesque (headings, figures) + IBM Plex Sans (everything else).
   Every page keeps its Bootstrap markup; --brand-* variables still drive colour.
   ===================================================================== */
:root {
  --brand-primary: #7c3aed;
  --brand-primary-dark: #5b21b6;
  --brand-accent: #a78bfa;
  --brand-glow: rgba(124, 58, 237, .30);
  --brand-tint: #f3edff;
  --pop: #ff6fae;
  --marigold: #ff6fae;
  --sidebar-width: 272px;
  --topbar-height: 72px;

  --ink-950: #1e1637;
  --ink-900: #251b45;
  --ink-700: #4a4266;
  --ink-500: #7a7396;
  --ink-400: #a39dbd;
  --line: #ece6f8;
  --line-strong: #d9d0ee;
  --surface: #ffffff;
  --canvas: #f6f3fd;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(76, 29, 149, .05);
  --shadow-sm: 0 2px 4px rgba(76, 29, 149, .04), 0 8px 24px -10px rgba(76, 29, 149, .14);
  --shadow-md: 0 14px 34px -14px rgba(76, 29, 149, .32);
  --shadow-lg: 0 30px 70px -26px rgba(76, 29, 149, .5);

  --font-display: 'Outfit', 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --bs-body-font-family: 'DM 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: 124, 58, 237;
  --bs-link-hover-color: var(--brand-primary-dark);
  --bs-link-hover-color-rgb: 91, 33, 182;
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: 124, 58, 237;
  --bs-success-rgb: 22, 163, 110;
  --bs-border-radius: 12px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink-700);
  font-family: var(--bs-body-font-family);
  font-size: .9rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink-900); font-family: var(--font-display); font-weight: 650; letter-spacing: -.015em; }
h4 { font-size: 1.55rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: .95rem; }
.text-muted { color: var(--ink-500) !important; }
a { text-decoration: none; }
::selection { background: rgba(167, 139, 250, .4); }

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

/* keyboard focus: the one place marigold is used on controls */
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.form-control:focus-visible, .form-select:focus-visible { outline: 0; }

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

/* ---------- Sidebar (light) ---------- */
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink-700);
  z-index: 1045;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1.1rem 1.25rem .9rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(var(--surface) 78%, rgba(255, 255, 255, 0));
}
.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--marigold);
  font-size: 1rem;
  background: var(--ink-950);
  flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-brand-name { color: var(--ink-950); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-sub { color: var(--ink-500); font-size: .74rem; font-weight: 500; }

.sidebar-section-label {
  color: var(--ink-400);
  font-size: .76rem;
  font-weight: 600;
  padding: .55rem 1.5rem .35rem;
}
.sidebar-nav { padding: 0 .75rem 2rem; }

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  color: var(--ink-700);
  border-radius: 8px;
  padding: .55rem .75rem;
  margin-bottom: 2px;
  font-size: .875rem;
  font-weight: 500;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.app-sidebar .nav-link i.fa-fw { width: 1.3em; font-size: .92rem; color: var(--ink-400); transition: color .15s ease; }
.app-sidebar .nav-link:hover { color: var(--ink-950); background: #f4f5f8; }
.app-sidebar .nav-link:hover i.fa-fw { color: var(--ink-700); }
.app-sidebar .nav-link.active {
  color: var(--brand-primary-dark);
  font-weight: 600;
  background: var(--brand-tint);
}
.app-sidebar .nav-link.active i.fa-fw { color: var(--brand-primary); }
/* marigold marker on the sidebar edge = "you are here" */
.app-sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: -.75rem;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--marigold);
}

/* collapsible groups */
.nav-group-toggle { cursor: pointer; }
.nav-group-chevron { font-size: .6rem; transition: transform .25s ease; color: var(--ink-400); }
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron { transform: rotate(180deg); }
.app-sidebar .nav-group-toggle[aria-expanded="true"] { color: var(--ink-950); font-weight: 600; }
.app-sidebar .nav-group-toggle[aria-expanded="true"] i.fa-fw { color: var(--ink-700); }
.app-sidebar .nav-group .nav {
  margin: 2px 0 8px 1.4rem;
  padding: 0 0 0 .55rem !important;
  border-left: 1px solid var(--line);
}
.app-sidebar .nav-group .nav .nav-link { font-size: .84rem; padding: .42rem .65rem; }
.app-sidebar .nav-group .nav .nav-link i.fa-fw { font-size: .78rem; }
.app-sidebar .nav-group .nav .nav-link.active { background: transparent; color: var(--brand-primary); }
.app-sidebar .nav-group .nav .nav-link.active::before {
  left: -.56rem;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--brand-primary);
}

.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(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; }
.topbar-page { color: var(--ink-950); font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date { color: var(--ink-500); font-size: .76rem; }
.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, color .15s ease;
}
.topbar-icon-btn:hover { color: var(--brand-primary); border-color: var(--line-strong); }
.topbar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: .25rem .7rem .25rem .25rem;
  transition: border-color .15s ease;
}
.topbar-user:hover, .topbar-user[aria-expanded="true"] { border-color: var(--line-strong); }
.topbar-user::after { margin-left: .25rem; color: var(--ink-400); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  color: var(--marigold);
  background: var(--ink-950);
}
.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; }

/* 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 { font-weight: 650 !important; }

/* section labels (were all-caps rules) — now plain sentence-case headings */
h6.text-uppercase {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-transform: none !important;
  letter-spacing: 0;
  font-family: var(--bs-body-font-family);
  font-weight: 600 !important;
  font-size: .85rem !important;
  color: var(--ink-700) !important;
  margin-top: .5rem;
}
h6.text-uppercase::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Dashboard header band ---------- */
.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 1.9rem 1.7rem;
  border-radius: var(--radius);
  color: #fff;
  background: var(--ink-950);
  border-bottom: 4px solid var(--marigold);
}
.page-hero-body { min-width: 0; }
.page-hero-eyebrow { font-size: .85rem; font-weight: 500; color: rgba(255, 255, 255, .62); margin-bottom: .3rem; }
.page-hero-title { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.1; margin-bottom: .5rem; letter-spacing: -.025em; }
.page-hero-sub { color: rgba(255, 255, 255, .7); font-size: .92rem; max-width: 60ch; }

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

/* KPI tiles: label top-left, figure underneath, small outlined icon at the right */
.stat-card { position: relative; overflow: hidden; border-radius: 12px; }
a > .stat-card, .row > [class*="col"] > a > .stat-card { transition: border-color .15s ease; }
a:hover > .stat-card { border-color: var(--line-strong); }
.stat-card .card-body.d-flex:has(> .stat-icon) { flex-direction: row-reverse; justify-content: space-between; align-items: flex-start !important; padding: 1rem 1.1rem 1.05rem; gap: .75rem !important; }
.stat-card .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.stat-card .text-muted.small { font-weight: 500; font-size: .8rem; color: var(--ink-500) !important; margin-bottom: .15rem; }
.stat-card .fs-4 { color: var(--ink-950); font-family: var(--font-display); font-weight: 700 !important; letter-spacing: -.02em; font-size: clamp(1.2rem, 1.5vw, 1.6rem) !important; line-height: 1.15; white-space: nowrap; }
.stat-card .fs-6.text-muted { font-size: 1rem !important; color: var(--ink-400) !important; }
.stat-card .card-body > div:last-child { min-width: 0; }
.stat-card .fs-5 { color: var(--ink-900); font-family: var(--font-display); font-weight: 650; letter-spacing: -.015em; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink-700); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .85rem; border-bottom-color: #edf0f3; vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .5rem .7rem; }
.table thead th {
  background: #f7f8fa;
  color: var(--ink-500);
  font-size: .78rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.table thead tr:first-child th:first-child { border-top-left-radius: 8px; }
.table thead tr:first-child th:last-child { border-top-right-radius: 8px; }
.table tbody td { font-size: .875rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f6f8ff; }
.table tfoot td, .table tfoot th { background: #f7f8fa; font-weight: 650; color: var(--ink-900); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #fafbfc; }
.table-bordered > :not(caption) > * > * { border-color: var(--line); }
/* row-action cells: keep buttons on one line, compact */
.table td:has(> .btn), .table td:has(> form), .table td:has(> .d-flex > .btn) { white-space: nowrap; }
.table td .btn-sm { padding: .22rem .6rem; font-size: .78rem; border-radius: 7px; }
.table td .btn-outline-secondary { border-color: var(--line); color: var(--ink-700); }
.table td .btn-outline-secondary:hover { background: var(--brand-tint); border-color: transparent; color: var(--brand-primary-dark); }
.table td form { display: inline-block; }
.table td a.text-nowrap, .table td .text-nowrap { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 8px;
  font-weight: 600;
  font-size: .86rem;
  padding: .48rem .95rem;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm { border-radius: 7px; font-size: .8rem; padding: .34rem .7rem; }
.btn-lg { border-radius: 10px; }
.btn:focus-visible { box-shadow: none; outline: 2px solid var(--marigold); outline-offset: 2px; }

.btn.text-white[style*="brand-primary"], .btn-primary {
  background: var(--brand-primary) !important;
  border: 1px solid var(--brand-primary);
  color: #fff !important;
}
.btn.text-white[style*="brand-primary"]:hover, .btn-primary:hover { background: var(--brand-primary-dark) !important; border-color: var(--brand-primary-dark); }
.btn-success { background: #16805a; border: 1px solid #16805a; }
.btn-success:hover { background: #11694a; border-color: #11694a; }
.btn-danger { background: #c8322b; border: 1px solid #c8322b; }
.btn-danger:hover { background: #a82822; border-color: #a82822; }
.btn-warning { background: #f5a700; border: 1px solid #f5a700; color: #3b2a00; }
.btn-warning:hover { background: #dc9600; border-color: #dc9600; color: #3b2a00; }
.btn-info { background: #0f7fa8; border: 1px solid #0f7fa8; color: #fff; }
.btn-outline-secondary { color: var(--ink-700); border-color: var(--line-strong); background: #fff; }
.btn-outline-secondary:hover { background: #f4f5f8; border-color: var(--ink-400); color: var(--ink-950); }
.btn-outline-primary { color: var(--brand-primary); border-color: #b7c2f4; background: #fff; }
.btn-outline-primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-outline-danger { background: #fff; border-color: #f0c4c1; color: #c8322b; }
.btn-outline-danger:hover { background: #c8322b; border-color: #c8322b; color: #fff; }
.btn-outline-success { background: #fff; border-color: #b6dccb; color: #16805a; }
.btn-outline-success:hover { background: #16805a; border-color: #16805a; color: #fff; }
.btn-outline-warning { background: #fff; border-color: #f2d58b; color: #8a5a00; }
.btn-outline-info { background: #fff; border-color: #b4dcea; color: #0f6f94; }
.btn-light { background: #f1f3f6; border-color: #f1f3f6; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background-color: #fff;
  color: var(--ink-900);
  padding: .5rem .8rem;
  font-size: .9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: var(--ink-400); }
.form-control:hover, .form-select:hover { border-color: var(--ink-400); }
.form-control-sm, .form-select-sm { border-radius: 7px; padding: .32rem .6rem; font-size: .82rem; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .16);
}
.form-control:disabled, .form-control[readonly] { background: #f6f7f9; }
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-700); margin-bottom: .3rem; }
.form-text { color: var(--ink-500); font-size: .78rem; }
.form-check-input { border-color: var(--ink-400); }
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(124, 58, 237, .16); border-color: var(--brand-primary); }
.form-switch .form-check-input { width: 2.4em; }
.input-group-text { border-radius: 8px; background: #f6f7f9; border-color: var(--line-strong); color: var(--ink-500); }

/* ---------- Badges (status pills with a dot) ---------- */
.badge { border-radius: 999px; font-weight: 600; padding: .38em .75em; font-size: .74em; }
td .badge::before, .card-body .badge.text-bg-success::before, .card-body .badge.text-bg-danger::before, .card-body .badge.text-bg-warning::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: .45em;
  vertical-align: .08em;
}
td .badge { text-transform: capitalize; }
.badge.text-bg-success, .badge.bg-success { background: #e1f3ea !important; color: #11694a !important; }
.badge.text-bg-danger,  .badge.bg-danger  { background: #fbe4e2 !important; color: #a82822 !important; }
.badge.text-bg-warning, .badge.bg-warning { background: #fdf0cf !important; color: #8a5a00 !important; }
.badge.text-bg-info,    .badge.bg-info    { background: #e0f0f7 !important; color: #0f6f94 !important; }
.badge.text-bg-primary, .badge.bg-primary { background: var(--brand-tint) !important; color: var(--brand-primary-dark) !important; }
.badge.text-bg-secondary, .badge.bg-secondary { background: #eef0f3 !important; color: #4a5260 !important; }
.badge.text-bg-dark, .badge.bg-dark { background: var(--ink-950) !important; color: #fff !important; }
.badge.text-bg-light { background: #f1f3f6 !important; color: var(--ink-700) !important; border: 1px solid var(--line); }

/* ---------- Alerts ---------- */
.alert {
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 10px;
  padding: .8rem 1.05rem;
  font-weight: 500;
  font-size: .88rem;
  position: relative;
}
.alert-success { background: #eef8f3; color: #0f5a3f; border-color: #cfe9dc; border-left-color: #16805a; }
.alert-danger  { background: #fdf0ef; color: #8f2420; border-color: #f4d3d1; border-left-color: #c8322b; }
.alert-warning { background: #fff8e6; color: #7a5200; border-color: #f6e2ab; border-left-color: #f5a700; }
.alert-info    { background: #eef3fe; color: #1f3590; border-color: #d0dbf8; border-left-color: var(--brand-primary); }
.alert-secondary { background: #f6f7f9; color: var(--ink-700); border-color: var(--line); border-left-color: var(--ink-400); }

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

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: .4rem;
  font-size: .87rem;
  min-width: 13rem;
}
.dropdown-item { border-radius: 7px; padding: .48rem .7rem; font-weight: 500; color: var(--ink-700); }
.dropdown-item:hover { background: #f4f5f8; color: var(--ink-950); }
.dropdown-item.text-danger:hover { background: #fdf0ef; }

.pagination { gap: 4px; }
.pagination .page-link { border-radius: 7px !important; color: var(--ink-700); border-color: var(--line); font-weight: 600; font-size: .82rem; }
.pagination .page-link:hover { background: var(--brand-tint); color: var(--brand-primary); }
.pagination .active > .page-link { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

.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: .65rem 1rem;
  margin-bottom: -1px;
}
.nav-tabs .nav-link:hover { color: var(--ink-950); border-bottom-color: var(--line-strong); }
.nav-tabs .nav-link.active { color: var(--ink-950); background: transparent; border-bottom-color: var(--marigold); border-bottom-width: 3px; }
.nav-pills .nav-link { border-radius: 8px; color: var(--ink-700); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--brand-primary); }

.list-group-item { border-color: var(--line); }
.list-group-item:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.list-group-item:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.progress { border-radius: 999px; background: #e8ebf0; height: .55rem; }
.progress-bar { background: var(--brand-primary); border-radius: 999px; }
.toast { border-radius: 12px; box-shadow: var(--shadow-md); }
hr { border-color: var(--line); opacity: 1; }
.border, .border-top, .border-bottom { border-color: var(--line) !important; }
code { color: #a3245c; background: #fbeff5; padding: .1em .35em; border-radius: 5px; }

/* =====================================================================
   Auth pages (login / forgot / reset / license expired)
   Split screen: ink brand panel on the left (wide screens), form on the right.
   ===================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--surface);
}
.auth-aside { display: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card {
  width: 100%;
  max-width: 420px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.auth-card > .card-body { padding: 0 !important; }
.auth-card .text-center { text-align: left !important; }
.auth-logo {
  width: 46px;
  height: 46px;
  margin: 0 0 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--marigold);
  background: var(--ink-950);
}
.auth-card h4 { font-size: 1.75rem; letter-spacing: -.025em; }
.auth-card .form-control { padding: .68rem .9rem; }
.auth-card .btn-signin {
  padding: .72rem;
  font-weight: 650;
  font-size: .95rem;
  border-radius: 9px;
  color: #fff;
  border: 0;
  background: var(--brand-primary);
}
.auth-card .btn-signin:hover { background: var(--brand-primary-dark); color: #fff; }
.auth-card a:not(.btn) { color: var(--brand-primary); font-weight: 600; }
.auth-card a:not(.btn):hover { text-decoration: underline; }

@media (min-width: 992px) {
  .auth-wrapper { grid-template-columns: minmax(380px, 5fr) minmax(0, 6fr); }
  .auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.25rem;
    color: #fff;
    background: var(--ink-950);
    border-right: 6px solid var(--marigold);
    order: -1;
  }
  .auth-aside-brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
  .auth-aside-brand i { color: var(--marigold); }
  .auth-aside h2 { color: #fff; font-size: clamp(2rem, 3.3vw, 3.1rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 1rem; max-width: 14ch; }
  .auth-aside p { color: rgba(255, 255, 255, .66); max-width: 38ch; margin: 0; }
  .auth-aside small { color: rgba(255, 255, 255, .45); }
}

/* =====================================================================
   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(17, 20, 27, .28); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(17, 20, 27, .5);
    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.25rem 1.25rem 1.35rem; }
  .page-hero-title { font-size: 1.55rem; }
}
@media (max-width: 767.98px) {
  /* wide data tables scroll sideways instead of crushing their columns */
  .table-responsive > .table { min-width: 680px; }
  .table-responsive > .table td:first-child { min-width: 11rem; }
}
@media (max-width: 575.98px) {
  .stat-card .fs-4 { font-size: 1.2rem !important; }
  .stat-card .card-body.d-flex:has(> .stat-icon) { padding: .85rem .9rem; }
  .stat-card .stat-icon { width: 30px; height: 30px; font-size: .8rem; }
  h4 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* =====================================================================
   v4 skin — soft, rounded, violet. Overrides the base rules above.
   ===================================================================== */
body { background: var(--canvas); background-image: radial-gradient(900px 420px at 100% -10%, rgba(167, 139, 250, .18), transparent 70%), radial-gradient(700px 380px at -10% 110%, rgba(255, 111, 174, .08), transparent 70%); background-attachment: fixed; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.01em; }

/* sidebar */
.app-sidebar { border-right: 0; box-shadow: 4px 0 40px -18px rgba(76, 29, 149, .25); }
.sidebar-brand { background: linear-gradient(#fff 78%, rgba(255, 255, 255, 0)); padding: 1.25rem 1.35rem 1rem; }
.sidebar-logo { width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 10px 20px -8px rgba(124, 58, 237, .6); }
.sidebar-brand-name { font-weight: 700; }
.sidebar-section-label { padding-left: 1.6rem; }
.sidebar-nav { padding: 0 .85rem 2rem; }
.app-sidebar .nav-link { border-radius: 12px; padding: .62rem .85rem; margin-bottom: 3px; }
.app-sidebar .nav-link i.fa-fw { color: #a78bfa; }
.app-sidebar .nav-link:hover { background: var(--brand-tint); color: var(--brand-primary-dark); }
.app-sidebar .nav-link:hover i.fa-fw { color: var(--brand-primary); }
.app-sidebar .nav-link.active { color: #fff; background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 10px 22px -10px rgba(109, 40, 217, .8); }
.app-sidebar .nav-link.active i.fa-fw { color: #fff; }
.app-sidebar .nav-link.active::before { display: none; }
.app-sidebar .nav-group-toggle[aria-expanded="true"] { background: var(--brand-tint); color: var(--brand-primary-dark); }
.app-sidebar .nav-group-toggle[aria-expanded="true"] i.fa-fw { color: var(--brand-primary); }
.app-sidebar .nav-group .nav { border-left: 2px solid var(--line); }
.app-sidebar .nav-group .nav .nav-link.active { background: var(--brand-tint); color: var(--brand-primary-dark); box-shadow: none; font-weight: 600; }
.app-sidebar .nav-group .nav .nav-link.active i.fa-fw { color: var(--brand-primary); }
.app-sidebar .nav-group .nav .nav-link.active::before { display: block; left: -.56rem; top: 8px; bottom: 8px; width: 2px; background: var(--brand-primary); }

/* topbar */
.app-topbar { background: rgba(246, 243, 253, .8); border-bottom: 0; padding: 0 2rem; }
.topbar-icon-btn { border-radius: 14px; border-color: var(--line); box-shadow: var(--shadow-xs); }
.topbar-user { border-radius: 16px; border-color: var(--line); box-shadow: var(--shadow-xs); padding: .3rem .8rem .3rem .3rem; }
.avatar { width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); }

/* dashboard banner */
.page-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  padding: 1.9rem 2.1rem;
  border-radius: 26px;
  border-bottom: 0;
  background:
    radial-gradient(420px 240px at 92% 0%, rgba(255, 255, 255, .28), transparent 65%),
    radial-gradient(360px 260px at 55% 130%, rgba(255, 111, 174, .55), transparent 65%),
    linear-gradient(120deg, #5b21b6 0%, #7c3aed 50%, #a855f7 100%);
  box-shadow: 0 24px 44px -24px rgba(109, 40, 217, .75);
}
.page-hero::before { content: ""; position: absolute; right: 9%; top: -46px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .10); pointer-events: none; }
.page-hero::after { content: ""; position: absolute; right: -30px; bottom: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .09); pointer-events: none; }
.page-hero-body, .page-hero-art { position: relative; z-index: 1; }
.page-hero-title { font-weight: 700; font-size: 1.85rem; letter-spacing: -.02em; }
.page-hero-eyebrow { color: rgba(255, 255, 255, .8); }
.page-hero-sub { color: rgba(255, 255, 255, .86); }
.page-hero-art { width: 80px; height: 80px; border-radius: 24px; align-items: center; justify-content: center; font-size: 2rem; color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); transform: rotate(-6deg); flex-shrink: 0; }

/* cards & tiles */
.card { border-color: transparent; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { border-bottom-color: var(--line); font-weight: 600; }
.card-footer { background: #faf8fe; border-top-color: var(--line); }
.stat-card { border-radius: 20px; transition: transform .2s ease, box-shadow .2s ease; }
a:hover > .stat-card, .row > [class*="col"] > a:hover > .stat-card { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.stat-card .card-body.d-flex:has(> .stat-icon) { flex-direction: row; justify-content: flex-start; align-items: center !important; padding: 1.1rem 1.2rem; gap: .95rem !important; }
.stat-card .stat-icon {
  width: 50px; height: 50px; border-radius: 16px; font-size: 1.15rem; color: #fff !important;
  background-color: var(--brand-primary);
  /* each tile keeps its own colour from the page; this adds a soft highlight */
  background-image: linear-gradient(145deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 60%) !important;
  box-shadow: 0 10px 20px -10px rgba(76, 29, 149, .55);
}
.stat-card .text-muted.small { font-weight: 500; }
.stat-card .fs-4 { font-weight: 700 !important; letter-spacing: -.02em; }

/* tables */
.table thead th { background: #f7f4fd; color: var(--ink-500); border-bottom: 1px solid var(--line); font-weight: 600; }
.table thead tr:first-child th:first-child { border-top-left-radius: 12px; }
.table thead tr:first-child th:last-child { border-top-right-radius: 12px; }
.table > :not(caption) > * > * { border-bottom-color: #f1ecfa; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #faf7ff; }
.table tfoot td, .table tfoot th { background: #f7f4fd; }
.table td .btn-outline-secondary { border-color: var(--line-strong); }
.table td .btn-outline-secondary:hover { background: var(--brand-tint); color: var(--brand-primary-dark); }

/* buttons */
.btn { border-radius: 12px; padding: .52rem 1.05rem; }
.btn-sm { border-radius: 10px; }
.btn:focus-visible, :focus-visible { outline-color: var(--brand-accent); }
.btn.text-white[style*="brand-primary"], .btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  border: 0;
  box-shadow: 0 10px 20px -10px rgba(109, 40, 217, .85);
}
.btn.text-white[style*="brand-primary"]:hover, .btn-primary:hover { background: linear-gradient(135deg, #7c3aed, #5b21b6) !important; transform: translateY(-1px); box-shadow: 0 14px 24px -10px rgba(109, 40, 217, .9); }
.btn-outline-primary { border-color: #cdbcf7; color: var(--brand-primary); }
.btn-outline-primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-secondary { border-color: var(--line-strong); }
.btn-outline-secondary:hover { background: var(--brand-tint); border-color: #cdbcf7; color: var(--brand-primary-dark); }

/* forms */
.form-control, .form-select { border-radius: 12px; border-color: var(--line-strong); padding: .56rem .9rem; }
.form-control:focus, .form-select:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.input-group-text { border-radius: 12px; background: #f7f4fd; }

/* alerts, modals, menus, tabs */
.alert { border-radius: 14px; border-left-width: 1px; }
.alert-info { background: #f3edff; color: #4c1d95; border-color: #dccffb; }
.modal-content { border-radius: 24px; }
.dropdown-menu { border-radius: 16px; border-color: transparent; box-shadow: var(--shadow-md); }
.dropdown-item { border-radius: 10px; }
.dropdown-item:hover { background: var(--brand-tint); color: var(--brand-primary-dark); }
.nav-tabs .nav-link.active { color: var(--brand-primary); border-bottom: 3px solid var(--brand-primary); }
.nav-pills .nav-link { border-radius: 12px; }
.nav-pills .nav-link.active { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 10px 20px -10px rgba(109, 40, 217, .8); }
.progress-bar, .meter > span { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.pagination .page-link { border-radius: 10px !important; }
code { color: #a21a5c; background: #fdeef6; }

/* login & other auth pages */
.auth-wrapper { background: var(--canvas); }
.auth-card { background: #fff; border-radius: 28px; padding: 1rem; box-shadow: var(--shadow-md); max-width: 460px; }
.auth-card > .card-body { padding: 1.5rem !important; }
.auth-logo { width: 54px; height: 54px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 14px 26px -10px rgba(124, 58, 237, .7); }
.auth-card .btn-signin { border-radius: 14px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 14px 26px -12px rgba(109, 40, 217, .9); }
.auth-card .btn-signin:hover { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
@media (min-width: 992px) {
  .auth-aside {
    border-right: 0;
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(520px 380px at 100% 0%, rgba(255, 255, 255, .22), transparent 65%),
      radial-gradient(520px 420px at 0% 110%, rgba(255, 111, 174, .6), transparent 65%),
      linear-gradient(150deg, #4c1d95, #7c3aed 60%, #a855f7);
  }
  .auth-aside::before { content: ""; position: absolute; right: -90px; top: 28%; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
  .auth-aside > * { position: relative; z-index: 1; }
  .auth-aside-brand i { color: #fff; }
  .auth-aside h2 { font-weight: 700; }
  .auth-aside p { color: rgba(255, 255, 255, .8); }
  .auth-aside small { color: rgba(255, 255, 255, .65); }
  .auth-main { background: var(--canvas); }
}
@media (max-width: 991.98px) { .app-topbar { padding: 0 1rem; } .page-hero { padding: 1.4rem 1.4rem; border-radius: 22px; } .page-hero-title { font-size: 1.45rem; } }
@media (max-width: 575.98px) { .stat-card .stat-icon { width: 42px; height: 42px; border-radius: 13px; font-size: 1rem; } .stat-card .card-body.d-flex:has(> .stat-icon) { flex-direction: column; align-items: flex-start !important; gap: .7rem !important; padding: 1rem; } }

/* =====================================================================
   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; }
  body { background: #fff; }
  .card, .stat-card { box-shadow: none !important; }
  .page-hero { color: #000; background: none; border: 1px solid #ddd; }
  .page-hero-title, .page-hero-sub, .page-hero-eyebrow { color: #000; }
}

/* =====================================================================
   Growth features: WhatsApp button, progress meters, payslip
   ===================================================================== */
.btn-whatsapp { background: #16a34a; border: 1px solid #16a34a; color: #fff !important; }
.btn-whatsapp:hover { background: #0e7339; border-color: #0e7339; }
.btn-whatsapp .fa-whatsapp { font-size: 1.05em; }

.meter { height: .5rem; border-radius: 999px; background: #e8ebf0; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-primary); }
.meter.meter-warn > span { background: #f5a700; }
.meter.meter-low > span { background: #c8322b; }

.rank-badge {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem; background: #eef0f3; color: var(--ink-700);
}
.rank-1 { background: #f5c04a; color: #3b2a00; }
.rank-2 { background: #d5d9e0; color: #1f2530; }
.rank-3 { background: #e7c3a1; color: #5a3411; }

.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, #5b21b6, #7c3aed 60%, #a855f7); color: #fff; border-radius: 18px; box-shadow: 0 18px 34px -18px rgba(109, 40, 217, .8); }
.payslip-net .fs-3 { font-family: var(--font-display); }
