:root {
  color-scheme: light;
  --bs-body-font-size: 1rem;
  --bs-btn-font-size: 1rem;
  --app-font-size-base: 1rem;
  --app-font-size-sm: .875rem;
  --app-font-size-xs: .8125rem;
  --app-radius: .571rem;
  --app-radius-sm: .429rem;
  --app-radius-pill: 999rem;
  --app-control-height: 3rem;
  --app-control-height-sm: 2.286rem;
  --app-control-height-lg: 3.714rem;
  --app-icon-size: 3rem;
  --app-icon-size-sm: 2.143rem;
  --app-check-size: 1.143rem;
  --app-blue: #2563eb;
  --app-blue-strong: #1d4ed8;
  --app-blue-soft: #eff6ff;
  --app-sky: #06b6d4;
  --app-green: #059669;
  --app-amber: #b45309;
  --app-red: #e11d48;
  --app-bg: #f7f9fc;
  --app-surface: #ffffff;
  --app-surface-2: #f8fafc;
  --app-surface-3: #edf2f7;
  --app-text: #172033;
  --app-muted: #64748b;
  --app-border: #e2e8f0;
  --app-sidebar: #ffffff;
  --app-sidebar-text: #20304a;
  --app-topbar: rgba(255, 255, 255, .94);
  --app-shadow: 0 22px 48px rgba(15, 23, 42, .10);
  --app-shadow-soft: 0 12px 28px rgba(15, 23, 42, .06);
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --app-blue: #60a5fa;
  --app-blue-strong: #93c5fd;
  --app-blue-soft: rgba(96, 165, 250, .14);
  --app-sky: #22d3ee;
  --app-green: #34d399;
  --app-amber: #f59e0b;
  --app-red: #fb7185;
  --app-bg: #111827;
  --app-surface: #172033;
  --app-surface-2: #1d293d;
  --app-surface-3: #26364f;
  --app-text: #f8fafc;
  --app-muted: #aab7ca;
  --app-border: #2d3d56;
  --app-sidebar: #0f172a;
  --app-sidebar-text: #e5edf8;
  --app-topbar: rgba(17, 24, 39, .92);
  --app-shadow: 0 18px 42px rgba(0, 0, 0, .28);
  --app-shadow-soft: 0 10px 24px rgba(0, 0, 0, .18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  font-size: 87.5%;
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--app-blue-soft) 48%, transparent) 0, transparent 270px),
    var(--app-bg);
  color: var(--app-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  font-size: var(--app-font-size-base);
  line-height: 1.5;
  letter-spacing: 0;
  overflow-x: hidden;
  text-rendering: geometricPrecision;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-weight: 500;
}


a {
  color: var(--app-blue);
}

.text-secondary {
  color: var(--app-muted) !important;
}

.app-layout {
  min-height: 100vh;
}

.app-sidebar {
  background: var(--app-sidebar);
  border-right: 1px solid var(--app-border);
  color: var(--app-sidebar-text);
  display: flex;
  flex-direction: column;
  inset: 0 auto 0 0;
  overflow: hidden;
  padding: 0;
  position: fixed;
  transition: transform .22s ease, width .22s ease;
  width: 284px;
  z-index: 1040;
}

.sidebar-header {
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  flex-shrink: 0;
  min-height: 72px;
  padding: 0 .85rem;
}

.sidebar-nav {
  flex: 1 1 0;
  overflow-y: auto;
  padding: .5rem .85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--app-border) transparent;
}

.sidebar-footer {
  border-top: 1px solid var(--app-border);
  flex-shrink: 0;
  padding: .75rem .85rem;
}

.toolbar-icon-sm {
  height: var(--app-icon-size-sm);
  min-width: var(--app-icon-size-sm);
  padding: 0;
  width: var(--app-icon-size-sm);
}

.app-brand {
  color: var(--app-sidebar-text);
  font-weight: 600;
  letter-spacing: 0;
}

.brand-mark {
  align-items: center;
  background: var(--app-blue);
  border-radius: var(--app-radius);
  color: #fff;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.brand-copy small {
  color: var(--app-muted);
  display: block;
  font-size: .75rem;
  font-weight: 500;
}

.nav-section {
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  margin: 1.25rem .75rem .5rem;
  text-transform: uppercase;
}

.sidebar-link {
  align-items: center;
  border-radius: var(--app-radius);
  color: var(--app-sidebar-text);
  display: flex;
  font-size: .875rem;
  font-weight: 500;
  gap: .75rem;
  margin: .08rem 0;
  min-height: 38px;
  padding: .5rem .7rem;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--app-blue-soft);
  color: var(--app-blue-strong);
}

.sidebar-link i {
  font-size: 1rem;
  width: 1.2rem;
}

.nav-badge {
  background: var(--app-surface-3);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-pill);
  color: var(--app-muted);
  font-size: .75rem;
  margin-left: auto;
  padding: .08rem .45rem;
}

.sidebar-upgrade {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: .85rem;
}

.app-main {
  margin-left: 284px;
  min-height: 100vh;
  transition: margin-left .22s ease;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: var(--app-topbar);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  gap: .9rem;
  min-height: 72px;
  padding: .78rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-search {
  flex: 1 1 260px;
  max-width: 600px;
  min-width: 200px;
  width: auto;
}

.topbar-search .form-control {
  min-height: var(--app-control-height);
}

.toolbar-icon {
  align-items: center;
  border-radius: var(--app-radius);
  display: inline-flex;
  height: var(--app-icon-size);
  justify-content: center;
  width: var(--app-icon-size);
}

.content-wrap {
  margin: 0 auto;
  max-width: 1480px;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-header .breadcrumb {
  font-size: .8125rem;
}

.page-header .breadcrumb-item a {
  color: var(--app-muted);
  text-decoration: none;
}

.page-header .breadcrumb-item a:hover {
  color: var(--app-blue);
}

.page-header .breadcrumb-item.active {
  color: var(--app-text);
  font-weight: 500;
}

.page-subtitle {
  margin-top: .2rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.topbar .page-actions {
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.surface,
.metric-card,
.table-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
}

.surface-plain {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}

.soft-surface {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
}

.metric-card {
  --metric-accent: var(--app-blue);
  --metric-accent-soft: color-mix(in srgb, var(--app-blue) 9%, var(--app-surface));
  background: var(--app-surface);
  min-height: 132px;
  overflow: hidden;
  padding: 1.05rem;
  position: relative;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.metric-card::before,
.metric-card::after {
  border-radius: 50%;
  content: '';
  pointer-events: none;
  position: absolute;
}

.metric-card::before {
  border: 10px solid color-mix(in srgb, var(--app-blue) 10%, transparent);
  bottom: -12px;
  height: 54px;
  right: -12px;
  width: 54px;
}

.metric-card::after {
  border: 4px solid color-mix(in srgb, var(--app-blue) 5%, transparent);
  bottom: -28px;
  height: 80px;
  right: -28px;
  width: 80px;
}

.metric-card:hover {
  border-color: color-mix(in srgb, var(--app-blue) 28%, var(--app-border));
  box-shadow: var(--app-shadow);
  transform: translateY(-1px);
}

.metric-card.success {
  --metric-accent: var(--app-green);
  --metric-accent-soft: color-mix(in srgb, var(--app-green) 10%, var(--app-surface));
}

.metric-card.warning {
  --metric-accent: var(--app-amber);
  --metric-accent-soft: color-mix(in srgb, var(--app-amber) 10%, var(--app-surface));
}

.metric-card.danger {
  --metric-accent: var(--app-red);
  --metric-accent-soft: color-mix(in srgb, var(--app-red) 10%, var(--app-surface));
}

.metric-value {
  font-size: clamp(1.3rem, 1.7vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

.metric-label {
  color: var(--app-muted);
  font-size: .8125rem;
  font-weight: 500;
}

.metric-trend {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: .75rem;
  font-weight: 500;
  gap: .25rem;
  line-height: 1;
  padding: .28rem .55rem;
}

.trend-up {
  background: rgba(22, 163, 74, .12);
  border-color: rgba(5, 150, 105, .14);
  color: var(--app-green);
}

.trend-down {
  background: rgba(220, 38, 38, .12);
  border-color: rgba(225, 29, 72, .14);
  color: var(--app-red);
}

.icon-box {
  align-items: center;
  background: var(--metric-accent-soft, color-mix(in srgb, var(--app-blue) 9%, var(--app-surface)));
  border: 1px solid color-mix(in srgb, var(--metric-accent, var(--app-blue)) 14%, transparent);
  border-radius: var(--app-radius);
  color: var(--metric-accent, var(--app-blue-strong));
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.icon-box.success {
  background: color-mix(in srgb, var(--app-green) 10%, var(--app-surface));
  border-color: color-mix(in srgb, var(--app-green) 16%, transparent);
  color: var(--app-green);
}

.icon-box.warning {
  background: color-mix(in srgb, var(--app-amber) 10%, var(--app-surface));
  border-color: color-mix(in srgb, var(--app-amber) 16%, transparent);
  color: var(--app-amber);
}

.icon-box.danger {
  background: color-mix(in srgb, var(--app-red) 10%, var(--app-surface));
  border-color: color-mix(in srgb, var(--app-red) 16%, transparent);
  color: var(--app-red);
}

.btn {
  align-items: center;
  border-radius: var(--app-radius);
  display: inline-flex;
  font-size: var(--app-font-size-base);
  font-weight: 500;
  gap: .429rem;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: var(--app-control-height);
  padding: .643rem 1rem;
}

.btn-sm {
  font-size: var(--app-font-size-sm);
  min-height: var(--app-control-height-sm);
  padding: .429rem .75rem;
}

.btn-lg {
  font-size: 1.125rem;
  min-height: var(--app-control-height-lg);
  padding: .75rem 1.25rem;
}

.btn i {
  line-height: 1;
}

.btn-primary {
  --bs-btn-bg: var(--app-blue);
  --bs-btn-border-color: var(--app-blue);
  --bs-btn-hover-bg: var(--app-blue-strong);
  --bs-btn-hover-border-color: var(--app-blue-strong);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-blue-strong);
  --bs-btn-border-color: rgba(23, 105, 224, .35);
  --bs-btn-hover-bg: var(--app-blue);
  --bs-btn-hover-border-color: var(--app-blue);
}

.dropdown-menu {
  background: var(--app-surface);
  border-color: var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--app-text);
}

.dropdown-item {
  color: var(--app-text);
}

.dropdown-item:hover {
  background: var(--app-blue-soft);
  color: var(--app-blue-strong);
}

.form-control,
.form-select,
.input-group-text {
  background-color: var(--app-surface);
  border-radius: var(--app-radius);
  border-color: var(--app-border);
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  line-height: 1.4;
}

.form-control,
.form-select {
  min-height: var(--app-control-height);
  padding-bottom: .643rem;
  padding-top: .643rem;
}

.form-control {
  padding-left: .875rem;
  padding-right: .875rem;
}

.form-select {
  padding-left: .875rem;
  padding-right: 2.25rem;
}

.input-group-text {
  min-height: var(--app-control-height);
  padding-left: .875rem;
  padding-right: .875rem;
}

.form-label {
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  font-weight: 500;
  margin-bottom: .429rem;
}

.form-text,
.valid-feedback,
.invalid-feedback {
  font-size: var(--app-font-size-sm);
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--app-muted) 75%, transparent);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--app-surface);
  border-color: var(--app-blue);
  box-shadow: 0 0 0 .2rem rgba(23, 105, 224, .14);
  color: var(--app-text);
}

.form-check-input {
  border-color: var(--app-border);
  height: var(--app-check-size);
  width: var(--app-check-size);
}

.form-check-input:checked {
  background-color: var(--app-blue);
  border-color: var(--app-blue);
}

.badge {
  border-radius: 999px;
  font-weight: 600;
}

.badge-soft {
  background: var(--app-blue-soft);
  color: var(--app-blue-strong);
}

.badge-soft-success {
  background: rgba(22, 163, 74, .13);
  color: var(--app-green);
}

.badge-soft-warning {
  background: rgba(217, 119, 6, .14);
  color: var(--app-amber);
}

.badge-soft-danger {
  background: rgba(220, 38, 38, .12);
  color: var(--app-red);
}

.avatar {
  align-items: center;
  background: var(--app-blue-soft);
  border: 1px solid rgba(23, 105, 224, .15);
  border-radius: 50%;
  color: var(--app-blue-strong);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 600;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.avatar-sm {
  font-size: .75rem;
  height: 2.143rem;
  width: 2.143rem;
}

.avatar-lg {
  font-size: 1.15rem;
  height: 3.714rem;
  width: 3.714rem;
}

/* Bootstrap pagination — design tokens */
.page-link {
  background-color: var(--app-surface);
  border-color: var(--app-border);
  border-radius: var(--app-radius-sm) !important;
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  min-height: 2.571rem;
  min-width: 2.571rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .6rem;
}

.page-link:hover {
  background-color: var(--app-blue-soft);
  border-color: var(--app-blue);
  color: var(--app-blue-strong);
}

.page-item.active .page-link {
  background-color: var(--app-blue);
  border-color: var(--app-blue);
  color: #fff;
}

.page-item.disabled .page-link {
  background-color: var(--app-surface-2);
  border-color: var(--app-border);
  color: var(--app-muted);
}

.pagination {
  gap: .25rem;
}

.status-dot {
  align-items: center;
  display: inline-flex;
  gap: .4rem;
}

.status-dot::before {
  background: var(--app-green);
  border-radius: 50%;
  content: "";
  height: .48rem;
  width: .48rem;
}

.status-dot.warning::before {
  background: var(--app-amber);
}

.status-dot.danger::before {
  background: var(--app-red);
}

.progress-thin {
  background: var(--app-surface-3);
  border-radius: var(--app-radius-pill);
  height: .5rem;
  overflow: hidden;
}

.progress-thin span {
  background: var(--app-blue);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.chart-card {
  min-height: 330px;
}

.timeline {
  display: grid;
  gap: .95rem;
}

.timeline-item {
  display: grid;
  gap: .75rem;
  grid-template-columns: 2.429rem 1fr;
}

.timeline-icon {
  align-items: center;
  background: var(--app-blue-soft);
  border-radius: 50%;
  color: var(--app-blue-strong);
  display: inline-flex;
  height: 2.429rem;
  justify-content: center;
  width: 2.429rem;
}

/* ── UI Kit masonry layout ───────────────────────────────────── */
.uk-masonry {
  column-gap: 1rem;
  columns: 1;
}

@media (min-width: 768px) {
  .uk-masonry { columns: 2; }
}

@media (min-width: 1280px) {
  .uk-masonry { columns: 3; }
}

.uk-card {
  break-inside: avoid;
  display: inline-block;
  margin-bottom: 1rem;
  width: 100%;
}

.kit-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kit-tile {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  min-height: 104px;
  padding: 1rem;
}

.kit-tile-icon {
  align-items: center;
  background: var(--app-blue-soft);
  border-radius: var(--app-radius);
  color: var(--app-blue-strong);
  display: inline-flex;
  height: 2.429rem;
  justify-content: center;
  width: 2.429rem;
}

.kit-empty-state {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px dashed var(--app-border);
  border-radius: var(--app-radius);
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 2rem;
  text-align: center;
}

.kit-skeleton {
  background: linear-gradient(90deg, var(--app-surface-2), var(--app-surface-3), var(--app-surface-2));
  background-size: 200% 100%;
  border-radius: var(--app-radius-sm);
  min-height: .85rem;
  overflow: hidden;
}

.kit-skeleton.is-loading {
  animation: skeleton-loading 1.2s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.kit-stepper {
  display: grid;
  gap: .75rem;
}

.kit-step {
  align-items: flex-start;
  display: grid;
  gap: .75rem;
  grid-template-columns: 2rem minmax(0, 1fr);
  position: relative;
}

.kit-step:not(:last-child)::after {
  background: var(--app-border);
  bottom: -.7rem;
  content: "";
  left: 1rem;
  position: absolute;
  top: 2.25rem;
  width: 1px;
}

.kit-step-number {
  align-items: center;
  background: var(--app-blue);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: .8125rem;
  font-weight: 600;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.kit-code {
  background: var(--app-sidebar);
  border-radius: var(--app-radius);
  color: var(--app-sidebar-text);
  display: block;
  font-size: .8125rem;
  margin: 0;
  overflow-x: auto;
  padding: 1rem;
  white-space: pre;
}

.kbd-key {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-bottom-width: 2px;
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  display: inline-flex;
  font-size: .75rem;
  font-weight: 600;
  min-width: 1.8rem;
  padding: .18rem .45rem;
  text-align: center;
}

.kit-toolbar {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.kit-toolbar-search {
  flex: 1 1 100%;
  min-width: 0;
}

.kit-toolbar-select {
  flex: 1 1 9rem;
  min-width: 0;
}

.kit-toolbar-action {
  flex: 1 1 auto;
  min-width: 7rem;
}

.kit-chip {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-pill);
  color: var(--app-text);
  display: inline-flex;
  font-size: .8125rem;
  font-weight: 600;
  gap: .35rem;
  min-height: 2.143rem;
  padding: .25rem .75rem;
}

.kit-chip.active,
.kit-chip:hover {
  background: var(--app-blue-soft);
  border-color: color-mix(in srgb, var(--app-blue) 34%, var(--app-border));
  color: var(--app-blue-strong);
}

.kit-dropzone {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px dashed color-mix(in srgb, var(--app-blue) 42%, var(--app-border));
  border-radius: var(--app-radius);
  color: var(--app-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: 1.5rem;
  text-align: center;
}

.kit-dropzone:hover {
  background: color-mix(in srgb, var(--app-blue-soft) 64%, var(--app-surface));
}

.kit-uploader {
  position: relative;
}

.kit-uploader__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.kit-uploader__zone {
  margin: 0;
  width: 100%;
  transition: background .15s ease, border-color .15s ease;
}

.kit-uploader__icon {
  color: var(--app-blue-strong);
  font-size: 1.75rem;
  margin-bottom: .5rem;
}

.kit-uploader.is-dragging .kit-uploader__zone {
  background: color-mix(in srgb, var(--app-blue-soft) 64%, var(--app-surface));
  border-color: var(--app-blue);
}

.kit-uploader.is-invalid .kit-uploader__zone,
.kit-uploader.is-invalid .kit-uploader__preview {
  border-color: var(--app-red);
}

.kit-uploader__preview {
  position: relative;
  display: none;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
  background: var(--app-surface-2);
}

.kit-uploader.is-filled .kit-uploader__zone {
  display: none;
}

.kit-uploader.is-filled .kit-uploader__preview {
  display: block;
}

.kit-uploader__image {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  background:
    repeating-conic-gradient(color-mix(in srgb, var(--app-text) 6%, transparent) 0% 25%, transparent 0% 50%)
    50% / 18px 18px;
}

.kit-uploader__remove {
  position: absolute;
  top: .5rem;
  right: .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  color: #fff;
  background: color-mix(in srgb, var(--app-red) 86%, #000);
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
}

.kit-uploader__remove:hover,
.kit-uploader__remove:focus {
  color: #fff;
  background: var(--app-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-red) 24%, transparent);
}

.kit-uploader__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 100%;
  padding: .4rem .75rem;
  color: #fff;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, #000 72%, transparent));
}

.kit-file-row,
.kit-notification,
.kit-integration,
.kit-event,
.kit-result,
.kit-banner {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  display: flex;
  gap: .75rem;
  padding: .75rem;
}

.kit-banner {
  align-items: flex-start;
}

.kit-banner > i {
  color: var(--app-blue-strong);
  font-size: 1.15rem;
  margin-top: .1rem;
}

.kit-banner.warning > i { color: var(--app-amber); }
.kit-banner.danger > i { color: var(--app-red); }

.kit-command {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: .75rem;
}

.kit-command-list {
  display: grid;
  gap: .35rem;
}

.kit-command-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  display: flex;
  gap: .75rem;
  padding: .65rem;
  text-align: left;
  width: 100%;
}

.kit-command-item:hover {
  background: var(--app-surface);
}

.kit-command-icon,
.kit-notification-icon,
.kit-result-icon {
  align-items: center;
  background: var(--app-blue-soft);
  border-radius: var(--app-radius);
  color: var(--app-blue-strong);
  display: inline-flex;
  flex-shrink: 0;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.kit-notification-icon.success,
.kit-result-icon.success {
  background: color-mix(in srgb, var(--app-green) 12%, var(--app-surface));
  color: var(--app-green);
}

.kit-notification-icon.warning,
.kit-result-icon.warning {
  background: color-mix(in srgb, var(--app-amber) 12%, var(--app-surface));
  color: var(--app-amber);
}

.kit-result-icon.danger {
  background: color-mix(in srgb, var(--app-red) 12%, var(--app-surface));
  color: var(--app-red);
}

.kit-permission {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
}

.kit-permission-row {
  align-items: center;
  display: grid;
  gap: .65rem;
  grid-template-columns: minmax(0, 1fr) repeat(3, 3.2rem);
  padding: .75rem;
}

.kit-permission-row + .kit-permission-row {
  border-top: 1px solid var(--app-border);
}

.kit-permission-head {
  background: var(--app-surface-2);
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.kit-message,
.kit-receipt,
.kit-plan,
.kit-inline-editor {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 1rem;
}

.kit-chat-row {
  align-items: flex-start;
  display: flex;
  gap: .65rem;
}

.kit-chat-row.own {
  justify-content: flex-end;
}

.kit-chat-bubble {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  max-width: 78%;
  padding: .65rem .75rem;
}

.kit-chat-row.own .kit-chat-bubble {
  background: var(--app-blue);
  border-color: var(--app-blue);
  color: #fff;
}

.kit-receipt-row,
.kit-receipt-total {
  border-top: 1px solid var(--app-border);
  display: flex;
  justify-content: space-between;
  padding: .65rem 0;
}

.kit-receipt-total {
  font-size: 1rem;
  font-weight: 700;
}

.kit-event {
  align-items: flex-start;
}

.kit-event-date {
  align-items: center;
  background: var(--app-blue-soft);
  border-radius: var(--app-radius);
  color: var(--app-blue-strong);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 4rem;
  padding: .5rem;
  text-align: center;
}

.kit-event-date span {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.kit-event-date strong {
  font-size: 1.5rem;
  line-height: 1.1;
}

.kit-check-row {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  display: flex;
  gap: .65rem;
  padding: .65rem .75rem;
}

.kit-density {
  display: grid;
  gap: .65rem;
}

.kit-density-option {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-text);
  display: flex;
  justify-content: space-between;
  padding: .75rem;
  text-align: left;
}

.kit-density-option.active,
.kit-density-option:hover {
  border-color: color-mix(in srgb, var(--app-blue) 42%, var(--app-border));
  box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--app-blue) 9%, transparent);
}

@media (max-width: 767.98px) {
  .kit-toolbar > * {
    flex-basis: 100%;
    width: 100%;
  }

  .kit-permission-row {
    grid-template-columns: minmax(0, 1fr) repeat(3, 2.5rem);
  }

  .kit-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

.quick-action {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  color: var(--app-text);
  display: flex;
  gap: .75rem;
  padding: .6rem .75rem;
  text-decoration: none;
}

.quick-action:hover {
  border-color: rgba(23, 105, 224, .38);
  color: var(--app-blue-strong);
}

.table-card {
  overflow: hidden;
}

.table-card-header {
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.05rem;
}

.table-card-header > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
}

.table-card-title {
  letter-spacing: 0;
  margin: 0;
}

.table-card-subtitle {
  color: var(--app-muted);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}

.filter-bar {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 1rem;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--app-border);
  --bs-table-color: var(--app-text);
  font-size: .875rem;
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: .82rem .95rem;
}

.table tbody tr:hover {
  background: color-mix(in srgb, var(--app-blue-soft) 52%, transparent);
}

.table .action-stack {
  display: inline-flex;
  gap: .35rem;
  white-space: nowrap;
}

.action-btn {
  align-items: center;
  border-radius: var(--app-radius);
  display: inline-flex;
  height: var(--app-control-height-sm);
  justify-content: center;
  padding: 0;
  width: var(--app-control-height-sm);
}

.datatable-wrapper {
  color: var(--app-text);
}

.datatable-wrapper.no-footer .datatable-container {
  border-bottom: 0;
}

/* replace float-based default layout with flex */
.datatable-top,
.datatable-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .7rem 1rem;
}

.datatable-top::after,
.datatable-bottom::after {
  display: none;
}

.datatable-top {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.datatable-bottom {
  background: var(--app-surface);
  border-top: 1px solid var(--app-border);
}

.datatable-dropdown label {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  font-size: .8125rem;
  gap: .5rem;
}

.datatable-search {
  margin-left: auto;
}

.datatable-selector,
.datatable-input {
  background-color: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-text);
  float: none;
  font-size: var(--app-font-size-sm);
  min-height: var(--app-control-height-sm);
  outline: 0;
}

.datatable-selector {
  padding: .45rem 2rem .45rem .7rem;
}

.datatable-input {
  min-width: min(260px, 72vw);
  padding: .45rem .8rem;
}

.datatable-input:focus,
.datatable-selector:focus {
  border-color: var(--app-blue);
  box-shadow: 0 0 0 .2rem rgba(23, 105, 224, .14);
}

.datatable-container {
  border: 0 !important;
  overflow-x: auto;
}

.datatable-table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  min-width: 780px;
  width: 100%;
}

.datatable-table > thead > tr > th {
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: .875rem;
  font-weight: 600;
  padding: .78rem .95rem;
  vertical-align: middle;
  white-space: nowrap;
}

.datatable-table > thead > tr > th > button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
  text-align: inherit;
  text-transform: inherit;
}

.datatable-table > tbody > tr > td {
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: .875rem;
  padding: .78rem .95rem;
  vertical-align: middle;
  white-space: nowrap;
}

.datatable-table > tbody > tr:last-child > td {
  border-bottom: 0;
}

.datatable-table > tbody > tr:hover > td {
  background: var(--app-surface-2);
}

.datatable-sorter,
.datatable-filter {
  color: inherit;
  display: inline-block;
  height: 100%;
  padding-right: 1rem;
  position: relative;
  text-decoration: none;
  width: 100%;
}

.datatable-sorter::before {
  border-top-color: var(--app-muted) !important;
  opacity: .45;
}

.datatable-sorter::after {
  border-bottom-color: var(--app-muted) !important;
  opacity: .45;
}

.datatable-table th.no-sort .datatable-sorter {
  padding-right: 0;
}

.datatable-table th.no-sort .datatable-sorter::before,
.datatable-table th.no-sort .datatable-sorter::after {
  display: none;
}

.datatable-info {
  color: var(--app-muted);
  font-size: var(--app-font-size-sm);
}

/* pagination — reset floats, apply flex */
.datatable-pagination {
  margin-left: auto;
}

.datatable-pagination-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.datatable-pagination-list-item {
  float: none;
}

/* 3-class chain (.datatable-wrapper + li + link) beats any CDN rule */
.datatable-wrapper .datatable-pagination-list-item .datatable-pagination-list-item-link {
  align-items: center;
  background: transparent;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-text);
  cursor: pointer;
  display: inline-flex;
  float: none;
  font-family: inherit;
  font-size: var(--app-font-size-sm);
  justify-content: center;
  line-height: 1;
  min-height: var(--app-control-height-sm);
  min-width: var(--app-control-height-sm);
  padding: .25rem .55rem;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}

.datatable-wrapper .datatable-pagination-list-item .datatable-pagination-list-item-link:hover {
  background: var(--app-blue-soft);
  border-color: var(--app-blue);
  color: var(--app-blue-strong);
}

.datatable-wrapper .datatable-pagination-list-item.datatable-active .datatable-pagination-list-item-link,
.datatable-wrapper .datatable-pagination-list-item.datatable-active .datatable-pagination-list-item-link:focus,
.datatable-wrapper .datatable-pagination-list-item.datatable-active .datatable-pagination-list-item-link:hover {
  background: var(--app-blue);
  border-color: var(--app-blue);
  color: #fff;
  cursor: default;
}

.datatable-wrapper .datatable-pagination-list-item.datatable-disabled .datatable-pagination-list-item-link,
.datatable-wrapper .datatable-pagination-list-item.datatable-disabled .datatable-pagination-list-item-link:hover {
  background: transparent;
  cursor: not-allowed;
  opacity: .4;
}

.datatable-wrapper .datatable-pagination-list-item.datatable-ellipsis .datatable-pagination-list-item-link {
  border-color: transparent;
  cursor: default;
}

.select2-container {
  max-width: 100%;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-text);
  min-height: var(--app-control-height);
}

.select2-container .select2-selection--single {
  align-items: center;
  display: flex;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  line-height: 1.35;
  padding-left: .875rem;
  padding-right: 2.4rem;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: color-mix(in srgb, var(--app-muted) 75%, transparent);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: .65rem;
  top: 0;
  width: 1rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--app-muted) transparent transparent transparent;
  border-width: 5px 4px 0 4px;
  margin-left: -4px;
  margin-top: -2px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--app-muted) transparent;
  border-width: 0 4px 5px 4px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: var(--app-blue);
  box-shadow: 0 0 0 .2rem rgba(23, 105, 224, .14);
}

.select2-container--default .select2-selection--multiple {
  cursor: text;
  padding: .26rem .44rem .18rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .34rem;
  padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  align-items: center;
  background: var(--app-blue-soft);
  border: 0;
  border-radius: 999px;
  color: var(--app-blue-strong);
  display: inline-flex;
  float: none;
  font-size: var(--app-font-size-sm);
  gap: .35rem;
  margin: 0;
  padding: .2rem .55rem .2rem .35rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  margin-right: .2rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: var(--app-blue);
}

.select2-container--default .select2-search--inline {
  line-height: 1;
}

.select2-container--default .select2-search--inline .select2-search__field {
  color: var(--app-text);
  font-family: inherit;
  font-size: var(--app-font-size-base);
  margin: 0;
  min-height: 2rem;
}

.select2-dropdown {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--app-text);
  overflow: hidden;
  z-index: 1085;
}

.select2-container--open .select2-dropdown--below {
  border-top: 1px solid var(--app-border);
  margin-top: .35rem;
}

.select2-container--open .select2-dropdown--above {
  border-bottom: 1px solid var(--app-border);
  margin-top: -.35rem;
}

.select2-search--dropdown {
  padding: .45rem;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  font-family: inherit;
  outline: 0;
  padding: .5rem .65rem;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--app-blue);
  box-shadow: 0 0 0 .2rem rgba(23, 105, 224, .12);
}

.select2-results__options {
  padding: .35rem;
}

.select2-container--default .select2-results__option {
  border-radius: var(--app-radius-sm);
  color: var(--app-text);
  font-size: var(--app-font-size-base);
  padding: .55rem .65rem;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
  background: var(--app-blue-soft);
  color: var(--app-blue-strong);
  font-weight: 600;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--app-blue);
  color: #fff;
}

.auth-shell {
  background: var(--app-bg);
  min-height: 100vh;
}

.auth-visual {
  background:
    linear-gradient(145deg, rgba(23, 105, 224, .96), rgba(8, 35, 82, .98)),
    #0b3372;
  color: #fff;
  min-height: 100vh;
}

.auth-panel {
  max-width: 500px;
}

.auth-feature {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  padding: 1rem;
}

.modal-content {
  background: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
}

.btn-close {
  filter: none;
}

[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.permission-grid {
  display: grid;
  gap: .75rem;
}

.permission-row {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: .75rem;
  grid-template-columns: 1.2fr repeat(4, minmax(72px, .4fr));
  padding: .8rem;
}

.ticket-board {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.playbook-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ticket-lane {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow-soft);
  min-height: 210px;
  padding: 1rem;
}

.invoice-preview {
  min-height: 100%;
}

.invoice-preview .h5 {
  font-size: 1rem;
}

.profile-cover {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
  position: relative;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.profile-cover-banner::before {
  background: var(--app-blue);
  border-radius: var(--app-radius-pill);
  content: "";
  height: .286rem;
  left: 1.25rem;
  pointer-events: none;
  position: absolute;
  top: 1.25rem;
  width: 4rem;
}

.profile-cover-banner::after {
  border: 10px solid color-mix(in srgb, var(--app-blue) 9%, transparent);
  border-radius: 50%;
  bottom: -2.2rem;
  content: "";
  height: 7.2rem;
  pointer-events: none;
  position: absolute;
  right: -2rem;
  width: 7.2rem;
}

.profile-cover:hover {
  border-color: color-mix(in srgb, var(--app-blue) 28%, var(--app-border));
  box-shadow: var(--app-shadow);
}

.profile-cover-banner {
  align-items: flex-start;
  background: var(--app-surface);
  border-bottom: 1px solid color-mix(in srgb, var(--app-blue) 12%, var(--app-border));
  display: flex;
  height: 96px;
  justify-content: flex-end;
  overflow: hidden;
  padding: 1rem 1.25rem;
  position: relative;
}

.profile-cover-kicker {
  background: color-mix(in srgb, var(--app-surface) 92%, var(--app-blue-soft));
  border: 1px solid color-mix(in srgb, var(--app-blue) 18%, var(--app-border));
  border-radius: var(--app-radius);
  color: var(--app-muted);
  display: grid;
  gap: .1rem;
  justify-items: end;
  padding: .6rem .78rem;
  position: relative;
  text-align: right;
  z-index: 1;
}

.profile-cover-kicker span {
  font-size: .75rem;
  font-weight: 500;
}

.profile-cover-kicker strong {
  color: var(--app-text);
  font-size: .875rem;
  font-weight: 600;
}

.profile-identity {
  align-items: center;
  background: var(--app-surface);
  display: flex;
  gap: 1.25rem;
  padding: 0 1.25rem 1.15rem;
  position: relative;
  z-index: 1;
}

.profile-avatar-wrap {
  flex-shrink: 0;
  margin-top: -2.35rem;
  position: relative;
}

.profile-avatar-upload {
  border-radius: 50%;
  bottom: .2rem;
  height: 1.857rem;
  padding: 0;
  position: absolute;
  right: -.1rem;
  width: 1.857rem;
}

.profile-avatar {
  background: color-mix(in srgb, var(--app-blue) 9%, var(--app-surface));
  border: .286rem solid var(--app-surface);
  box-shadow: 0 .8rem 1.9rem rgba(15, 23, 42, .14);
  color: var(--app-blue-strong);
  font-size: 1.35rem;
  height: 5.143rem;
  width: 5.143rem;
}

.profile-summary {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: .95rem;
}

.profile-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.profile-status {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.profile-meta {
  color: var(--app-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .8125rem;
  gap: .4rem 1rem;
  margin-top: .3rem;
}

.profile-meta span {
  align-items: center;
  display: inline-flex;
  gap: .35rem;
  min-width: 0;
}

.profile-meta i {
  color: var(--app-blue);
}

.profile-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
  padding-top: .95rem;
}

.color-grid,
.docs-stack {
  display: grid;
  gap: .8rem;
}

.docs-meta-grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.color-swatch {
  align-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: .75rem;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: .75rem;
}

.color-swatch > span {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: block;
  height: 42px;
  width: 42px;
}

.color-swatch small {
  color: var(--app-muted);
  display: block;
}

.docs-section {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

.docs-section-title {
  align-items: center;
  display: flex;
  gap: .65rem;
}

.docs-section-title i {
  color: var(--app-blue);
}

.docs-code {
  background: var(--app-sidebar);
  border-radius: var(--app-radius);
  color: var(--app-sidebar-text);
  display: block;
  font-size: .8125rem;
  margin: .75rem 0 0;
  overflow-x: auto;
  padding: .85rem;
  white-space: pre;
}

.docs-section li {
  margin: .35rem 0;
}

@media (max-width: 1199.98px) {
  .topbar-search {
    display: none;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-board,
  .playbook-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Sidebar collapse (desktop only) ─────────────────────────── */
@media (min-width: 992px) {
  .sidebar-collapsed .app-sidebar {
    width: 64px;
  }

  .sidebar-collapsed .app-main {
    margin-left: 64px;
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-section,
  .sidebar-collapsed .sidebar-link-label,
  .sidebar-collapsed .nav-badge,
  .sidebar-collapsed .sidebar-user-info {
    display: none !important;
  }

  .sidebar-collapsed .sidebar-header {
    display: flex;
    justify-content: center;
    padding: 1rem .5rem;
  }

  .sidebar-collapsed .sidebar-nav {
    padding-left: 0;
    padding-right: 0;
    scrollbar-width: none;
  }

  .sidebar-collapsed .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: .55rem 0;
  }

  .sidebar-collapsed .sidebar-link i {
    width: auto;
  }

  .sidebar-collapsed .sidebar-footer {
    padding: .75rem .5rem;
  }

  .sidebar-collapsed .sidebar-footer > div {
    justify-content: center;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .sidebar-open .app-sidebar {
    box-shadow: var(--app-shadow);
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    max-width: 100vw;
    overflow-x: hidden;
    width: 100vw;
  }

  .sidebar-backdrop {
    background: rgba(0, 0, 0, .48);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 1030;
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .content-wrap {
    max-width: 100vw;
    overflow-x: hidden;
    padding: 1rem;
  }

  .content-wrap > .row {
    --bs-gutter-x: 0;
  }

  .content-wrap > .row > * {
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  .topbar {
    display: grid;
    gap: .6rem;
    grid-template-columns: 42px minmax(0, 1fr);
    max-width: 100vw;
    padding: .75rem 1rem;
    width: 100vw;
  }

  .topbar-title h1 {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-title .text-secondary {
    display: none;
  }

  .page-actions .btn span,
  .topbar .btn span {
    display: none;
  }

  .topbar .page-actions {
    display: none !important;
  }

  .filter-bar,
  .quick-grid,
  .ticket-board,
  .playbook-grid,
  .profile-cover {
    grid-template-columns: 1fr;
  }

  .filter-bar .d-flex {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-bar .toolbar-icon {
    display: none;
  }

  .profile-cover-banner {
    height: 92px;
    justify-content: flex-start;
    margin-bottom: 0;
    padding: .85rem 1rem;
    position: relative;
  }

  .profile-cover-kicker {
    justify-items: start;
    text-align: left;
  }

  .profile-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: .75rem;
    padding: 0 1rem 1rem;
  }

  .profile-avatar-wrap {
    margin-top: -2rem;
  }

  .profile-summary {
    padding-top: 0;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding-top: 0;
    width: 100%;
  }

  .profile-actions .btn {
    justify-content: center;
  }

  .table-card-header .page-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    width: 100%;
  }

  .table-card-header .page-actions .btn {
    width: 100%;
  }

  .datatable-top,
  .datatable-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .datatable-dropdown label,
  .datatable-search,
  .datatable-input {
    width: 100%;
  }

  .permission-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Breadcrumb / page header (already in layout) ───────────── */

/* ─── Password strength bar ──────────────────────────────────── */
.password-strength {
  background: var(--app-surface-2);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}

.password-strength-bar {
  border-radius: 4px;
  height: 100%;
  transition: width .3s ease, background .3s ease;
  width: 0;
}

/* ─── Dark mode extras ────────────────────────────────────────── */
[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ─── Error pages ─────────────────────────────────────────────── */
.error-page {
  align-items: center;
  background: var(--app-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1.5rem;
  text-align: center;
}

.error-code {
  color: var(--app-blue);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: .5rem;
  opacity: .12;
}

.error-graphic {
  background: var(--app-blue-soft);
  border-radius: 50%;
  color: var(--app-blue);
  font-size: 2.2rem;
  height: 80px;
  line-height: 80px;
  margin: -3.5rem auto 1.5rem;
  width: 80px;
}

.error-graphic--warning {
  background: color-mix(in srgb, var(--app-amber) 12%, var(--app-surface));
  color: var(--app-amber);
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

.error-description {
  color: var(--app-muted);
  font-size: .875rem;
  margin-bottom: 1.75rem;
  max-width: 380px;
}

.error-brand {
  margin-top: 3rem;
  opacity: .5;
}

/* ─── Toast notifications ─────────────────────────────────────── */
.toast-stack {
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  position: fixed;
  right: 1.25rem;
  width: 320px;
  z-index: 1090;
}

.toast-item {
  align-items: flex-start;
  animation: toast-in .22s ease;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--app-blue);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  display: flex;
  gap: .75rem;
  padding: .85rem 1rem;
}

.toast-item.toast-success { border-left-color: var(--app-green); }
.toast-item.toast-warning { border-left-color: var(--app-amber); }
.toast-item.toast-danger  { border-left-color: var(--app-red); }

.toast-icon { color: var(--app-blue); font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.toast-item.toast-success .toast-icon { color: var(--app-green); }
.toast-item.toast-warning .toast-icon { color: var(--app-amber); }
.toast-item.toast-danger  .toast-icon { color: var(--app-red); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: .875rem; font-weight: 600; }
.toast-message { color: var(--app-muted); font-size: .8125rem; margin-top: .1rem; }

.toast-close {
  background: transparent;
  border: 0;
  color: var(--app-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: .875rem;
  line-height: 1;
  padding: 0;
}
.toast-close:hover { color: var(--app-text); }

.toast-item.toast-leaving { animation: toast-out .2s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}

/* ─── Kanban board ────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .5rem;
}

.kanban-col {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 400px;
  width: 272px;
}

.kanban-col-header {
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  gap: .5rem;
  padding: .85rem 1rem;
}

.kanban-col-title {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  flex: 1;
}

.kanban-count {
  background: var(--app-border);
  border-radius: 20px;
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 600;
  padding: .1rem .45rem;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .6rem;
  min-height: 5rem;
  padding: .75rem;
}

.kanban-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  cursor: grab;
  padding: .85rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.kanban-card:active { cursor: grabbing; }

.kanban-board.is-sorting .kanban-cards {
  outline: 1px dashed color-mix(in srgb, var(--app-border) 78%, transparent);
  outline-offset: -.35rem;
}

.kanban-card-chosen {
  border-color: color-mix(in srgb, var(--app-blue) 40%, var(--app-border));
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
}

.kanban-card-ghost {
  background: var(--app-blue-soft);
  border-color: color-mix(in srgb, var(--app-blue) 32%, var(--app-border));
  box-shadow: none;
  opacity: .55;
}

.kanban-card-drag {
  box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
  transform: rotate(.4deg);
}

.kanban-card-title { font-size: .875rem; font-weight: 500; margin-bottom: .4rem; }

.kanban-card-meta {
  align-items: center;
  color: var(--app-muted);
  display: flex;
  font-size: .75rem;
  gap: .5rem;
}

.kanban-card-tag {
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .45rem;
}

.kanban-add-btn {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--app-border);
  border-radius: 0 0 10px 10px;
  color: var(--app-muted);
  cursor: pointer;
  font-size: .8125rem;
  padding: .65rem 1rem;
  text-align: left;
  transition: background .15s, color .15s;
  width: 100%;
}
.kanban-add-btn:hover { background: var(--app-blue-soft); color: var(--app-blue); }

/* ─── Calendar ────────────────────────────────────────────────── */
.calendar-grid {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  max-width: 100%;
  overflow: hidden;
}

.calendar-toolbar {
  min-width: 0;
}

.calendar-toolbar .btn,
.calendar-toolbar .btn-group {
  min-width: 0;
}

.calendar-library {
  background: var(--app-surface);
  overflow-x: auto;
  overflow-y: hidden;
  padding: .75rem;
}

.calendar-library .fc {
  color: var(--app-text);
  font-family: inherit;
  font-size: .875rem;
}

.calendar-library .fc-theme-standard td,
.calendar-library .fc-theme-standard th,
.calendar-library .fc-theme-standard .fc-scrollgrid {
  border-color: var(--app-border);
}

.calendar-library .fc-theme-standard .fc-scrollgrid {
  border-radius: 8px;
  overflow: hidden;
}

.calendar-library .fc-col-header-cell {
  background: var(--app-surface-2);
}

.calendar-library .fc-col-header-cell-cushion {
  color: var(--app-muted);
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .7rem .5rem;
  text-decoration: none;
  text-transform: uppercase;
}

.calendar-library .fc-daygrid-day-number,
.calendar-library .fc-timegrid-axis-cushion,
.calendar-library .fc-timegrid-slot-label-cushion,
.calendar-library .fc-list-day-text,
.calendar-library .fc-list-day-side-text {
  color: var(--app-muted);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
}

.calendar-library .fc-daygrid-day-number {
  padding: .5rem .55rem;
}

.calendar-library .fc-day-other {
  background: var(--app-surface-2);
}

.calendar-library .fc-day-today {
  background: color-mix(in srgb, var(--app-blue) 5%, var(--app-surface)) !important;
}

.calendar-library .fc-day-today .fc-daygrid-day-number {
  align-items: center;
  background: var(--app-blue);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  height: 1.55rem;
  justify-content: center;
  margin: .25rem;
  padding: 0;
  width: 1.55rem;
}

.calendar-library .fc-daygrid-day-frame {
  min-height: 7rem;
}

.calendar-library .fc-event {
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 500;
  margin: .1rem .35rem;
  padding: .14rem .42rem;
}

.calendar-library .fc-event-main {
  color: inherit;
}

.calendar-library .fc-event.ev-blue,
.calendar-library .fc-list-event.ev-blue .fc-list-event-dot {
  background: var(--app-blue-soft);
  color: var(--app-blue-strong);
}

.calendar-library .fc-event.ev-green,
.calendar-library .fc-list-event.ev-green .fc-list-event-dot {
  background: color-mix(in srgb, var(--app-green) 12%, var(--app-surface));
  color: color-mix(in srgb, var(--app-green) 80%, #000);
}

.calendar-library .fc-event.ev-amber,
.calendar-library .fc-list-event.ev-amber .fc-list-event-dot {
  background: color-mix(in srgb, var(--app-amber) 12%, var(--app-surface));
  color: color-mix(in srgb, var(--app-amber) 80%, #000);
}

.calendar-library .fc-event.ev-red,
.calendar-library .fc-list-event.ev-red .fc-list-event-dot {
  background: color-mix(in srgb, var(--app-red) 12%, var(--app-surface));
  color: color-mix(in srgb, var(--app-red) 80%, #000);
}

.calendar-library .fc-list,
.calendar-library .fc-list-table td,
.calendar-library .fc-list-day-cushion {
  background: var(--app-surface);
  border-color: var(--app-border);
}

.calendar-library .fc-list-event:hover td {
  background: var(--app-surface-2);
}

/* Sticky upcoming events sidebar */
.calendar-sidebar {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  scrollbar-width: thin;
  scrollbar-color: var(--app-border) transparent;
  top: 80px;
}

.calendar-ev-item {
  align-items: flex-start;
  background: var(--app-surface-2);
  border-radius: 8px;
  display: flex;
  gap: .6rem;
  padding: .55rem .65rem;
}

.calendar-ev-date {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}

.calendar-ev-month {
  color: var(--app-muted);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

.calendar-ev-day {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.calendar-event {
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 500;
  margin-bottom: .2rem;
  overflow: hidden;
  padding: .15rem .4rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.ev-blue  { background: var(--app-blue-soft); color: var(--app-blue-strong); }
.calendar-event.ev-green { background: color-mix(in srgb, var(--app-green) 12%, var(--app-surface)); color: color-mix(in srgb, var(--app-green) 80%, #000); }
.calendar-event.ev-amber { background: color-mix(in srgb, var(--app-amber) 12%, var(--app-surface)); color: color-mix(in srgb, var(--app-amber) 80%, #000); }
.calendar-event.ev-red   { background: color-mix(in srgb, var(--app-red) 12%, var(--app-surface)); color: color-mix(in srgb, var(--app-red) 80%, #000); }

/* ─── Donut chart ─────────────────────────────────────────────── */
.donut-chart-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart { transform: rotate(-90deg); overflow: visible; }

.donut-center {
  left: 50%;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
}

.donut-center-value { font-size: 1.5rem; font-weight: 600; line-height: 1; }
.donut-center-label { color: var(--app-muted); font-size: .75rem; margin-top: .2rem; }

.donut-legend { display: flex; flex-direction: column; gap: .55rem; }

.donut-legend-item { align-items: center; display: flex; font-size: .8125rem; gap: .55rem; }
.donut-legend-dot { border-radius: 3px; flex-shrink: 0; height: 10px; width: 10px; }
.donut-legend-label { color: var(--app-muted); flex: 1; }
.donut-legend-value { font-weight: 600; }

/* ─── Sparkline ───────────────────────────────────────────────── */
.sparkline-list { display: flex; flex-direction: column; gap: .85rem; }

.sparkline-row {
  display: grid;
  align-items: center;
  gap: .75rem;
  grid-template-columns: 1fr 60px 48px;
}

.sparkline-label { font-size: .8125rem; }

.sparkline-bar-wrap {
  background: var(--app-surface-2);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.sparkline-bar {
  background: var(--app-blue);
  border-radius: 4px;
  height: 100%;
  transition: width .4s ease;
}

.sparkline-pct { color: var(--app-muted); font-size: .75rem; text-align: right; }

/* ─── Notification card ───────────────────────────────────────── */
.notif-card {
  align-items: flex-start;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: 10px;
  display: flex;
  gap: .85rem;
  padding: .85rem 1rem;
  position: relative;
  transition: border-color .15s;
}

.notif-card:hover { border-color: color-mix(in srgb, var(--app-blue) 30%, transparent); }

.notif-card.unread { background: color-mix(in srgb, var(--app-blue) 4%, var(--app-surface)); }

.notif-card.unread::before {
  background: var(--app-blue);
  border-radius: 50%;
  content: '';
  height: 7px;
  position: absolute;
  right: .85rem;
  top: .85rem;
  width: 7px;
}

.notif-card-body { flex: 1 1 0; min-width: 0; }

.notif-card-title { font-size: .875rem; line-height: 1.4; }

.notif-card-desc { color: var(--app-muted); font-size: .8125rem; margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notif-card-meta { align-items: flex-end; display: flex; flex-direction: column; flex-shrink: 0; gap: .35rem; }

.notif-card-time { color: var(--app-muted); font-size: .75rem; white-space: nowrap; }

.notif-group-label {
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: .5rem;
  padding: 0 .25rem;
  text-transform: uppercase;
}

/* ─── Storefront / Product catalog ───────────────────────────── */
.product-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}

.product-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.product-img {
  align-items: center;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-icon {
  font-size: 4.5rem;
  opacity: .75;
}

.product-badge {
  border-radius: 4px;
  font-size: .7rem;
  left: .625rem;
  position: absolute;
  top: .625rem;
}

.product-wishlist {
  align-items: center;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,.82);
  border: none;
  border-radius: 50%;
  color: var(--app-muted);
  cursor: pointer;
  display: flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: .625rem;
  top: .625rem;
  transition: color .18s ease, background .18s ease;
  width: 32px;
}

.product-wishlist:hover { color: #ef4444; }

.product-body { padding: .875rem; }

.product-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  font-weight: 600;
  line-clamp: 2;
  line-height: 1.35;
  min-height: 2.7em;
  overflow: hidden;
}

.star-rating { color: #f59e0b; font-size: .8rem; }

.shop-filter-section {
  border-bottom: 1px solid var(--app-border);
  padding: .875rem 1rem;
}

.shop-filter-section:last-child { border-bottom: none; }

.shop-filter-title {
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  margin-bottom: .75rem;
  text-transform: uppercase;
}

.shop-tag {
  align-items: center;
  background: var(--app-blue);
  background-clip: padding-box;
  border: none;
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-size: .75rem;
  gap: .35rem;
  padding: .2rem .5rem;
}

.shop-tag-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.shop-tag-close:hover { color: #fff; }

.outline-ring {
  box-shadow: 0 0 0 2px var(--app-surface), 0 0 0 4px var(--app-blue);
}

/* ─── Empty state ─────────────────────────────────────────────── */
.datatable-empty {
  color: var(--app-muted);
  font-size: .875rem;
  padding: 3rem 1rem;
  text-align: center;
}

/* ─── Print styles (invoice detail) ──────────────────────────── */
@media print {
  .app-sidebar, .topbar, .page-header, .invoice-print-actions { display: none !important; }
  .app-main { margin: 0 !important; }
  .content-wrap { padding: 0 !important; }
  .invoice-print-body {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  body { background: #fff !important; color: #000 !important; }
  @page { margin: 1.5cm; }
}

/* ─── Mobile additions for new pages ─────────────────────────── */
@media (max-width: 767.98px) {
  .kanban-col { width: 240px; }

  .toast-stack {
    bottom: .75rem;
    right: .75rem;
    width: calc(100vw - 1.5rem);
  }

  .calendar-library { padding: .4rem; }
  .calendar-library .fc { font-size: .8125rem; }
  .calendar-library .fc-view-harness { min-width: 42rem; }
  .calendar-library .fc-col-header-cell-cushion { font-size: .6875rem; padding: .55rem .15rem; }
  .calendar-library .fc-daygrid-day-frame { min-height: 5rem; }
  .calendar-library .fc-event { font-size: .6875rem; margin-inline: .2rem; }
  .page-actions.calendar-toolbar {
    display: grid !important;
    gap: .55rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
  .page-actions.calendar-toolbar > .btn,
  .page-actions.calendar-toolbar > .btn-group {
    min-width: 0;
    width: 100%;
  }
  .page-actions.calendar-toolbar .btn-group {
    display: grid !important;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: -1;
  }
  .page-actions.calendar-toolbar .btn-group .btn {
    flex: none;
    min-width: 0;
    width: 100%;
  }
  .page-actions.calendar-toolbar .btn {
    font-size: .8125rem;
    justify-content: center;
    padding-left: .55rem;
    padding-right: .55rem;
  }
  .calendar-create-action {
    grid-column: 4;
    min-width: 0;
  }
  .calendar-sidebar { max-height: unset; position: static; }
}

.app-toast {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-soft);
  color: var(--app-text);
}

.app-toast .toast-body {
  padding: .85rem 1rem;
}

.app-toast__icon {
  font-size: 1.1rem;
  line-height: 1.4;
}

.app-toast--success {
  border-left-color: var(--app-green);
}

.app-toast--success .app-toast__icon {
  color: var(--app-green);
}

.app-toast--error {
  border-left-color: var(--app-red);
}

.app-toast--error .app-toast__icon {
  color: var(--app-red);
}
