/* Boutique Manager — layout fixes on top of maguva.css */

/* Hide inactive tab panes (maguva expects #adminMainTabContent wrapper) */
#adminMainTabContent > .tab-pane {
  display: none !important;
}

#adminMainTabContent > .tab-pane.active {
  display: block !important;
}

/* Content-sized main area — avoid huge empty white block below short pages */
body[data-maguva-unified-shell="1"] #adminMainTabContent > .tab-pane.active {
  min-height: 0 !important;
  background: transparent !important;
}

.maguva-main-content {
  align-self: flex-start;
}

@media (min-width: 768px) {
  .maguva-chrome {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .maguva-chrome > .maguva-app-shell.admin-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .admin-shell > .row {
    height: calc(100dvh - 56px);
    max-height: calc(100dvh - 56px);
    min-height: 0 !important;
    overflow: hidden;
  }

  .admin-shell .maguva-app-nav.sidebar {
    height: calc(100dvh - 56px);
    max-height: calc(100dvh - 56px);
    min-height: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    align-self: flex-start;
    position: sticky;
    top: 56px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.45) rgba(255, 255, 255, 0.12);
  }

  .admin-shell .maguva-app-nav.sidebar::-webkit-scrollbar {
    width: 8px;
  }

  .admin-shell .maguva-app-nav.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }

  .admin-shell .maguva-app-nav.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 4px;
  }

  .admin-shell .maguva-app-nav.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.58);
  }

  .admin-shell .maguva-main-content {
    height: calc(100dvh - 56px);
    max-height: calc(100dvh - 56px);
    min-height: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    align-self: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════
   Boutique global UI — light glass shell & soft surfaces
   ═══════════════════════════════════════════════════════════ */
body[data-maguva-unified-shell="1"] {
  --boutique-radius: 1.25rem;
  --boutique-radius-sm: 0.875rem;
  --boutique-blur: blur(18px);
  --boutique-surface: rgba(255, 255, 255, 0.78);
  --boutique-shadow: 0 14px 40px rgba(17, 24, 39, 0.07);
  --boutique-shadow-hover: 0 20px 48px rgba(111, 66, 193, 0.14);
  --boutique-muted: #6b7280;
  --boutique-field-border: 1px solid rgba(17, 24, 39, 0.16);
  --boutique-field-border-hover: 1px solid rgba(17, 24, 39, 0.24);
  --boutique-field-border-focus: 1px solid rgba(111, 66, 193, 0.5);
  --boutique-field-bg: #fff;
  --boutique-field-focus-ring: 0 0 0 3px rgba(111, 66, 193, 0.12);
  background: linear-gradient(155deg, #eee8ff 0%, #f8f6ff 28%, #f3f6fb 62%, #fdeff8 100%) !important;
  background-attachment: fixed !important;
}

body[data-maguva-unified-shell="1"] .navbar-maguva {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(111, 66, 193, 0.08) !important;
  box-shadow: 0 8px 32px rgba(17, 24, 39, 0.05) !important;
}

body[data-maguva-unified-shell="1"] .maguva-brand-word { color: var(--maguva-primary-dark); }

body[data-maguva-unified-shell="1"] .maguva-brand-mark {
  background: linear-gradient(135deg, var(--maguva-primary), var(--maguva-accent));
  color: #fff;
  box-shadow: 0 6px 18px rgba(111, 66, 193, 0.28);
}

body[data-maguva-unified-shell="1"] .boutique-nav-client,
body[data-maguva-unified-shell="1"] .boutique-nav-user {
  font-size: 0.8125rem;
  color: var(--boutique-muted);
}

body[data-maguva-unified-shell="1"] .boutique-nav-user {
  font-weight: 600;
  color: #374151;
}

body[data-maguva-unified-shell="1"] .boutique-nav-logout {
  border-radius: 999px;
  border: 1px solid rgba(111, 66, 193, 0.18);
  color: var(--maguva-primary);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.35rem 0.85rem;
}

body[data-maguva-unified-shell="1"] .boutique-nav-logout:hover {
  background: rgba(111, 66, 193, 0.08);
  color: var(--maguva-primary-dark);
}

@media (min-width: 768px) {
  body[data-maguva-unified-shell="1"] .maguva-app-shell > .row {
    background: transparent !important;
  }

  body[data-maguva-unified-shell="1"] .maguva-app-nav {
    background: rgba(255, 255, 255, 0.52) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid rgba(111, 66, 193, 0.08) !important;
  }

  body[data-maguva-unified-shell="1"] .maguva-app-shell > .row > main,
  body[data-maguva-unified-shell="1"] .admin-shell .maguva-main-content {
    background: transparent !important;
    border-left: none !important;
    padding: 1.35rem 1.65rem 2rem !important;
  }

  body[data-maguva-unified-shell="1"] .admin-shell .maguva-app-nav.sidebar {
    scrollbar-color: rgba(111, 66, 193, 0.25) transparent;
  }

  body[data-maguva-unified-shell="1"] .admin-shell .maguva-app-nav.sidebar::-webkit-scrollbar-thumb {
    background: rgba(111, 66, 193, 0.22);
  }
}

body[data-maguva-unified-shell="1"] .maguva-nav-heading {
  color: rgba(111, 66, 193, 0.55) !important;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  padding-left: 0.85rem;
}

body[data-maguva-unified-shell="1"] .maguva-app-nav .maguva-nav-pills > .nav-item > .nav-link {
  color: #5b6472 !important;
  border-bottom: none !important;
  border-radius: 0.85rem !important;
  margin: 0.15rem 0.55rem;
  padding: 0.6rem 0.85rem !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

body[data-maguva-unified-shell="1"] .maguva-app-nav .maguva-nav-pills .nav-link i {
  color: var(--maguva-primary);
  opacity: 0.85;
}

body[data-maguva-unified-shell="1"] .maguva-app-nav .maguva-nav-pills .nav-link:hover:not(.active) {
  background: rgba(111, 66, 193, 0.07) !important;
  color: var(--maguva-primary-dark) !important;
}

body[data-maguva-unified-shell="1"] .maguva-app-nav .maguva-nav-pills > .nav-item > .nav-link[data-admin-tab].active {
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.16), rgba(214, 51, 132, 0.1)) !important;
  color: var(--maguva-primary-dark) !important;
  box-shadow: inset 0 0 0 1px rgba(111, 66, 193, 0.12);
  font-weight: 700;
}

body[data-maguva-unified-shell="1"] .maguva-app-nav .maguva-nav-pills > .nav-item > .nav-link[data-admin-tab].active::before {
  display: none !important;
}

body[data-maguva-unified-shell="1"] .maguva-app-nav .maguva-nav-pills .nav-link.active i {
  color: var(--maguva-primary-dark) !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .h4,
body[data-maguva-unified-shell="1"] .maguva-main-content h2.h4 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--maguva-primary-dark);
  margin-bottom: 0.35rem !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .tab-pane > p.text-muted:first-of-type,
body[data-maguva-unified-shell="1"] .maguva-main-content .maguva-tab-pane > p.text-muted:first-of-type {
  color: var(--boutique-muted) !important;
  font-size: 0.9375rem;
  margin-bottom: 1.25rem !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .card {
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  border-radius: var(--boutique-radius) !important;
  background: var(--boutique-surface) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--boutique-shadow) !important;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .card:hover {
  box-shadow: var(--boutique-shadow-hover) !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .card-header {
  background: transparent !important;
  border-bottom: none !important;
  padding: 1.15rem 1.35rem 0 !important;
  font-weight: 700;
  color: #374151;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .card-body {
  padding: 1.15rem 1.35rem 1.35rem !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .card-body.border-bottom {
  border-bottom: 1px solid rgba(111, 66, 193, 0.08) !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4b5563;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .form-control:not(.wi-readonly-field),
body[data-maguva-unified-shell="1"] .maguva-main-content .form-select,
body[data-maguva-unified-shell="1"] .boutique-input {
  border: var(--boutique-field-border);
  border-radius: var(--boutique-radius-sm);
  background: var(--boutique-field-bg);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.03);
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .form-control:not(.wi-readonly-field):hover,
body[data-maguva-unified-shell="1"] .maguva-main-content .form-select:hover,
body[data-maguva-unified-shell="1"] .boutique-input:hover {
  border: var(--boutique-field-border-hover);
}

body[data-maguva-unified-shell="1"] .maguva-main-content .form-control:not(.wi-readonly-field):focus,
body[data-maguva-unified-shell="1"] .maguva-main-content .form-select:focus,
body[data-maguva-unified-shell="1"] .boutique-input:focus {
  border: var(--boutique-field-border-focus);
  box-shadow: var(--boutique-field-focus-ring);
  outline: none;
}

body[data-maguva-unified-shell="1"] .btn { border-radius: 999px; font-weight: 600; }

body[data-maguva-unified-shell="1"] .btn-outline-secondary {
  border-color: rgba(107, 114, 128, 0.25);
  color: #4b5563;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .table thead th {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--boutique-muted);
  border-bottom: 1px solid rgba(111, 66, 193, 0.1) !important;
  background: transparent;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .table-hover tbody tr:hover {
  background: rgba(111, 66, 193, 0.04) !important;
}

body[data-maguva-unified-shell="1"] .maguva-main-content .table td {
  border-color: rgba(111, 66, 193, 0.06);
  vertical-align: middle;
}

body[data-maguva-unified-shell="1"] .modal-content {
  border: none !important;
  border-radius: calc(var(--boutique-radius) + 0.15rem) !important;
  box-shadow: 0 28px 64px rgba(17, 24, 39, 0.18) !important;
  overflow: hidden;
}

body[data-maguva-unified-shell="1"] .modal-header {
  border-bottom: none;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.06), rgba(214, 51, 132, 0.04));
}

body[data-maguva-unified-shell="1"] .modal-footer { border-top: none; }

body[data-maguva-unified-shell="1"] #globalAlert.alert {
  border: none;
  border-radius: var(--boutique-radius-sm);
  box-shadow: var(--boutique-shadow);
}

body[data-maguva-unified-shell="1"] .boutique-profile-dl dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--boutique-muted);
}

body[data-maguva-unified-shell="1"] .boutique-scan-card,
body[data-maguva-unified-shell="1"] .boutique-success-modal .success-item-details {
  background: rgba(255, 255, 255, 0.65);
  border-radius: var(--boutique-radius-sm);
  border: none;
}

/* Login */
.boutique-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.boutique-login-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(111, 66, 193, 0.22), transparent 42%),
    radial-gradient(circle at 85% 10%, rgba(214, 51, 132, 0.18), transparent 38%),
    linear-gradient(155deg, #eee8ff 0%, #f8f6ff 35%, #f3f6fb 100%);
  z-index: 0;
}

.boutique-login-container { position: relative; z-index: 1; }

.boutique-login-card {
  padding: 2rem 1.75rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.12);
}

.boutique-login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.boutique-login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--maguva-primary), var(--maguva-accent));
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 10px 28px rgba(111, 66, 193, 0.32);
}

.boutique-login-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--maguva-primary-dark);
  margin: 0 0 0.15rem;
}

.boutique-login-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.boutique-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4b5563;
}

.boutique-login-page .boutique-input {
  border: none;
  border-radius: var(--boutique-radius-sm, 0.875rem);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.05);
  padding: 0.6rem 0.85rem;
}

.boutique-login-page .boutique-input:focus {
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.14);
}

.boutique-login-btn { padding: 0.7rem 1rem; border-radius: 999px !important; }

.boutique-login-demo {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
}

.boutique-login-demo code {
  color: var(--maguva-primary-dark);
  background: rgba(111, 66, 193, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

.boutique-photo-card .photo-confirmed-thumb,
.boutique-photo-card .photo-preview-thumb {
  max-width: 100%;
  max-height: 200px;
  border-radius: 0.5rem;
  object-fit: cover;
  box-shadow: var(--maguva-shadow-sm);
}

.boutique-stock-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.boutique-profile-dl dt {
  color: #6c757d;
  font-weight: 500;
}

.boutique-profile-dl dd {
  margin-bottom: 0.75rem;
}

.boutique-requirements-preview {
  line-height: 1.5;
  word-break: break-word;
}

.boutique-requirements-preview strong,
.boutique-requirements-preview b {
  font-weight: 700;
}

.boutique-requirements-preview ul,
.boutique-requirements-preview ol {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

.boutique-requirements-preview blockquote {
  margin: 0.5rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(0, 0, 0, 0.15);
  color: var(--bs-secondary-color);
}

.boutique-requirements-preview hr {
  margin: 0.75rem 0;
  opacity: 0.25;
}

.wi-rich-text-editor.wi-requirements-quill,
.wi-form-field-editor .wi-requirements-quill {
  border: var(--boutique-field-border, 1px solid rgba(17, 24, 39, 0.16));
  border-radius: var(--boutique-radius-sm, var(--wi-radius-sm, 0.875rem));
  overflow: hidden;
  background: var(--boutique-field-bg, #fff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wi-rich-text-editor.wi-requirements-quill:hover,
.wi-form-field-editor .wi-requirements-quill:hover {
  border: var(--boutique-field-border-hover, 1px solid rgba(17, 24, 39, 0.24));
}

.wi-rich-text-editor.wi-requirements-quill:focus-within,
.wi-form-field-editor .wi-requirements-quill:focus-within {
  border: var(--boutique-field-border-focus, 1px solid rgba(111, 66, 193, 0.5));
  box-shadow: var(--boutique-field-focus-ring, 0 0 0 3px rgba(111, 66, 193, 0.12));
}

.wi-requirements-quill .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 0;
  background: rgba(248, 249, 250, 0.95);
}

.wi-requirements-quill .ql-container.ql-snow {
  border: none;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.9375rem;
  background: #fff;
}

.wi-requirements-quill .ql-editor {
  min-height: 8rem;
  max-height: 12rem;
  overflow-y: auto;
  line-height: 1.45;
}

.wi-requirements-quill .ql-editor.ql-blank::before {
  color: var(--bs-secondary-color);
  font-style: normal;
}

.wi-rich-text-compact .ql-editor {
  min-height: 5rem;
  max-height: 8rem;
}

.wi-rich-text-inline {
  font-size: inherit;
  line-height: 1.4;
}

.wi-rich-text-inline p:last-child {
  margin-bottom: 0;
}

.wi-readonly-field.boutique-requirements-preview {
  height: auto;
  min-height: calc(1.5em + 0.75rem + 2px);
  white-space: normal;
}

.ql-snow .ql-toolbar button.ql-divider::before {
  content: '—';
  font-weight: 700;
  line-height: 1;
}

.wi-saved-popup {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: #198754;
  color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  font-weight: 500;
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.wi-saved-popup.show {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Work items — modern UI ─── */
.wi-page {
  --wi-radius: 1.25rem;
  --wi-radius-sm: 0.875rem;
  --wi-surface: rgba(255, 255, 255, 0.88);
  --wi-surface-soft: rgba(255, 255, 255, 0.62);
  --wi-blur: blur(16px);
  --wi-shadow: 0 12px 40px rgba(17, 24, 39, 0.07);
  --wi-shadow-hover: 0 18px 48px rgba(111, 66, 193, 0.14);
  --wi-gradient: linear-gradient(135deg, rgba(111, 66, 193, 0.12) 0%, rgba(214, 51, 132, 0.08) 55%, rgba(255, 255, 255, 0) 100%);
}

.work-item-save-footer {
  position: static;
  width: 100%;
  margin-top: 0;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid rgba(111, 66, 193, 0.1);
}

.work-item-save-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 1rem 0 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.wi-save-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
}

.wi-save-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
}

.wi-transition-blockers {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 0.75rem;
  text-align: left;
}

.wi-transition-blockers-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #856404;
}

.wi-transition-blockers-list {
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: #6c5700;
}

.wi-transition-blockers-list li + li {
  margin-top: 0.15rem;
}

.wi-send-stage-btn.is-blocked,
.wi-send-stage-btn:disabled,
.wi-next-stage-btn.is-blocked,
.wi-next-stage-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
  box-shadow: none;
}

.wi-save-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.wi-save-transitions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wi-save-last {
  font-size: 0.8125rem;
  color: #6c757d;
}

.work-item-save-footer .wi-save-hint {
  display: flex;
  align-items: center;
  color: var(--maguva-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.work-item-save-footer .wi-save-hint .bi-circle-fill {
  font-size: 0.45rem;
}

/* List page */
.wi-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.wi-page-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--maguva-primary-dark);
  margin-bottom: 0.2rem;
}

.wi-page-subtitle {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 0.9375rem;
}

.wi-page-cta {
  border-radius: 999px;
  padding-inline: 1.25rem;
}

.wi-list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.wi-list-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.wi-list-filters-row .wi-search-wrap {
  flex: 1 1 14rem;
  min-width: min(100%, 14rem);
}

.wi-filter-field {
  flex: 0 1 11rem;
  min-width: 9rem;
}

.wi-filter-field .form-select {
  border-radius: 0.65rem;
}

.wi-list-summary {
  min-height: 1.25rem;
}

.wi-items-table-card {
  border-radius: calc(var(--wi-radius) + 0.1rem);
  overflow: hidden;
}

.wi-items-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  white-space: nowrap;
  border-bottom-width: 1px;
}

.wi-items-table tbody td {
  vertical-align: middle;
  font-size: 0.875rem;
}

.wi-table-row {
  cursor: pointer;
}

.wi-table-row:hover {
  background: rgba(124, 58, 237, 0.04);
}

.wi-table-row-invalid {
  opacity: 0.88;
}

.wi-table-delivery {
  font-weight: 600;
}

.wi-empty-state {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--wi-radius);
  border: 1px dashed rgba(148, 163, 184, 0.45);
}

@media (max-width: 767.98px) {
  .wi-filter-field {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
  }
}

.wi-list-toolbar-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
}

.wi-list-toolbar-inline .wi-search-wrap {
  flex: 1 1 16rem;
}

.wi-orders-period {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
}

.wi-orders-period .maguva-period-pills .btn {
  flex: 0 0 auto;
  min-width: 5rem;
  min-height: 2.45rem;
}

@media (max-width: 767.98px) {
  .wi-orders-period {
    align-items: stretch;
    margin-left: 0;
    width: 100%;
  }

  .wi-orders-period .maguva-period-pills .btn {
    flex: 1 1 auto;
  }
}

.wi-recent-section {
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.15rem 1.15rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
  backdrop-filter: var(--wi-blur);
  border-radius: calc(var(--wi-radius) + 0.15rem);
  box-shadow: var(--wi-shadow);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.wi-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.wi-recent-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c3aed;
}

.wi-recent-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
}

.wi-recent-count {
  flex-shrink: 0;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  font-size: 0.75rem;
  font-weight: 700;
}

.wi-recent-scroll {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.wi-recent-scroll::-webkit-scrollbar {
  height: 6px;
}

.wi-recent-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
}

.wi-recent-card {
  flex: 0 0 15.5rem;
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wi-recent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.wi-recent-card-photo {
  flex: 0 0 4.25rem;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3f4f6;
}

.wi-recent-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wi-recent-card-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1.35rem;
}

.wi-recent-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1 1 auto;
}

.wi-recent-card-time {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #7c3aed;
}

.wi-recent-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wi-recent-card-meta {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wi-recent-card-stage {
  align-self: flex-start;
  margin-top: 0.15rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wi-search-wrap {
  position: relative;
  max-width: 28rem;
}

.wi-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-secondary-color);
  pointer-events: none;
}

.wi-search-input {
  padding-left: 2.65rem;
  border: none;
  border-radius: 999px;
  background: var(--wi-surface);
  backdrop-filter: var(--wi-blur);
  box-shadow: var(--wi-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wi-search-input:focus {
  box-shadow: var(--wi-shadow-hover);
  transform: translateY(-1px);
}

.wi-view-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wi-view-chip {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--wi-blur);
  transition: all 0.2s ease;
}

.wi-view-chip:hover {
  color: var(--maguva-primary-dark);
  background: rgba(111, 66, 193, 0.08);
}

.wi-view-chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--maguva-primary) 0%, var(--maguva-primary-dark) 100%);
  box-shadow: 0 4px 14px rgba(111, 66, 193, 0.28);
}

.wi-list-group.is-today .wi-list-group-title {
  color: var(--maguva-primary-dark);
}

.wi-list-group-empty {
  grid-column: 1 / -1;
  padding: 0.35rem 0.15rem 0.15rem;
}

.wi-stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wi-stage-chip {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--wi-blur);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.wi-stage-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--maguva-primary) 0%, var(--maguva-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.35);
}

.wi-stage-chip.active .wi-stage-chip-count {
  background: #fff;
  color: var(--maguva-primary-dark);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.12);
}

.wi-stage-chip:hover {
  color: var(--maguva-primary);
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}

.wi-stage-chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--maguva-primary), var(--maguva-accent));
  box-shadow: 0 6px 20px rgba(111, 66, 193, 0.28);
}

.wi-stage-chip--invalid {
  color: #6c757d;
}

.wi-stage-chip--invalid .wi-stage-chip-count {
  background: rgba(108, 117, 125, 0.14);
  color: #495057;
}

.wi-stage-chip--invalid.active {
  background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
  box-shadow: 0 4px 14px rgba(108, 117, 125, 0.28);
}

.wi-stage-chip--invalid.active .wi-stage-chip-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.wi-list-card-invalid {
  opacity: 0.92;
  border-color: rgba(108, 117, 125, 0.22);
}

.wi-list-stage--invalid {
  background: rgba(108, 117, 125, 0.14);
  color: #495057;
  border-color: rgba(108, 117, 125, 0.24);
}

.wi-list-invalid-reason {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  line-height: 1.35;
}

.wi-list-group--invalid .wi-list-group-head {
  border-color: rgba(108, 117, 125, 0.18);
}

.wi-list-group--invalid .wi-list-group-eyebrow {
  color: #6c757d;
}

.wi-eta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wi-eta-chip {
  border: 1px solid rgba(111, 66, 193, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background: rgba(255, 255, 255, 0.55);
  transition: all 0.2s ease;
}

.wi-eta-chip:hover {
  color: var(--maguva-primary);
  background: rgba(255, 255, 255, 0.85);
}

.wi-eta-chip.active {
  color: #fff;
  background: linear-gradient(135deg, #495057, #343a40);
  border-color: transparent;
}

.wi-eta-chip[data-wi-eta="breached"].active {
  background: linear-gradient(135deg, #e03131, #c92a2a);
}

.wi-eta-chip[data-wi-eta="today"].active {
  background: linear-gradient(135deg, #f08c00, #e67700);
}

.wi-eta-chip[data-wi-eta="tomorrow"].active {
  background: linear-gradient(135deg, #228be6, #1c7ed6);
}

.wi-list-card-breached {
  border-color: rgba(250, 82, 82, 0.45);
  box-shadow: 0 0 0 1px rgba(250, 82, 82, 0.12), var(--wi-shadow);
}

.wi-list-eta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.wi-stage-eta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.wi-stage-eta-breached {
  color: #c92a2a;
  background: rgba(250, 82, 82, 0.12);
  border-color: rgba(250, 82, 82, 0.28);
}

.wi-stage-eta-today {
  color: #e67700;
  background: rgba(253, 126, 20, 0.12);
  border-color: rgba(253, 126, 20, 0.28);
}

.wi-stage-eta-tomorrow {
  color: #1c7ed6;
  background: rgba(34, 139, 230, 0.1);
  border-color: rgba(34, 139, 230, 0.25);
}

.wi-stage-eta-upcoming {
  color: var(--maguva-primary-dark);
  background: rgba(111, 66, 193, 0.08);
  border-color: rgba(111, 66, 193, 0.14);
}

.wi-list-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wi-list-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wi-list-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.15rem;
}

.wi-list-group-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #868e96;
}

.wi-list-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: #343a40;
}

.wi-list-group-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6c757d;
  white-space: nowrap;
}

.wi-list-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
}

.wi-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.wi-list-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--wi-surface);
  backdrop-filter: var(--wi-blur);
  border-radius: var(--wi-radius);
  box-shadow: var(--wi-shadow);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  border: 1px solid rgba(255, 255, 255, 0.7);
  text-align: left;
  width: 100%;
}

.wi-list-card:not(.has-photo) {
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
}

.wi-list-card-photo {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3f4f6;
}

.wi-list-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wi-list-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
}

.wi-list-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.wi-list-created {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  flex-shrink: 0;
}

.wi-list-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wi-list-card-sub {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wi-list-card .wi-list-stage {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  align-self: flex-start;
}

.wi-list-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.wi-list-delivery {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wi-list-delivery strong {
  font-weight: 800;
}

.wi-list-delivery.wi-delivery-normal {
  color: var(--maguva-primary-dark);
  background: rgba(111, 66, 193, 0.08);
  border-color: rgba(111, 66, 193, 0.14);
}

.wi-list-delivery.wi-delivery-soon {
  color: #946200;
  background: rgba(255, 193, 7, 0.14);
  border-color: rgba(255, 193, 7, 0.35);
}

.wi-list-delivery.wi-delivery-urgent {
  color: #b45309;
  background: rgba(253, 126, 20, 0.12);
  border-color: rgba(253, 126, 20, 0.35);
}

.wi-list-delivery.wi-delivery-overdue {
  color: #c92a2a;
  background: rgba(250, 82, 82, 0.1);
  border-color: rgba(250, 82, 82, 0.35);
}

.wi-list-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--wi-shadow-hover);
}

.wi-list-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wi-list-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--maguva-primary-dark);
}

.wi-list-card-event {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
}

.wi-list-muted {
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.wi-list-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wi-list-open {
  font-weight: 700;
  color: var(--maguva-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Stage badges & select */
.wi-stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wi-stage-draft { background: rgba(92, 102, 122, 0.12); color: #5c667a; }
.wi-stage-ready { background: rgba(24, 100, 171, 0.12); color: #1864ab; }
.wi-stage-assigned { background: rgba(90, 50, 163, 0.12); color: #5a32a3; }
.wi-stage-in-progress { background: rgba(230, 119, 0, 0.12); color: #e67700; }
.wi-stage-completed { background: rgba(43, 138, 62, 0.12); color: #2b8a3e; }
.wi-stage-delivered { background: rgba(54, 79, 199, 0.12); color: #364fc7; }
.wi-stage-default { background: rgba(73, 80, 87, 0.12); color: #495057; }

.wi-stage-select {
  appearance: none;
  min-width: 10rem;
  padding: 0.55rem 2.25rem 0.55rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236f42c1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wi-stage-select:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(111, 66, 193, 0.15);
}

.wi-stage-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.18);
}

.wi-stage-change-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(111, 66, 193, 0.06);
  border-radius: var(--wi-radius-sm);
}

.wi-status-notes-input {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.5;
  border: none;
  border-radius: var(--wi-radius-sm);
  background: #fff;
}

.wi-status-notes-preview {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #374151;
}

/* Detail page */
.wi-detail-page {
  padding-bottom: 0;
}

.wi-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--maguva-primary);
  font-weight: 600;
  font-size: 0.875rem;
  transition: gap 0.2s ease, color 0.2s ease;
}

.wi-back-link:hover {
  color: var(--maguva-primary-dark);
  gap: 0.6rem;
}

.wi-detail-canvas {
  overflow: visible;
  border-radius: calc(var(--wi-radius) + 0.25rem);
  background: var(--wi-surface);
  backdrop-filter: var(--wi-blur);
  box-shadow: var(--wi-shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

#workItemNormalPane .form-select,
#workItemNormalPane .form-control.sdui-input,
.wi-sdui-form-pane .form-select,
.wi-sdui-form-pane .form-control.sdui-input {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  cursor: pointer;
  border: var(--boutique-field-border, 1px solid rgba(17, 24, 39, 0.16));
  background: var(--boutique-field-bg, #fff);
}

#workItemNormalPane .form-control.sdui-input:focus,
#workItemNormalPane .form-select:focus,
.wi-sdui-form-pane .form-control.sdui-input:focus,
.wi-sdui-form-pane .form-select:focus {
  border: var(--boutique-field-border-focus, 1px solid rgba(111, 66, 193, 0.5));
  box-shadow: var(--boutique-field-focus-ring, 0 0 0 3px rgba(111, 66, 193, 0.12));
}

#workItemNormalPane textarea.sdui-input,
.wi-sdui-form-pane textarea.sdui-input {
  cursor: text;
}

.order-wi-table-wrap {
  overflow-x: auto;
}

.order-wi-table .order-wi-col-code {
  width: 8rem;
  white-space: nowrap;
}

.order-wi-table .order-wi-col-progress {
  min-width: 36rem;
}

.wi-code-link {
  color: var(--maguva-purple, #6f42c1);
  font-weight: 600;
  text-decoration: none;
  vertical-align: baseline;
}

.wi-code-link:hover,
.wi-code-link:focus-visible {
  color: var(--maguva-purple-dark, #5a32a3);
  text-decoration: underline;
}

.order-wi-row-clickable,
.order-row-clickable {
  cursor: pointer;
}

.order-wi-row-clickable:hover,
.order-row-clickable:hover {
  background: rgba(111, 66, 193, 0.06);
}

.order-wi-stepper .wi-stage-stepper-track-wrap {
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.order-wi-stepper .wi-stage-stepper-btn {
  pointer-events: none;
  padding: 0.35rem 0.3rem 0.45rem;
}

.order-wi-stepper .wi-stage-stepper-step {
  min-width: 4.5rem;
}

.order-wi-stepper .wi-stage-stepper-label {
  font-size: 0.62rem;
  line-height: 1.15;
}

.order-wi-stepper .wi-stage-stepper-date {
  font-size: 0.58rem;
  min-height: 0.85rem;
}

.order-wi-stepper .wi-stage-stepper-icon {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.65rem;
}

.order-wi-stepper .wi-stage-stepper-connector {
  margin: 0 0.05rem;
}

.order-wi-stepper .wi-stage-stepper-connector i {
  font-size: 0.65rem;
}

.wi-stage-stepper-panel .wi-readonly-field,
.wi-stage-timeline-panel .wi-readonly-field {
  pointer-events: none;
  cursor: default;
}

.wi-detail-hero-band {
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--wi-gradient),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.75) 100%);
}

.wi-stage-timeline-band {
  padding: 0.85rem 1.5rem 1rem;
  border-top: 1px solid rgba(111, 66, 193, 0.08);
  border-bottom: 1px solid rgba(111, 66, 193, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(248, 246, 255, 0.92) 100%);
}

.wi-stage-stepper-compact .wi-stage-stepper-header {
  margin-bottom: 0.75rem;
}

.wi-stage-stepper-compact .wi-stage-stepper-btn {
  padding: 0.5rem 0.4rem 0.6rem;
}

.wi-stage-stepper-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.wi-stage-stepper-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wi-stage-stepper-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #868e96;
}

.wi-stage-stepper-summary {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--maguva-primary);
}

.wi-stage-stepper-delivery {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--maguva-primary-dark);
  background: rgba(111, 66, 193, 0.08);
  border: 1px solid rgba(111, 66, 193, 0.12);
  white-space: nowrap;
}

.wi-stage-stepper-delivery i {
  color: var(--maguva-primary);
}

.wi-stage-stepper-track-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0.25rem 0.25rem 0.35rem;
  scrollbar-width: thin;
}

.wi-stage-stepper-track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
}

.wi-stage-stepper-step {
  flex: 0 0 7.5rem;
  width: 7.5rem;
}

.wi-stage-stepper-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 6.5rem;
  padding: 0.55rem 0.35rem 0.6rem;
  border: 1px solid rgba(111, 66, 193, 0.1);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wi-stage-stepper-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(111, 66, 193, 0.12);
}

.wi-stage-stepper-step.is-expanded .wi-stage-stepper-btn {
  border-color: rgba(111, 66, 193, 0.35);
  box-shadow: 0 8px 24px rgba(111, 66, 193, 0.16);
}

.wi-stage-stepper-btn:disabled {
  cursor: default;
  opacity: 0.72;
}

.wi-stage-stepper-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  border: 2px solid #ced4da;
  background: #fff;
  color: #868e96;
  flex-shrink: 0;
}

.wi-stage-stepper-num {
  font-size: 0.8125rem;
  line-height: 1;
}

.wi-stage-stepper-step.is-completed .wi-stage-stepper-icon {
  border-color: #2b8a3e;
  background: linear-gradient(135deg, #40c057 0%, #2b8a3e 100%);
  color: #fff;
}

.wi-stage-stepper-step.is-skipped .wi-stage-stepper-icon {
  border-color: #f59f00;
  background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
  color: #fff;
}

.wi-stage-stepper-step.is-current .wi-stage-stepper-icon {
  border-color: var(--maguva-primary);
  background: linear-gradient(135deg, #8b5cf6 0%, var(--maguva-primary) 100%);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(111, 66, 193, 0.18);
}

.wi-stage-stepper-step.is-upcoming .wi-stage-stepper-icon {
  border-color: #dee2e6;
  background: #f8f9fa;
  color: #adb5bd;
}

.wi-stage-stepper-label {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #343a40;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
  width: 100%;
}

.wi-stage-stepper-step.is-current .wi-stage-stepper-label {
  color: var(--maguva-primary);
}

.wi-stage-stepper-step.is-upcoming .wi-stage-stepper-label {
  color: #868e96;
}

.wi-stage-stepper-step.is-skipped .wi-stage-stepper-label {
  color: #e67700;
}

.wi-stage-stepper-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(73, 80, 87, 0.08);
  color: #868e96;
}

.wi-stage-stepper-step.is-completed .wi-stage-stepper-badge {
  background: rgba(43, 138, 62, 0.12);
  color: #2b8a3e;
}

.wi-stage-stepper-step.is-skipped .wi-stage-stepper-badge {
  background: rgba(250, 176, 5, 0.15);
  color: #e67700;
}

.wi-stage-stepper-step.is-current .wi-stage-stepper-badge {
  background: rgba(111, 66, 193, 0.12);
  color: var(--maguva-primary);
}

.wi-stage-stepper-date {
  margin-top: auto;
  padding-top: 0.25rem;
  font-size: 0.625rem;
  color: #868e96;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.wi-stage-stepper-step.is-current .wi-stage-stepper-date {
  color: var(--maguva-primary);
  font-weight: 600;
}

.wi-stage-stepper-step.is-upcoming .wi-stage-stepper-date {
  color: #adb5bd;
}

.wi-revert-reason-banner-wrap {
  margin: 0 0 0.85rem;
}

.wi-revert-reason-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--wi-radius-sm);
  border: 1px solid rgba(220, 53, 69, 0.35);
  background: rgba(220, 53, 69, 0.1);
  color: #842029;
}

.wi-revert-reason-banner-icon {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1;
  margin-top: 0.1rem;
  color: #dc3545;
}

.wi-revert-reason-banner-title {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.wi-revert-reason-banner-text {
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.wi-revert-history-toggle {
  margin-top: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #842029;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 53, 69, 0.28);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
}

.wi-revert-history-toggle:hover {
  color: #58151c;
  background: #fff;
  border-color: rgba(220, 53, 69, 0.45);
}

.wi-revert-history-panel {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(220, 53, 69, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.wi-revert-history-item {
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(220, 53, 69, 0.18);
}

.wi-revert-history-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.2rem;
}

.wi-revert-history-route {
  font-size: 0.75rem;
  font-weight: 700;
  color: #842029;
}

.wi-revert-history-when {
  font-size: 0.6875rem;
  color: rgba(132, 32, 41, 0.75);
}

.wi-revert-history-item-reason {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #58151c;
  white-space: pre-wrap;
  word-break: break-word;
}

.wi-stage-stepper-step.is-revert-highlight .wi-stage-stepper-icon {
  background: rgba(255, 193, 7, 0.22);
  border-color: #ffc107;
  color: #b58100;
}

.wi-stage-stepper-step.is-revert-highlight .wi-stage-stepper-label {
  color: #b58100;
  font-weight: 700;
}

.wi-stage-stepper-step.is-revert-highlight .wi-stage-stepper-btn:not(:disabled):hover,
.wi-stage-stepper-step.is-revert-highlight.is-current .wi-stage-stepper-btn {
  background: rgba(255, 193, 7, 0.12);
  border-color: rgba(255, 193, 7, 0.45);
}

.wi-stage-stepper-revert-reason {
  margin-top: 0.2rem;
  font-size: 0.6rem;
  line-height: 1.25;
  color: #b58100;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.15rem;
}

.wi-transition-actions .wi-skip-stage-btn,
.wi-transition-actions .wi-revert-stage-btn {
  white-space: nowrap;
}

.wi-stage-stepper-connector {
  flex: 0 0 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.65rem;
  color: #ced4da;
}

.wi-stage-stepper-line {
  display: none;
}

.wi-stage-stepper-connector i {
  font-size: 1rem;
  line-height: 1;
}

.wi-stage-stepper-connector.is-done {
  color: #40c057;
}

.wi-stage-stepper-connector.is-skipped {
  color: #fab005;
}

.wi-stage-stepper-connector.is-active {
  color: var(--maguva-primary);
}

.wi-stage-stepper-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(111, 66, 193, 0.15);
}

.wi-stage-stepper-panel {
  display: none;
}

.wi-stage-stepper-panel.is-visible {
  display: block;
}

.wi-stage-stepper-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wi-stage-stepper-panel-body {
  padding: 0.15rem 0 0;
}

.wi-timeline-stage-card {
  margin-bottom: 0.85rem !important;
}

.wi-timeline-stage-card:last-child {
  margin-bottom: 0 !important;
}

.wi-timeline-stage-card .card-header {
  padding: 0.75rem 1rem;
}

.wi-timeline-stage-card .card-body {
  padding: 1rem;
}

.wi-readonly-field {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #212529;
  min-height: calc(1.5em + 0.75rem + 2px);
}

.wi-readonly-notes {
  padding: 0.65rem 0.85rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: var(--wi-radius-sm, 0.375rem);
  min-height: 3rem;
}

.wi-stage-data-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.wi-stage-data-row:last-child {
  border-bottom: none;
}

.wi-stage-data-label {
  color: #868e96;
  font-size: 0.8125rem;
}

.wi-stage-data-value {
  color: #212529;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
}

  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wi-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wi-activity-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.wi-activity-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(111, 66, 193, 0.1);
  color: var(--maguva-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wi-activity-summary {
  color: #212529;
  line-height: 1.45;
}

.wi-activity-details {
  padding-left: 1.1rem;
  color: #495057;
  font-size: 0.875rem;
}

.wi-activity-details li + li {
  margin-top: 0.2rem;
}

.wi-rich-editor {
  border: 1px solid rgba(111, 66, 193, 0.15);
  border-radius: var(--wi-radius-sm);
  overflow: hidden;
  background: #fff;
}

.wi-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(248, 249, 250, 0.9);
}

.wi-rich-btn {
  border: none;
  background: transparent;
  color: #495057;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wi-rich-btn:hover {
  background: rgba(111, 66, 193, 0.1);
  color: var(--maguva-primary);
}

.wi-rich-content {
  min-height: 120px;
  padding: 0.75rem 0.9rem;
  line-height: 1.5;
  outline: none;
}

.wi-journal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.wi-journal-photo {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.wi-stage-photo-view {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.wi-stage-photo-view img,
.wi-journal-photo img,
.wi-stage-timeline-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.wi-stage-timeline-photo {
  width: 72px;
  height: 72px;
  border-radius: 0.375rem;
}

.wi-journal-photo-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  line-height: 1;
  font-size: 0.95rem;
}

.wi-stage-data-notes,
.wi-stage-data-photos {
  margin-bottom: 0.65rem;
}

.wi-stage-notes-html {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
}

.wi-stage-notes-html ul,
.wi-stage-notes-html ol {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.wi-detail-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
}

.wi-detail-hero-inner.has-photo {
  align-items: center;
}

.wi-hero-photo-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.wi-hero-photo {
  flex: 0 0 7.5rem;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  background: #f3f4f6;
}

.wi-hero-photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  box-shadow: none;
}

.wi-hero-photo-placeholder {
  color: #9ca3af;
  font-size: 1.75rem;
}

.wi-hero-photo-btn {
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.wi-recent-card-photo,
.wi-recent-card-photo-empty {
  flex: 0 0 4.25rem;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3f4f6;
}

.wi-recent-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wi-recent-card-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1.35rem;
}

.wi-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wi-hero-identity {
  flex: 1 1 16rem;
  min-width: 0;
}

.wi-hero-stage-badge {
  margin-bottom: 0.55rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.wi-hero-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  line-height: 1.4;
}

.wi-hero-ref {
  display: inline-block;
  margin-top: 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  opacity: 0.85;
}

.wi-hero-ref-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.wi-hero-ref-row .wi-hero-ref {
  margin-top: 0;
}

.wi-hero-invalid-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wi-hero-stage-badge--invalid {
  background: rgba(108, 117, 125, 0.16);
  color: #495057;
  border-color: rgba(108, 117, 125, 0.28);
}

.wi-invalid-banner-wrap {
  margin: 0 0 0.85rem;
}

.wi-invalid-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--wi-radius-sm);
  border: 1px solid rgba(108, 117, 125, 0.35);
  background: rgba(108, 117, 125, 0.12);
  color: #495057;
}

.wi-invalid-banner-icon {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1;
  margin-top: 0.1rem;
  color: #6c757d;
}

.wi-invalid-banner-title {
  font-weight: 700;
  font-size: 0.875rem;
}

.wi-invalid-banner-text {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
}

.wi-invalid-banner-when {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.85;
}

.wi-details-current-stage--invalid {
  opacity: 0.92;
}

.wi-hero-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex: 0 1 auto;
}

.wi-hero-date-card {
  min-width: 10rem;
  max-width: 13rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(111, 66, 193, 0.12);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: var(--wi-blur);
}

.wi-hero-date-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.wi-hero-date-value {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  color: #1f2937;
}

.wi-hero-date-value strong {
  font-weight: 800;
}

.wi-hero-date-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.wi-hero-date-normal {
  border-color: rgba(111, 66, 193, 0.14);
  background: rgba(111, 66, 193, 0.06);
}

.wi-hero-date-normal .wi-hero-date-value {
  color: var(--maguva-primary-dark);
}

.wi-hero-date-soon,
.wi-hero-date-today {
  border-color: rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.12);
}

.wi-hero-date-soon .wi-hero-date-value,
.wi-hero-date-today .wi-hero-date-value {
  color: #946200;
}

.wi-hero-date-urgent,
.wi-hero-date-tomorrow {
  border-color: rgba(253, 126, 20, 0.35);
  background: rgba(253, 126, 20, 0.1);
}

.wi-hero-date-urgent .wi-hero-date-value,
.wi-hero-date-tomorrow .wi-hero-date-value {
  color: #b45309;
}

.wi-hero-date-overdue,
.wi-hero-date-breached {
  border-color: rgba(250, 82, 82, 0.35);
  background: rgba(250, 82, 82, 0.08);
}

.wi-hero-date-overdue .wi-hero-date-value,
.wi-hero-date-breached .wi-hero-date-value {
  color: #c92a2a;
}

.wi-hero-date-upcoming {
  border-color: rgba(34, 139, 230, 0.25);
  background: rgba(34, 139, 230, 0.08);
}

.wi-hero-date-upcoming .wi-hero-date-value {
  color: #1864ab;
}

.wi-hero-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maguva-accent);
}

.wi-hero-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1f2937;
  line-height: 1.25;
}

.wi-hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.wi-delivery-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.wi-delivery-chip strong {
  font-weight: 800;
}

.wi-delivery-chip-countdown {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.9;
}

.wi-delivery-normal {
  color: var(--maguva-primary-dark);
  background: rgba(111, 66, 193, 0.08);
  border-color: rgba(111, 66, 193, 0.14);
}

.wi-delivery-soon {
  color: #946200;
  background: rgba(255, 193, 7, 0.14);
  border-color: rgba(255, 193, 7, 0.35);
}

.wi-delivery-urgent {
  color: #b45309;
  background: rgba(253, 126, 20, 0.12);
  border-color: rgba(253, 126, 20, 0.35);
}

.wi-delivery-overdue {
  color: #c92a2a;
  background: rgba(250, 82, 82, 0.1);
  border-color: rgba(250, 82, 82, 0.35);
}

.wi-hero-code {
  margin: 0 0 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--maguva-primary-dark);
  line-height: 1.1;
}

.wi-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
}

.wi-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wi-hero-stage {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.wi-hero-stage-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.wi-detail-body {
  padding: 0 1.25rem 1.35rem;
}

.wi-detail-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.3rem;
  background: rgba(111, 66, 193, 0.06);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: thin;
  max-width: 100%;
}

.wi-detail-tabs .nav-item {
  flex: 0 0 auto;
}

.wi-detail-tab-content {
  min-height: 12rem;
}

.wi-sdui-section-card .card-header {
  background: rgba(255, 255, 255, 0.55);
}

.wi-progress-stages {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wi-progress-stage {
  border: 1px solid rgba(111, 66, 193, 0.12);
  border-radius: var(--wi-radius);
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.wi-progress-stage.is-current {
  border-color: rgba(111, 66, 193, 0.35);
  box-shadow: 0 4px 16px rgba(111, 66, 193, 0.08);
}

.wi-progress-stage-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
}

.wi-progress-stage-toggle:hover {
  background: rgba(111, 66, 193, 0.04);
}

.wi-progress-stage-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(111, 66, 193, 0.1);
  color: var(--maguva-primary);
  font-size: 0.85rem;
  font-weight: 700;
}

.wi-progress-stage.is-completed .wi-progress-stage-icon {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.wi-progress-stage.is-current .wi-progress-stage-icon {
  background: linear-gradient(135deg, var(--maguva-primary), var(--maguva-accent));
  color: #fff;
}

.wi-progress-stage-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.wi-progress-stage-meta strong {
  font-size: 0.9375rem;
}

.wi-progress-stage-meta small {
  color: var(--bs-secondary-color);
}

.wi-progress-stage-chevron {
  transition: transform 0.2s ease;
  color: var(--bs-secondary-color);
}

.wi-progress-stage.is-expanded .wi-progress-stage-chevron {
  transform: rotate(180deg);
}

.wi-progress-stage-body {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(111, 66, 193, 0.08);
}

.wi-progress-stage.is-expanded .wi-progress-stage-body {
  display: block;
}

.wi-progress-stage-body .wi-timeline-stage-card:last-child {
  margin-bottom: 0 !important;
}

.wi-detail-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background: transparent;
  transition: all 0.2s ease;
}

.wi-detail-tabs .nav-link:hover {
  color: var(--maguva-primary);
  background: rgba(255, 255, 255, 0.55);
}

.wi-detail-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--maguva-primary), var(--maguva-accent));
  box-shadow: 0 6px 18px rgba(111, 66, 193, 0.28);
}

.wi-expenses-total {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--maguva-primary);
}

.wi-expenses-summary-block,
.wi-materials-consumed-block {
  padding: 0.25rem 0;
}

.wi-expenses-entries-table td,
.wi-expenses-entries-table th {
  vertical-align: middle;
}

.wi-detail-stage-costs {
  margin-top: 0.85rem;
}

.wi-detail-stage-cost-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wi-detail-stage-cost-list li {
  padding: 0.45rem 0.65rem;
  background: rgba(111, 66, 193, 0.05);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.wi-detail-overview {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.wi-completion-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--wi-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.wi-completion-ring {
  --wi-progress: 0;
  position: relative;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: conic-gradient(var(--maguva-primary) calc(var(--wi-progress) * 1%), rgba(111, 66, 193, 0.1) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.wi-completion-ring::before {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 50%;
  background: #fff;
}

.wi-completion-value {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--maguva-primary-dark);
}

.wi-completion-value small {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.55;
}

.wi-completion-title {
  margin: 0 0 0.15rem;
  font-weight: 700;
  color: #1f2937;
}

.wi-completion-sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
}

.wi-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.wi-field-tile {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--wi-radius);
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.wi-field-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(111, 66, 193, 0.1);
}

.wi-field-tile--wide {
  grid-column: 1 / -1;
}

.wi-field-tile--compact {
  min-height: 7.5rem;
}

.wi-field-tile--empty {
  background: rgba(255, 255, 255, 0.45);
  border-style: dashed;
  border-color: rgba(111, 66, 193, 0.15);
}

.wi-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.wi-tile-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.wi-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.14), rgba(214, 51, 132, 0.1));
  color: var(--maguva-primary);
  flex-shrink: 0;
}

.wi-tile-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
}

.wi-tile-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  color: var(--maguva-primary);
  background: rgba(111, 66, 193, 0.08);
  transition: all 0.2s ease;
}

.wi-tile-edit:hover {
  background: rgba(111, 66, 193, 0.16);
  transform: scale(1.05);
}

.wi-tile-value {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #1f2937;
}

.wi-value-text {
  font-weight: 600;
}

.wi-value-date {
  color: var(--maguva-primary-dark);
}

.wi-tile-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.wi-tile-add {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--maguva-primary);
}

.wi-tile-value .boutique-requirements-preview {
  max-height: 6rem;
  overflow: auto;
  font-size: 0.875rem;
}

.wi-tile-value .wi-status-notes-preview {
  max-height: 5rem;
  overflow: auto;
}

.wi-dress-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.wi-dress-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(111, 66, 193, 0.06);
  border-radius: 999px;
  font-size: 0.8125rem;
}

.wi-dress-name { font-weight: 600; }
.wi-dress-notes { font-size: 0.75rem; color: var(--bs-secondary-color); }

/* Activity feed */
.wi-activity-empty-icon {
  font-size: 2rem;
  color: rgba(111, 66, 193, 0.3);
}

.wi-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wi-activity-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--wi-radius-sm);
  transition: transform 0.2s ease;
}

.wi-activity-card:hover {
  transform: translateX(3px);
}

.wi-activity-card--latest {
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.08), rgba(214, 51, 132, 0.05));
}

.wi-activity-card-icon {
  color: var(--maguva-primary);
  font-size: 1.5rem;
  line-height: 1;
  margin-top: -0.15rem;
}

.wi-activity-card-text {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
}

.wi-activity-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.wi-activity-card-meta span {
  margin: 0 0.35rem;
  opacity: 0.5;
}

/* Modals */
.wi-form-modal .modal-content {
  border: none !important;
  border-radius: calc(var(--wi-radius) + 0.15rem);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.18);
}

.wi-form-modal-header {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem 1.35rem 0.75rem;
  border: none;
  background: var(--wi-gradient), #fff;
}

.wi-form-modal-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.wi-form-modal-heading .wi-field-icon,
.wi-form-modal-heading .wi-tile-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.14), rgba(214, 51, 132, 0.1));
  color: var(--maguva-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wi-form-modal .modal-body {
  padding: 0.5rem 1.35rem 1rem;
}

.wi-form-modal-footer {
  padding: 0.75rem 1.35rem 1.25rem;
  border: none;
}

.wi-form-field {
  padding: 1rem;
  background: rgba(111, 66, 193, 0.04);
  border: none;
  border-radius: var(--wi-radius);
}

.wi-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

.wi-form-control {
  border: var(--boutique-field-border, 1px solid rgba(17, 24, 39, 0.16));
  border-radius: var(--wi-radius-sm);
  font-size: 0.9375rem;
  padding: 0.65rem 0.85rem;
  background: var(--boutique-field-bg, #fff);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wi-form-control:hover {
  border: var(--boutique-field-border-hover, 1px solid rgba(17, 24, 39, 0.24));
}

.wi-form-control:focus {
  border: var(--boutique-field-border-focus, 1px solid rgba(111, 66, 193, 0.5));
  box-shadow: var(--boutique-field-focus-ring, 0 0 0 3px rgba(111, 66, 193, 0.12));
  outline: none;
}

.wi-form-dress-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.wi-form-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: none;
  border-radius: var(--wi-radius-sm);
  color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
}

.wi-form-row-remove:hover:not(:disabled) {
  background: rgba(220, 53, 69, 0.14);
}

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

  .wi-field-tile--compact {
    min-height: 0;
  }

  .wi-detail-body {
    padding-inline: 1rem;
  }

  .wi-detail-hero-band {
    padding-inline: 1.15rem;
  }
}

@media (max-width: 575.98px) {
  .wi-form-dress-row {
    grid-template-columns: 1fr;
  }

  .wi-form-row-remove {
    width: 100%;
  }
}

.boutique-stock-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 0.375rem;
  background: #f1f3f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 1.25rem;
}

.boutique-stock-status-normal {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.boutique-stock-status-low {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffecb5;
  font-weight: 600;
}

.boutique-threshold-input {
  width: 5.5rem;
  min-width: 4.5rem;
}

.boutique-success-modal .modal-header {
  border-bottom: none;
  padding-bottom: 0;
  justify-content: center;
}

.boutique-success-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #198754 0%, #20c997 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 24px rgba(25, 135, 84, 0.35);
  margin: 0.5rem auto 0;
}

.boutique-success-modal .modal-body {
  text-align: center;
  padding-top: 0.5rem;
}

.boutique-success-modal .success-item-photo {
  max-width: 100%;
  max-height: 220px;
  border-radius: 0.75rem;
  object-fit: cover;
  box-shadow: var(--maguva-shadow-md);
  margin: 0 auto 1rem;
  display: block;
}

.boutique-success-modal .success-item-details {
  text-align: left;
  background: #f8f9fb;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  margin-top: 0.5rem;
}

.boutique-success-modal .success-item-details dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.15rem;
}

.boutique-success-modal .success-item-details dd {
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.boutique-success-modal .success-item-details dd:last-child {
  margin-bottom: 0;
}

.boutique-success-modal .success-no-photo {
  width: 100%;
  max-width: 200px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 0.75rem;
  background: #f1f3f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2.5rem;
}

.boutique-scan-reader {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #111;
}

.boutique-scan-reader video {
  width: 100% !important;
  border-radius: 0.75rem;
}

.boutique-scan-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  background: #f8f9fb;
  border-radius: 0.75rem;
  padding: 1rem;
}

.boutique-scan-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.boutique-scan-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 0.5rem;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2rem;
  flex-shrink: 0;
}

.boutique-scan-details dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.1rem;
}

.boutique-scan-details dd {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.boutique-scan-details dd:last-child {
  margin-bottom: 0;
}

.wi-material-picker-search {
  position: relative;
}

.wi-material-search-input {
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  letter-spacing: 0.02em;
}

.wi-material-search-input::placeholder {
  font-family: var(--bs-body-font-family);
  letter-spacing: normal;
}

.wi-material-scan-wrap {
  margin-top: 0.75rem;
}

.wi-material-scan-reader {
  max-width: 280px;
}

.wi-material-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 1060;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.wi-material-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wi-material-search-item:last-child {
  border-bottom: 0;
}

.wi-material-search-item:hover,
.wi-material-search-item.is-active {
  background: rgba(var(--maguva-primary-rgb, 128, 0, 64), 0.06);
}

.wi-material-search-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f3f6;
}

.wi-material-search-item-thumb.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
}

.wi-material-search-item-body {
  min-width: 0;
  flex: 1;
}

.wi-material-search-item-name {
  font-weight: 600;
  line-height: 1.25;
}

.wi-material-search-item-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

.wi-material-selected-card {
  margin-top: 1rem;
}

.wi-material-selected-card .boutique-scan-card {
  position: relative;
  margin-bottom: 0;
}

.wi-material-selected-clear {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
}

.wi-material-qty-row {
  margin-top: 1rem;
}

.wi-material-qty-row .input-group {
  max-width: 220px;
}

.wi-material-qty-row .form-control {
  font-weight: 600;
}

#wiMaterialUsageModal .modal-body {
  min-height: 280px;
}

/* Finance — ledger, cashbook, dashboard */

.finance-combobox {
  position: relative;
}

.finance-combobox-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin-top: 4px;
}

.finance-combobox-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.finance-combobox-item:hover {
  background: rgba(111, 66, 193, 0.08);
}

.finance-combobox-empty {
  padding: 0.75rem;
  color: #6c757d;
  font-size: 0.875rem;
}

.finance-form-card.editing {
  border-color: rgba(111, 66, 193, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.12) !important;
}

.ledger-pane .ledger-toolbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
}

.ledger-entries-card .card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ledger-entries-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
  white-space: nowrap;
}

.ledger-entries-table tbody td {
  vertical-align: middle;
}

.ledger-entries-table tbody td:nth-child(4) {
  min-width: 7rem;
}

.ledger-entries-table .badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

@media (max-width: 991.98px) {
  .ledger-pane .ledger-toolbar .card-body {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 767.98px) {
  .ledger-pane .ledger-toolbar {
    position: static;
  }

  .ledger-toolbar-badges {
    width: 100%;
    margin-top: 0.35rem;
  }

  .ledger-pane .ledger-toolbar .row.g-2 > [class*="col-"] {
    flex: 1 1 auto;
    min-width: 8.5rem;
  }

  .ledger-entries-card .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .ledger-entries-table thead th {
    font-size: 0.7rem;
  }

  .ledger-entries-table .btn-sm {
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
  }

  .ledger-entries-table td:last-child {
    min-width: 8.5rem;
  }
}

@media (max-width: 575.98px) {
  .ledger-toolbar-badges .badge {
    font-size: 0.68rem;
    padding: 0.35em 0.55em;
  }

  .ledger-pane .ledger-toolbar h2.h5 {
    font-size: 1rem;
  }
}

.finance-stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.9) 100%);
  border-left: 4px solid var(--maguva-primary, #6f42c1);
}

.finance-type-toggle .btn-outline-success:checked,
.finance-type-toggle .btn-check:checked + .btn-outline-success {
  background: #198754;
  border-color: #198754;
  color: #fff;
}

.finance-type-toggle .btn-check:checked + .btn-outline-danger {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.finance-day-group {
  margin-bottom: 1.25rem;
}

.finance-day-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.1) 0%, rgba(13, 202, 240, 0.06) 100%);
  border-radius: 0.65rem 0.65rem 0 0;
  border: 1px solid rgba(111, 66, 193, 0.12);
  border-bottom: none;
}

.finance-day-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.finance-day-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.finance-total-in { color: #198754; font-weight: 600; }
.finance-total-out { color: #dc3545; font-weight: 600; }

.finance-day-entries {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0 0 0.65rem 0.65rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
}

.finance-entry-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.finance-entry-card:last-child {
  border-bottom: none;
}

.finance-entry-card.cash-in {
  border-left: 3px solid #198754;
}

.finance-entry-card.cash-out {
  border-left: 3px solid #dc3545;
}

.finance-entry-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  flex: 1;
  min-width: 0;
}

.finance-entry-category { font-weight: 600; }
.finance-entry-type { font-size: 0.8rem; color: #6c757d; }
.finance-entry-amount { font-weight: 700; font-size: 1.05rem; }
.finance-entry-note { font-size: 0.875rem; color: #495057; flex: 1; min-width: 120px; }
.finance-entry-balance { font-size: 0.8rem; }

.finance-entry-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.finance-dash-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
}

#finance-dashboard-root .chart-sankey-wrap,
#finance-dashboard-root .chart-treemap-wrap,
#finance-dashboard-root .chart-expense-breakdown-scroll {
  border-radius: 0.5rem;
}

.sankey-legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  vertical-align: middle;
}

.sankey-legend-in { background: #16a34a; }
.sankey-legend-out { background: #ea580c; }
.sankey-legend-profit { background: #059669; }

#finance-dashboard-root .chart-sankey-wrap,
#finance-dashboard-root .chart-bar-wrap,
#finance-dashboard-root .chart-treemap-wrap {
  overflow: visible !important;
}

#finance-dashboard-root .chart-expense-breakdown-scroll {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

#finance-dashboard-root .chart-sankey-scroll,
#finance-dashboard-root .chart-treemap-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#finance-dashboard-root .chart-sankey-wrap .recharts-wrapper,
#finance-dashboard-root .chart-sankey-wrap svg,
#finance-dashboard-root .chart-bar-wrap .recharts-wrapper,
#finance-dashboard-root .chart-bar-wrap svg,
#finance-dashboard-root .chart-treemap-wrap .recharts-wrapper,
#finance-dashboard-root .chart-treemap-wrap svg {
  overflow: visible !important;
}

#finance-dashboard-root .expense-chip {
  transition: opacity 0.15s ease, transform  0.1s ease;
}

#finance-dashboard-root .expense-chip:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

#finance-dashboard-root .expense-paired-charts .card {
  min-height: 100%;
}

#finance-dashboard-root .sankey-legend-in {
  background: linear-gradient(90deg, #38bdf8, #34d399);
}

#finance-dashboard-root .sankey-legend-out {
  background: linear-gradient(90deg, #fb923c, #f472b6);
}

#finance-dashboard-root .sankey-legend-profit {
  background: linear-gradient(90deg, #6ee7b7, #a5b4fc);
}

@media (max-width: 767.98px) {
  .finance-entry-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .finance-entry-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* ── Mobile shell & readability ── */
  body[data-maguva-unified-shell="1"] .maguva-app-shell > .row > main,
  body[data-maguva-unified-shell="1"] .admin-shell .maguva-main-content {
    padding: 0.85rem 0.75rem 1.35rem !important;
  }

  .maguva-main-content .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--boutique-radius-sm);
  }

  .maguva-main-content .table {
    font-size: 0.875rem;
  }

  .maguva-main-content .table .btn-sm {
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
  }

  #workItemStageFilter {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
    scrollbar-width: none;
  }

  #workItemStageFilter::-webkit-scrollbar {
    display: none;
  }

  #workItemStageFilter .wi-stage-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Work item detail — save bar sits at bottom of detail card */
  .work-item-save-footer {
    padding-inline: 0.85rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }

  .work-item-save-footer-inner {
    padding-top: 0.85rem;
  }

  .wi-save-actions {
    justify-content: stretch;
  }

  .wi-save-actions .btn,
  .wi-save-transitions .btn {
    flex: 1 1 auto;
    min-height: 2.5rem;
  }

  .wi-detail-tabs {
    scroll-snap-type: x proximity;
    padding-inline: 0.35rem;
  }

  .wi-detail-tabs .nav-link {
    scroll-snap-align: start;
    min-height: 2.5rem;
    font-size: 0.78rem;
  }

  .wi-detail-tabs .nav-link i {
    font-size: 1rem;
  }

  /* Modals — use full width on small screens */
  .modal-dialog {
    margin: 0.65rem auto;
    max-width: calc(100vw - 1.25rem);
  }

  .modal-dialog.modal-lg {
    max-width: calc(100vw - 1.25rem);
  }

  #wiMaterialModeTabs {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  #wiMaterialModeTabs .nav-link {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
  }

  .wi-material-search-group {
    flex-wrap: wrap;
  }

  .wi-material-search-group .form-control {
    min-width: 0;
  }

  /* Finance dashboard charts */
  #finance-dashboard-root .chart-bar-wrap,
  #finance-dashboard-root .chart-sankey-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wf-canvas-card {
    min-height: 360px;
    height: min(58vh, 520px);
  }
}

/* Workflow builder (Drawflow admin) */
.wf-builder-page {
  min-height: 520px;
}

.wf-builder-toolbar .form-label {
  font-weight: 600;
}

.wf-canvas-card {
  height: min(72vh, 680px);
  max-height: min(72vh, 680px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wf-canvas-card .card-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 !important;
}

.wf-drawflow-host {
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0 0 0.375rem 0.375rem;
  overflow: auto;
  position: relative;
}

.wf-drawflow-host .drawflow .parent-drawflow {
  background: transparent;
  min-height: 100%;
}

.wf-drawflow-host .drawflow {
  width: 100%;
  min-height: 100%;
  background: transparent;
}

.wf-drawflow-node .drawflow_content_node {
  min-width: 200px;
  width: 100%;
  overflow: visible;
  padding: 0.35rem 0.5rem;
  box-sizing: border-box;
}

.wf-node-card {
  padding: 0.25rem 0;
  text-align: center;
}

.wf-node-card strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wf-node-id {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.2rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.wf-node-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.wf-builder-panels {
  align-items: flex-start;
}

.wf-builder-panels > [class*="col-"] {
  min-height: 0;
}

.wf-builder-panels > .col-lg-4 {
  display: flex;
  flex-direction: column;
}

.wf-inspector-card {
  min-height: 520px;
  height: auto;
  max-height: none;
  overflow: visible;
}

.wf-inspector-scroll {
  padding: 1rem 1.15rem 2.5rem;
  overflow: visible;
  min-height: auto;
}

#wfFieldsEditor {
  overflow: visible;
}

.wf-field-editor-block {
  overflow: visible;
  padding: 0.75rem !important;
  margin-bottom: 0.75rem !important;
  background: rgba(255, 255, 255, 0.65);
}

.wf-field-stack .form-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.wi-entity-links-section .card-body {
  padding: 0.75rem 1rem !important;
}

.wi-details-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wi-details-stages-layout {
  display: grid;
  grid-template-columns: minmax(11.5rem, 30%) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.wi-details-stages-layout--ordered {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: stretch;
}

.wi-details-stages-layout--ordered .wi-detail-stage-card--hero {
  flex: 1 1 100%;
  width: 100%;
}

.wi-details-stages-layout--ordered .wi-detail-stage-card--mini {
  flex: var(--stage-flex, 1) 1 11.5rem;
  min-width: min(100%, 11.5rem);
  max-width: 100%;
}

.wi-details-stages-layout--hero-only,
.wi-details-stages-layout--sidebar-only {
  grid-template-columns: 1fr;
}

.wi-details-stages-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.wi-details-stages-hero {
  min-width: 0;
}

@media (max-width: 767.98px) {
  .wi-details-stages-layout {
    grid-template-columns: 1fr;
  }

  .wi-details-stages-layout--ordered {
    flex-direction: column;
  }

  .wi-details-stages-layout--ordered .wi-detail-stage-card--hero,
  .wi-details-stages-layout--ordered .wi-detail-stage-card--mini {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }
}

.wi-detail-stage-card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-width: 0;
  border: 1px solid rgba(111, 66, 193, 0.12);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 246, 255, 0.88) 100%);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.04);
}

.wi-detail-stage-card--hero {
  width: 100%;
}

.wi-detail-stage-card--mini {
  width: 100%;
}

.wi-detail-stage-card--mini .wi-detail-stage-card-head {
  padding: 0.55rem 0.7rem;
}

.wi-detail-stage-card--mini .wi-detail-stage-card-head h6 {
  font-size: 0.8125rem;
}

.wi-detail-stage-card--mini .wi-detail-stage-card-body {
  padding: 0.65rem 0.7rem 0.75rem;
}

.wi-detail-stage-card--mini .wi-detail-field-label {
  font-size: 0.625rem;
}

.wi-detail-stage-card--mini .wi-detail-field-value {
  font-size: 0.8125rem;
}

.wi-detail-stage-card--mini .wi-detail-measure-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}

.wi-detail-stage-card.is-upcoming {
  opacity: 0.82;
  border-style: dashed;
  background: rgba(248, 249, 250, 0.92);
}

.wi-detail-stage-card.is-upcoming .wi-detail-stage-badge {
  background: rgba(108, 117, 125, 0.14);
  color: var(--bs-secondary-color);
}

.wi-detail-stage-card.is-current {
  border-color: rgba(111, 66, 193, 0.28);
}

.wi-detail-stage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(111, 66, 193, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.wi-detail-stage-card-head h6 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--maguva-primary-dark);
}

.wi-detail-stage-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.wi-detail-stage-card.is-current .wi-detail-stage-badge {
  background: rgba(111, 66, 193, 0.12);
  color: var(--maguva-primary);
}

.wi-detail-stage-card-body {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.9rem 0.95rem;
}

.wi-detail-stage-card--hero .wi-detail-field-grid {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.wi-detail-stage-card--mini .wi-detail-field-grid {
  grid-template-columns: 1fr;
}

.wi-detail-stage-card--mini .wi-detail-field.is-wide {
  grid-column: auto;
}

.wi-detail-stage-card--mini .wi-detail-stage-photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(3.5rem, max-content));
}

.wi-detail-stage-card--mini .wi-detail-stage-photo-grid .wi-detail-stage-photo-thumb,
.wi-detail-stage-card--mini .wi-detail-stage-photo-grid .wi-stage-photo-view {
  width: 3.5rem;
  height: 3.5rem;
}

.wi-detail-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.wi-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.wi-detail-field.is-wide {
  grid-column: 1 / -1;
}

.wi-detail-field-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #868e96;
}

.wi-detail-field-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #343a40;
  line-height: 1.35;
  word-break: break-word;
}

.wi-detail-field-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.wi-detail-field-value-row .wi-detail-field-value {
  flex: 0 1 auto;
}

.wi-material-qty-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 9rem;
}

.wi-material-qty-cell .wi-material-qty-input {
  width: 4.5rem;
  min-width: 4rem;
}

.wi-detail-bill-btn {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
}

.wi-payment-summary .wi-detail-field-value-row strong {
  font-size: 0.9375rem;
}

.wi-detail-measurements {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(111, 66, 193, 0.12);
}

.wi-detail-measure-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.wi-detail-measure-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  background: rgba(111, 66, 193, 0.08);
  color: #495057;
}

.wi-detail-stage-photos {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(111, 66, 193, 0.12);
}

.wi-detail-stage-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.wi-detail-stage-photo-thumb {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f8f9fa;
  cursor: zoom-in;
  overflow: hidden;
  flex-shrink: 0;
}

.wi-detail-stage-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wi-stage-photo-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--maguva-primary);
  background: rgba(111, 66, 193, 0.1);
  border: 1px dashed rgba(111, 66, 193, 0.35) !important;
}

.wi-stage-photo-more span {
  padding: 0.1rem 0.2rem;
}

.wi-stage-photo-view-hidden {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.wi-stage-photos-block .wi-journal-photos {
  min-height: 2rem;
}

/* Stage photo lightbox */
.wi-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wi-photo-lightbox[hidden] {
  display: none !important;
}

.wi-photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.wi-photo-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 960px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wi-photo-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
}

.wi-photo-lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem;
}

.wi-photo-lightbox-title {
  font-weight: 600;
}

.wi-photo-lightbox-counter {
  font-size: 0.875rem;
  opacity: 0.75;
}

.wi-photo-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.wi-photo-lightbox-viewport {
  flex: 1;
  width: min(88vw, 860px);
  height: min(72vh, 640px);
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
  background: #111;
  cursor: grab;
}

.wi-photo-lightbox-viewport:active {
  cursor: grabbing;
}

.wi-photo-lightbox-img {
  max-width: 100%;
  max-height: min(72vh, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.wi-photo-lightbox-nav {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wi-photo-lightbox-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.wi-photo-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.wi-photo-lightbox-zoom-label {
  min-width: 3.5rem;
  text-align: center;
  color: #fff;
  font-size: 0.875rem;
}

.wi-photo-lightbox-hint {
  text-align: center;
}

body.wi-photo-lightbox-open {
  overflow: hidden;
}

.wi-details-current-stage-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--maguva-primary);
}

.wi-details-current-stage--closed .wi-details-current-stage-label {
  color: #198754;
}
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.wi-details-pane > .wi-details-summary-section:first-child + .wi-details-current-stage,
.wi-details-pane > .wi-details-current-stage:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.wi-details-current-stage .wi-sdui-section-card {
  margin-bottom: 0 !important;
}

.wi-details-summary-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 575.98px) {
  .wi-detail-field-grid {
    grid-template-columns: 1fr;
  }

  .wi-detail-field.is-wide {
    grid-column: auto;
  }

  .wi-linked-record-chip {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

.wi-linked-records-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.wi-linked-record-chip {
  flex: 1 1 10.5rem;
  min-width: 9.5rem;
  max-width: calc(50% - 0.35rem);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(111, 66, 193, 0.12);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.78);
}

.wi-linked-record-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #868e96;
}

.wi-linked-record-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.wi-linked-record-edit-btn {
  border: none;
  background: none;
  padding: 0.15rem 0.35rem;
  margin-left: 0.15rem;
  color: #868e96;
  line-height: 1;
  cursor: pointer;
  border-radius: 0.25rem;
}

.wi-linked-record-edit-btn:hover {
  color: var(--maguva-primary);
  background: rgba(124, 58, 237, 0.08);
}

.wi-linked-record-name {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--maguva-primary);
  text-align: left;
  cursor: pointer;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wi-linked-record-name:hover {
  color: var(--maguva-primary-dark);
  text-decoration: underline;
}

.wi-linked-record-missing,
.wi-linked-record-link {
  font-size: 0.8125rem;
}

.wi-linked-record-empty {
  background: rgba(248, 249, 250, 0.9);
}

.wi-weaver-links-block {
  flex: 1 1 100%;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(111, 66, 193, 0.12);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.78);
}

.wi-weaver-links-heading {
  margin-bottom: 0.1rem;
}

.wi-weaver-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wi-weaver-link-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(111, 66, 193, 0.08);
}

.wi-weaver-link-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wi-weaver-link-actions {
  width: 100%;
}

.wi-weaver-link-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  letter-spacing: 0.02em;
}

.wi-weaver-link-remove {
  border: none;
  background: none;
  padding: 0.15rem 0.35rem;
  color: #adb5bd;
  line-height: 1;
  cursor: pointer;
  border-radius: 0.25rem;
}

.wi-weaver-link-remove:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
}

.wi-weaver-link-add {
  align-self: flex-start;
  margin-top: 0.15rem;
}

.wi-weaver-links-empty {
  margin-bottom: 0;
}

.wi-linked-entity-details {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
}

.wi-linked-entity-details dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #868e96;
}

.wi-linked-entity-details dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #343a40;
}

.wi-entity-link-tabs .nav-link {
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
}

.wi-entity-link-tabs .nav-link.active {
  background: linear-gradient(135deg, #6f42c1, #9333ea);
  color: #fff;
}

.wf-field-editor-block .wf-f-del,
.wf-inspector-card .wf-bind-del,
.wf-inspector-card .wf-cond-del,
.wf-inspector-card .wf-comp-del {
  display: inline-block;
  margin-top: 0.5rem;
  line-height: 1.5;
  padding-bottom: 0.15rem;
}

.wf-json-preview {
  max-height: 240px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.75rem;
  border-radius: 0.375rem;
}

.drawflow .drawflow-node.wf-drawflow-node {
  display: block;
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  min-width: 232px;
  width: 232px;
  height: auto !important;
  min-height: 72px;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.drawflow .drawflow-node.wf-drawflow-node .inputs {
  position: absolute;
  top: -9px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
}

.drawflow .drawflow-node.wf-drawflow-node .outputs {
  position: absolute;
  bottom: -9px;
  top: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
}

.drawflow .drawflow-node.wf-drawflow-node .input,
.drawflow .drawflow-node.wf-drawflow-node .output {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 999px !important;
  margin: 0 !important;
}

.drawflow .drawflow-node.wf-drawflow-node .input {
  background: #fbbf24 !important;
  border: 2px solid #fff !important;
  box-shadow: 0 0 0 2px #94a3b8 !important;
}

.drawflow .drawflow-node.wf-drawflow-node .output {
  background: #fff !important;
  border: 2px solid var(--maguva-primary, #6f42c1) !important;
  box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.22) !important;
}

.drawflow .drawflow-node.wf-drawflow-node.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.drawflow .connection .main-path {
  stroke: #64748b;
  stroke-width: 2.75px;
  fill: none;
  marker-end: url(#wf-flow-arrow);
}

.drawflow .connection.selected .main-path {
  stroke: #2563eb;
  stroke-width: 3px;
  marker-end: url(#wf-flow-arrow-active);
}

.wf-drawflow-host .drawflow .connection .point {
  stroke: #64748b;
  fill: #fff;
}

/* Unified boutique insights dashboard */
.boutique-insights-dashboard .dashboard-section {
  padding-top: 0.25rem;
  border-top: 1px solid rgba(111, 66, 193, 0.12);
}

.boutique-insights-dashboard .dashboard-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.boutique-insights-dashboard .dashboard-section-head h3 {
  color: var(--maguva-primary, #6f42c1);
}

.boutique-insights-dashboard .dashboard-kpi {
  padding: 0.85rem 0.75rem;
}

.boutique-insights-dashboard .dashboard-kpi-value {
  font-size: clamp(0.82rem, 2.2vw, 1.05rem);
}

@media (max-width: 767.98px) {
  .boutique-insights-dashboard .dashboard-section-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.35rem;
  }

  .boutique-insights-dashboard .dashboard-section-head h3 {
    font-size: 1.05rem;
  }

  .boutique-insights-dashboard .chart-wrap,
  .boutique-insights-dashboard .dashboard-chart-card .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ml-insights-tab .ml-chart-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Billing — colorful work-item grouped cards */
.billing-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.billing-wi-group {
  overflow: hidden;
  border: 1px solid rgba(111, 66, 193, 0.12) !important;
}

.billing-wi-group-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.08), rgba(13, 110, 253, 0.06));
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.billing-wi-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  margin-bottom: 0.15rem;
}

.billing-wi-group-title .billing-wi-link {
  font-weight: 700;
}

.billing-wi-customer {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: #495057;
}

.billing-order-total-hero {
  text-align: right;
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #198754, #20c997);
  color: #fff;
  min-width: 8.5rem;
  box-shadow: 0 8px 20px rgba(25, 135, 84, 0.22);
}

.billing-order-total-hero--inline {
  min-width: auto;
  padding: 0.4rem 0.75rem;
}

.billing-order-total-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.billing-order-total-value {
  font-size: 1.15rem;
  line-height: 1.1;
}

.billing-wi-bills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  padding: 1rem;
}

.billing-wi-bills--detail {
  padding: 0;
  margin-top: 0.75rem;
}

.billing-bill-card {
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
}

.billing-bill-card--advance {
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(234, 88, 12, 0.25);
}

.billing-bill-card--remaining {
  background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: rgba(5, 150, 105, 0.25);
}

.billing-bill-card--order {
  background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
  border-color: rgba(37, 99, 235, 0.22);
}

.billing-bill-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.billing-bill-kind {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-bill-card--advance .billing-bill-kind { color: #c2410c; }
.billing-bill-card--remaining .billing-bill-kind { color: #047857; }
.billing-bill-card--order .billing-bill-kind { color: #1d4ed8; }

.billing-amended-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #6f42c1;
  background: rgba(111, 66, 193, 0.12);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.billing-bill-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #495057;
}

.billing-bill-amount {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.billing-bill-card--advance .billing-bill-amount { color: #9a3412; }
.billing-bill-card--remaining .billing-bill-amount { color: #065f46; }
.billing-bill-card--order .billing-bill-amount { color: #1e40af; }

.billing-bill-mode {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.billing-bill-summary,
.billing-bill-detail {
  font-size: 0.8rem;
  margin: 0;
  color: #4b5563;
}

.billing-bill-actions {
  margin-top: auto;
  padding-top: 0.35rem;
}

.billing-bill-pdf-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.billing-wi-detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.billing-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6c757d;
}

.billing-empty-state i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.55;
}

.billing-empty-state--compact {
  padding: 1.25rem 0.5rem;
}

.billing-dash-toolbar {
  border: 1px solid rgba(111, 66, 193, 0.12) !important;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.04), rgba(5, 150, 105, 0.04));
}

.billing-dashboard-root .dashboard-kpi--orange {
  --dash-kpi-accent: #ea580c;
  --dash-kpi-bg: linear-gradient(135deg, #fff7ed, #ffedd5);
}

.billing-dashboard-root .dashboard-kpi--green {
  --dash-kpi-accent: #059669;
  --dash-kpi-bg: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.billing-dashboard-root .dashboard-kpi--blue {
  --dash-kpi-accent: #2563eb;
  --dash-kpi-bg: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.billing-dash-chart {
  border-radius: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.billing-dash-chart--advance {
  background: linear-gradient(160deg, rgba(255, 247, 237, 0.9), #fff);
  border-color: rgba(234, 88, 12, 0.15);
}

.billing-dash-chart--closure {
  background: linear-gradient(160deg, rgba(236, 253, 245, 0.9), #fff);
  border-color: rgba(5, 150, 105, 0.15);
}

.billing-dash-chart--mix {
  background: linear-gradient(160deg, rgba(239, 246, 255, 0.9), #fff);
  border-color: rgba(37, 99, 235, 0.12);
}

@media (max-width: 767.98px) {
  .billing-wi-group-head {
    flex-direction: column;
  }

  .billing-order-total-hero {
    width: 100%;
    text-align: left;
  }
}
