/* =====================================================================
   OLPMS — theme
   Brand: #521138
   ===================================================================== */

:root {
  --brand: #521138;
  --brand-700: #6a1849;
  --brand-600: #7d1d56;
  --brand-500: #94276a;
  --brand-300: #c07aa4;
  --brand-100: #f3e6ee;
  --brand-050: #faf5f8;

  --ink: #241820;
  --ink-2: #5c5058;
  --ink-3: #8c8189;
  --line: #e8e2e6;
  --bg: #f6f4f6;
  --card: #ffffff;

  --ok: #1a7f56;
  --ok-bg: #e6f4ee;
  --warn: #b06a00;
  --warn-bg: #fdf1de;
  --danger: #b3261e;
  --danger-bg: #fbe9e8;
  --info: #0b6a8f;
  --info-bg: #e4f2f8;
  --muted-bg: #eeeaec;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(36, 24, 32, 0.06), 0 8px 24px rgba(36, 24, 32, 0.06);
  --shadow-sm: 0 1px 2px rgba(36, 24, 32, 0.08);
  --sidebar-w: 264px;
  --topbar-h: 64px;

  --bs-primary: #521138;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 0.925rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}
a:hover {
  color: var(--brand-500);
}

/* ------------------------------------------------------------------ *
   LAYOUT
 * ------------------------------------------------------------------ */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #521138 0%, #3d0c29 100%);
  color: #f5eaf1;
  display: flex;
  flex-direction: column;
  z-index: 1045;
  transition: transform 0.25s ease;
}
.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}
.sidebar__brand a {
  display: inline-flex;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.sidebar__brand a:hover {
  opacity: 0.85;
}
/* the mark stands alone now, so it carries the header on its own */
.sidebar__brand img {
  /* height: 40px; */
  width: auto;
  max-width: 100%;
  border-radius: 3px;
  /* background: #fff; */
  /* padding: 4px 7px; */
  display: block;
}

.sidebar__nav {
  overflow-y: auto;
  padding: 0.85rem 0.7rem 0.7rem;
  flex: 1 1 auto;
}
.sidebar__nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 3px;
}

.nav-heading {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  padding: 1rem 0.85rem 0.35rem;
  font-weight: 600;
}
.nav-link-side {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.85rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
  position: relative;
}
.nav-link-side i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.9;
}
.nav-link-side:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}
.nav-link-side.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
}
.nav-link-side.active::before {
  content: "";
  position: absolute;
  left: -0.7rem;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #f0c3dc;
}
.sidebar__foot {
  padding: 0.9rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.55rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
/* the search leads the bar; everything else is pushed to the right */
.topbar__search--lead {
  margin-right: auto;
}
.icon-btn.topbar__search-toggle {
  margin-left: auto;
}

/* ---- global search ---- */
.topbar__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 420px;
  min-width: 0;
}
.topbar__search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 0 4.6rem 0 2.4rem;
  font-size: 0.88rem;
  color: var(--ink);
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.topbar__search input::placeholder {
  color: var(--ink-3);
}
.topbar__search input:focus {
  outline: 0;
  background: #fff;
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.topbar__search input::-webkit-search-cancel-button {
  cursor: pointer;
}
.topbar__search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-3);
  pointer-events: none;
}
.topbar__search input:focus ~ .topbar__search-icon,
.topbar__search:focus-within .topbar__search-icon {
  color: var(--brand);
}
.topbar__kbd {
  position: absolute;
  right: 0.6rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink-3);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}
/* specificity has to beat .icon-btn's own display rule */
.icon-btn.topbar__search-toggle {
  display: none;
}

/* ---- user chip ---- */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.user-chip:hover,
.user-chip[aria-expanded="true"] {
  border-color: var(--brand-300);
  background: var(--brand-050);
}
.user-chip__who {
  display: none;
  text-align: left;
  line-height: 1.25;
  min-width: 0;
}
.user-chip__name {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.user-chip__role {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.user-chip__caret {
  display: none;
  font-size: 0.7rem;
  color: var(--ink-3);
  transition: transform 0.18s;
}
.user-chip[aria-expanded="true"] .user-chip__caret {
  transform: rotate(180deg);
}

/* ---- account menu ---- */
.user-menu {
  --bs-dropdown-min-width: 268px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.4rem;
  margin-top: 0.5rem;
  box-shadow: 0 18px 40px rgba(28, 8, 20, 0.14);
}
.user-menu__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.65rem 0.7rem;
}
.user-menu__name {
  display: block;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.user-menu__mail {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.user-menu__role {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  background: var(--brand-050);
  color: var(--brand);
  font-size: 0.66rem;
  font-weight: 650;
}
.user-menu .dropdown-divider {
  margin: 0.25rem 0.3rem;
  border-color: var(--line);
  opacity: 1;
}
.user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--ink-2);
}
.user-menu .dropdown-item i {
  font-size: 0.95rem;
  color: var(--ink-3);
}
.user-menu .dropdown-item:hover,
.user-menu .dropdown-item:focus {
  background: var(--brand-050);
  color: var(--brand);
}
.user-menu .dropdown-item:hover i {
  color: var(--brand);
}
.user-menu .dropdown-item--danger,
.user-menu .dropdown-item--danger i {
  color: var(--danger);
}
.user-menu .dropdown-item--danger:hover,
.user-menu .dropdown-item--danger:focus {
  background: rgba(220, 53, 69, 0.08);
  color: var(--danger);
}
.user-menu__count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

@media (min-width: 768px) {
  .user-chip__who,
  .user-chip__caret {
    display: block;
  }
}
@media (max-width: 1199.98px) {
  /* the search drops to its own full-width line, opened from the icon */
  .topbar__search {
    display: none;
    order: 9;
    flex: 1 0 100%;
  }
  .icon-btn.topbar__search-toggle {
    display: inline-flex;
  }
  body.search-open .topbar__search {
    display: flex;
  }
  .topbar__kbd {
    display: none;
  }
}
@media (max-width: 575.98px) {
  .topbar {
    padding: 0.5rem 0.85rem;
    gap: 0.45rem;
  }
  .user-chip {
    padding: 0.25rem;
    border-color: transparent;
    background: transparent;
  }
}
.topbar__title {
  font-weight: 650;
  font-size: 1.02rem;
  margin: 0;
  line-height: 1.2;
}
.topbar__crumb {
  font-size: 0.74rem;
  color: var(--ink-3);
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.icon-btn:hover {
  background: var(--brand-050);
  color: var(--brand);
  border-color: var(--brand-100);
}

.avatar--lg {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand));
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.content {
  background-color: #ffffff;
  padding: 1rem 1rem 1.5rem;
  flex: 1 1 auto;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.page-head h1 {
  font-size: 1.42rem;
  font-weight: 680;
  margin: 0 0 0rem;
  letter-spacing: -0.01em;
}
.page-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ *
   COMPONENTS
 * ------------------------------------------------------------------ */
.card-x {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-x__head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.card-x__head h2 {
  font-size: 0.98rem;
  font-weight: 650;
  margin: 0;
}
.card-x__body {
  padding: 1.15rem;
}

/* stat tiles */
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem 0.9rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  /* icon and caption share the top line; the figure gets the full width
     underneath, so four tiles fit a row without squeezing the number */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.6rem;
  row-gap: 0.3rem;
  align-items: center;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
/* the label/value wrapper steps out of the way so both become grid items */
.stat > div {
  display: contents;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand-100);
}
.stat__icon {
  grid-column: 1;
  grid-row: 1;
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex: 0 0 auto;
  background: var(--brand-100);
  color: var(--brand);
}
.stat__icon.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.stat__icon.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.stat__icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.stat__icon.info {
  background: var(--info-bg);
  color: var(--info);
}
.stat__label {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat__value {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: clamp(1.15rem, 8cqi, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.stat__meta {
  font-size: 0.73rem;
  color: var(--ink-3);
}

/* badges */
.badge-status {
  display: inline-block;
  padding: 0.26em 0.6em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-success {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bfe3d3;
}
.badge-warning {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f2ddb8;
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f3c9c6;
}
.badge-primary {
  background: var(--brand-100);
  color: var(--brand);
  border-color: #e2cad9;
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: #c2e0ee;
}
.badge-secondary {
  background: var(--muted-bg);
  color: var(--ink-2);
  border-color: #ded7db;
}
.badge-dark {
  background: #e3e0e2;
  color: #322a2f;
  border-color: #d0cacd;
}

/* buttons */
.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 550;
}
.btn-brand:hover,
.btn-brand:focus {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.btn-outline-brand {
  border-color: var(--brand-100);
  color: var(--brand);
  background: #fff;
  font-weight: 550;
}
.btn-outline-brand:hover {
  background: var(--brand-050);
  border-color: var(--brand-300);
  color: var(--brand);
}
.btn {
  border-radius: 10px;
  /* a steadier target for touch and mouse alike — every button in the app
     lands on the same height, whatever it holds (label, icon, or both) */
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  line-height: 1.3;
}
.btn-sm {
  border-radius: 8px;
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  font-size: 0.86rem;
}
.btn-lg {
  min-height: 48px;
  padding: 0.65rem 1.3rem;
}
/* icon-only buttons stay square rather than stretching wide */
.btn > i.bi:only-child {
  line-height: 1;
}
/* the alignment utilities still win over the flex centering above */
.btn.text-start {
  justify-content: flex-start;
}
.btn.text-end {
  justify-content: flex-end;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: var(--line);
  /* matched to .btn so filter rows line up on one baseline */
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-300);
  box-shadow: 0 0 0 0.2rem rgba(82, 17, 56, 0.1);
}
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 0.3rem;
}

/* tables */
.table-x {
  width: 100%;
  margin: 0;
  font-size: 0.86rem;
  border-collapse: separate;
  border-spacing: 0;
}
.table-x thead th {
  background: var(--brand-050);
  color: var(--ink-2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.table-x tbody td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table-x tbody tr:last-child td {
  border-bottom: 0;
}
.table-x tbody tr:hover {
  background: var(--brand-050);
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-3);
}
/* only the big illustrative glyph, not icons inside buttons placed here */
.empty-state > i {
  font-size: 2.4rem;
  color: var(--brand-300);
  display: block;
  margin-bottom: 0.6rem;
}

/* ------------------------------------------------------------------ *
   LOGIN
 * ------------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
}
.auth-art {
  flex: 1 1 52%;
  background: linear-gradient(150deg, #521138 0%, #3a0b26 55%, #2a0a1d 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-art::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1),
    transparent 65%
  );
}
.auth-art h2 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 24ch;
}
.auth-art .flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}
.auth-art .flow span {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
}
.auth-form {
  flex: 1 1 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: #fff;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card img.logo {
  height: 52px;
  margin-bottom: 1.25rem;
}

/* ------------------------------------------------------------------ *
   RESPONSIVE
 * ------------------------------------------------------------------ */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 18, 26, 0.5);
  z-index: 1040;
  display: none;
}
body.sidebar-open .sidebar-backdrop {
  display: block;
}

@media (max-width: 1199.98px) {
  :root {
    --sidebar-w: 240px;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .auth-art {
    display: none;
  }
  .auth-form {
    flex: 1 1 100%;
  }
}

@media (max-width: 767.98px) {
  .content {
    padding: 1.1rem 0.9rem 2rem;
  }
  .topbar {
    padding: 0 0.85rem;
  }
  .page-head h1 {
    font-size: 1.22rem;
  }
  .stat {
    padding: 0.9rem;
  }
  .stat__value {
    font-size: 1.35rem;
  }
  .card-x__body {
    padding: 0.95rem;
  }
  .table-x {
    font-size: 0.82rem;
  }
}

@media (max-width: 575.98px) {
  .stat {
    flex-direction: row;
    gap: 0.7rem;
  }
  .stat__icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .topbar__title {
    font-size: 0.95rem;
  }
  .btn {
    font-size: 0.85rem;
  }
}

@media print {
  .sidebar,
  .topbar,
  .no-print {
    display: none !important;
  }
  .main {
    margin-left: 0;
  }
  .content {
    padding: 0;
  }
  .card-x {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ------------------------------------------------------------------ *
   LIFECYCLE TIMELINE (order detail)
 * ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ *
   ORDER LIFECYCLE TIMELINE
   A rail down the left with one marker per stage. The rail is drawn from
   the marker's centre so it lines up whatever the row's height.
 * ------------------------------------------------------------------ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 0.9rem;
  padding-bottom: 1.15rem;
}
.timeline__item:last-child {
  padding-bottom: 0;
}

/* the rail: from just under this marker to the next one */
.timeline__item::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 2.1rem;
  bottom: -0.1rem;
  width: 2px;
  margin-left: -1px;
  background: var(--line);
}
.timeline__item:last-child::before {
  display: none;
}

.timeline__dot {
  grid-column: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--ink-3);
  position: relative;
  z-index: 1;
}
.timeline__body {
  grid-column: 2;
  min-width: 0;
  padding-top: 0.2rem;
}
.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.timeline__label {
  font-weight: 650;
  color: var(--ink);
}
.timeline__meta {
  font-size: 0.76rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.timeline__action {
  margin-left: auto;
}

/* stage states */
.timeline__item.is-done .timeline__dot {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.timeline__item.is-active .timeline__dot {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-050);
}
.timeline__item.is-ready .timeline__dot {
  background: var(--info);
  border-color: var(--info);
  color: #fff;
}
.timeline__item.is-blocked .timeline__dot {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.timeline__item.is-skip .timeline__dot {
  background: var(--muted-bg);
  border-color: var(--line);
  color: var(--ink-3);
}
.timeline__item.is-done::before {
  background: var(--ok);
  opacity: 0.45;
}
.timeline__item.is-active::before {
  background: var(--brand);
  opacity: 0.28;
}
.timeline__item.is-todo .timeline__body {
  opacity: 0.75;
}

@media (max-width: 575.98px) {
  .timeline__item {
    grid-template-columns: 1.7rem minmax(0, 1fr);
    column-gap: 0.7rem;
  }
  .timeline__item::before {
    left: 0.85rem;
    top: 1.8rem;
  }
  .timeline__dot {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.75rem;
  }
  /* the action sits under the stage rather than squeezing beside it */
  .timeline__action {
    margin-left: 0;
    flex-basis: 100%;
  }
}

@media (max-width: 575.98px) {
  .timeline__item {
    padding-left: 2.1rem;
  }
  .timeline__dot {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.75rem;
  }
  .timeline__item::before {
    left: 0.77rem;
  }
}

/* sortable table headers */
.table-x thead th a {
  color: inherit;
}
.table-x thead th a:hover {
  color: var(--brand);
}

/* pagination */
.pagination .page-link {
  color: var(--brand);
  border-color: var(--line);
  border-radius: 8px;
  margin: 0 1px;
}
.pagination .page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pagination .page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(82, 17, 56, 0.12);
}

/* ------------------------------------------------------------------ *
   REUSABLE MODAL
 * ------------------------------------------------------------------ */
.app-modal .modal-content {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(36, 24, 32, 0.22);
  overflow: hidden;
}
.app-modal .modal-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
}
.app-modal .modal-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.app-modal .modal-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-3);
  line-height: 1.45;
}
.app-modal .btn-close {
  margin: 0;
  opacity: 0.55;
}
.app-modal .btn-close:hover {
  opacity: 1;
}

.app-modal .modal-body {
  /* padding: 1.25rem 1.4rem; */
  /* background: var(--bg); */
}
.app-modal .modal-footer {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #fff;
  gap: 0.5rem;
}

.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3.5rem 1rem;
  color: var(--ink-3);
  font-size: 0.86rem;
}
.modal-loading .spinner-border {
  color: var(--brand);
  width: 2rem;
  height: 2rem;
}

.modal-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
  border: 1px solid transparent;
  line-height: 1.45;
}
.modal-alert i {
  font-size: 1rem;
  line-height: 1.3;
  flex: 0 0 auto;
}
.modal-alert--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f3c9c6;
}
.modal-alert--success {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bfe3d3;
}
.modal-alert--info {
  background: var(--info-bg);
  color: var(--info);
  border-color: #c2e0ee;
}
.modal-alert--warning {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f2ddb8;
}

/* form section card inside a modal */
.m-sec {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 1rem;
  overflow: hidden;
}
.m-sec:last-child {
  margin-bottom: 0;
}
.m-sec__head {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 1rem 1.15rem 0.35rem;
}
.m-sec__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: 0 0 auto;
  background: var(--brand-100);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.m-sec__title {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0;
}
.m-sec__sub {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin: 0.1rem 0 0;
}
.m-sec__body {
  padding: 0.85rem 1.15rem 1.15rem;
}

/* read-only key/value grid for view modals */
.m-kvs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.1rem 1.5rem;
  margin: 0;
}
.m-kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line);
}
.m-kv dt {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 0.8rem;
  margin: 0;
}
.m-kv dd {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 550;
  text-align: right;
  word-break: break-word;
}
@media (max-width: 767.98px) {
  .m-kvs {
    grid-template-columns: 1fr;
  }
}

/* compact stat strip inside a modal */
.m-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.m-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  text-align: center;
}
.m-stat__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
}
.m-stat__value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}
@media (max-width: 575.98px) {
  .m-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* row action buttons */
.row-actions {
  display: inline-flex;
  gap: 0.25rem;
  justify-content: flex-end;
}
.row-actions .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 0.88rem;
}
.row-actions .icon-btn.is-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f3c9c6;
}
.row-actions form {
  display: inline;
  margin: 0;
}

@media (max-width: 767.98px) {
  .app-modal .modal-body {
    padding: 1rem 0.9rem;
  }
  .app-modal .modal-header {
    padding: 1rem 0.9rem 0.85rem;
  }
  .app-modal .modal-footer {
    padding: 0.8rem 0.9rem;
  }
  .app-modal .modal-footer .btn {
    flex: 1 1 auto;
  }
  .m-sec__body {
    padding: 0.75rem 0.9rem 1rem;
  }
  .m-sec__head {
    padding: 0.9rem 0.9rem 0.25rem;
  }
}

/* ------------------------------------------------------------------ *
   ROW ACTIONS — vertical dots + dropdown
 * ------------------------------------------------------------------ */
.row-actions {
  display: inline-flex;
  justify-content: flex-end;
}
.row-actions > .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 1rem;
  border-radius: 9px;
}
.row-actions > .icon-btn[aria-expanded="true"] {
  background: var(--brand-050);
  color: var(--brand);
  border-color: var(--brand-300);
}

.action-menu {
  --bs-dropdown-min-width: 12rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 12px 32px rgba(36, 24, 32, 0.14);
}
.action-menu li {
  list-style: none;
}
.action-menu form {
  margin: 0;
}
.action-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
}
.action-menu .dropdown-item i {
  font-size: 0.95rem;
  width: 1.1rem;
  text-align: center;
  color: var(--ink-2);
}
.action-menu .dropdown-item:hover,
.action-menu .dropdown-item:focus {
  background: var(--brand-050);
  color: var(--brand);
}
.action-menu .dropdown-item:hover i {
  color: var(--brand);
}
.action-menu .dropdown-item.is-danger {
  color: var(--danger);
}
.action-menu .dropdown-item.is-danger i {
  color: var(--danger);
}
.action-menu .dropdown-item.is-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.action-menu .dropdown-item.is-note {
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 400;
  cursor: default;
  pointer-events: none;
}
.action-menu .dropdown-divider {
  margin: 0.3rem 0.2rem;
  border-color: var(--line);
}

/* ------------------------------------------------------------------ *
   DASHBOARD — hero stat cards
 * ------------------------------------------------------------------ */
.hero-card {
  display: block;
  height: 100%;
  position: relative;
  overflow: hidden;
  padding: 0.9rem 1rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent, var(--brand));
  opacity: 0.9;
}
.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-soft, var(--brand-100));
  color: var(--ink);
}
.hero-card:hover .hero-card__go {
  opacity: 1;
  transform: translate(0, 0);
}

.hero-card--brand {
  --accent: var(--brand);
  --accent-soft: var(--brand-100);
  --accent-ink: var(--brand);
}
.hero-card--info {
  --accent: var(--info);
  --accent-soft: var(--info-bg);
  --accent-ink: var(--info);
}
.hero-card--warn {
  --accent: var(--warn);
  --accent-soft: var(--warn-bg);
  --accent-ink: var(--warn);
}
.hero-card--danger {
  --accent: var(--danger);
  --accent-soft: var(--danger-bg);
  --accent-ink: var(--danger);
}
.hero-card--ok {
  --accent: var(--ok);
  --accent-soft: var(--ok-bg);
  --accent-ink: var(--ok);
}

/* icon sits beside the figure rather than above it — same information,
   roughly half the height */
.hero-card__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.hero-card__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.hero-card__go {
  position: absolute;
  top: 0.75rem;
  right: 0.8rem;
  font-size: 0.8rem;
  color: var(--ink-3);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
.hero-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 650;
  color: var(--ink-3);
}
.hero-card__value {
  font-size: clamp(1.25rem, 1.1vw + 0.85rem, 1.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
/* long money figures shrink instead of wrapping the headline onto two
   lines, which would stretch every card in the row */
.hero-card__value--tight {
  font-size: clamp(1rem, 0.7vw + 0.68rem, 1.25rem);
  white-space: nowrap;
}
.hero-card__caption {
  font-size: 0.76rem;
  color: var(--ink-2);
  margin-top: 0.55rem;
}
/* bar and its percentage share one line instead of stacking */
.hero-card__meter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.5rem;
}
.hero-card__bar {
  flex: 1 1 auto;
  height: 5px;
  border-radius: 99px;
  background: var(--muted-bg);
  overflow: hidden;
}
.hero-card__bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  min-width: 2px;
  transition: width 0.5s ease;
}
.hero-card__pct {
  flex: 0 0 auto;
  font-size: 0.69rem;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}
.hero-card__foot {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--line);
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ *
   DASHBOARD — lifecycle pipeline strip
 * ------------------------------------------------------------------ */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem 0.25rem;
}

.pipe {
  flex: 1 1 84px;
  min-width: 84px;
  text-align: center;
  padding: 0.7rem 0.55rem 0.6rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.pipe:hover {
  background: var(--brand-050);
  border-color: var(--brand-100);
  color: var(--brand);
  transform: translateY(-2px);
}
.pipe__icon {
  display: block;
  font-size: 1rem;
  color: var(--brand-300);
  margin-bottom: 0.15rem;
}
.pipe:hover .pipe__icon {
  color: var(--brand);
}
.pipe__count {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.pipe__label {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.pipe.is-empty {
  opacity: 0.45;
}
.pipe__sep {
  display: flex;
  align-items: center;
  color: var(--line);
  font-size: 0.7rem;
  flex: 0 0 auto;
}

/* The chevrons only read correctly while the strip is one row; once the
   stages wrap they would point at the wrong neighbour, so they go. */
@media (max-width: 1399.98px) {
  .pipe {
    flex-basis: 78px;
    min-width: 78px;
  }
  .pipe__sep {
    display: none;
  }
}
@media (max-width: 575.98px) {
  .hero-card {
    padding: 1rem;
  }
  .hero-card__value {
    font-size: 1.5rem;
  }
  .pipeline {
    gap: 0.35rem 0.25rem;
  }
  .pipe {
    flex-basis: 70px;
    min-width: 70px;
    padding: 0.6rem 0.35rem 0.5rem;
  }
  .pipe__count {
    font-size: 1.05rem;
  }
  .pipe__label {
    font-size: 0.64rem;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }
}

/* ------------------------------------------------------------------ *
   IMPORT — drop zone
 * ------------------------------------------------------------------ */
.drop-zone {
  border: 2px dashed var(--brand-100);
  background: var(--brand-050);
  border-radius: 14px;
  padding: 1.6rem 1.2rem;
  text-align: center;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.drop-zone.is-over {
  border-color: var(--brand);
  background: var(--brand-100);
}
.drop-zone > i {
  font-size: 2.1rem;
  color: var(--brand-300);
  display: block;
}
.drop-zone__title {
  font-weight: 650;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
.drop-zone__hint {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.drop-zone input[type="file"] {
  max-width: 420px;
  margin-inline: auto;
}
.drop-zone__file {
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
  margin-top: 0.5rem;
}

@media (max-width: 575.98px) {
  .drop-zone {
    padding: 1.2rem 0.8rem;
  }
  .drop-zone > i {
    font-size: 1.7rem;
  }
}

/* ------------------------------------------------------------------ *
   STAGE SCREENS (fabrication / inventory / production / QC)
 * ------------------------------------------------------------------ */
.stat.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(82, 17, 56, 0.09);
}

.mini-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--muted-bg);
  margin-top: 0.3rem;
  overflow: hidden;
  min-width: 60px;
}
.mini-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
}

/* stage modal header strip */
.stage-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin-bottom: 1rem;
}
.stage-head__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stage-head__po {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.stage-head__main .text-muted {
  font-size: 0.78rem;
}
.stage-head__figs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  color: var(--ink-3);
}
.stage-head__figs strong {
  color: var(--ink);
  font-size: 0.9rem;
}

/* repeatable material lines */
.mat-lines {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.mat-line {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 2.2rem 0.85rem 0.85rem;
  background: var(--brand-050);
}
.mat-line .form-label {
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}
.mat-line .form-control,
.mat-line .form-select {
  font-size: 0.84rem;
  padding: 0.4rem 0.6rem;
}
.mat-line__del {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.mat-line__del:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f3c9c6;
}
.mat-short.is-short {
  color: var(--danger);
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .stage-head {
    padding: 0.7rem 0.8rem;
  }
  .stage-head__figs {
    gap: 0.65rem;
    font-size: 0.74rem;
  }
  .mat-line {
    padding: 0.7rem 2rem 0.7rem 0.7rem;
  }
}

/* ------------------------------------------------------------------ *
   NOTIFICATIONS
 * ------------------------------------------------------------------ */
.bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--brand-050);
}
.notif:last-child {
  border-bottom: 0;
}
.notif.is-read {
  background: #fff;
}
.notif__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex: 0 0 auto;
  border: 1px solid transparent;
}
.notif__body {
  flex: 1 1 auto;
  min-width: 0;
}
.notif__title {
  font-weight: 620;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.notif__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex: 0 0 auto;
}
.notif__msg {
  font-size: 0.83rem;
  color: var(--ink-2);
  margin-top: 0.1rem;
}
.notif__meta {
  font-size: 0.72rem;
  color: var(--ink-3);
  margin-top: 0.3rem;
}
.notif__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.notif.is-read .notif__title {
  font-weight: 500;
  color: var(--ink-2);
}

@media (max-width: 575.98px) {
  .notif {
    padding: 0.8rem 0.9rem;
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .notif__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ------------------------------------------------------------------ *
   REPORTS
 * ------------------------------------------------------------------ */
.report-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.report-tabs::-webkit-scrollbar {
  height: 5px;
}
.report-tabs::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
.report-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 0.83rem;
  font-weight: 550;
  text-decoration: none;
  transition: 0.15s;
}
.report-tab:hover {
  border-color: var(--brand-300);
  color: var(--brand);
  background: var(--brand-050);
}
.report-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.report-tab i {
  font-size: 0.95rem;
}

.table-report {
  font-size: 0.8rem;
}
.table-report th,
.table-report td {
  white-space: nowrap;
}

@media print {
  .print-head {
    display: block !important;
    padding: 0.6rem 0 1rem;
    font-size: 0.85rem;
  }
  .table-report {
    font-size: 0.68rem;
  }
  .table-report th,
  .table-report td {
    padding: 0.25rem 0.35rem;
  }
  .table-wrap {
    overflow: visible !important;
  }
  .report-tabs,
  .page-head .btn {
    display: none !important;
  }
  .stat {
    break-inside: avoid;
  }
}

/* ------------------------------------------------------------------ *
   RESPONSIVE TABLES  (assets/js/responsive-table.js)
   Columns fit the viewport; whatever does not fit moves into the
   per-row detail panel instead of forcing a horizontal scrollbar.
 * ------------------------------------------------------------------ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
.table-x {
  table-layout: auto;
}

/* columns dropped by the fitter */
.table-x .rt-hide {
  display: none !important;
}

/* measuring pass — natural width, nothing wrapped */
.table-x.rt-measure thead th,
.table-x.rt-measure tbody td {
  white-space: nowrap !important;
}
/* Headings stay on one line — a wrapped "PO / NO." reads as two headings.
   Body cells may wrap, which is how a fitted table squeezes into the space
   it has. Both rules hold through every measuring pass, so the fit is
   stable rather than oscillating between wrapped and unwrapped states. */
.table-x.rt-fit thead th {
  white-space: nowrap;
}
.table-x.rt-fit tbody td {
  white-space: normal;
}
/* figures stay on one line — a wrapped "Rs. 5,82,000.00" reads as two numbers */
.table-x.rt-fit thead th.text-end,
.table-x.rt-fit tbody td.text-end {
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .table-x thead th,
  .table-x tbody td {
    padding: 0.6rem 0.55rem;
  }
}
}

/* print keeps the full record on the page */
@media print {
  .table-x .rt-hide {
    display: table-cell !important;
  }
  .table-wrap {
    overflow: visible !important;
  }
}

/* ------------------------------------------------------------------ *
   FLUID UI — nothing clips, nothing pushes the page sideways
 * ------------------------------------------------------------------ */
.stat {
  min-width: 0;
  /* the figure is sized against this card, not the viewport — the same
     viewport gives very different card widths across the grid */
  container-type: inline-size;
}
.stat > div {
  min-width: 0;
  flex: 1 1 auto;
}
.stat__label {
  overflow-wrap: anywhere;
}
.stat__value {
  overflow-wrap: break-word;
}
.page-head {
  gap: 0.75rem;
}
.page-head h1 {
  overflow-wrap: anywhere;
}
/* the shell itself never scrolls sideways */
html,
body {
  overflow-x: hidden;
}
.main,
.card-x,
.card-x__body {
  min-width: 0;
}
/* money and other long figures get their own, tighter scale */
.stat__value--money {
  font-size: clamp(0.95rem, 6.4cqi, 1.5rem);
  letter-spacing: -0.01em;
  /* keep the figure whole where it fits; break-word lets it split only when
     it genuinely cannot fit on a line, so it is never clipped */
  overflow-wrap: break-word;
  word-break: normal;
}
@media (max-width: 575.98px) {
  .stat__value {
    font-size: 1.15rem;
  }
}

/* ------------------------------------------------------------------ *
   CUSTOM SELECT  (assets/js/custom-select.js)
   The native <select> stays in the form — invisible but focusable, so
   required-field validation still reports against it — while this
   trigger and its portalled listbox carry the brand styling.
 * ------------------------------------------------------------------ */
.cselect {
  position: relative;
  display: block;
}
.cselect__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.cselect__trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  text-align: left;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.cselect__trigger:hover:not(:disabled) {
  border-color: var(--brand-300);
}
.cselect__trigger:focus-visible,
.cselect__trigger.is-open {
  outline: 0;
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.cselect__trigger:disabled {
  background: var(--bg);
  color: var(--ink-3);
  cursor: not-allowed;
}
.cselect__trigger.is-placeholder .cselect__value {
  color: var(--ink-3);
}
.cselect__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cselect__caret {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--ink-3);
  transition: transform 0.18s;
}
.cselect__trigger.is-open .cselect__caret {
  transform: rotate(180deg);
  color: var(--brand);
}
/* validation styling rides on the hidden native control */
.was-validated .cselect__native:invalid ~ .cselect__trigger,
.cselect__native.is-invalid ~ .cselect__trigger {
  border-color: var(--danger);
}
.was-validated .cselect__native:valid ~ .cselect__trigger {
  border-color: var(--ok, #198754);
}

/* ---- the portalled listbox ---- */
.cselect__panel {
  position: fixed;
  z-index: 1080;
  display: none;
  flex-direction: column;
  min-width: 180px;
  max-width: min(92vw, 420px);
  padding: 0.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(28, 8, 20, 0.16);
  overflow: hidden;
}
.cselect__panel.is-open {
  display: flex;
  animation: cselect-in 0.12s ease-out;
}
@keyframes cselect-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cselect__filter {
  position: relative;
  flex: 0 0 auto;
  padding: 0.15rem 0.15rem 0.35rem;
}
.cselect__filter i {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-60%);
  font-size: 0.8rem;
  color: var(--ink-3);
  pointer-events: none;
}
.cselect__filter input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  padding: 0 0.6rem 0 2rem;
  font-size: 0.85rem;
  color: var(--ink);
}
.cselect__filter input:focus {
  outline: 0;
  background: #fff;
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.cselect__list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cselect__list::-webkit-scrollbar {
  width: 8px;
}
.cselect__list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}
.cselect__opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  font-size: 0.87rem;
  color: var(--ink-2);
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cselect__opt.is-active {
  background: var(--brand-050);
  color: var(--brand);
}
.cselect__opt.is-selected {
  color: var(--brand);
  font-weight: 600;
}
.cselect__opt.is-selected::after {
  content: "\F26E"; /* bi-check-lg */
  font-family: "bootstrap-icons";
  margin-left: auto;
  font-size: 0.8rem;
}
.cselect__opt.is-disabled {
  color: var(--ink-3);
  cursor: not-allowed;
}
.cselect__opt.is-hidden {
  display: none;
}
.cselect__empty {
  display: none;
  padding: 0.8rem 0.6rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-3);
}
.cselect__empty.is-shown {
  display: block;
}

@media print {
  .cselect__panel {
    display: none !important;
  }
}

/* ------------------------------------------------------------------ *
   DATE PICKER  (assets/js/date-picker.js)
   The native input keeps the ISO value and the validation; this field
   and its portalled calendar carry the brand styling.
 * ------------------------------------------------------------------ */
.cdate {
  position: relative;
  display: block;
}
.cdate__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.cdate__display {
  padding-right: 2.6rem;
}
.cdate.is-open .cdate__display {
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.cdate__btn {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition:
    background 0.15s,
    color 0.15s;
}
.cdate__btn:hover:not(:disabled),
.cdate.is-open .cdate__btn {
  background: var(--brand-050);
  color: var(--brand);
}
.cdate__btn:disabled {
  opacity: 0.5;
}
.was-validated .cdate__native:invalid ~ .cdate__display {
  border-color: var(--danger);
}

/* ---- the portalled calendar ---- */
.cdate__panel {
  position: fixed;
  z-index: 1080;
  display: none;
  width: 296px;
  padding: 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(28, 8, 20, 0.16);
}
.cdate__panel.is-open {
  display: block;
  animation: cselect-in 0.12s ease-out;
}
.cdate__head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.cdate__title {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
}
.cdate__title:hover {
  background: var(--brand-050);
  color: var(--brand);
}
.cdate__nav {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.cdate__nav:hover {
  background: var(--brand-050);
  border-color: var(--brand-100);
  color: var(--brand);
}
.cdate__dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.2rem;
}
.cdate__dow span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.25rem 0;
}
.cdate__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cdate__grid--months,
.cdate__grid--years {
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.cdate__day,
.cdate__cell {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  color: var(--ink);
  font-size: 0.83rem;
  padding: 0.42rem 0;
  transition:
    background 0.12s,
    color 0.12s;
}
.cdate__cell {
  padding: 0.6rem 0;
  font-size: 0.85rem;
}
.cdate__day:hover:not(:disabled),
.cdate__cell:hover {
  background: var(--brand-050);
  color: var(--brand);
}
.cdate__day:focus-visible,
.cdate__cell:focus-visible {
  outline: 0;
  border-color: var(--brand-300);
  box-shadow: 0 0 0 2px var(--brand-050);
}
.cdate__day.is-muted {
  color: var(--ink-3);
  opacity: 0.65;
}
.cdate__day.is-today,
.cdate__cell.is-today {
  border-color: var(--brand-300);
  font-weight: 650;
  color: var(--brand);
}
.cdate__day.is-selected,
.cdate__cell.is-selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 650;
}
.cdate__day.is-selected:hover,
.cdate__cell.is-selected:hover {
  background: var(--brand-600);
  color: #fff;
}
.cdate__day.is-disabled {
  color: var(--ink-3);
  opacity: 0.35;
  cursor: not-allowed;
}
.cdate__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.cdate__link {
  border: 0;
  background: transparent;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-3);
}
.cdate__link:hover {
  background: var(--bg);
  color: var(--ink);
}
.cdate__link--brand {
  color: var(--brand);
}
.cdate__link--brand:hover {
  background: var(--brand-050);
  color: var(--brand);
}

@media print {
  .cdate__panel {
    display: none !important;
  }
}

/* ------------------------------------------------------------------ *
   ACTIVE FILTER CHIPS
   What is applied stays visible even while the filter panel is shut.
 * ------------------------------------------------------------------ */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.filter-chips__label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 0.15rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.25rem 0.5rem 0.25rem 0.6rem;
  border: 1px solid var(--brand-100);
  border-radius: 99px;
  background: var(--brand-050);
  color: var(--brand);
  font-size: 0.78rem;
  line-height: 1.3;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.chip:hover {
  background: var(--brand-100);
  border-color: var(--brand-300);
  color: var(--brand);
}
.chip__k {
  color: var(--ink-3);
  font-size: 0.72rem;
}
.chip__v {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16ch;
}
.chip i {
  font-size: 0.85rem;
  opacity: 0.7;
}
.chip:hover i {
  opacity: 1;
}
.chip--clear {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-3);
  font-weight: 600;
}
.chip--clear:hover {
  background: var(--bg);
  border-color: var(--ink-3);
  color: var(--ink);
}
/* count of filters hiding inside the collapsed panel */
.chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 0.35rem;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------ *
   SCROLLBARS
   One slim, brand-tinted bar everywhere — the page, tables, modals and
   dropdown panels — instead of the OS default. The sidebar keeps a
   light-on-dark version of the same shape.
 * ------------------------------------------------------------------ */
/* Firefox has no ::-webkit-scrollbar, so it takes the standard properties.
   Chrome/Edge/Safari fall through to the rules below — which is deliberate:
   when both are declared the standard ones win there, and the OS scrollbar
   they draw brings stepper arrows back with it. */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-700) transparent;
  }
  .sidebar,
  .sidebar__nav {
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  }
}

::-webkit-scrollbar {
  width: 12px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--brand-300);
  border-radius: 99px;
  /* transparent border + clip keeps the visible bar slim while leaving a
     comfortable hit area for the pointer */
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
  background-clip: content-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}
/* no stepper arrows — they belong to the OS chrome, not this UI */
::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* the rail is dark, so its bar is white-tinted instead */
.sidebar__nav::-webkit-scrollbar {
  width: 10px;
}
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border: 3px solid transparent;
  background-clip: content-box;
}
.sidebar__nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.42);
  background-clip: content-box;
}

/* on a phone the summary cards are only ~170px wide, so pin the figure to a
   size that fits rather than relying on container units */
@media (max-width: 575.98px) {
  .stat__value--money {
    font-size: 0.78rem;
  }
}

/* ------------------------------------------------------------------ *
   NOTIFICATION BELL PANEL  (assets/js/notifications.js)
 * ------------------------------------------------------------------ */
.notif-drop .icon-btn.has-unread,
.notif-drop .icon-btn[aria-expanded="true"] {
  background: var(--brand-050);
  border-color: var(--brand-100);
  color: var(--brand);
}
.notif-pop {
  --bs-dropdown-min-width: 380px;
  max-width: calc(100vw - 1.5rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 0.5rem;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(28, 8, 20, 0.16);
}
.notif-pop__loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.86rem;
}

/* header */
.notif-pop__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: var(--brand-050);
}
.notif-pop__mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.notif-pop__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.2;
}
.notif-pop__sub {
  font-size: 0.76rem;
  color: var(--ink-3);
}
.notif-pop__clear {
  margin-left: auto;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 650;
  padding: 0.3rem 0.4rem;
  border-radius: 7px;
}
.notif-pop__clear:hover {
  background: var(--brand-100);
}
.notif-pop__clear:disabled {
  opacity: 0.5;
}

/* list */
.notif-pop__list {
  max-height: 380px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.12s;
}
.notif-item:last-child {
  border-bottom: 0;
}
.notif-item:hover {
  background: var(--brand-050);
  color: inherit;
}
.notif-item.is-unread {
  background: rgba(82, 17, 56, 0.035);
}
.notif-item__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  background: var(--brand-100);
  color: var(--brand);
}
.notif-item__icon--danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.notif-item__icon--warning {
  background: var(--warn-bg);
  color: var(--warn);
}
.notif-item__icon--success {
  background: var(--ok-bg);
  color: var(--ok);
}
.notif-item__icon--info {
  background: var(--info-bg);
  color: var(--info);
}
.notif-item__body {
  min-width: 0;
  flex: 1 1 auto;
}
.notif-item__title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.notif-item.is-unread .notif-item__title {
  font-weight: 700;
}
.notif-item__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-top: 0.1rem;
}
.notif-item__time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.71rem;
  color: var(--ink-3);
}
.notif-item__po {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.05em 0.4em;
  border-radius: 5px;
  background: var(--muted-bg);
  color: var(--ink-2);
  font-weight: 600;
}
.notif-item__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--brand);
}

/* empty state */
.notif-pop__empty {
  padding: 2.4rem 1.5rem;
  text-align: center;
}
.notif-pop__empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.9rem;
  border-radius: 16px;
  background: var(--brand-050);
  color: var(--brand-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.notif-pop__empty-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}
.notif-pop__empty-text {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* footer */
.notif-pop__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
  background: var(--card);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}
.notif-pop__foot:hover {
  background: var(--brand-050);
  color: var(--brand);
}

@media (max-width: 575.98px) {
  .notif-pop {
    --bs-dropdown-min-width: 320px;
  }
  .notif-pop__list {
    max-height: 60vh;
  }
}

/* ------------------------------------------------------------------ *
   FULL-HEIGHT CARDS
   Cards sharing a row match heights; their body takes the slack so a
   short table or an empty state sits centred instead of leaving the
   card looking unfinished.
 * ------------------------------------------------------------------ */
.card-x.h-100 {
  display: flex;
  flex-direction: column;
}
.card-x.h-100 > .card-x__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card-x.h-100 > .card-x__body > .table-wrap {
  flex: 1 1 auto;
}
/* the illustrated empty state centres in whatever space is left */
.card-x.h-100 > .card-x__body > .empty-state,
.card-x.h-100 > .card-x__body > .table-wrap .empty-state {
  margin-block: auto;
}
/* pagination and footers stay pinned under the content */
.card-x.h-100 > nav {
  margin-top: auto;
}

/* Three short rows: stack them at their natural height. Stretching them
   to fill a card sized by the table alongside left huge dead gaps. */
.mix {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.mix__row + .mix__row {
  margin-top: 0;
}

/* ------------------------------------------------------------------ *
   AUTH — shared by the sign-in and forgotten-password screens
 * ------------------------------------------------------------------ */
/* an icon sitting inside the field, without disturbing the input itself */
.input-icon {
  position: relative;
}
.input-icon > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--ink-3);
  pointer-events: none;
}
.input-icon .form-control {
  padding-left: 2.5rem;
}
.input-icon:focus-within > i {
  color: var(--brand);
}

/* the confirmation panel after a reset has been requested */
.auth-done {
  text-align: center;
  padding: 0.5rem 0 0;
}
.auth-done__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: var(--brand-050);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

/* ------------------------------------------------------------------ *
   PROFILE
 * ------------------------------------------------------------------ */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.profile-hero__avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.profile-hero__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.profile-hero__mail {
  font-size: 0.82rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.profile-hero__role {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 99px;
  background: var(--brand-050);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 650;
}

.profile-facts {
  margin: 0;
  padding: 0.9rem 0 0;
}
.profile-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
}
.profile-facts > div:last-child {
  border-bottom: 0;
}
.profile-facts dt {
  font-size: 0.76rem;
  color: var(--ink-3);
  font-weight: 500;
}
.profile-facts dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.profile-stats__n {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.profile-stats__k {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  font-weight: 600;
  margin-top: 0.15rem;
}

/* an inline note under a form, quieter than an alert */
.note-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--brand-050);
  color: var(--ink-2);
  font-size: 0.79rem;
}
.note-line i {
  color: var(--brand);
  margin-top: 0.1rem;
}


/* the handbook, framed inside the app */
.doc-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 460px;
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fff;
}
@media (max-width: 767.98px) {
  .doc-frame {
    height: calc(100vh - 260px);
  }
}


/* ------------------------------------------------------------------ *
   ORDER LINES — the repeatable product rows in the order form
 * ------------------------------------------------------------------ */
.ol {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ol__head,
.ol__row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 0.9fr 0.7fr 1.1fr 1fr 44px;
  gap: 0.6rem;
  align-items: start;
}
.ol__head {
  padding: 0.55rem 0.75rem;
  background: var(--brand-050);
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ol__row {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.ol__row:last-child {
  border-bottom: 0;
}
.ol__desc {
  margin-top: 0.4rem;
  font-size: 0.82rem;
}
.ol__total {
  padding-top: 0.55rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.ol__remove {
  width: 36px;
  height: 36px;
  margin-top: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.ol__remove:hover:not(:disabled) {
  border-color: var(--danger);
  background: rgba(220, 53, 69, 0.06);
  color: var(--danger);
}
.ol__remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ol__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.ol__sum {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  background: var(--brand-050);
}
.ol__sum-k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
  color: var(--ink-3);
}
.ol__sum-v {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* stacked on narrow screens, with the column names as labels */
@media (max-width: 991.98px) {
  .ol__head {
    display: none;
  }
  .ol__row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    position: relative;
    padding-right: 3rem;
  }
  .ol__row > div:first-child {
    grid-column: 1 / -1;
  }
  .ol__total {
    padding-top: 0;
    align-self: center;
  }
  .ol__remove {
    position: absolute;
    top: 0.7rem;
    right: 0.75rem;
    margin-top: 0;
  }
}


/* ------------------------------------------------------------------ *
   QUICK VIEW — the order summary shown in a modal
 * ------------------------------------------------------------------ */
/* label/value pairs as a real table: two per row on desktop, one on mobile */
.qv-spec {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.85rem;
  table-layout: fixed;
}
.qv-spec th,
.qv-spec td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.qv-spec tr:last-child th,
.qv-spec tr:last-child td {
  border-bottom: 0;
}
.qv-spec th {
  width: 23%;
  background: var(--brand-050);
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  /* long labels wrap inside their own column rather than running into the
     value beside them */
  line-height: 1.25;
}
.qv-spec td {
  color: var(--ink);
  font-weight: 500;
}
.qv-spec__sub {
  color: var(--ink-3);
  font-size: 0.76rem;
  font-weight: 400;
}

/* the line and lifecycle tables inside the modal */
.qv-table {
  border: 1px solid var(--line);
  border-radius: 10px;
}
.qv-table .table-x tfoot th {
  background: var(--brand-050);
  border-top: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.qv-table .table-x tbody tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.qv-stage {
  white-space: nowrap;
  font-weight: 600;
}
.qv-stage__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 0.5rem;
  border-radius: 8px;
  background: var(--brand-050);
  color: var(--brand);
  font-size: 0.8rem;
  vertical-align: middle;
}

@media (max-width: 767.98px) {
  /* stack each pair: label above value, one pair per line */
  .qv-spec,
  .qv-spec tbody,
  .qv-spec tr,
  .qv-spec th,
  .qv-spec td {
    display: block;
    width: auto;
  }
  .qv-spec tr {
    border-bottom: 1px solid var(--line);
  }
  .qv-spec tr:last-child {
    border-bottom: 0;
  }
  .qv-spec th {
    border-bottom: 0;
    padding-bottom: 0.15rem;
  }
  .qv-spec td {
    border-bottom: 0;
    padding-top: 0;
  }
  .qv-stage__icon {
    display: none;
  }
}
