/* ============================================================================
 * Ninatrans WMS — desktop styles
 *
 * Aligned with the Ninatrans CRM design system: brand red `#B91C4D`, light
 * card-style shell, soft gradient background, subtle elevation. HSL values
 * mirror the CRM `:root` tokens so the two apps feel like one product.
 * ========================================================================== */

:root {
  /* ---- Brand / palette (HSL components — hsl(var(--token)) in rules) ---- */
  --background: 240 10% 98%;
  --foreground: 240 10% 8%;

  --card: 0 0% 100%;
  --card-foreground: 240 10% 8%;
  --card-border: 240 6% 90%;

  --primary: 338 95% 29%;
  --primary-foreground: 0 0% 100%;
  --primary-light: 338 95% 85%;
  --primary-dark: 338 95% 20%;

  --secondary: 240 5% 96%;
  --secondary-foreground: 240 6% 10%;

  --muted: 240 5% 96%;
  --muted-foreground: 240 4% 46%;

  --accent: 240 5% 96%;
  --accent-foreground: 240 6% 10%;

  --success: 142 76% 36%;
  --success-light: 142 76% 90%;
  --warning: 45 93% 58%;
  --warning-light: 45 93% 90%;
  --danger: 0 84% 60%;
  --danger-light: 0 84% 95%;
  --info: 217 91% 60%;
  --info-light: 217 91% 90%;

  --border: 240 6% 90%;
  --input: 240 6% 90%;
  --ring: 338 95% 29%;

  --radius: 0.5rem;

  --gradient-primary: linear-gradient(135deg, hsl(338 95% 29%), hsl(338 95% 20%));
  --gradient-subtle: linear-gradient(180deg, hsl(240 10% 99%), hsl(240 10% 96%));

  --shadow-card: 0 1px 3px hsl(240 5% 0% / 0.08), 0 1px 2px hsl(240 5% 0% / 0.04);
  --shadow-elevated: 0 4px 14px hsl(240 5% 0% / 0.08), 0 2px 4px hsl(240 5% 0% / 0.04);
  --shadow-primary: 0 4px 14px hsl(338 95% 29% / 0.18);

  --wms-header-height: 64px;
  --wms-sidebar-width: 256px;
}

* { box-sizing: border-box; }

body.wms-app {
  margin: 0;
  background: var(--gradient-subtle);
  color: hsl(var(--foreground));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ---- Bootstrap override: brand colours ---------------------------------- */
/* Bootstrap utility classes are reused everywhere, so we re-skin them here
   rather than swapping every template. Use HSL via the design tokens so a
   future theme change is a one-liner. */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--gradient-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px hsl(338 95% 29% / 0.25);
  color: hsl(var(--primary-foreground));
}
.btn-primary:disabled {
  background: hsl(var(--primary) / 0.6);
  border-color: hsl(var(--primary) / 0.6);
}

a { color: hsl(var(--primary)); }
a:hover { color: hsl(var(--primary-dark)); }

/* Tighter, more modern badges */
.badge { font-weight: 600; letter-spacing: 0.01em; }

/* ---- Tenant onboarding form ---------------------------------------------- */
.tenant-form__hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid hsl(var(--primary) / 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.08), hsl(var(--card)));
}

.tenant-form__hero-icon {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.14);
}

.tenant-form__section {
  border: 1px solid hsl(var(--card-border));
  border-radius: 12px;
  background: hsl(var(--card));
  padding: 1rem;
}

.tenant-form__section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0 0 0.75rem;
}

.tenant-form__slug-wrap {
  display: flex;
  align-items: center;
}

.tenant-form__slug-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0 0.65rem;
  border: 1px solid hsl(var(--input));
  border-right: 0;
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.8);
  font-size: 0.86rem;
}

.tenant-form__slug-wrap .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.tenant-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.tenant-copy-option {
  border: 1px solid hsl(var(--card-border));
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  background: hsl(var(--muted) / 0.35);
  cursor: pointer;
}

.tenant-copy-option:hover {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.05);
}

.tenant-copy-option .form-check-label {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.tenant-copy-option__hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.35;
}

.tenant-form__steps {
  margin: 0;
  padding-left: 1.05rem;
}

.tenant-form__steps li {
  margin-bottom: 0.45rem;
  color: hsl(var(--muted-foreground));
}

.tenant-form__steps li:last-child {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .tenant-copy-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Top header + horizontal navigation --------------------------------- */

.wms-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1035;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--card-border));
  box-shadow: var(--shadow-card);
}

.wms-header__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--wms-header-height);
  padding: 0 1rem 0 1.25rem;
  min-width: 0;
  overflow: visible;
}

.wms-header__start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.wms-header__end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
}

.wms-header__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.wms-header__brand-logo {
  height: 2rem;
  width: auto;
  object-fit: contain;
}

.wms-header__toggle {
  display: none;
  background: transparent;
  border: 0;
  color: hsl(var(--foreground));
  font-size: 18px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.wms-header__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  flex-shrink: 0;
}

.wms-topnav {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow: visible;
}

.wms-topnav__list {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: max-content;
  height: 100%;
}

.wms-topnav__list > li {
  display: flex;
  align-items: stretch;
}

.wms-topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  height: auto;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease;
}

.wms-topnav__link i {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.wms-topnav__link:hover,
.wms-topnav__link:focus,
.wms-topnav__link.show {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}

.wms-topnav__link:hover i,
.wms-topnav__link:focus i,
.wms-topnav__link.show i {
  color: hsl(var(--primary));
}

.wms-topnav__link.is-active {
  color: hsl(var(--primary));
  font-weight: 600;
  background: hsl(var(--primary) / 0.12);
}

.wms-topnav__link.is-active i {
  color: hsl(var(--primary));
}

.wms-topnav__dropdown .dropdown-toggle::after {
  margin-left: 0.15rem;
  vertical-align: 0.1em;
}

.wms-topnav__dropdown {
  position: static;
}

.wms-topnav__menu {
  margin-top: 0.35rem;
  padding: 0.35rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  min-width: 13rem;
  z-index: 1060;
}

.wms-topnav__menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 13.5px;
  padding: 0.45rem 0.65rem;
}

.wms-topnav__menu .dropdown-item i {
  width: 16px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}

.wms-topnav__menu .dropdown-item.active,
.wms-topnav__menu .dropdown-item:active {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.wms-topnav__menu .dropdown-item.active i,
.wms-topnav__menu .dropdown-item:active i {
  color: hsl(var(--primary));
}

/* ---- Vertical sidebar navigation ---------------------------------------- */

.wms-nav-section {
  margin: 1rem 0.85rem 0.35rem;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground) / 0.7);
}

.wms-nav-group {
  margin-bottom: 0.35rem;
}

.wms-nav-group__label {
  margin: 0.65rem 0.85rem 0.2rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}

.wms-nav-group__label.is-active {
  color: hsl(var(--primary));
}

.wms-sidenav__sublink {
  padding-left: 1.35rem;
  font-size: 13.5px;
}

.wms-sidenav__sublink i {
  display: none;
}

.wms-sidenav {
  position: fixed;
  top: var(--wms-header-height);
  left: 0;
  bottom: 0;
  width: var(--wms-sidebar-width);
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--card-border));
  box-shadow: 2px 0 18px hsl(240 5% 0% / 0.06);
  z-index: 1030;
  transition: width 180ms ease;
}

.wms-sidenav__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.65rem 0.5rem;
  gap: 0.125rem;
}

.wms-sidenav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}

.wms-sidenav__link i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: hsl(var(--muted-foreground));
}

.wms-sidenav__link:hover {
  background: hsl(var(--primary) / 0.06);
  color: hsl(var(--primary));
}

.wms-sidenav__link:hover i {
  color: hsl(var(--primary));
}

.wms-sidenav__link.is-active {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-weight: 600;
}

.wms-sidenav__link.is-active i {
  color: hsl(var(--primary));
}

.wms-sidenav__link .wms-nav-badge {
  margin-left: auto;
}

.wms-sidenav__label {
  white-space: nowrap;
}

.wms-sidenav__fold {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  position: sticky;
  top: 0;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  margin: 0.5rem 0.5rem 0 0;
  padding: 0;
  border: 1px solid hsl(var(--card-border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.wms-sidenav__fold i {
  font-size: 0.8rem;
}
.wms-sidenav__fold:hover {
  background: hsl(var(--primary) / 0.06);
  color: hsl(var(--primary));
}

body.wms-nav-vertical .wms-main {
  margin-left: var(--wms-sidebar-width);
  transition: margin-left 180ms ease;
}

body.wms-nav-horizontal .wms-main {
  margin-left: 0;
}

@media (min-width: 993px) {
  html.nav-folded {
    --wms-sidebar-width: 4.5rem;
  }
  html.nav-folded .wms-sidenav__label,
  html.nav-folded .wms-nav-section {
    display: none;
  }
  html.nav-folded .wms-sidenav__link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }
  html.nav-folded .wms-sidenav__fold {
    align-self: center;
    margin: 0.5rem auto 0;
  }
  html.nav-folded .wms-sidenav__nav {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
}

/* ---- Main column -------------------------------------------------------- */

.wms-main {
  margin-top: var(--wms-header-height);
  min-height: calc(100vh - var(--wms-header-height));
  display: flex;
  flex-direction: column;
}

/* Settings cards (landing page) ----------------------------------------- */

.wms-settings-card {
  color: hsl(var(--foreground));
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.wms-settings-card:hover {
  transform: translateY(-1px);
  border-color: hsl(var(--primary) / 0.4);
  box-shadow: 0 6px 20px -10px hsl(var(--primary) / 0.5);
}
.wms-settings-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
  flex-shrink: 0;
}
.wms-settings-card__icon i {
  font-size: 18px;
}

/* User profile menu (mirrors the CRM `.crm-usermenu` in FMS) ------------- */
.wms-usermenu {
  position: relative;
}

.wms-usermenu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background 120ms ease;
}
.wms-usermenu__trigger:hover {
  background: hsl(var(--accent));
}

.wms-usermenu__id {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.wms-usermenu__name {
  font-weight: 500;
  font-size: 13px;
  color: hsl(var(--foreground));
}
.wms-usermenu__role {
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}

.wms-usermenu__chev {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  transition: transform 200ms ease;
}
.wms-usermenu.is-open .wms-usermenu__chev {
  transform: rotate(180deg);
}

.wms-usermenu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 14rem;
  display: none;
  padding: 0.35rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  z-index: 1050;
}
.wms-usermenu.is-open .wms-usermenu__dropdown {
  display: block;
}

.wms-usermenu__label {
  padding: 0.4rem 0.6rem;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  font-weight: 700;
}

.wms-usermenu__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  font-size: 13px;
  color: hsl(var(--foreground));
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.wms-usermenu__item i {
  width: 16px;
  text-align: center;
  color: hsl(var(--muted-foreground));
}
.wms-usermenu__item:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.wms-usermenu__item--danger,
.wms-usermenu__item--danger i {
  color: hsl(var(--danger));
}
.wms-usermenu__item--danger:hover {
  background: hsl(var(--danger) / 0.08);
  color: hsl(var(--danger));
}

.wms-usermenu__sep {
  height: 1px;
  background: hsl(var(--card-border));
  margin: 0.3rem 0;
}

/* Round avatar with brand-red initials */
.wms-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.wms-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 100%;
}

.wms-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wms-page-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.wms-flash-stack {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ---- Cards -------------------------------------------------------------- */

.wms-card,
.card.wms-card,
.crm-skin .card {
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: var(--shadow-card);
}

.wms-card .card-header {
  background: transparent;
  border-bottom: 1px solid hsl(var(--card-border));
  font-weight: 600;
  padding: 0.85rem 1.1rem;
}

/* ---- Tables (CRM-aligned global style) ---------------------------------- */

.table-responsive {
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: var(--shadow-card);
  overflow: auto;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: hsl(var(--foreground));
  --bs-table-border-color: hsl(var(--card-border));
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.65rem 0.85rem;
  border-bottom-color: hsl(var(--card-border));
}

.table > thead,
.table-light {
  --bs-table-bg: hsl(var(--muted));
  --bs-table-color: hsl(var(--muted-foreground));
}

.table > thead th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  border-bottom: 1px solid hsl(var(--card-border));
  white-space: nowrap;
}

.table > tbody td {
  color: hsl(var(--foreground));
}

.table > tfoot th,
.table > tfoot td {
  background: hsl(var(--muted) / 0.65);
  font-weight: 600;
}

.table-hover > tbody > tr:hover > * {
  background: hsl(var(--muted));
}

.table tbody tr.js-row-link {
  cursor: pointer;
}

.table-sm > :not(caption) > * > * {
  padding: 0.5rem 0.7rem;
}

/* Micro-pass: table typography by context ---------------------------------- */
/* Most operational listing pages use `table-hover`; keep them compact. */
.table.table-hover:not(.wms-table-finance) > :not(caption) > * > * {
  padding: 0.55rem 0.75rem;
}

.table.table-hover:not(.wms-table-finance) > thead th {
  font-size: 11px;
  letter-spacing: 0.045em;
}

/* Finance tables (invoicing/pricelists): slightly roomier and clearer totals. */
.table.wms-table-finance > :not(caption) > * > * {
  padding: 0.75rem 0.95rem;
}

.table.wms-table-finance > thead th {
  font-size: 11.25px;
}

.table.wms-table-finance .text-end,
.table.wms-table-finance td[data-money] {
  font-variant-numeric: tabular-nums;
}

/* Action-column buttons stay visually consistent in all table contexts. */
.table td.text-end .btn.btn-sm {
  min-width: 2rem;
}

/* ---- Stat cards (dashboard) -------------------------------------------- */

.wms-stat .card-body { padding: 1.25rem; }

.wms-stat__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  margin-bottom: 0.75rem;
}

.wms-stat__label {
  color: hsl(var(--muted-foreground));
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.wms-stat__value {
  font-size: 28px;
  font-weight: 700;
  color: hsl(var(--foreground));
}

/* Keep KPI cards visually identical even when labels wrap differently. */
.wms-kpi-row .wms-kpi-card {
  min-height: 110px;
}

.wms-kpi-row .wms-kpi-card .card-body {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.1rem;
}

.wms-kpi-row .wms-stat__label {
  min-height: 2.2em;
  line-height: 1.1;
  margin-bottom: 0.45rem;
}

.wms-kpi-row .wms-stat__value {
  line-height: 1;
}

.wms-stat--alert .wms-stat__icon {
  background: hsl(var(--danger) / 0.1);
  color: hsl(var(--danger));
}
.wms-stat--success .wms-stat__icon {
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}
.wms-stat--warning .wms-stat__icon {
  background: hsl(var(--warning) / 0.15);
  color: hsl(45 93% 35%);
}

/* Dashboard: THT expiry alerts card */
.wms-card-collapse-toggle {
  color: inherit;
  font-weight: 600;
}

.wms-card-collapse-toggle:hover,
.wms-card-collapse-toggle:focus {
  color: inherit;
}

.tht-alerts-table-wrap--scroll {
  max-height: 18rem;
  overflow-y: auto;
}

.tht-alerts-table-wrap--scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: hsl(var(--muted));
}

.wms-card-collapse-toggle .tht-alerts-chevron {
  transition: transform 160ms ease;
}

.wms-card-collapse-toggle.collapsed .tht-alerts-chevron {
  transform: rotate(180deg);
}

/* ---- Activity feed icons ----------------------------------------------- */

.wms-feed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  flex-shrink: 0;
  font-size: 14px;
}
.wms-feed-icon--success {
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
}
.wms-feed-icon--info {
  background: hsl(var(--info) / 0.1);
  color: hsl(var(--info));
}
.wms-feed-icon--primary {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

/* ---- Nav badges (dropdown items) --------------------------------------- */

.wms-topnav__menu .dropdown-item {
  position: relative;
}

.wms-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  background: hsl(var(--primary));
  color: #fff;
}
.wms-nav-badge:empty,
.wms-nav-badge[data-count="0"] {
  display: none;
}

/* ---- Global search input in header bar --------------------------------- */

.wms-header__search {
  position: relative;
  flex: 0 1 14rem;
  width: 14rem;
  max-width: 14rem;
  min-width: 0;
  margin: 0;
}
.wms-header__search input.form-control {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.85rem 0 2.25rem;
  border-radius: var(--radius);
  background: hsl(var(--muted));
  border-color: hsl(var(--card-border));
}
.wms-header__search input.form-control:focus {
  background: hsl(var(--card));
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.12);
}
.wms-header__search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}
@media (max-width: 640px) {
  .wms-header__search {
    max-width: none;
  }
}

/* ---- Form polish -------------------------------------------------------- */

.form-control,
.form-select {
  border-color: hsl(var(--input));
}
.form-control:focus,
.form-select:focus {
  border-color: hsl(var(--ring) / 0.4);
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

/* Select2 parity with Bootstrap form-select controls. */
select.form-select + .select2 {
  width: 100% !important;
}

select.form-select + .select2 .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
  border: 1px solid hsl(var(--input));
  border-radius: 0.375rem;
}

select.form-select + .select2 .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.75rem);
  padding-left: 0.75rem;
  color: hsl(var(--foreground));
}

select.form-select + .select2 .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.75rem);
  right: 0.35rem;
}

select.form-select.form-select-sm + .select2 .select2-selection--single {
  height: calc(1.5em + 0.5rem + 2px);
}

select.form-select.form-select-sm + .select2 .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.5rem);
  font-size: 0.875rem;
}

select.form-select + .select2 .select2-selection--multiple {
  min-height: calc(1.5em + 0.75rem + 2px);
  border: 1px solid hsl(var(--input));
  border-radius: 0.375rem;
}

select.form-select.form-select-sm + .select2 .select2-selection--multiple {
  min-height: calc(1.5em + 0.5rem + 2px);
}

select.form-select + .select2.select2-container--focus .select2-selection--single,
select.form-select + .select2.select2-container--focus .select2-selection--multiple {
  border-color: hsl(var(--ring) / 0.4);
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

/* Select2 dropdown must stack above Bootstrap modals (z-index 1055). */
.select2-container--open {
  z-index: 1060 !important;
}

.select2-dropdown {
  z-index: 1060 !important;
}

.modal .select2-dropdown {
  z-index: 1 !important;
}

/* ---- Login screen (split panel, matches CRM Auth.tsx) ------------------ */

body.wms-login-page {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background: hsl(var(--background));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: hsl(var(--foreground));
}

.wms-login {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.wms-login__panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.wms-login__form-wrap {
  width: min(448px, 100%);
}

.wms-login__logo {
  height: 64px;
  width: auto;
  margin-bottom: 2rem;
}

.wms-login__title {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: hsl(var(--foreground));
}

.wms-login__subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 18px;
  margin-bottom: 2rem;
}

.wms-login__form .form-label {
  font-weight: 500;
  font-size: 13px;
  color: hsl(var(--foreground));
}

.wms-login__form .btn-primary {
  height: 56px;
  font-size: 16px;
  font-weight: 600;
  background: #b91c4d;
  border-color: #b91c4d;
}

.wms-login__form .btn-primary:hover,
.wms-login__form .btn-primary:focus,
.wms-login__form .btn-primary:active {
  background: #9a1741 !important;
  border-color: #9a1741 !important;
}

.wms-login__m365-btn {
  height: 56px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #b91c4d;
  border: 1px solid #b91c4d;
  border-radius: var(--radius);
  box-shadow: var(--shadow-primary);
}

.wms-login__m365-btn:hover,
.wms-login__m365-btn:focus,
.wms-login__m365-btn:active {
  color: #fff !important;
  background: #9a1741 !important;
  border-color: #9a1741 !important;
  text-decoration: none;
}

.wms-login__m365-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.wms-login__hero {
  flex: 1;
  display: none;
  position: relative;
  padding: 3rem;
  color: #fff;
  overflow: hidden;
}
@media (min-width: 992px) {
  .wms-login__hero { display: flex; flex-direction: column; justify-content: space-between; }
}

.wms-login__hero-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
}
.wms-login__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(185, 28, 77, 0.9), rgba(154, 23, 65, 0.85));
}
.wms-login__hero > *:not(.wms-login__hero-bg):not(.wms-login__hero-overlay) {
  position: relative;
  z-index: 1;
}

.wms-login__hero-title {
  font-size: 48px;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

.wms-login__hero-subtitle {
  font-size: 20px;
  font-weight: 600;
  opacity: 0.9;
  margin: 1rem 0 0;
}

.wms-login__hero-lead {
  font-size: 18px;
  line-height: 1.6;
  max-width: 448px;
  opacity: 0.8;
  margin: 1rem 0 0;
}

.wms-login__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  max-width: 672px;
}

.wms-login__feature {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.wms-login__feature i {
  font-size: 18px;
  margin-bottom: 0.5rem;
  display: block;
}

.wms-login__hero-footer {
  font-size: 14px;
  opacity: 0.7;
}

.wms-login__info {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: hsl(var(--muted) / 0.6);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 13.5px;
  color: hsl(var(--muted-foreground));
}
.wms-login__info i {
  color: hsl(var(--danger));
  margin-top: 2px;
}

/* ---- Responsive horizontal nav ----------------------------------------- */

@media (max-width: 992px) {
  .wms-header__toggle {
    display: inline-flex;
  }

  .wms-sidenav__fold {
    display: none;
  }

  .wms-header__bar {
    flex-wrap: wrap;
    padding: 0 0.75rem;
  }

  .wms-header__end {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
  }

  .wms-header__search {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
  }

  body.wms-nav-horizontal .wms-topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: none;
    height: auto;
    max-height: calc(100vh - var(--wms-header-height));
    overflow-y: auto;
    background: hsl(var(--card));
    border-bottom: 1px solid hsl(var(--card-border));
    box-shadow: var(--shadow-elevated);
  }

  body.wms-nav-horizontal .wms-topnav.is-open {
    display: block;
  }

  body.wms-nav-vertical .wms-sidenav {
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 1040;
    top: 0;
    height: 100vh;
  }

  body.wms-nav-vertical .wms-sidenav.is-open {
    transform: translateX(0);
  }

  body.wms-nav-vertical .wms-main {
    margin-left: 0;
  }

  body.wms-nav-horizontal .wms-topnav__list {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 0.5rem;
    gap: 0.15rem;
  }

  .wms-topnav__list > li {
    display: block;
  }

  .wms-topnav__link {
    width: 100%;
    height: auto;
    padding: 0.65rem 0.85rem;
    border-bottom: 0;
    border-radius: var(--radius);
  }

  body.wms-nav-horizontal .wms-topnav__link.is-active,
  body.wms-nav-horizontal .wms-topnav__link.show {
    border-bottom: 0;
    background: hsl(var(--primary) / 0.1);
  }

  body.wms-nav-horizontal .wms-topnav__dropdown .dropdown-menu {
    position: static !important;
    transform: none !important;
    float: none;
    width: 100%;
    margin: 0.15rem 0 0.35rem 0.75rem;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .wms-usermenu__id {
    display: none !important;
  }

  .wms-page-title {
    font-size: 1.15rem;
  }
}

/* ---- Stock pallet detail page ------------------------------------------ */

.wms-detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  flex-wrap: wrap;
}

.wms-detail-breadcrumb__link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wms-detail-breadcrumb__link:hover {
  color: hsl(var(--primary));
}

.wms-detail-breadcrumb__sep {
  color: hsl(var(--border));
}

.wms-detail-breadcrumb__current {
  color: hsl(var(--foreground));
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.wms-detail-hero {
  border-left: 4px solid hsl(var(--primary));
}

.wms-detail-hero__sscc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}

.wms-detail-hero__product {
  font-size: 15px;
  color: hsl(var(--foreground));
}

.wms-detail-hero__meta {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.wms-detail-hero__qty {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}

.wms-detail-hero__uom {
  font-size: 0.95rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-left: 0.25rem;
}

.wms-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 500;
}

.wms-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wms-status-pill--sm {
  font-size: 11px;
  padding: 0.15rem 0.5rem;
}

.wms-status-pill--received  { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.wms-status-pill--putaway   { background: hsl(var(--info-light)); color: hsl(217 91% 35%); }
.wms-status-pill--in-stock  { background: hsl(var(--success-light)); color: hsl(var(--success)); }
.wms-status-pill--blocked   { background: hsl(0 85% 96%); color: hsl(0 70% 38%); }
.wms-status-pill--allocated { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.wms-status-pill--picked    { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.wms-status-pill--dispatched { background: hsl(var(--foreground) / 0.08); color: hsl(var(--foreground)); }
.wms-status-pill--neutral   { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.wms-stat__value--sm {
  font-size: 1.05rem;
  line-height: 1.3;
}

.wms-lifecycle {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.wms-lifecycle__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 72px;
  flex-shrink: 0;
}

.wms-lifecycle__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
}

.wms-lifecycle__step.is-complete .wms-lifecycle__dot,
.wms-lifecycle__step.is-current .wms-lifecycle__dot {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.wms-lifecycle__step.is-current .wms-lifecycle__dot {
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.15);
}

.wms-lifecycle__label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-align: center;
  white-space: nowrap;
}

.wms-lifecycle__step.is-current .wms-lifecycle__label,
.wms-lifecycle__step.is-complete .wms-lifecycle__label {
  color: hsl(var(--foreground));
}

.wms-lifecycle__connector {
  flex: 1 1 auto;
  height: 2px;
  background: hsl(var(--border));
  margin-top: 13px;
  min-width: 12px;
}

.wms-lifecycle__connector.is-complete {
  background: hsl(var(--primary));
}

.wms-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.wms-timeline__item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.35rem;
  position: relative;
}

.wms-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: hsl(var(--border));
}

.wms-timeline__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  z-index: 1;
}

.wms-timeline__icon--success { background: hsl(var(--success-light)); color: hsl(var(--success)); }
.wms-timeline__icon--info    { background: hsl(var(--info-light)); color: hsl(var(--info)); }
.wms-timeline__icon--warning { background: hsl(var(--warning-light)); color: hsl(32 95% 35%); }
.wms-timeline__icon--primary { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.wms-timeline__icon--danger  { background: hsl(var(--danger-light)); color: hsl(var(--danger)); }

.wms-timeline__body {
  flex: 1;
  min-width: 0;
  padding-top: 0.15rem;
}

.wms-timeline__title {
  font-weight: 600;
  font-size: 14px;
  color: hsl(var(--foreground));
  margin-bottom: 0.15rem;
}

.wms-timeline__detail {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
}

.wms-timeline__link {
  display: inline-block;
  margin-top: 0.35rem;
  text-decoration: none;
}

.wms-timeline__meta {
  flex-shrink: 0;
}

.wms-info-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid hsl(var(--card-border));
}

.wms-info-list__row:last-child {
  border-bottom: 0;
}

.wms-info-list__row dt {
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.wms-info-list__row dd {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  margin: 0;
}

.wms-detail-grid .wms-detail-field {
  height: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.35);
}

.wms-detail-field__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.35rem;
}

.wms-detail-field__value {
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.35;
  word-break: break-word;
}

.wms-detail-field__value--lg {
  font-size: 1.35rem;
  font-weight: 700;
}

.wms-detail-field__value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* Compact header filters for list views */
.wms-list-filters {
  margin-bottom: 0;
}

.wms-list-filter-row th {
  padding: 0.45rem 0.5rem;
  background: hsl(var(--card));
  border-top: 0;
}

.wms-list-filter-row .form-control,
.wms-list-filter-row .form-select {
  font-size: 12px;
  min-height: 30px;
  padding: 0.25rem 0.45rem;
}

/* Sortable column headers */
.wms-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.wms-sort:hover {
  color: hsl(var(--primary));
}

.wms-sort--active {
  color: hsl(var(--primary));
}

.wms-sort__icon {
  font-size: 10px;
}

.wms-sort__icon--idle {
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.wms-sort:hover .wms-sort__icon--idle,
.wms-sort:focus-visible .wms-sort__icon--idle {
  opacity: 0.45;
}

/* In-app documentation */
.wms-docs-nav-card {
  position: sticky;
  top: 1rem;
}

.wms-docs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wms-docs-nav__link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
}

.wms-docs-nav__link:hover {
  background: hsl(var(--muted) / 0.55);
  color: hsl(var(--foreground));
}

.wms-docs-nav__link.is-active {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.wms-docs-nav__link i {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
}

.wms-docs-body {
  font-size: 14px;
  line-height: 1.6;
  color: hsl(var(--foreground));
}

.wms-docs-body .lead {
  font-size: 15px;
}

.wms-docs-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
  font-size: 1rem;
  font-weight: 600;
}

.wms-docs-heading:first-of-type {
  margin-top: 0;
}

.wms-docs-list {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.wms-docs-list li {
  margin-bottom: 0.35rem;
}

.wms-docs-tip {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.45);
  border-left: 3px solid hsl(var(--primary));
  font-size: 13px;
  color: hsl(var(--foreground));
}

.wms-docs-tip i {
  color: hsl(var(--primary));
  margin-top: 0.15rem;
}

/* ---- Copy-to-clipboard -------------------------------------------------- */
.wms-copyable {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  vertical-align: middle;
}

.wms-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.375rem;   /* 22px — matches cap-height of body text */
  height: 1.375rem;
  padding: 0;
  margin: 0;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: 0.25rem;
  line-height: 1;
  font-size: 0.6875rem; /* ~11px icon */
  cursor: pointer;
  opacity: 0.85;
  box-shadow: none;
  appearance: none;
}

.wms-copy-btn i {
  font-size: inherit;
  line-height: 1;
}

.wms-copy-btn:hover,
.wms-copy-btn:focus-visible {
  opacity: 1;
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.04);
  outline: none;
}

.wms-copy-btn.is-copied {
  opacity: 1;
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.4);
}

/* Dense tables: reveal copy on row/cell hover (always visible on touch). */
.wms-copyable--hover .wms-copy-btn {
  opacity: 0;
}

.wms-copyable--hover:hover .wms-copy-btn,
.wms-copyable--hover:focus-within .wms-copy-btn,
tr:hover .wms-copyable--hover .wms-copy-btn {
  opacity: 0.85;
}

tr:hover .wms-copyable--hover .wms-copy-btn:hover,
.wms-copyable--hover .wms-copy-btn:hover,
.wms-copyable--hover .wms-copy-btn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .wms-copyable--hover .wms-copy-btn {
    opacity: 0.75;
  }
}

/* ---- ITSM extras (same tokens as WMS; do not fork the chrome) ----------- */

body.has-dev-banner .wms-header { top: 24px; }
body.has-dev-banner .wms-sidenav { top: calc(var(--wms-header-height) + 24px); }
body.has-dev-banner .wms-main { margin-top: calc(var(--wms-header-height) + 24px); }
body.has-dev-banner.wms-nav-vertical .wms-sidenav { top: calc(var(--wms-header-height) + 24px); }

.dev-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  height: 24px;
  background: hsl(var(--warning));
  color: #422006;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 24px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.page-head h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.card-pad { padding: 1.1rem; }

.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}
.stat-card .label {
  color: hsl(var(--muted-foreground));
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.search-results {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 4px);
  min-width: 100%;
  width: max(100%, 22rem);
  max-width: min(32rem, calc(100vw - 2rem));
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  z-index: 1050;
  box-shadow: var(--shadow-elevated);
}
.search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-results a:hover { background: hsl(var(--muted)); }

.wms-notify {
  position: relative;
}

.wms-header__notify {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  cursor: pointer;
}
.wms-header__notify:hover,
.wms-notify.is-open .wms-header__notify {
  background: hsl(var(--accent));
  color: hsl(var(--primary));
}
.wms-header__notify .wms-nav-badge {
  position: absolute;
  top: 0;
  right: 0;
  margin-left: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
}

.wms-notify__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 20rem;
  max-width: calc(100vw - 1.5rem);
  display: none;
  flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  z-index: 1050;
}
.wms-notify.is-open .wms-notify__dropdown {
  display: flex;
}

.wms-notify__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid hsl(var(--card-border));
  background: hsl(var(--muted) / 0.5);
}
.wms-notify__head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.wms-notify__markall {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  cursor: pointer;
}
.wms-notify__markall:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.wms-notify__list {
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wms-notify__item {
  position: relative;
  border-bottom: 1px solid hsl(var(--card-border));
}
.wms-notify__item:last-child {
  border-bottom: 0;
}
.wms-notify__item.is-unread {
  background: hsl(var(--primary) / 0.05);
}

.wms-notify__body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.25rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.wms-notify__item:hover .wms-notify__body {
  background: hsl(var(--muted) / 0.55);
}

.wms-notify__icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.wms-notify__text {
  flex: 1;
  min-width: 0;
}
.wms-notify__title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wms-notify__item:not(.is-unread) .wms-notify__title {
  color: hsl(var(--muted-foreground));
}
.wms-notify__msg {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 2px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.wms-notify__time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: hsl(var(--muted-foreground) / 0.75);
}
.wms-notify__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 9999px;
  background: hsl(var(--primary));
}

.wms-notify__delete {
  position: absolute;
  top: 0.5rem;
  right: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.wms-notify__item:hover .wms-notify__delete,
.wms-notify__item:focus-within .wms-notify__delete {
  opacity: 1;
  pointer-events: auto;
}
.wms-notify__delete button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.wms-notify__delete button:hover {
  background: hsl(var(--danger) / 0.1);
  color: hsl(var(--danger));
}

.wms-notify__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 8rem;
  padding: 1.5rem 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}
.wms-notify__empty i {
  font-size: 1.5rem;
  opacity: 0.5;
}
.wms-notify__empty p {
  margin: 0;
}

@media (hover: none) {
  .wms-notify__delete {
    opacity: 1;
    pointer-events: auto;
  }
}

.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
}
.settings-nav__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--foreground));
  padding: 0 0.35rem 0.35rem;
}
.settings-nav .heading {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground) / 0.7);
  margin: 0.85rem 0.35rem 0.25rem;
}
.settings-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.settings-nav a i {
  width: 1rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
}
.settings-nav a:hover {
  background: hsl(var(--primary) / 0.06);
  color: hsl(var(--primary));
}
.settings-nav a.active {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-weight: 600;
}
.settings-nav a.active i,
.settings-nav a:hover i {
  color: inherit;
}

.asset-fields-card .card-header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.asset-fields-card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.asset-fields-card__title i {
  color: hsl(var(--muted-foreground));
}
.asset-fields-card__desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
  line-height: 1.45;
}
.asset-field-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 1rem;
}
.asset-field-tabs__tab {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 13px;
  font-weight: 500;
}
.asset-field-tabs__tab:hover {
  color: hsl(var(--foreground));
}
.asset-field-tabs__tab.active {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}
.asset-fields-add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.asset-fields-add .form-control {
  flex: 1;
}
.asset-fields-add .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.asset-opt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.asset-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--card-border));
}
.asset-opt:last-child {
  border-bottom: 0;
}
.asset-opt.is-inactive {
  background: hsl(var(--muted) / 0.45);
}
.asset-opt__view {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
}
.asset-opt.is-inactive .asset-opt__view {
  color: hsl(var(--muted-foreground));
  text-decoration: line-through;
}
.asset-opt__edit {
  display: none;
  flex: 1;
  align-items: center;
  gap: 0.35rem;
}
.asset-opt.is-editing .asset-opt__view,
.asset-opt.is-editing .asset-opt__actions {
  display: none;
}
.asset-opt.is-editing .asset-opt__edit {
  display: flex;
}
.asset-opt__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.asset-opt__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--muted-foreground));
}
.asset-opt__icon-btn:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
}
.asset-opt__icon-btn--ok {
  color: hsl(var(--success));
}
.asset-opt .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  cursor: pointer;
  background-color: hsl(var(--muted));
  border-color: hsl(var(--card-border));
}
.asset-opt .form-check-input:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.cf-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.cf-card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}
.cf-card__desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
  margin-top: 0.25rem;
}
.cf-card__add {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.cf-empty {
  text-align: center;
  color: hsl(var(--muted-foreground));
  padding: 3rem 1rem;
}
.cf-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.cf-group-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.cf-field-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cf-field-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.cf-field-card:hover {
  background: hsl(var(--muted) / 0.45);
}
.cf-field-card__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.cf-required {
  font-size: 11px;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: 999px;
  color: hsl(var(--muted-foreground));
}
.cf-field-card__name {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.cf-field-card__name code {
  font-size: 0.75rem;
  background: hsl(var(--muted));
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.cf-field-card__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.cf-field-card__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.asset-opt__icon-btn--danger:hover {
  color: hsl(var(--danger));
}

.cat-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.cat-node > .cat-children {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid hsl(var(--card-border));
  margin-left: 1.35rem;
}
.cat-node.is-collapsed > .cat-children { display: none; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid hsl(var(--card-border));
}
.cat-node:last-child > .cat-row { border-bottom: 0; }
.cat-row.is-inactive { background: hsl(var(--muted) / 0.35); }
.cat-row.is-editing .asset-opt__view,
.cat-row.is-editing .asset-opt__actions { display: none; }
.cat-row.is-editing .asset-opt__edit { display: flex; }
.cat-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}
.cat-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: hsl(var(--muted) / 0.4);
}
.cat-add--root {
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.cat-add .form-control { flex: 1; }
.cat-row .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  cursor: pointer;
}

.cf-option-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.35);
}
.cf-option-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: hsl(var(--secondary));
  font-size: 0.8rem;
  font-weight: 500;
}
.cf-option-chip__x {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  line-height: 1;
  padding: 0 0.1rem;
  font-size: 1rem;
}
.cf-option-chip__x:hover {
  color: hsl(var(--danger));
}
.cf-empty__icon {
  display: block;
  font-size: 2.5rem;
  opacity: 0.2;
  margin-bottom: 0.75rem;
}
.auto-rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.auto-rule {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--card-border));
}
.auto-rule:last-child { border-bottom: 0; }
.auto-rule.is-inactive { opacity: 0.72; }
.auto-rule__switch { margin-top: 0.15rem; flex-shrink: 0; }
.auto-rule .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  cursor: pointer;
  background-color: hsl(var(--muted));
  border-color: hsl(var(--card-border));
}
.auto-rule .form-check-input:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.auto-rule__body { flex: 1; min-width: 0; }
.auto-rule__name {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.auto-rule__line {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.3rem;
  line-height: 1.5;
}
.auto-rule__kw {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.auto-rule__line code {
  font-size: 0.7rem;
  background: hsl(var(--muted));
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  color: hsl(var(--foreground));
}
.auto-rule__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.auto-builder-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.3);
}
.auto-builder-row .form-select,
.auto-builder-row .form-control { min-width: 0; }
.auto-builder-join {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  width: 2.2rem;
  text-align: center;
  flex-shrink: 0;
}

.comment {
  border-left: 3px solid hsl(var(--primary));
  padding: 0.75rem 1rem;
  background: hsl(var(--card));
  margin-bottom: 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.comment.internal {
  border-left-color: hsl(32 95% 35%);
  background: hsl(var(--warning-light));
}

.priority-urgent { color: hsl(var(--danger)); font-weight: 700; }
.priority-high { color: hsl(32 95% 30%); font-weight: 600; }

.ql-editor { min-height: 140px; background: #fff; }
.tpl-quill .ql-editor { min-height: 180px; }
.tpl-list { display: flex; flex-direction: column; gap: 0.5rem; }
.tpl-card.is-inactive { opacity: 0.5; }
.tpl-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.tpl-card__name { font-size: 0.9rem; }
.tpl-card__actions { display: flex; align-items: center; gap: 0.15rem; flex-shrink: 0; }
.tpl-card__preview {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpl-default {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: hsl(32 95% 92%);
  color: hsl(32 95% 30%);
  border: 1px solid hsl(32 95% 80%);
}
.tpl-scope-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.4rem;
}
.tpl-scope-caret { color: hsl(var(--muted-foreground)); font-size: 0.7rem; }
.tpl-scope-menu { max-height: 18rem; overflow: auto; }
.tpl-card .wms-detail-chip i { margin-right: 0.15rem; }

.badge.bg-new, .badge.bg-open { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.badge.bg-in_progress { background: hsl(var(--info-light)); color: hsl(217 91% 35%); }
.badge.bg-pending, .badge.bg-on_hold, .badge.bg-external { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.badge.bg-resolved { background: hsl(var(--success-light)); color: hsl(var(--success)); }
.badge.bg-closed, .badge.bg-merged { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge.bg-in_stock { background: hsl(var(--info-light)); color: hsl(217 91% 35%); }
.badge.bg-in_use { background: hsl(var(--success-light)); color: hsl(var(--success)); }
.badge.bg-in_repair { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.badge.bg-retired { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.card .table-responsive,
.wms-card .table-responsive {
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.wms-status-pill--new,
.wms-status-pill--open,
.wms-status-pill--picking { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.wms-status-pill--in-progress { background: hsl(var(--info-light)); color: hsl(217 91% 35%); }
.wms-status-pill--pending,
.wms-status-pill--on-hold,
.wms-status-pill--external,
.wms-status-pill--allocated { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.wms-status-pill--resolved,
.wms-status-pill--in-use,
.wms-status-pill--done,
.wms-status-pill--completed { background: hsl(var(--success-light)); color: hsl(var(--success)); }
.wms-status-pill--closed,
.wms-status-pill--merged,
.wms-status-pill--retired { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.wms-status-pill--in-stock,
.wms-status-pill--putaway { background: hsl(var(--info-light)); color: hsl(217 91% 35%); }
.wms-status-pill--in-repair,
.wms-status-pill--blocked { background: hsl(0 85% 96%); color: hsl(0 70% 38%); }

.crm-skin .list-group-item {
  border-color: hsl(var(--card-border));
  background: hsl(var(--card));
}

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .cf-card__head { flex-direction: column; align-items: stretch; }
}

/* Tickets list — quick filters + compact column-filter row */
.ticket-qf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ticket-qf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 0.8rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: 999px;
  background: #fff;
  color: hsl(var(--foreground));
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
}
.ticket-qf:hover,
.ticket-qf:focus {
  border-color: hsl(var(--primary) / 0.4);
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
.ticket-qf.is-active,
.ticket-qf[aria-expanded="true"] {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: #fff;
}
.ticket-qf.is-active:hover,
.ticket-qf[aria-expanded="true"]:hover {
  background: hsl(var(--primary-dark));
  border-color: hsl(var(--primary-dark));
  color: #fff;
}
.ticket-qf i { font-size: 12px; }
.ticket-qf__badge {
  min-width: 1.2rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.ticket-qf.is-active .ticket-qf__badge,
.ticket-qf[aria-expanded="true"] .ticket-qf__badge {
  background: rgb(255 255 255 / 0.22);
  color: #fff;
}
.ticket-qf__badge--alert {
  background: hsl(var(--danger));
  color: #fff;
}
.ticket-qf.is-active .ticket-qf__badge--alert {
  background: #fff;
  color: hsl(var(--danger));
}
.ticket-qf.dropdown-toggle::after {
  margin-left: 0.15rem;
}
.ticket-clear {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 0.45rem;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  border-radius: var(--radius);
}
.ticket-clear:hover { color: hsl(var(--primary)); background: hsl(var(--muted)); }
.ticket-saved-menu { min-width: 16rem; }
.ticket-saved-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
}
.ticket-saved-item a {
  flex: 1;
  min-width: 0;
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 13px;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-saved-item a:hover { background: hsl(var(--muted)); }
.ticket-saved-del {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ticket-saved-del:hover { background: hsl(var(--danger-light)); color: hsl(var(--danger)); }
.wms-filter-row .form-control,
.wms-filter-row .form-select {
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  font-size: 12px;
  padding: 0 0.5rem;
}
.wms-filter-row select.form-select + .select2,
.wms-filter-row select.form-select + .select2 .select2-selection--single,
.wms-filter-row select.form-select + .select2 .select2-selection--multiple {
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  font-size: 12px;
}
.wms-filter-row select.form-select + .select2 .select2-selection--multiple {
  overflow: hidden;
}
.wms-filter-row select.form-select + .select2 .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  height: 28px;
  overflow: hidden;
}
.wms-filter-row select.form-select + .select2 .select2-selection--multiple .select2-selection__choice {
  margin: 0;
  height: 20px;
  line-height: 20px;
  font-size: 11px;
  padding: 0 6px;
  background: hsl(var(--muted));
  border: 0;
  border-radius: 999px;
}
.wms-filter-row select.form-select + .select2 .select2-search--inline .select2-search__field {
  height: 20px;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.ticket-list-table { min-width: 1100px; }

/* ---- To-dos list + kanban ------------------------------------------------ */
.todo-quick-add {
  position: relative;
}
.todo-quick-add > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  pointer-events: none;
}
.todo-quick-add .form-control {
  height: 40px;
  padding-left: 2.2rem;
}
.todo-toolbar-search { width: 12rem; }
.todo-toolbar-search .form-control,
.todo-priority-filter {
  height: 30px;
  min-height: 30px;
  font-size: 12px;
  padding: 0 0.5rem;
}
.todo-priority-filter { width: 9.5rem; }
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.todo-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  cursor: pointer;
}
.todo-card:hover { background: hsl(var(--muted) / 0.45); }
.todo-card.is-compact { padding: 0.6rem; }
.todo-card.is-done { opacity: 0.6; }
.todo-card.is-done .todo-card__title { text-decoration: line-through; color: hsl(var(--muted-foreground)); }
.todo-card__check { padding-top: 0.15rem; }
.todo-card__body { flex: 1; min-width: 0; }
.todo-card__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-decoration: none;
  line-height: 1.3;
}
.todo-card__title:hover { color: hsl(var(--primary)); }
.todo-card__desc {
  margin: 0.2rem 0 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.todo-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.todo-card__due,
.todo-card__people,
.todo-card__ticket {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.todo-card__ticket { color: hsl(var(--primary)); }
.todo-card__ticket:hover { text-decoration: underline; }
.todo-card__due.is-overdue { color: hsl(var(--danger)); font-weight: 600; }
.todo-card__due.is-today { color: hsl(32 95% 30%); font-weight: 600; }
.todo-card__menu { flex-shrink: 0; }
.todo-card__more {
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: 6px;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.todo-card:hover .todo-card__more,
.todo-card__more[aria-expanded="true"] { opacity: 1; }
.todo-card__more:hover { background: hsl(var(--muted)); }
.todo-kanban {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .todo-kanban { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
  .todo-kanban { grid-template-columns: repeat(4, 1fr); }
}
.todo-col { min-width: 0; }
.todo-col__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding: 0 0.15rem;
}
.todo-col__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.todo-col__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.todo-col__dot--open { background: #60a5fa; }
.todo-col__dot--in-progress { background: #facc15; }
.todo-col__dot--on-hold { background: #fb923c; }
.todo-col__dot--done { background: #4ade80; }
.todo-col__dot--user { background: hsl(var(--primary)); }
.todo-col__dot--unassigned { background: #94a3b8; }
.todo-completed {
  margin-top: 0.65rem;
}
.todo-completed summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  padding: 0 0.15rem;
}
.todo-completed summary::-webkit-details-marker { display: none; }
.todo-completed summary::before {
  content: "▸";
  display: inline-block;
  width: 0.9rem;
  font-size: 11px;
}
.todo-completed[open] summary::before { content: "▾"; }
.todo-completed summary:hover { color: hsl(var(--foreground)); }
.todo-completed .todo-col__cards { margin-top: 0.5rem; }
.todo-col__count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.todo-col__cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 4rem;
}
.todo-col__add {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border: 1px dashed hsl(var(--card-border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius);
  font-size: 12px;
}
.todo-col__add:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.todo-overlay .modal-content { overflow: hidden; }
.todo-panel__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--card-border));
}
.todo-panel__header.is-done { background: hsl(142 70% 96%); }
.todo-panel__title {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0;
  box-shadow: none;
}
.todo-panel__title:focus { outline: none; box-shadow: none; }
.todo-panel__title-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.todo-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.2rem;
}
.todo-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.todo-panel__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
}
@media (min-width: 768px) {
  .todo-panel__grid { grid-template-columns: 1.4fr 0.8fr; }
}
.todo-panel__desc { min-height: 12rem; }
.todo-panel__comments { margin-top: 1.25rem; }
.todo-panel__comments h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.todo-panel__side {
  border-top: 1px solid hsl(var(--card-border));
  padding-top: 1rem;
}
@media (min-width: 768px) {
  .todo-panel__side {
    border-top: 0;
    border-left: 1px solid hsl(var(--card-border));
    padding: 0 0 0 1.25rem;
  }
}
.todo-panel__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid hsl(var(--card-border));
  background: hsl(var(--muted) / 0.35);
}
.todo-panel-page .todo-panel__header { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.wms-seg__item i { font-size: 13px; }

/* ---- Reports ------------------------------------------------------------- */
.report-filters .form-label { font-size: 11px; color: hsl(var(--muted-foreground)); }
.report-filter-control {
  height: 30px;
  min-height: 30px;
  font-size: 12px;
  padding: 0 0.5rem;
  width: auto;
  min-width: 9.5rem;
}
.report-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--card-border));
  border-radius: 9px;
}
@media (min-width: 768px) {
  .report-tabs { grid-template-columns: repeat(6, 1fr); }
}
.report-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.report-tab:hover { color: hsl(var(--primary)); }
.report-tab.is-active {
  background: #fff;
  color: hsl(var(--primary));
  font-weight: 600;
  box-shadow: 0 1px 2px hsl(240 5% 0% / 0.08);
}
.report-chart,
.report-chart-lg { position: relative; }
.report-chart { height: 260px; }
.report-chart-lg { height: 300px; }
.report-donut {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}
.report-donut__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.report-donut__label strong { font-size: 1.6rem; line-height: 1; }
.report-donut__label span { font-size: 12px; color: hsl(var(--muted-foreground)); }
.report-sla {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.report-sla:last-child { margin-bottom: 0; }
.report-sla i { font-size: 1.1rem; }
.report-sla div { flex: 1; }
.report-sla small { color: hsl(var(--muted-foreground)); }
.report-sla b { font-size: 1.25rem; }
.report-sla--ok { background: hsl(var(--success) / 0.1); color: hsl(var(--success)); }
.report-sla--warn { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.report-sla--bad { background: hsl(var(--danger) / 0.1); color: hsl(var(--danger)); }
.report-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  font-size: 10px;
  font-weight: 700;
}
.report-rate { font-weight: 600; }
.report-rate--success { color: hsl(var(--success)); }
.report-rate--warning { color: hsl(32 95% 30%); }
.report-rate--danger { color: hsl(var(--danger)); }
.wms-status-pill--expired { background: hsl(var(--danger) / 0.12); color: hsl(var(--danger)); }

/* AI Agents */
.agent-kill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  border: 1px solid hsl(var(--success) / 0.35);
  border-radius: var(--radius);
  background: hsl(var(--success) / 0.08);
}
.agent-kill.is-paused {
  border-color: hsl(var(--warning) / 0.45);
  background: hsl(var(--warning-light));
}
.agent-kill__lead {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}
.agent-kill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: hsl(var(--success) / 0.18);
  color: hsl(var(--success));
  flex-shrink: 0;
}
.agent-kill.is-paused .agent-kill__icon {
  background: hsl(32 95% 30% / 0.12);
  color: hsl(32 95% 30%);
}
.agent-kill__title { font-weight: 600; }
.agent-kill__lead p { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.agent-kill__end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.agent-tabs a.asset-field-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.agent-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.agent-card.is-off { opacity: 0.78; }
.agent-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.agent-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  flex-shrink: 0;
}
.agent-card__title { font-weight: 600; font-size: 1.05rem; }
.agent-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.agent-stat {
  padding: 0.75rem 0.9rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.agent-stat__label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.agent-stat__value { font-size: 1.35rem; font-weight: 650; line-height: 1.2; }
.agent-stat__hint { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.agent-mode-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.agent-mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.agent-mode-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  cursor: pointer;
  min-height: 100%;
}
.agent-mode-tile:hover { background: hsl(var(--muted) / 0.45); }
.agent-mode-tile.is-active {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.25);
}
.agent-mode-tile__desc {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.agent-mode-badge {
  display: inline-flex;
  align-items: center;
  text-transform: capitalize;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.agent-mode-badge.is-off { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.agent-mode-badge.is-shadow { background: hsl(217 91% 95%); color: hsl(217 91% 35%); }
.agent-mode-badge.is-suggest { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.agent-mode-badge.is-auto { background: hsl(var(--success) / 0.14); color: hsl(var(--success)); }
.agent-flag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.agent-prompt {
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: hsl(var(--muted) / 0.5);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0;
  max-height: 16rem;
  overflow: auto;
}
.agent-decision {
  display: inline-flex;
  align-items: center;
  text-transform: capitalize;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: hsl(var(--muted));
}
.agent-decision.is-auto_applied { background: hsl(var(--success) / 0.14); color: hsl(var(--success)); }
.agent-decision.is-suggested { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.agent-decision.is-shadowed { background: hsl(217 91% 95%); color: hsl(217 91% 35%); }
.agent-decision.is-queued { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.agent-decision.is-errored { background: hsl(var(--danger) / 0.12); color: hsl(var(--danger)); }
.agent-decision.is-skipped { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.agent-kill .form-check-input,
.agent-card .form-check-input,
.agent-flag .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  cursor: pointer;
}
@media (max-width: 900px) {
  .agent-kill { flex-direction: column; align-items: stretch; }
  .agent-mode-grid { grid-template-columns: 1fr 1fr; }
}

/* Integrations + Roles */
.int-card .cf-card__head { align-items: flex-start; }
.int-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  flex-shrink: 0;
}
.int-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: hsl(var(--success));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.int-badge--down {
  background: hsl(var(--danger) / 0.12);
  color: hsl(var(--danger));
}
.int-features { display: flex; flex-direction: column; gap: 0.5rem; }
.int-feature {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.55);
}
.int-feature__ok { color: hsl(var(--success)); flex-shrink: 0; margin-top: 0.15rem; }
.int-section-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin: 1.25rem 0 0.65rem;
}
.kuma-how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.kuma-how .int-feature { justify-content: flex-start; }
.kuma-url {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.kuma-url .form-control { font-size: 0.75rem; }
.kuma-monitors { display: flex; flex-direction: column; gap: 0.5rem; }
.kuma-monitor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.kuma-monitor__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.int-priority {
  display: inline-flex;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.int-priority--low { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.int-priority--medium { background: hsl(var(--warning-light)); color: hsl(32 95% 30%); }
.int-priority--high { background: hsl(32 95% 92%); color: hsl(24 90% 35%); }
.int-priority--urgent { background: hsl(var(--danger) / 0.12); color: hsl(var(--danger)); }
.role-card--admin {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.05);
}
.role-card__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.role-card__icon { font-size: 1.15rem; color: hsl(var(--primary)); flex-shrink: 0; }
.role-chip {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.role-chip--user {
  background: hsl(217 91% 95%);
  color: hsl(217 91% 35%);
  border-color: hsl(217 91% 85%);
}
.role-chip--viewer {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--card-border));
}
.role-group {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}
.role-sep { margin: 1rem 0; border-color: hsl(var(--card-border)); opacity: 1; }
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.role-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
}
.role-cell__label { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.role-cell .form-check-input,
.int-card .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  cursor: pointer;
}
@media (max-width: 900px) {
  .kuma-how { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .kuma-url { flex-wrap: wrap; }
}

.dash-tabs {
  grid-template-columns: repeat(3, 1fr);
  max-width: 28rem;
}
.dash-grid {
  display: grid;
  gap: 1rem;
}
.dash-grid--2 { grid-template-columns: 1fr; }
.dash-grid--3 { grid-template-columns: 1fr; }
.dash-grid--4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 768px) {
  .dash-grid--2 { grid-template-columns: 1fr 1fr; }
  .dash-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .dash-grid--4 { grid-template-columns: repeat(4, 1fr); }
}
a.dash-kpi, a.dash-row, a.dash-person, a.dash-sla, a.dash-bar, a.dash-mini, a.dash-deadline, a.dash-alert {
  text-decoration: none;
  color: inherit;
}
.dash-kpi {
  display: block;
  padding: 1rem 1.1rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
a.dash-kpi:hover, .dash-kpi:hover {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: var(--shadow-card);
}
.dash-kpi__main { display: block; color: inherit; text-decoration: none; }
.dash-kpi__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.35rem;
}
.dash-kpi__head i { opacity: 0.7; }
.dash-kpi__value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
}
.dash-kpi__hint, .dash-kpi__meta {
  margin-top: 0.35rem;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.dash-kpi__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--card-border));
  background: hsl(var(--muted));
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.dash-chip--urgent, .dash-chip--breached, .dash-chip--critical { background: hsl(var(--danger) / 0.12); border-color: hsl(var(--danger) / 0.25); color: hsl(var(--danger)); }
.dash-chip--high, .dash-chip--warn, .dash-chip--warning { background: hsl(32 95% 92%); border-color: hsl(32 90% 80%); color: hsl(32 95% 30%); }
.dash-chip--medium, .dash-chip--at_risk { background: hsl(var(--warning-light)); border-color: hsl(48 90% 75%); color: hsl(32 95% 30%); }
.dash-chip--low, .dash-chip--on_track, .dash-chip--approaching { background: hsl(var(--success) / 0.12); border-color: hsl(var(--success) / 0.25); color: hsl(var(--success)); }
.dash-progress {
  display: block;
  height: 6px;
  background: hsl(var(--muted));
  border-radius: 999px;
  overflow: hidden;
}
.dash-progress__bar {
  display: block;
  height: 100%;
  background: hsl(var(--muted-foreground));
}
.dash-progress__bar.is-ok { background: hsl(var(--success)); }
.dash-progress__bar.is-warn { background: hsl(32 95% 46%); }
.dash-progress__bar.is-bad { background: hsl(var(--danger)); }
.dash-progress__bar.is-info { background: hsl(217 91% 50%); }
.dash-progress__bar.is-muted { background: hsl(var(--muted-foreground) / 0.5); }
.dash-sla {
  display: block;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--card-border));
}
.dash-sla--bad { background: hsl(var(--danger) / 0.08); border-color: hsl(var(--danger) / 0.2); color: hsl(var(--danger)); }
.dash-sla--warn { background: hsl(var(--warning-light)); border-color: hsl(48 90% 75%); color: hsl(32 95% 30%); }
.dash-sla--ok { background: hsl(var(--success) / 0.1); border-color: hsl(var(--success) / 0.25); color: hsl(var(--success)); }
.dash-sla__label { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 0.35rem; }
.dash-sla__value { font-size: 1.5rem; font-weight: 700; margin-top: 0.2rem; }
.dash-person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.35rem;
  margin: 0 -0.35rem;
  border-radius: var(--radius);
}
.dash-person:hover { background: hsl(var(--muted) / 0.7); }
.dash-person__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-person__text { flex: 1; min-width: 0; }
.dash-person__name { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-person__urgent { display: block; font-size: 11px; color: hsl(var(--danger)); }
.dash-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.4rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.35);
}
.dash-row:last-child { margin-bottom: 0; }
.dash-row:hover { background: hsl(var(--muted) / 0.7); }
.dash-row__num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
.dash-row__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.dash-row__meta { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.dash-todo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0;
}
.dash-todo__check {
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0;
  cursor: pointer;
}
.dash-todo__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dash-todo__due { font-size: 12px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
.dash-todo__due.is-overdue { color: hsl(var(--danger)); }
.dash-todo__due.is-today { color: hsl(32 95% 38%); }
.dash-deadlines { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.dash-deadline {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius);
  border-left-width: 4px;
}
.dash-deadline span { min-width: 0; flex: 1; }
.dash-deadline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.dash-deadline__title { display: block; font-size: 13px; font-weight: 500; margin-top: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-deadline__time { display: block; font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 0.15rem; }
.dash-deadline--breached, .dash-deadline--critical { border-left-color: hsl(var(--danger)); background: hsl(var(--danger) / 0.06); }
.dash-deadline--urgent { border-left-color: hsl(24 90% 48%); background: hsl(24 90% 48% / 0.06); }
.dash-deadline--at_risk, .dash-deadline--warning { border-left-color: hsl(48 95% 45%); background: hsl(var(--warning-light)); }
.dash-deadline--approaching { border-left-color: hsl(217 91% 50%); background: hsl(217 91% 50% / 0.06); }
.dash-deadline--on_track { border-left-color: hsl(var(--success)); background: hsl(var(--success) / 0.06); }
.dash-bar { display: block; margin-bottom: 0.75rem; }
.dash-bar:last-child { margin-bottom: 0; }
.dash-alert {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--card-border));
  margin-bottom: 0.5rem;
  font-size: 13px;
}
.dash-alert--bad { background: hsl(var(--danger) / 0.08); border-color: hsl(var(--danger) / 0.2); }
.dash-alert--warn { background: hsl(var(--warning-light)); border-color: hsl(48 90% 75%); }
.dash-mini {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  padding: 0.35rem 0.15rem;
}
.dash-mini span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: hsl(var(--foreground)); }
.dash-mini span:last-child { flex-shrink: 0; }

@media print {
  .wms-sidenav, .wms-header, .dev-banner, .report-toolbar, .report-filters, .report-tabs, .wms-flash-stack {
    display: none !important;
  }
  .wms-main, .wms-content { margin: 0 !important; padding: 0 !important; }
  body.wms-app { background: #fff !important; }
}
