:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --panel-soft: #fbfaf6;
  --line: #ded7c9;
  --line-strong: #c9baa2;
  --text: #171410;
  --muted: #6e675d;
  --accent: #f5a400;
  --accent-dark: #b67600;
  --dark: #050505;
  --blue: #2563eb;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(23, 20, 16, 0.1);
  --customer-bg-image: url("/assets/audit-cover-banner-default.jpg");
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* customer-report-management-20260726: management structure and preflight preview */
.customer-report-preview .customer-report-preflight {
  display: grid;
  grid-template-columns: minmax(180px, .45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-left: 6px solid #16a34a;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
}

.customer-report-preview .customer-report-preflight.is-error {
  border-left-color: #dc2626;
  background: #fff7f7;
}

.customer-report-preview .customer-report-preflight span,
.customer-report-preview .customer-report-preflight strong {
  display: block;
}

.customer-report-preview .customer-report-preflight span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-report-preview .customer-report-preflight strong {
  color: #0f172a;
  font-size: 16px;
}

.customer-report-preview .customer-report-preflight p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.customer-report-preview .customer-report-cover-page {
  display: grid;
  align-content: center;
  min-height: 920px;
  padding: 24px;
  border: 1px solid #dbe3ed;
  border-radius: 12px;
  background: #fff;
}

.customer-report-preview .customer-report-ai-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-report-preview .customer-report-change-note {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cfe0ff;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #fff;
}

.customer-report-preview .customer-report-change-note.no-comparison {
  border-left-color: #64748b;
  background: #f8fafc;
}

.customer-report-preview .customer-report-change-note strong,
.customer-report-preview .customer-report-change-note p {
  margin: 0;
}

.customer-report-preview .customer-report-readiness-management {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.customer-report-preview .customer-report-readiness-management > div {
  padding: 14px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #f8fafc;
}

.customer-report-preview .customer-report-readiness-management h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 15px;
}

.customer-report-preview .customer-report-readiness-management p,
.customer-report-preview .customer-report-readiness-management small {
  color: #475569;
  line-height: 1.45;
}

.customer-report-preview .customer-report-readiness-management ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-report-preview .customer-report-readiness-management li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
}

.customer-report-preview .customer-report-readiness-management li strong {
  color: #b91c1c;
  font-size: 17px;
}

.customer-report-preview .customer-report-readiness-table {
  width: 100%;
  table-layout: fixed;
  font-size: 11px;
}

.customer-report-preview .customer-report-readiness-table th,
.customer-report-preview .customer-report-readiness-table td {
  overflow-wrap: anywhere;
}

.customer-report-preview .customer-report-readiness-table th:nth-child(1) { width: 24%; }
.customer-report-preview .customer-report-readiness-table th:nth-child(2),
.customer-report-preview .customer-report-readiness-table th:nth-child(3),
.customer-report-preview .customer-report-readiness-table th:nth-child(4) { width: 13%; }
.customer-report-preview .customer-report-readiness-table th:nth-child(5) { width: 22%; }
.customer-report-preview .customer-report-readiness-table th:nth-child(6) { width: 15%; }
.customer-report-preview .customer-report-readiness-table tr.is-critical td:first-child { border-left: 4px solid #dc2626; }
.customer-report-preview .customer-report-readiness-table tr.is-open td:first-child { border-left: 4px solid #f59e0b; }
.customer-report-preview .customer-report-readiness-table tr.is-good td:first-child { border-left: 4px solid #16a34a; }

.customer-report-preview .customer-report-deadline-groups {
  display: grid;
  gap: 14px;
}

.customer-report-preview .customer-report-deadline-group {
  padding: 14px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #fff;
}

.customer-report-preview .customer-report-deadline-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
  gap: 14px;
  margin-bottom: 12px;
}

.customer-report-preview .customer-report-deadline-head h3 {
  margin: 0 0 5px;
  color: #0f172a;
  font-size: 16px;
}

.customer-report-preview .customer-report-deadline-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.customer-report-preview .customer-report-deadline-mini-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.customer-report-preview .customer-report-deadline-mini-kpis span {
  padding: 7px 9px;
  border-left: 4px solid #64748b;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
}

.customer-report-preview .customer-report-deadline-mini-kpis span.is-overdue { border-left-color: #dc2626; background: #fef2f2; color: #991b1b; }
.customer-report-preview .customer-report-deadline-mini-kpis span.is-soon { border-left-color: #f59e0b; background: #fffbeb; color: #92400e; }
.customer-report-preview .customer-report-deadline-mini-kpis span.is-scheduled { border-left-color: #16a34a; background: #f0fdf4; color: #166534; }

.customer-report-preview .customer-report-attachments-heading {
  padding: 24px;
  border: 1px solid #dbe3ed;
  border-left: 7px solid #f5a400;
  border-radius: 9px;
  background: #f8fafc;
}

.customer-report-preview .customer-report-attachments-heading span {
  color: #b37500;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-report-preview .customer-report-attachments-heading h2 {
  margin: 8px 0;
  color: #0f172a;
  font-size: 28px;
}

.customer-report-preview .customer-report-action-plan {
  overflow-x: auto;
}

.customer-report-preview .customer-report-action-intro {
  break-inside: avoid;
}

.customer-report-preview .customer-report-management-table.is-task-table {
  min-width: 980px;
  table-layout: fixed;
  font-size: 12px;
}

.customer-report-preview .customer-report-management-table.is-task-table th,
.customer-report-preview .customer-report-management-table.is-task-table td {
  padding: 9px 8px;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.customer-report-preview .customer-report-management-table.is-task-table th:nth-child(1) { width: 105px; }
.customer-report-preview .customer-report-management-table.is-task-table th:nth-child(2) { width: 270px; }
.customer-report-preview .customer-report-management-table.is-task-table th:nth-child(3) { width: 130px; }
.customer-report-preview .customer-report-management-table.is-task-table th:nth-child(4) { width: 150px; }
.customer-report-preview .customer-report-management-table.is-task-table th:nth-child(5) { width: 190px; }
.customer-report-preview .customer-report-management-table.is-task-table th:nth-child(6) { width: 150px; }

.customer-report-preview .customer-report-document-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.customer-report-preview .customer-report-document-summary > div {
  border: 1px solid #dbe3ed;
  border-left: 4px solid #f5a400;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.customer-report-preview .customer-report-document-summary span,
.customer-report-preview .customer-report-document-summary strong,
.customer-report-preview .customer-report-document-reference span,
.customer-report-preview .customer-report-document-reference strong {
  display: block;
}

.customer-report-preview .customer-report-document-summary span,
.customer-report-preview .customer-report-document-reference span {
  color: #64748b;
}

.customer-report-preview .customer-report-document-summary strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 22px;
}

.customer-report-preview .customer-report-document-reference {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
  color: #334155;
}

.customer-report-preview .customer-report-task-legend {
  margin: 12px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .customer-report-preview .customer-report-preflight,
  .customer-report-preview .customer-report-readiness-management,
  .customer-report-preview .customer-report-deadline-head,
  .customer-report-preview .customer-report-ai-grid,
  .customer-report-preview .customer-report-document-summary {
    grid-template-columns: 1fr;
  }

  .customer-report-preview .customer-report-change-note {
    grid-template-columns: 1fr;
  }

  .customer-report-preview .customer-report-cover-page {
    min-height: 0;
    padding: 12px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #050505;
  color: var(--text);
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

body[data-auth="locked"] .shell {
  display: none;
}

body[data-auth="loading"] .shell {
  display: none;
}

body[data-auth="loading"] .auth-gate {
  display: none;
}

body[data-auth="loading"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10020;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.88), rgba(24, 16, 0, 0.78)),
    var(--customer-background-image, url("/assets/audit-cover-banner-default.jpg"));
  background-size: cover;
  background-position: center;
}

body[data-auth="loading"]::after {
  content: "VEFKapp wird geladen...";
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10021;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(245, 164, 0, 0.54);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff8e8;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52), 0 0 24px rgba(245, 164, 0, 0.2);
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0;
  padding: 10px 16px;
}

body:not([data-role="admin"]) .admin-only {
  display: none !important;
}

body:not([data-access-role="masteradmin"]) .master-only {
  display: none !important;
}

body[data-package-builds="disabled"] .package-build-only {
  display: none !important;
}

body[data-auth="locked"] .backup-allowed,
body:not([data-role="admin"]) .backup-allowed {
  display: none !important;
}

body:not([data-role="admin"]) .api-allowed,
body[data-access-role="reader"] .write-action {
  display: none !important;
}

body[data-can-create-customers="false"] .sidebar-customer-add {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #050505;
  color: #fff7e6;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 10px;
  flex-direction: column;
  border-bottom: 1px solid rgba(245, 164, 0, 0.26);
}

.brand-logo {
  display: block;
  width: min(164px, 100%);
  height: auto;
  max-height: 164px;
  object-fit: contain;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  filter: drop-shadow(0 0 18px rgba(245, 164, 0, 0.18));
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(245, 164, 0, 0.45);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f5a400;
  color: #050505;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 0;
  color: #f5a400;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

nav {
  display: grid;
  gap: 6px;
}

.sidebar-customer-picker {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(245, 164, 0, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 164, 0, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-customer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-customer-head span {
  color: #f5a400;
  font-size: calc(10px * var(--hub-ui-scale, 1));
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-customer-head strong {
  min-width: 24px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.18);
  color: #fff8e8;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.sidebar-customer-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
}

.sidebar-customer-search input {
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #171410;
  padding: 0 9px;
  outline: none;
}

.sidebar-customer-add {
  width: 30px;
  height: 32px;
  border: 1px solid rgba(245, 164, 0, 0.5);
  border-radius: 8px;
  background: #f5a400;
  color: #050505;
  font-size: calc(18px * var(--hub-ui-scale, 1));
  font-weight: 850;
  line-height: 1;
}

.sidebar-customer-list {
  display: grid;
  gap: 6px;
  max-height: min(34vh, 300px);
  min-height: 62px;
  overflow: auto;
  padding-right: 2px;
}

.sidebar-customer-empty {
  border: 1px dashed rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  color: rgba(255, 248, 232, 0.66);
  padding: 10px;
  text-align: center;
}

.sidebar-customer-picker .customer-item {
  min-height: 50px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  border-color: rgba(245, 164, 0, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  padding: 7px;
  box-shadow: none;
}

.sidebar-customer-picker .customer-item:hover,
.sidebar-customer-picker .customer-item.active {
  border-color: rgba(245, 164, 0, 0.78);
  background: rgba(245, 164, 0, 0.18);
  transform: none;
}

.sidebar-customer-picker .customer-avatar {
  width: 34px;
  height: 34px;
}

.sidebar-customer-picker .customer-card-title strong {
  color: #ffffff;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.sidebar-customer-picker .customer-card-title span {
  display: none;
}

.sidebar-customer-picker .customer-card-main > span {
  color: rgba(255, 248, 232, 0.64);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.sidebar-info {
  display: grid;
  gap: 7px;
  padding: 13px 12px;
  border: 1px solid rgba(245, 164, 0, 0.24);
  border-radius: 8px;
  background: rgba(245, 164, 0, 0.07);
  color: #fff7e6;
}

.sidebar-info strong {
  color: #ffffff;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  line-height: 1.25;
}

.sidebar-info span {
  color: #d8cbb5;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1.42;
}

.runtime-status {
  margin-top: auto;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 0 !important;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(245, 164, 0, 0.13), rgba(245, 164, 0, 0.04));
  color: #fff7e6;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.runtime-status:hover:not(:disabled),
.runtime-status:focus-visible {
  border-color: rgba(245, 164, 0, 0.82);
  background: linear-gradient(180deg, rgba(245, 164, 0, 0.2), rgba(245, 164, 0, 0.07));
  outline: none;
}

.runtime-status:disabled {
  cursor: default;
  opacity: 0.78;
}

html body:not(.print-mode) button.runtime-status.runtime-status {
  min-height: 0 !important;
  border-radius: 8px !important;
  padding: 12px !important;
}

.runtime-status span {
  color: #f5a400;
  font-size: calc(10px * var(--hub-ui-scale, 1));
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.runtime-status strong {
  color: #ffffff;
  font-size: calc(14px * var(--hub-ui-scale, 1));
  line-height: 1.2;
}

.runtime-status small {
  color: #d8cbb5;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1.35;
}

.runtime-status .runtime-status-action {
  color: #ffd578;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.legal-links a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(245, 164, 0, 0.12), rgba(0, 0, 0, 0.08)),
    rgba(0, 0, 0, 0.34);
  color: #fff3d2;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 820;
  line-height: 1;
  padding: 0 9px;
  text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  border-color: rgba(255, 194, 71, 0.78);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(245, 164, 0, 0.22);
}

.auth-legal-links {
  justify-content: center;
  border-top: 1px solid rgba(201, 186, 162, 0.58);
  padding-top: 10px;
}

.auth-legal-links a {
  background: rgba(245, 164, 0, 0.08);
  color: #6d4500;
}

.legal-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.legal-settings-form label {
  min-width: 0;
}

.legal-settings-form .wide {
  grid-column: 1 / -1;
}

.legal-settings-form textarea {
  resize: vertical;
}

.legal-preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid rgba(245, 164, 0, 0.24);
  border-radius: 12px;
  background: rgba(245, 164, 0, 0.08);
  padding: 10px;
}

.legal-preview-links a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(245, 164, 0, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff3d2;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 850;
  padding: 0 11px;
  text-decoration: none;
}

.nav-item {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e3d7bf;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  text-align: left;
  font-weight: 760;
  letter-spacing: 0;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(245, 164, 0, 0.14);
  color: #ffffff;
}

.icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #f5a400;
  background: rgba(245, 164, 0, 0.08);
  position: relative;
}

.icon::before,
.icon::after {
  content: "";
  position: absolute;
  border-color: currentColor;
}

.icon-dashboard::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  box-shadow: inset 6px 0 0 transparent;
}

.icon-dashboard::after {
  width: 2px;
  height: 14px;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor;
  opacity: 0.9;
}

.icon-customers::before {
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  top: 6px;
}

.icon-customers::after {
  width: 16px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  bottom: 5px;
}

.icon-backups::before {
  width: 15px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-backups::after {
  width: 8px;
  height: 2px;
  background: currentColor;
  top: 9px;
  box-shadow: 0 5px 0 currentColor;
}

.icon-settings::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-settings::after {
  width: 5px;
  height: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #050505;
}

.icon-legal::before {
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-legal::after {
  width: 8px;
  height: 2px;
  background: currentColor;
  top: 10px;
  box-shadow: 0 5px 0 currentColor;
}

.content {
  min-width: 0;
  min-height: 100vh;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.82), rgba(5, 5, 5, 0.52) 48%, rgba(5, 5, 5, 0.78)),
    var(--customer-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 8px;
  background: rgba(8, 7, 5, 0.66);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  padding: 10px 12px;
  margin-bottom: 16px;
  backdrop-filter: blur(16px);
}

.topbar h1 {
  color: #fff8e8;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.48);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.app-sync-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 430px;
}

.app-sync-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 248, 232, 0.82);
  padding: 3px 7px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1;
  white-space: nowrap;
}

.app-sync-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.14);
}

.app-sync-chip.fresh {
  border-color: rgba(34, 197, 94, 0.38);
  color: #dcfce7;
}

.app-sync-chip.fresh::before {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.app-sync-chip.stale {
  border-color: rgba(248, 113, 113, 0.42);
  color: #fee2e2;
}

.app-sync-chip.stale::before {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 164, 0, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(5, 5, 5, 0.96), rgba(18, 16, 12, 0.9) 48%, rgba(6, 12, 22, 0.96));
  padding: 28px;
}

.auth-gate[hidden] {
  display: none;
}

.auth-shell {
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, 0.72fr);
  overflow: hidden;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.auth-visual {
  position: relative;
  min-height: 520px;
  background: #dcebf6;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: left center;
}

.auth-visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 46%),
    linear-gradient(0deg, rgba(4, 12, 20, 0.18), transparent 44%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  display: grid;
  align-content: center;
  gap: 18px;
  border-left: 1px solid rgba(245, 164, 0, 0.24);
  background:
    linear-gradient(180deg, #ffffff, #fbfaf6);
  padding: clamp(24px, 4vw, 42px);
  overflow: auto;
}

.auth-heading {
  display: grid;
  gap: 10px;
}

.auth-logo {
  display: block;
  width: min(132px, 42vw);
  height: auto;
  border: 1px solid rgba(201, 186, 162, 0.72);
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(23, 20, 16, 0.08);
}

.label-note {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.auth-kicker {
  width: fit-content;
  border: 1px solid rgba(245, 164, 0, 0.36);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.1);
  color: #6d4500;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.auth-heading h1 {
  font-size: calc(30px * var(--hub-ui-scale, 1));
  line-height: 1.08;
  color: #10233a;
}

.auth-card .auth-form {
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.auth-card .auth-form button {
  width: 100%;
}

.admin-login-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.password-reset-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-login-disclosure summary,
.password-reset-disclosure summary {
  cursor: pointer;
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 700;
  padding: 10px 12px;
}

.admin-login-disclosure .auth-form,
.password-reset-disclosure .auth-form {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.auth-hint {
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.force-password-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid rgba(245, 164, 0, 0.48);
  border-radius: 16px;
  background: #080806;
  color: #fff8e8;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(245, 164, 0, 0.18);
  padding: 0;
}

.force-password-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.force-password-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.force-password-card h2 {
  color: #fff8e8;
  margin: 4px 0 6px;
}

.force-password-card p {
  color: rgba(255, 248, 232, 0.74);
  margin: 0;
}

.force-password-card label {
  color: rgba(255, 248, 232, 0.82);
}

.force-password-card input {
  border-color: rgba(245, 164, 0, 0.38);
  background: rgba(0, 0, 0, 0.72);
  color: #fff8e8;
}

.password-policy-note {
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 10px;
  background: rgba(245, 164, 0, 0.08);
  padding: 10px 12px;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.auth-error {
  border: 1px solid rgba(185, 28, 28, 0.52);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  color: #7f1d1d;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 800;
  padding: 10px 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.auth-error[hidden] {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: calc(21px * var(--hub-ui-scale, 1));
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: calc(16px * var(--hub-ui-scale, 1));
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.status-pill {
  min-width: 144px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 9px 14px;
  color: #fff0c8;
  text-align: center;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  backdrop-filter: blur(10px);
}

.status-pill.warning {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.28);
  color: #ffe4e6;
}

.status-pill.inline-status {
  min-width: 0;
  width: fit-content;
  color: #4b2b00;
  background: rgba(245, 164, 0, 0.12);
}

.workspace {
  background: rgba(255, 252, 244, 0.74);
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  padding: 18px;
  backdrop-filter: blur(20px) saturate(1.08);
}

body[data-view="customers"] .content {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.82), rgba(5, 5, 5, 0.52) 48%, rgba(5, 5, 5, 0.78)),
    var(--customer-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body[data-view="customers"] .topbar {
  min-height: 54px;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 8px;
  background: rgba(8, 7, 5, 0.66);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  padding: 12px 16px;
  backdrop-filter: blur(16px);
}

body[data-view="customers"] .topbar h1,
body[data-view="customers"] .topbar p {
  color: #fff8e8;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.48);
}

body[data-view="customers"] .topbar p {
  color: rgba(255, 248, 232, 0.78);
}

body[data-view="customers"] .status-pill {
  border-color: rgba(245, 164, 0, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff0c8;
  backdrop-filter: blur(10px);
}

body[data-view="customers"] #customersView.workspace {
  border-color: rgba(245, 164, 0, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.68), rgba(255, 248, 232, 0.52)),
    rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px) saturate(1.1);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.customer-create-primary {
  flex: 0 0 auto;
  white-space: nowrap;
}

.app-list {
  display: grid;
  gap: 18px;
}

.app-tile-group {
  display: grid;
  gap: 10px;
}

.app-tile-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-tile-group-head h3 {
  margin: 0;
  font-size: calc(15px * var(--hub-ui-scale, 1));
}

.app-tile-group-head span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  background: #050505;
  color: var(--accent);
  font-weight: 800;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.app-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.app-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto;
  gap: 10px;
  align-items: start;
  min-height: 156px;
  border: 1px solid rgba(86, 69, 38, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(18, 14, 8, 0.1);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.link-app-row {
  border-color: rgba(245, 164, 0, 0.52);
  background: #fffaf0;
}

.app-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 10px 22px rgba(0, 0, 0, 0.16);
}

.app-logo img {
  width: 72%;
  height: 72%;
  display: block;
  object-fit: contain;
}

.app-initial {
  color: #fff;
  font-weight: 800;
}

.link-app-row .app-initial {
  color: #050505;
}

.app-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.app-title strong {
  font-size: calc(15px * var(--hub-ui-scale, 1));
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-title span {
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.legal-hub-view {
  gap: 14px;
}

.legal-hub-head {
  align-items: center;
}

.legal-open-link {
  text-decoration: none;
}

.legal-hub-card {
  display: grid;
  gap: 12px;
  min-height: min(760px, calc(100vh - 170px));
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(245, 164, 0, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(20, 20, 18, 0.96), rgba(4, 4, 4, 0.98));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  padding: 14px;
}

.legal-hub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-hub-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(245, 164, 0, 0.16), rgba(0, 0, 0, 0.24)),
    rgba(0, 0, 0, 0.62);
  color: #fff3d2;
  font-weight: 850;
  padding: 0 14px;
  text-decoration: none;
}

.legal-hub-links a:hover,
.legal-hub-links a:focus-visible {
  border-color: rgba(255, 203, 92, 0.82);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(245, 164, 0, 0.22);
}

.legal-frame-shell {
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(245, 164, 0, 0.22);
  border-radius: 12px;
  background: #050505;
}

.legal-frame-shell iframe {
  width: 100%;
  height: min(760px, calc(100vh - 260px));
  min-height: 620px;
  display: block;
  border: 0;
  background: #050505;
}

.tag-strip {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-self: start;
  min-height: 24px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: #fff;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.state {
  grid-column: 1 / -1;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  color: var(--accent-dark);
  font-weight: 750;
}

.port {
  margin-right: auto;
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.row-actions {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  gap: 7px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.app-order-controls {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.icon-only {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.empty-tile-note {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.primary,
.secondary {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: calc(14px * var(--hub-ui-scale, 1));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.inline-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-actions select {
  width: auto;
  min-width: 180px;
  max-width: 260px;
}

.inline-actions #packagePlatform,
.inline-actions #packageVariant {
  min-width: 210px;
  flex: 0 1 240px;
}

.inline-actions #packageVersionBump {
  min-width: 190px;
  flex: 0 1 220px;
}

.inline-actions #packageLicensedTo {
  width: 190px;
  flex: 0 1 190px;
}

.inline-actions #packageVersion {
  width: 150px;
  flex: 0 1 150px;
}

.inline-actions #packageOutputDirectory {
  width: 320px;
  flex: 1 1 280px;
  min-width: 240px;
  max-width: 460px;
}

.backup-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.backup-action-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
  box-shadow: 0 16px 45px rgba(12, 20, 30, 0.08);
}

.backup-action-card.backup-action-card-wide:not([hidden]) {
  max-width: none;
}

.offsite-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.offsite-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(245, 164, 0, 0.10);
  color: #fff8e8;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 850;
}

.offsite-state.ready {
  border-color: rgba(52, 211, 153, 0.58);
  background: rgba(6, 95, 70, 0.38);
}

.offsite-state.pending,
.offsite-state.warning {
  border-color: rgba(251, 191, 36, 0.58);
  background: rgba(120, 53, 15, 0.34);
}

.offsite-config-grid,
.offsite-retention-grid,
.offsite-custodian-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.offsite-config-grid label,
.offsite-retention-grid label,
.offsite-custodian label {
  display: grid;
  gap: 5px;
  color: rgba(255, 248, 232, 0.76);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.offsite-config-grid input,
.offsite-retention-grid input,
.offsite-custodian input {
  width: 100%;
}

.offsite-fieldset {
  min-width: 0;
  border: 1px solid rgba(245, 164, 0, 0.26);
  border-radius: 8px;
  margin: 0;
  padding: 10px;
}

.offsite-fieldset legend {
  color: #f5a400;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 850;
  padding: 0 6px;
}

.offsite-retention-grid {
  grid-template-columns: repeat(3, minmax(90px, 0.35fr)) minmax(240px, 1fr);
  align-items: end;
}

.offsite-retention-grid output {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-left: 3px solid #f5a400;
  background: rgba(245, 164, 0, 0.08);
  color: #fff8e8;
  padding: 7px 10px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 750;
}

.offsite-custodian {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.offsite-custodian > strong {
  grid-column: 1 / -1;
  color: #fff8e8;
}

.offsite-actions {
  justify-content: space-between;
}

.offsite-actions .inline-check {
  min-height: 36px;
}

.offsite-actions small {
  flex: 1 1 300px;
}

.backup-action-head {
  display: grid;
  gap: 4px;
}

.backup-action-kicker {
  color: var(--accent-strong);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.backup-action-head strong {
  font-size: calc(16px * var(--hub-ui-scale, 1));
}

.backup-action-head small,
.backup-control-row small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 700;
  line-height: 1.35;
}

.backup-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.backup-control-row select {
  min-width: 190px;
  width: auto;
}

.backup-action-card .backup-control-row button,
.backup-action-card .package-output-row button {
  min-height: 32px;
  padding: 0 10px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1;
  white-space: nowrap;
}

.success-action,
.restore-action {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  padding: 0 14px;
}

.success-action {
  background: #047857;
}

.success-action:hover {
  background: #065f46;
}

.restore-action {
  background: #d97706;
}

.restore-action:hover {
  background: #b45309;
}

.package-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.package-form-grid label,
.package-output-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.package-form-grid select,
.package-form-grid input,
.package-output-row input {
  width: 100%;
}

.package-customers-field,
.package-output-row,
.package-security-check {
  grid-column: 1 / -1;
}

.package-customers-field select {
  min-height: 116px;
}

.package-output-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
  gap: 8px;
  align-items: end;
}

.package-output-row input[readonly] {
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  cursor: default;
}

.package-advanced-hidden {
  display: none !important;
}

.package-release-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 3px;
}

.package-release-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.package-release-item strong,
.package-release-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-release-item span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.package-release-item code {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-dialog {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.directory-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.directory-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.release-history-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  border: 1px solid rgba(245, 164, 0, 0.72);
  border-radius: 8px;
  padding: 0;
  background: #17191d;
  color: #f8fafc;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.release-history-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.release-history-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  max-height: min(86vh, 760px);
  padding: 22px;
}

.release-history-head,
.release-history-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.release-history-head {
  border-bottom: 1px solid rgba(245, 164, 0, 0.38);
  padding-bottom: 15px;
}

.release-history-head span,
.release-history-entry-head > div:first-child > span {
  display: block;
  margin-bottom: 4px;
  color: #f5a400;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.release-history-head h2,
.release-history-head p,
.release-history-entry h3,
.release-history-entry p {
  margin: 0;
}

.release-history-head h2 {
  font-size: 22px;
}

.release-history-head p {
  margin-top: 5px;
  color: #b9c0ca;
  font-size: 13px;
}

.release-history-list {
  display: grid;
  align-content: start;
  gap: 11px;
  overflow-y: auto;
  padding-right: 5px;
}

.release-history-entry {
  border: 1px solid #3e444d;
  border-left: 4px solid #6b7280;
  border-radius: 7px;
  background: #202329;
  padding: 15px 16px;
}

.release-history-entry.current {
  border-color: rgba(245, 164, 0, 0.72);
  border-left-color: #f5a400;
  background: #29271f;
}

.release-history-entry h3 {
  font-size: 16px;
  line-height: 1.3;
}

.release-history-entry-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #b9c0ca;
  font-size: 12px;
  white-space: nowrap;
}

.release-history-entry-meta strong {
  border-radius: 999px;
  background: #f5a400;
  color: #111318;
  padding: 4px 9px;
  font-size: 11px;
}

.release-history-entry ul {
  display: grid;
  gap: 6px;
  margin: 13px 0 0;
  padding-left: 20px;
  color: #d7dbe1;
  font-size: 13px;
  line-height: 1.45;
}

.app-customer-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  border: 1px solid rgba(245, 164, 0, 0.72);
  border-radius: 10px;
  padding: 0;
  background: #17191d;
  color: #f8fafc;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.app-customer-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.app-customer-dialog form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  max-height: min(86vh, 760px);
  padding: 22px;
}

.app-customer-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(245, 164, 0, 0.38);
  padding-bottom: 14px;
}

.app-customer-dialog-head span {
  display: block;
  margin-bottom: 4px;
  color: #f5a400;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.app-customer-dialog-head h2,
.app-customer-dialog-head p {
  margin: 0;
}

.app-customer-dialog-head h2 {
  font-size: calc(21px * var(--hub-ui-scale, 1));
  letter-spacing: 0;
}

.app-customer-dialog-head p {
  margin-top: 5px;
  color: #b9c0ca;
  font-size: 13px;
}

.app-customer-dialog-search {
  display: grid;
  gap: 6px;
  color: #d6d9df;
  font-size: 12px;
  font-weight: 750;
}

.app-customer-dialog-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #555d68;
  border-radius: 6px;
  background: #0d0f12;
  color: #f8fafc;
  padding: 0 13px;
  font: inherit;
}

.app-customer-dialog-search input:focus {
  border-color: #f5a400;
  outline: 2px solid rgba(245, 164, 0, 0.28);
  outline-offset: 1px;
}

.app-customer-dialog-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

html body:not(.print-mode) dialog.app-customer-dialog button.app-customer-choice.app-customer-choice {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(92px, auto) 112px;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 78px !important;
  border: 1px solid #3e444d;
  border-radius: 7px;
  background: #202329;
  color: #f8fafc;
  padding: 12px 14px !important;
  text-align: left;
  cursor: pointer;
}

.app-customer-choice:hover,
.app-customer-choice:focus-visible {
  border-color: #f5a400;
  background: #292c32;
  outline: none;
}

.app-customer-choice.active {
  border-color: #d49400;
  background: #27271f;
  box-shadow: inset 4px 0 0 #f5a400;
}

.app-customer-choice-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid #555d68;
  border-radius: 6px;
  background: #f8fafc;
  color: #111827;
  font-weight: 900;
}

.app-customer-choice-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-customer-choice-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.app-customer-choice-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-customer-choice-copy strong {
  font-size: 16px;
  line-height: 1.25;
}

.app-customer-choice-copy small,
.app-customer-choice-meta {
  color: #aeb5bf;
  font-size: 13px;
  line-height: 1.35;
}

.app-customer-choice-copy small {
  white-space: normal;
}

.app-customer-choice-open {
  min-width: 108px;
  border-radius: 5px;
  background: #f5a400;
  color: #080808;
  padding: 10px 12px;
  text-align: center;
  font-weight: 900;
}

.app-customer-dialog-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 180px;
  border: 1px dashed #555d68;
  border-radius: 7px;
  color: #b9c0ca;
  padding: 24px;
  text-align: center;
}

.app-customer-dialog-empty strong {
  color: #f8fafc;
}

.app-customer-dialog-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #343941;
  padding-top: 12px;
}

@media (max-width: 620px) {
  .release-history-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .release-history-dialog form {
    max-height: calc(100dvh - 16px);
    padding: 16px;
  }

  .release-history-head,
  .release-history-entry-head {
    align-items: stretch;
    flex-direction: column;
  }

  .release-history-entry-meta {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
  }

  .app-customer-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .app-customer-dialog form {
    max-height: calc(100dvh - 16px);
    gap: 14px;
    padding: 16px;
  }

  .app-customer-dialog-head {
    align-items: stretch;
    flex-direction: column;
  }

  html body:not(.print-mode) dialog.app-customer-dialog button.app-customer-choice.app-customer-choice {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px 12px;
    min-height: 118px !important;
    padding: 13px !important;
  }

  .app-customer-choice-avatar {
    width: 46px;
    height: 46px;
  }

  .app-customer-choice-meta {
    display: none;
  }

  .app-customer-choice-open {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
  }

  .app-customer-dialog-actions .secondary {
    width: 100%;
  }
}

.customer-access-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  border: 1px solid rgba(255, 186, 46, 0.72);
  border-radius: 18px;
  padding: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 186, 46, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(18, 14, 7, 0.99), rgba(0, 0, 0, 0.98));
  color: #fff8e8;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
}

.customer-access-modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(2px);
}

.customer-access-modal form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.customer-access-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 186, 46, 0.24);
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 186, 46, 0.16), rgba(0, 0, 0, 0.86));
}

.customer-access-modal-head h2,
.customer-access-modal-head p {
  margin: 0;
}

.customer-access-modal-head h2 {
  color: #fff8e8;
  font-size: calc(20px * var(--hub-ui-scale, 1));
}

.customer-access-modal-head p {
  color: rgba(255, 239, 199, 0.72);
}

.customer-access-modal-body {
  overflow: auto;
  max-height: calc(min(88vh, 820px) - 112px);
}

.customer-access-modal .customer-access-manage {
  display: grid;
  gap: 16px;
  border: 0;
  padding: 0;
}

.customer-access-modal .customer-access-manage > summary {
  display: none;
}

.customer-access-modal .customer-access-add {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(255, 186, 46, 0.24);
  border-radius: 14px;
  background: rgba(255, 186, 46, 0.05);
}

.customer-access-modal .customer-reader-create {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 186, 46, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.customer-access-modal .customer-reader-create-shell {
  border: 1px solid rgba(255, 186, 46, 0.24);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 186, 46, 0.045);
}

.customer-access-modal .customer-reader-create-shell > summary {
  min-height: 42px;
  border: 1px solid rgba(255, 186, 46, 0.62);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.98), rgba(255, 198, 70, 0.94));
  color: #050505;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(245, 164, 0, 0.22);
}

.customer-access-modal .customer-reader-create-shell > summary::-webkit-details-marker {
  display: none;
}

.customer-access-modal .customer-reader-create-shell:not([open]) .customer-reader-create {
  display: none !important;
}

.customer-access-modal .customer-reader-create .inline-check,
.customer-access-modal .customer-reader-create button {
  grid-column: 1 / -1;
}

.customer-access-modal label {
  color: #fff8e8;
  font-weight: 800;
}

.customer-access-modal input,
.customer-access-modal select {
  min-height: 44px;
  border: 1px solid rgba(255, 186, 46, 0.52);
  border-radius: 12px;
  background: #050505;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
}

.customer-access-modal option {
  background: #050505;
  color: #fff8e8;
}

@media (max-width: 720px) {
  .customer-access-modal form {
    padding: 14px;
  }

  .customer-access-modal-head,
  .customer-access-modal .customer-access-add,
  .customer-access-modal .customer-reader-create {
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column;
    align-items: stretch;
  }
}

.backup-folder-preview {
  display: grid;
  gap: 10px;
}

.backup-folder-preview-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.backup-folder-preview-card strong,
.backup-folder-preview-card span,
.backup-folder-preview-card p {
  margin: 0;
}

.backup-package-row {
  border-color: #f0b35b;
  background: rgba(245, 164, 0, 0.08);
}

.directory-dialog-head,
.directory-path-row,
.directory-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.directory-dialog-head h2,
.directory-dialog-head p {
  margin: 0;
}

.directory-dialog-head p {
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.directory-path-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.directory-list {
  display: grid;
  gap: 6px;
  max-height: min(420px, 55vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.directory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.directory-row:hover,
.directory-row.active {
  border-color: var(--accent);
  background: rgba(245, 164, 0, 0.12);
}

.directory-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.primary {
  background: var(--accent);
  color: #050505;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}

.secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.editor-form,
.customer-form {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 650;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.wide {
  grid-column: 1 / -1;
}

.customer-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: -2px -2px 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.13), rgba(37, 99, 235, 0.08) 54%, rgba(217, 119, 6, 0.1)),
    #f8fbfc;
  border: 1px solid #d6e4e8;
  padding: 18px;
}

.customer-hero h2 {
  font-size: calc(24px * var(--hub-ui-scale, 1));
  line-height: 1.15;
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.customer-stats > div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.customer-stats span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.customer-stats strong {
  font-size: calc(24px * var(--hub-ui-scale, 1));
  line-height: 1;
}

.customer-import {
  margin-bottom: 16px;
}

.customer-import summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.customer-import summary::-webkit-details-marker {
  display: none;
}

.customer-import summary span {
  font-weight: 800;
}

.customer-import summary small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  text-align: right;
}

.customer-import[open] summary {
  margin-bottom: 12px;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.86fr) minmax(420px, 1.14fr);
  gap: 18px;
  align-items: start;
}

.customer-browser {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
}

.customer-searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search {
  margin-bottom: 0;
}

.customer-list,
.preview-list {
  display: grid;
  gap: 9px;
}

.customer-list {
  max-height: calc(100vh - 330px);
  min-height: 260px;
  overflow: auto;
  padding-right: 3px;
}

.customer-item {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.customer-item:hover {
  border-color: #99c4bd;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.08);
  transform: translateY(-1px);
}

.customer-item.active {
  border-color: var(--accent);
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.09), #fff 46%);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.customer-avatar,
.customer-editor-logo {
  border: 1px solid #d4e3e0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #e8f4f2;
  color: var(--accent-dark);
  font-weight: 850;
}

.customer-avatar {
  width: 46px;
  height: 46px;
}

.customer-avatar img,
.customer-editor-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.customer-card-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.customer-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.customer-card-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(14px * var(--hub-ui-scale, 1));
}

.customer-card-title span {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.customer-item span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-card-meta,
.customer-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.customer-card-meta small {
  color: #465668;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.customer-card-tags em {
  border-radius: 999px;
  background: #eef4ff;
  color: #254f95;
  padding: 3px 7px;
  font-style: normal;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 750;
}

.customer-empty {
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.customer-empty strong {
  color: var(--text);
}

.customer-editor-card {
  border: 1px solid #cfe1de;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0)),
    #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto minmax(240px, 0.75fr);
  gap: 12px;
  align-items: center;
}

.customer-editor-main {
  min-width: 0;
}

.customer-access-card {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  width: min(320px, 100%);
  align-self: stretch;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.72), rgba(24, 18, 6, 0.82));
  color: #fff8e8;
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
  max-height: 240px;
  overflow: auto;
}

.customer-access-card[hidden] {
  display: none;
}

.customer-access-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.customer-access-head strong {
  font-size: calc(16px * var(--hub-ui-scale, 1));
  line-height: 1.05;
}

.customer-access-head span,
.customer-access-head strong,
.customer-access-empty {
  color: #fff3d2;
}

.customer-access-list {
  display: grid;
  gap: 6px;
  max-height: 116px;
  overflow: auto;
}

.customer-access-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 108px) auto;
  gap: 6px;
  align-items: center;
}

.customer-access-user-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff8e8;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 850;
}

.customer-access-user-row select {
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: #050505;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
  padding: 5px 8px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.customer-access-user-row select option {
  background: #050505;
  color: #fff8e8;
}

.customer-access-user-menu {
  position: relative;
  min-width: 0;
}

.customer-access-user-menu summary {
  list-style: none;
}

.customer-access-user-menu summary::-webkit-details-marker {
  display: none;
}

.customer-access-user {
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff8e8;
  padding: 6px 9px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
}

.customer-access-user:hover,
.customer-access-user-menu[open] .customer-access-user {
  border-color: rgba(255, 204, 92, 0.76);
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.2), rgba(0, 0, 0, 0.74));
  box-shadow: 0 0 18px rgba(245, 164, 0, 0.18);
}

.customer-access-user small {
  color: rgba(255, 206, 118, 0.82);
}

.customer-access-menu {
  display: grid;
  gap: 7px;
  min-width: min(100%, 270px);
  margin-top: 7px;
  border: 1px solid rgba(245, 164, 0, 0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 16, 13, 0.98), rgba(0, 0, 0, 0.96));
  color: #fff8e8;
  padding: 10px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
}

.customer-access-menu strong,
.customer-access-menu span,
.customer-access-menu small {
  color: #fff8e8;
}

.customer-access-menu small,
.customer-access-menu span {
  color: rgba(255, 239, 199, 0.76);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1.35;
}

.customer-access-menu-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.customer-access-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 8px;
}

.customer-access-add select {
  min-width: 0;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: #050505;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
  padding: 8px 10px;
}

.customer-access-add select option,
.customer-access-add select optgroup {
  background: #050505;
  color: #fff8e8;
}

.customer-access-manage {
  border-top: 1px solid rgba(245, 164, 0, 0.22);
  padding-top: 8px;
}

.customer-access-manage summary {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.2), rgba(0, 0, 0, 0.72));
  padding: 7px 10px;
  color: #fff3d2;
  cursor: pointer;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 900;
  list-style: none;
}

.customer-access-manage summary::-webkit-details-marker {
  display: none;
}

.customer-access-manage[open] summary {
  border-color: rgba(255, 204, 92, 0.78);
}

.customer-reader-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 164, 0, 0.16);
}

.customer-reader-create label {
  color: rgba(255, 248, 232, 0.82);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
}

.customer-reader-create input,
.customer-reader-create select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: #050505;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
  padding: 8px 10px;
}

.customer-reader-create select option {
  background: #050505;
  color: #fff8e8;
}

.customer-reader-create .inline-check {
  justify-content: flex-start;
  min-height: auto;
}

.customer-reader-create .inline-check input {
  width: auto;
  min-height: auto;
  accent-color: #f5a400;
}

@media (max-width: 860px) {
  .customer-editor-card {
    grid-template-columns: 54px minmax(0, 1fr) auto;
  }

  .customer-editor-actions {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: start;
    min-width: 0;
  }

  .customer-access-card {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .customer-editor-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .customer-editor-actions {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* monthly-customer-report-20260712: scoped preview styles for the management report. */
.customer-report-preview .customer-report-running-head,
.customer-report-preview .customer-report-running-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 4px;
  color: #64748b;
  font-size: 11px;
}
.customer-report-preview .customer-report-running-head { border-bottom: 1px solid #d9e2ec; }
.customer-report-preview .customer-report-running-foot { border-top: 1px solid #d9e2ec; }
.customer-report-preview .customer-report-management-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid #d9e2ec;
  border-left: 7px solid #f5a400;
  border-radius: 18px;
  background: #fff7ed;
}
.customer-report-preview .customer-report-management-summary.good { border-left-color: #22c55e; background: #f0fdf4; }
.customer-report-preview .customer-report-management-summary.critical { border-left-color: #ef4444; background: #fef2f2; }
.customer-report-preview .customer-report-management-copy > span,
.customer-report-preview .customer-report-meta-strip span {
  color: #b87500;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.customer-report-preview .customer-report-management-copy > strong {
  display: block;
  margin: 7px 0;
  color: #0f172a;
  font-size: 21px;
  line-height: 1.2;
}
.customer-report-preview .customer-report-management-copy p { margin: 0; }
.customer-report-preview .customer-report-management-kpis,
.customer-report-preview .customer-report-meta-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.customer-report-preview .customer-report-management-kpis > div,
.customer-report-preview .customer-report-meta-strip > div {
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: rgba(255,255,255,.88);
}
.customer-report-preview .customer-report-management-kpis span,
.customer-report-preview .customer-report-management-kpis strong,
.customer-report-preview .customer-report-meta-strip span,
.customer-report-preview .customer-report-meta-strip strong { display: block; }
.customer-report-preview .customer-report-management-kpis strong { margin-top: 3px; color: #0f172a; font-size: 24px; }
.customer-report-preview .customer-report-management-kpis .is-critical strong,
.customer-report-preview .customer-report-management-table tr.is-overdue td:first-child { color: #b91c1c; }
.customer-report-preview .customer-report-meta-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 16px;
  background: #f8fafc;
}
.customer-report-preview .customer-report-meta-strip strong { margin-top: 4px; color: #0f172a; font-size: 12px; }
.customer-report-preview .customer-report-bar-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}
.customer-report-preview .customer-report-bar-value span { color: #334155; font-weight: 800; text-align: right; }
.customer-report-preview .customer-report-management-table tr.is-overdue td:first-child { border-left: 4px solid #ef4444; }
@media screen and (max-width: 900px) {
  .customer-report-preview .customer-report-management-summary,
  .customer-report-preview .customer-report-meta-strip { grid-template-columns: 1fr; }
}

body[data-view="customers"] .customer-editor-card {
  border-color: rgba(245, 164, 0, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 225, 0.56)),
    rgba(255, 255, 255, 0.42);
  box-shadow: 0 16px 46px rgba(5, 5, 5, 0.13);
  backdrop-filter: blur(16px) saturate(1.08);
}

.customer-editor-logo {
  width: 54px;
  height: 54px;
}

.customer-editor-card span,
.customer-editor-card small {
  display: block;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.customer-editor-card strong {
  display: block;
  margin: 2px 0;
  font-size: calc(17px * var(--hub-ui-scale, 1));
  line-height: 1.2;
}

.customer-link-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.customer-link-empty {
  border: 1px dashed #d6dde4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  padding: 12px 14px;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  backdrop-filter: blur(12px);
}

.customer-link-tile {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 96px;
  border: 1px solid #e3d0a6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.14), rgba(255, 255, 255, 0) 58%),
    rgba(255, 255, 255, 0.58);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px) saturate(1.06);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.customer-link-preview-media {
  width: 76px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 34% 26%, rgba(245, 164, 0, 0.34), transparent 48%),
    linear-gradient(135deg, #050505, #2b2111);
  color: #ffc247;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.customer-link-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.customer-link-preview-media:not(.has-image) img {
  object-fit: contain;
  padding: 8px;
}

.customer-link-preview-media span {
  color: #ffc247;
  font-size: calc(16px * var(--hub-ui-scale, 1));
  font-weight: 950;
  letter-spacing: 0;
}

.customer-link-open-tile:hover,
.customer-link-open-tile:focus-visible {
  border-color: rgba(245, 164, 0, 0.74);
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.22), rgba(255, 255, 255, 0) 58%),
    rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
  outline: none;
}

.customer-link-tile strong,
.customer-link-tile em,
.customer-link-tile small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-link-tile strong {
  color: #111827;
  font-size: calc(14px * var(--hub-ui-scale, 1));
  line-height: 1.2;
}

.customer-link-tile em {
  margin-top: 3px;
  color: #8a5a00;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
  font-style: normal;
}

.customer-link-tile small {
  margin-top: 5px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.customer-link-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.customer-link-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.customer-link-list-empty {
  border: 1px dashed rgba(138, 90, 0, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  padding: 10px 12px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.customer-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(245, 164, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}

.customer-link-row strong,
.customer-link-row span,
.customer-link-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-link-row strong {
  color: #171410;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.customer-link-row span {
  margin-top: 3px;
  color: #8a5a00;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 780;
}

.customer-link-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.customer-open-points {
  display: grid;
  grid-template-columns: 104px minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.82), rgba(32, 28, 20, 0.74)),
    rgba(17, 24, 39, 0.66);
  color: #fff;
  padding: 14px;
  box-shadow: 0 18px 42px rgba(5, 5, 5, 0.16);
  backdrop-filter: blur(14px) saturate(1.08);
}

.open-points-ring {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: var(--ring);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.26);
}

.open-points-ring::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: inherit;
  background: #111827;
}

.open-points-ring strong,
.open-points-ring span {
  position: relative;
  z-index: 1;
}

.open-points-ring strong {
  align-self: end;
  font-size: calc(24px * var(--hub-ui-scale, 1));
  line-height: 1;
}

.open-points-ring span {
  align-self: start;
  color: rgba(255, 255, 255, 0.7);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.open-points-copy span,
.open-points-copy small {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.open-points-copy strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: calc(18px * var(--hub-ui-scale, 1));
  line-height: 1.15;
}

.open-points-apps {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  gap: 0;
}

.customer-app-group {
  min-width: 0;
  margin-inline: -4px;
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(90deg, color-mix(in srgb, var(--group-accent) 7%, transparent), transparent 48%);
}

.customer-app-group:first-child {
  border-top: 0;
  padding-top: 8px;
}

.customer-app-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 5px solid var(--group-accent);
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--group-accent) 18%, transparent));
}

.customer-app-group-head > div:first-child {
  min-width: 0;
}

.customer-app-group-head span,
.customer-app-group-head small {
  display: block;
}

.customer-app-group-head span {
  color: #fff;
  font-size: calc(15px * var(--hub-ui-scale, 1));
  font-weight: 850;
}

.customer-app-group-head small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.customer-app-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.customer-app-group-summary {
  display: grid;
  grid-template-columns: 52px auto;
  gap: 9px;
  align-items: center;
  flex: 0 0 auto;
}

.customer-app-group-summary > div:last-child span {
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.customer-app-group-summary > div:last-child small {
  color: rgba(255, 255, 255, 0.58);
  font-size: calc(10px * var(--hub-ui-scale, 1));
}

.customer-app-group-ring {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--group-accent) var(--group-progress), rgba(255, 255, 255, 0.12) 0);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--group-accent) 38%, transparent),
    0 8px 18px color-mix(in srgb, var(--group-accent) 18%, transparent);
}

.customer-app-group-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  background: #171a20;
}

.customer-app-group-ring strong {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1;
}

.open-point-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "name value"
    "detail detail"
    "bar bar";
  column-gap: 10px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font: inherit;
  min-height: 94px;
  padding: 10px 11px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 6px 14px rgba(0, 0, 0, 0.12);
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.open-point-app::before,
.open-point-app::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.open-point-app::before {
  z-index: 2;
  top: 0;
  left: 12px;
  width: 48px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--card-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--card-accent) 54%, transparent);
}

.open-point-app::after {
  z-index: 0;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 20%, transparent), transparent 56%);
  opacity: 0.3;
  transition: opacity 0.18s ease;
}

.open-point-app > * {
  position: relative;
  z-index: 1;
}

.open-point-app:hover {
  border-color: color-mix(in srgb, var(--card-accent) 64%, rgba(255, 255, 255, 0.2));
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 10px 22px color-mix(in srgb, var(--card-accent) 18%, rgba(0, 0, 0, 0.34));
}

.open-point-app:hover::after {
  opacity: 0.46;
}

.open-point-app:focus-visible {
  outline: 2px solid var(--card-accent);
  outline-offset: 2px;
}

.open-point-app > div {
  grid-area: name;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-height: 0;
  min-width: 0;
}

.open-point-app strong {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  hyphens: none;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  line-height: 1.3;
  white-space: normal;
}

.open-point-app em,
.open-point-app small {
  display: block;
}

.open-point-app em {
  grid-area: value;
  margin: 0;
  color: #fff;
  font-style: normal;
  font-size: calc(17px * var(--hub-ui-scale, 1));
  font-weight: 850;
  line-height: 1.12;
  overflow-wrap: normal;
  justify-self: end;
  max-width: 140px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 42%, rgba(255, 255, 255, 0.12));
  border-radius: 4px;
  background: color-mix(in srgb, var(--card-accent) 13%, rgba(0, 0, 0, 0.34));
  padding: 3px 6px;
  text-align: right;
}

.open-point-app small {
  grid-area: detail;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1.35;
  min-height: 1.35em;
}

.open-point-dot {
  margin-top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.open-point-app b,
.open-points-track {
  display: block;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.open-point-app b {
  grid-area: bar;
  margin-top: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

@media (max-width: 620px) {
  .customer-app-group-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 8px;
  }

  .customer-app-group-summary {
    grid-template-columns: 44px minmax(0, 1fr);
    justify-self: stretch;
    text-align: left;
  }

  .customer-app-group-summary > div:last-child {
    display: block;
    max-width: none;
  }

  .customer-app-group-summary > div:last-child span {
    font-size: calc(10px * var(--hub-ui-scale, 1));
    line-height: 1.1;
  }

  .customer-app-group-summary > div:last-child small {
    display: block;
  }

  .customer-app-group-ring {
    width: 42px;
    height: 42px;
  }

  .customer-app-group-grid {
    grid-template-columns: 1fr;
  }

  .open-point-app strong {
    overflow-wrap: anywhere;
  }
}

.open-point-app b i,
.open-points-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.certificate-hub-tile {
  border-color: rgba(245, 164, 0, 0.46);
  background: rgba(245, 164, 0, 0.12);
}

.certificate-hub-tile:hover {
  border-color: rgba(245, 164, 0, 0.72);
  background: rgba(245, 164, 0, 0.18);
}

.open-points-track {
  grid-column: 1 / -1;
}

.open-points-track i {
  background: linear-gradient(90deg, #f5a400, #0f766e);
}

.open-point-app-muted {
  opacity: 0.64;
}

.open-point-app--good {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(20, 83, 45, 0.22);
}

.open-point-app--warning {
  border-color: rgba(245, 164, 0, 0.44);
  background: rgba(120, 74, 0, 0.22);
}

.open-point-app--danger {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(127, 29, 29, 0.24);
}

.open-point-app--muted {
  border-style: dashed;
}

.customer-insights {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.86), rgba(34, 31, 23, 0.78)),
    rgba(17, 24, 39, 0.82);
  color: #fff;
  padding: 14px;
  box-shadow: 0 16px 36px rgba(5, 5, 5, 0.14);
}

.insight-mini-head span,
.insight-mini-head small {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.insight-mini-head strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: calc(17px * var(--hub-ui-scale, 1));
  line-height: 1.15;
}

.customer-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customer-insight-card {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: grid;
  gap: 10px;
  font: inherit;
  padding: 12px;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.customer-insight-card:hover {
  border-color: rgba(245, 164, 0, 0.6);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.work-instruction-card {
  background: rgba(245, 208, 0, 0.09);
}

.insight-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.insight-card-top span:not(.insight-card-dot),
.customer-insight-card small {
  color: rgba(255, 255, 255, 0.62);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 750;
}

.insight-card-top strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: calc(16px * var(--hub-ui-scale, 1));
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-card-top em {
  color: #fff;
  font-size: calc(24px * var(--hub-ui-scale, 1));
  font-style: normal;
  font-weight: 900;
}

.insight-card-dot,
.insight-pill i {
  border-radius: 999px;
  flex: 0 0 auto;
}

.insight-card-dot {
  width: 10px;
  height: 10px;
}

.insight-segments {
  display: flex;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.insight-segments i {
  display: block;
  min-width: 3px;
  height: 100%;
}

.insight-segments.muted i {
  background: rgba(255, 255, 255, 0.24);
}

.insight-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.insight-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
}

.insight-pill i {
  width: 7px;
  height: 7px;
}

.insight-pill b {
  color: #fff;
}

.insight-pill.muted {
  color: rgba(255, 255, 255, 0.58);
}

.customer-form {
  grid-template-columns: 1fr;
}

.form-block,
.settings-panel,
.import-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

details.settings-panel {
  overflow: clip;
}

details.settings-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

details.settings-panel > summary::-webkit-details-marker {
  display: none;
}

details.settings-panel > summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
}

details.settings-panel[open] > summary {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

details.settings-panel[open] > summary::after {
  transform: rotate(225deg);
}

details.settings-panel > summary .inline-actions {
  margin-right: 18px;
}

.settings-panel.collapsible-panel {
  overflow: clip;
}

.settings-panel.collapsible-panel > .section-head {
  margin: -14px;
  padding: 14px;
  cursor: pointer;
  user-select: none;
}

.settings-panel.collapsible-panel > .section-head::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
}

.settings-panel.collapsible-panel:not(.is-collapsed) > .section-head {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-panel.collapsible-panel:not(.is-collapsed) > .section-head::after {
  transform: rotate(225deg);
}

.settings-panel.collapsible-panel.is-collapsed > :not(.section-head) {
  display: none;
}

.customer-form .form-block {
  background: #fff;
  border-color: #dce4ea;
  padding: 16px;
}

body[data-view="customers"] .customer-form .form-block {
  border-color: rgba(245, 164, 0, 0.22);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(5, 5, 5, 0.08);
  backdrop-filter: blur(14px) saturate(1.06);
}

body[data-view="customers"] .customer-form details.form-block > summary {
  background: linear-gradient(90deg, rgba(255, 248, 232, 0.62), rgba(255, 255, 255, 0));
}

body[data-view="customers"] .customer-form details.form-block[open] > summary {
  border-bottom-color: rgba(245, 164, 0, 0.18);
}

body[data-view="customers"] .customer-form label {
  color: #171410;
}

body[data-view="customers"] input,
body[data-view="customers"] select,
body[data-view="customers"] textarea {
  border-color: rgba(138, 90, 0, 0.32);
  background: rgba(255, 255, 255, 0.96);
}

body[data-view="customers"] input:focus,
body[data-view="customers"] select:focus,
body[data-view="customers"] textarea:focus {
  outline: 2px solid rgba(245, 164, 0, 0.24);
  border-color: rgba(245, 164, 0, 0.82);
}

.customer-form details.form-block {
  overflow: clip;
}

.customer-form details.form-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.customer-form details.form-block > summary::-webkit-details-marker {
  display: none;
}

.customer-form details.form-block > summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid #8a5a00;
  border-bottom: 2px solid #8a5a00;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.customer-form details.form-block[open] > summary {
  margin-bottom: 14px;
  border-bottom: 1px solid #edf0f3;
}

.customer-form details.form-block[open] > summary::after {
  transform: rotate(225deg);
}

.customer-form .form-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  color: #17202a;
}

.customer-form details.form-block > summary h3 {
  margin: 0;
}

.customer-form .form-block h3::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.form-block h3,
.settings-panel h3 {
  margin: 0;
  font-size: calc(15px * var(--hub-ui-scale, 1));
}

.customer-form .form-block h3 {
  margin-bottom: 13px;
}

.single-sync-block {
  border-color: #b7d9d4;
  background: #f3faf8;
}

.customer-links-block {
  border-color: #ead6aa;
}

.customer-link-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.customer-link-form .wide {
  grid-column: span 2;
}

.app-connection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.app-connection-row {
  background: #fff;
}

.single-sync-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.single-sync-result {
  margin-top: 10px;
  border: 1px dashed #9ccbc4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  line-height: 1.4;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.nested-list,
.settings-stack,
.lock-list,
.backup-list,
.import-list {
  display: grid;
  gap: 10px;
}

.import-panel {
  margin-bottom: 16px;
}

.import-panel > p {
  margin: 4px 0 12px;
}

.import-row {
  grid-template-columns: auto 44px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  font-weight: 400;
}

.import-row input {
  width: auto;
}

.import-row strong,
.import-row span,
.import-row small {
  display: block;
}

.import-row span,
.import-row small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.sync-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 12px;
  margin-top: 12px;
}

.sync-panel-head,
.sync-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sync-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.sync-check-list,
.sync-preview-list {
  display: grid;
  gap: 8px;
}

.sync-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  font-weight: 500;
}

.sync-check-row.disabled {
  opacity: 0.55;
}

.sync-check-row input {
  width: auto;
}

.sync-check-row strong,
.sync-check-row small {
  display: block;
}

.sync-check-row small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 2px;
}

.sync-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.sync-preview-card.ok {
  border-color: rgba(15, 118, 110, 0.32);
  background: #f2fbf8;
}

.sync-preview-card.warning {
  border-color: rgba(217, 119, 6, 0.42);
  background: #fff8ed;
}

.sync-preview-card strong,
.sync-preview-card span,
.sync-preview-card small {
  display: block;
}

.sync-preview-card span,
.sync-preview-card small,
.sync-empty {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.admin-guide-list {
  display: grid;
  gap: 12px;
}

.admin-guide-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(245, 164, 0, 0.24);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.admin-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-guide-head strong,
.admin-guide-head span {
  display: block;
}

.admin-guide-head span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 2px;
}

.admin-guide-card pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #eadcc2;
  background: #11100e;
  color: #fff7e6;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1.55;
  white-space: pre-wrap;
}

.storage-status-list {
  display: grid;
  gap: 12px;
}

.storage-status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.storage-status-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 2px;
}

.storage-status-summary strong {
  font-size: calc(24px * var(--hub-ui-scale, 1));
}

.storage-status-summary span,
.storage-status-card span,
.storage-status-card small,
.storage-next-step {
  color: var(--muted);
}

.storage-targets,
.storage-state-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storage-status-cards {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.storage-status-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.storage-status-card.is-ok {
  border-left-color: var(--green);
}

.storage-status-card.is-partial {
  border-left-color: var(--gold);
}

.storage-status-card.is-danger {
  border-left-color: var(--danger);
}

.storage-status-card.is-muted {
  border-left-color: var(--line-strong);
}

.storage-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.storage-status-head strong,
.storage-status-head span {
  display: block;
}

.storage-status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 5px 8px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
  white-space: nowrap;
}

.storage-metrics,
.storage-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.storage-metrics span,
.storage-signal-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.storage-status-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.storage-next-step {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.sync-preview-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #92400e;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.document-block {
  overflow: hidden;
}

.file-button {
  position: relative;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.document-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  gap: 12px;
  margin-bottom: 12px;
}

.document-source-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(245, 164, 0, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.72), rgba(255, 255, 255, 0.92));
  padding: 12px;
  margin: 0 0 12px;
}

.document-source-panel > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.document-source-panel strong {
  color: var(--text);
  font-size: calc(14px * var(--hub-ui-scale, 1));
}

.document-source-panel span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.document-source-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.document-source-tile {
  min-height: 74px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(23, 20, 16, 0.06);
}

.document-source-tile:hover {
  border-color: rgba(245, 164, 0, 0.58);
  background: #fffaf0;
}

.document-source-tile.active {
  border-color: rgba(245, 164, 0, 0.92);
  background: #fff3d0;
  box-shadow: inset 3px 0 0 var(--accent), 0 12px 28px rgba(23, 20, 16, 0.09);
}

.document-source-tile.empty {
  opacity: 0.58;
}

.document-source-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #050505;
  color: var(--accent);
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0;
}

.document-source-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.document-source-copy strong,
.document-source-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-source-copy small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 760;
}

.document-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(140px, 0.7fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  margin: 0 0 12px;
}

.document-filter-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 760;
}

.document-filter-grid input,
.document-filter-grid select {
  width: 100%;
  margin-top: 4px;
}

.document-asset-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: rgba(17, 16, 13, 0.92);
  color: #fff8e8;
  cursor: pointer;
}

.document-asset-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.document-asset-toggle span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.document-asset-toggle strong,
.document-asset-toggle small {
  display: block;
}

.document-asset-toggle small {
  color: rgba(255, 248, 232, 0.64);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 600;
}

.document-asset-toggle b {
  min-width: 34px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 164, 0, 0.5);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.12);
  color: #ffc042;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) minmax(560px, 1.5fr);
  gap: 14px;
  align-items: start;
}

.document-table-wrap {
  border: 1px solid rgba(245, 164, 0, 0.2);
  border-radius: 8px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.54);
  max-height: 820px;
  backdrop-filter: blur(14px) saturate(1.08);
}

.document-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.document-table th,
.document-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.document-table th {
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 248, 232, 0.64);
}

.document-table tr {
  cursor: pointer;
}

.document-table tr.active,
.document-table tr:hover {
  background: rgba(245, 164, 0, 0.12);
}

.document-table strong,
.document-table small {
  display: block;
}

.document-table td:first-child {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
}

.document-table td:first-child strong,
.document-table td:first-child small {
  grid-column: 2;
  min-width: 0;
}

.document-table small {
  color: var(--muted);
  margin-top: 3px;
}

.document-thumb {
  grid-row: span 2;
  width: 48px;
  height: 62px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 7px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.document-thumb-sheet {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(15, 118, 110, 0.08) 10px 12px, transparent 12px),
    repeating-linear-gradient(180deg, #fff 0 12px, #eef2f7 12px 13px);
}

.document-thumb-label {
  position: absolute;
  right: 4px;
  bottom: 4px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  padding: 2px 5px;
  font-size: calc(9px * var(--hub-ui-scale, 1));
  font-weight: 800;
  letter-spacing: 0;
}

.document-version {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #edf6f4;
  color: var(--accent-strong);
  padding: 0 9px;
  font-weight: 800;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.document-status-control {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.document-table td:first-child .document-status-control,
.document-table td:first-child .document-status-badge {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
}

.document-status-control select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  padding: 0 8px;
}

.document-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  padding: 0 9px;
  font-weight: 750;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.doc-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.document-preview {
  min-height: 760px;
  border: 1px solid rgba(245, 164, 0, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(238, 242, 247, 0.56);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 650;
  backdrop-filter: blur(14px) saturate(1.06);
}

.document-preview-card {
  width: 100%;
  height: 100%;
  min-height: 760px;
  display: grid;
  grid-template-rows: auto minmax(700px, 1fr);
  background: rgba(255, 255, 255, 0.72);
}

.document-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(245, 164, 0, 0.18);
  background: rgba(248, 250, 252, 0.72);
  color: var(--ink);
}

.document-preview-head strong,
.document-preview-head small {
  display: block;
}

.document-preview-head small {
  color: var(--muted);
  margin-top: 3px;
}

.document-preview iframe,
.document-preview-card iframe {
  width: 100%;
  height: 100%;
  min-height: 700px;
  border: 0;
  background: #fff;
}

.document-preview-image,
.hub-document-dialog-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #1a1a18;
}

.document-preview-placeholder {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.05), rgba(245, 164, 0, 0.08)),
    #fff;
}

.document-preview-placeholder span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.document-preview-placeholder strong {
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: center;
}

/* Keep the document archive on the dark Hub surface. */
.document-block .document-source-tile {
  border-color: rgba(245, 164, 0, 0.3);
  background: rgba(10, 10, 9, 0.9);
  color: #fff8e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.document-block .document-source-tile:hover {
  border-color: rgba(245, 164, 0, 0.64);
  background: rgba(35, 27, 10, 0.96);
}

.document-block .document-source-tile.active {
  border-color: rgba(245, 164, 0, 0.92);
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.22), rgba(11, 10, 8, 0.96) 58%);
  color: #fff8e8;
  box-shadow: inset 3px 0 0 var(--accent), 0 10px 24px rgba(0, 0, 0, 0.24);
}

.document-block .document-source-copy strong {
  color: #fff8e8;
}

.document-block .document-source-copy small,
.document-block .document-source-panel span,
.document-block .document-filter-grid label {
  color: rgba(255, 248, 232, 0.7);
}

.document-block .document-filter-grid {
  border-color: rgba(245, 164, 0, 0.28);
  background: rgba(10, 10, 9, 0.82);
}

.document-block .document-filter-grid input,
.document-block .document-filter-grid select {
  border-color: rgba(245, 164, 0, 0.34);
  background: #171613;
  color: #fff8e8;
  color-scheme: dark;
}

.document-block .document-filter-grid input::placeholder {
  color: rgba(255, 248, 232, 0.5);
}

.document-block .document-table-wrap,
.document-block .document-preview {
  background: rgba(10, 10, 9, 0.82);
}

.document-block .document-table th {
  background: rgba(245, 164, 0, 0.12);
  color: rgba(255, 248, 232, 0.78);
}

.document-block .document-table td {
  color: #fff8e8;
}

.document-block .document-table small,
.document-block .document-preview {
  color: rgba(255, 248, 232, 0.68);
}

.document-block .document-preview-placeholder {
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.08), transparent 42%),
    #11110f;
  color: rgba(255, 248, 232, 0.72);
}

.document-block .document-preview-placeholder strong {
  color: #fff8e8;
}

.hub-document-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.hub-document-dialog {
  width: min(1120px, 96vw);
  height: min(92vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
}

.hub-document-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.hub-document-dialog-head strong,
.hub-document-dialog-head small {
  display: block;
}

.hub-document-dialog-head small {
  color: var(--muted);
  margin-top: 4px;
}

.hub-document-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 760px) {
  .document-asset-toggle {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .document-asset-toggle small {
    line-height: 1.35;
  }
}

.logo-chip {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef2f7;
  color: var(--accent-dark);
  font-weight: 800;
}

.logo-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nested-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.site-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.customer-form .contact-row,
.customer-form .site-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-form .nested-row [data-remove-row] {
  justify-self: start;
}


.customer-form .contact-row,
.customer-form .site-row {
  align-items: stretch;
}

.customer-form .contact-row {
  grid-template-columns: 1fr;
}

.customer-form .contact-row-head,
.customer-form .site-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.customer-form .contact-row-toggle,
.customer-form .site-row-toggle {
  flex: 1 1 auto;
  min-width: 0;
}

.customer-form .contact-row-body,
.customer-form .site-row-body {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(245, 164, 0, 0.16);
}

.customer-form .contact-row[data-collapsed="true"] .contact-row-body,
.customer-form .site-row[data-collapsed="true"] .site-row-body {
  display: none;
}

.customer-form .contact-row[data-collapsed="true"],
.customer-form .site-row[data-collapsed="true"] {
  padding-block: 8px;
}

.customer-form .contact-row[data-collapsed="true"] .site-row-actions,
.customer-form .site-row[data-collapsed="true"] > [data-remove-row] {
  align-self: center;
}

.site-row button {
  justify-self: start;
}

.security-form,
.lock-row,
.openai-form,
.user-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.openai-form {
  grid-template-columns: 180px minmax(240px, 1fr) minmax(220px, 0.9fr) auto auto;
  margin-bottom: 12px;
}

.ai-gateway-settings {
  order: -1;
  scroll-margin-top: 18px;
}

.settings-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
  text-transform: uppercase;
}

.ai-gateway-form,
.ai-gateway-block {
  display: grid;
  gap: 12px;
}

.ai-gateway-form {
  margin: 14px 0;
}

.ai-gateway-block {
  padding: 14px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: rgba(18, 19, 20, 0.78);
}

.ai-gateway-block-head,
.ai-gateway-actions,
.ai-gateway-safety {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-gateway-block-head > div {
  display: grid;
  gap: 3px;
}

.ai-gateway-block-head strong {
  color: #fff8e8;
  font-size: calc(15px * var(--hub-ui-scale, 1));
}

.ai-gateway-block-head span,
.ai-gateway-actions span {
  color: rgba(255, 248, 232, 0.72);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.ai-gateway-connection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.ai-gateway-context-grid,
.ai-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-gateway-context-grid textarea,
.ai-profile-card textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.45;
}

.ai-profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-profile-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(122, 137, 151, 0.34);
  border-radius: 8px;
  background: rgba(30, 32, 34, 0.86);
}

.ai-profile-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff8e8;
  font-weight: 800;
}

.ai-profile-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.ai-gateway-safety {
  justify-content: flex-start;
  padding: 10px 12px;
  border-left: 4px solid #14b8a6;
  background: rgba(15, 118, 110, 0.12);
  color: #e8fffb;
}

.ai-gateway-safety span {
  padding: 5px 8px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.ai-gateway-actions {
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .ai-gateway-connection-grid,
  .ai-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ai-gateway-settings,
  .ai-gateway-form,
  .ai-gateway-block,
  .ai-gateway-block-head,
  .ai-gateway-block-head > div,
  .ai-gateway-connection-grid,
  .ai-gateway-context-grid,
  .ai-profile-grid,
  .ai-profile-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ai-gateway-connection-grid,
  .ai-gateway-context-grid,
  .ai-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-gateway-connection-grid > *,
  .ai-gateway-context-grid > *,
  .ai-profile-grid > *,
  .ai-gateway-connection-grid input,
  .ai-gateway-context-grid textarea,
  .ai-profile-card textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ai-gateway-block {
    padding: 12px;
  }

  .ai-gateway-actions .primary,
  .ai-gateway-connection-grid .secondary {
    width: 100%;
  }
}

.openai-help-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.72);
  color: #fff8e8;
  font-weight: 800;
}

.openai-help-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.openai-help-toggle span {
  color: inherit;
  line-height: 1.2;
}

.security-form#adminPasswordForm {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.hub-signature-settings {
  display: grid;
  gap: 12px;
}

.hub-signature-preview,
.hub-signature-pad-wrap {
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 8px;
  background: #fff;
  color: #172022;
}

.hub-signature-preview {
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #5c4630;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.hub-signature-preview-stage {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: 720 / 220;
  background: #fff;
}

.hub-signature-preview-card {
  width: min(100%, 720px);
  display: grid;
  gap: 8px;
  padding: 10px;
}

.hub-signature-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid rgba(23, 32, 34, 0.18);
  color: #172022;
  text-align: left;
}

.hub-signature-preview-meta span {
  display: grid;
  gap: 2px;
}

.hub-signature-preview-meta strong {
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.hub-signature-preview-meta small {
  color: #667174;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 600;
}

.hub-signature-preview-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hub-signature-preview-stage .signature-background {
  inset: 50% auto auto 50%;
  width: calc(42% * var(--signature-background-scale, 1));
  height: auto;
  max-width: calc(280px * var(--signature-background-scale, 1));
  max-height: calc(86px * var(--signature-background-scale, 1));
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.hub-signature-preview-stage .signature-ink {
  z-index: 1;
}

.hub-signature-pad-wrap {
  padding: 8px;
}

#signaturePad {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  min-height: 160px;
  margin: 0 auto;
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}

.hub-signature-actions,
.hub-signature-background {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.signature-opacity-control {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) 44px;
  gap: 9px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 8, 6, 0.92);
  color: #fff8e8;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.signature-opacity-control input {
  accent-color: var(--accent);
}

.signature-opacity-control strong {
  text-align: right;
}

.signature-helper {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.openai-test-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.openai-test-result.pending {
  border-color: rgba(217, 119, 6, 0.34);
  background: #fff8ed;
  color: #92400e;
}

.openai-test-result.ok {
  border-color: rgba(15, 118, 110, 0.34);
  background: #f1fbf7;
  color: #0f766e;
}

.openai-test-result.error {
  border-color: rgba(185, 28, 28, 0.3);
  background: #fff1f2;
  color: #b91c1c;
}

.openai-usage-dashboard {
  display: grid;
  gap: 16px;
  margin: 16px 0 12px;
}

.openai-usage-dashboard:empty {
  display: none;
}

.ai-usage-heading,
.ai-usage-section-head,
.ai-user-usage-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-usage-heading > div,
.ai-usage-section-head > div,
.ai-user-usage-title > div {
  min-width: 0;
}

.ai-usage-heading strong,
.ai-usage-heading span,
.ai-usage-section-head strong,
.ai-usage-section-head span,
.ai-user-usage-title strong,
.ai-user-usage-title span {
  display: block;
}

.ai-usage-heading > div > strong {
  font-size: calc(18px * var(--hub-ui-scale, 1));
}

.ai-usage-heading > div > span,
.ai-usage-section-head > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.ai-usage-date,
.ai-usage-section-head > span {
  flex: 0 0 auto;
  border: 1px solid rgba(168, 137, 255, 0.42);
  border-radius: 999px;
  background: rgba(217, 204, 255, 0.2);
  color: #503278;
  padding: 5px 9px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
}

.openai-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.openai-usage-grid article {
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 232, 0.82));
  color: var(--ink);
  padding: 10px 12px;
  min-width: 0;
}

.openai-usage-grid strong {
  display: block;
  color: var(--ink);
  font-size: calc(20px * var(--hub-ui-scale, 1));
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.openai-usage-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.ai-limit-health {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.48);
  border-radius: 8px;
  background: rgba(254, 243, 199, 0.55);
}

.ai-usage-meter-warning {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 8px;
  background: rgba(254, 243, 199, 0.58);
  color: #713f12;
}

.ai-usage-meter-warning strong,
.ai-usage-meter-warning span {
  display: block;
}

.ai-usage-meter-warning span {
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1.4;
}

.ai-limit-health.protected {
  border-color: rgba(22, 163, 74, 0.42);
  background: rgba(220, 252, 231, 0.62);
}

.ai-limit-health-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d97706;
}

.ai-limit-health.protected .ai-limit-health-indicator {
  background: #15803d;
}

.ai-limit-health strong,
.ai-limit-health span {
  display: block;
}

.ai-limit-health > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1.45;
}

.ai-limit-health-count {
  color: var(--ink);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 900;
  text-align: right;
}

.ai-usage-last {
  grid-column: span 2;
}

.ai-usage-section {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(245, 164, 0, 0.26);
}

.ai-usage-section-head {
  margin-bottom: 10px;
}

.ai-user-usage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.ai-user-usage-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(168, 137, 255, 0.38);
  border-radius: 8px;
  background: rgba(231, 221, 255, 0.3);
  padding: 11px;
}

.ai-user-usage-title > div > strong {
  color: var(--ink);
  font-size: calc(14px * var(--hub-ui-scale, 1));
}

.ai-user-usage-title > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.ai-user-usage-title > strong {
  flex: 0 0 auto;
  color: #503278;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.ai-user-usage-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 85, 130, 0.18);
}

.ai-user-usage-progress > span {
  display: block;
  width: var(--ai-usage-percent, 0%);
  height: 100%;
  border-radius: inherit;
  background: #7c55c7;
}

.ai-user-usage-card.near-limit {
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(254, 243, 199, 0.55);
}

.ai-user-usage-card.near-limit .ai-user-usage-progress > span {
  background: #f59e0b;
}

.ai-user-usage-card.limit-reached {
  border-color: rgba(239, 68, 68, 0.72);
  background: rgba(254, 226, 226, 0.6);
}

.ai-user-usage-card.limit-reached .ai-user-usage-progress > span {
  background: #dc2626;
}

.ai-user-usage-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.ai-user-usage-metrics span,
.ai-user-usage-card small {
  min-width: 0;
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ai-user-usage-metrics strong {
  display: inline;
  color: var(--ink);
  font-size: inherit;
}

.ai-usage-unmetered {
  border-left: 3px solid #d97706;
  padding-left: 8px;
  color: #92400e !important;
}

.ai-app-usage-list {
  display: grid;
  gap: 6px;
}

.ai-app-usage-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(96px, 0.7fr));
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(245, 164, 0, 0.18);
  padding: 9px 4px;
}

.ai-app-usage-card:last-child {
  border-bottom: 0;
}

.ai-app-usage-card > div {
  min-width: 0;
}

.ai-app-usage-card strong,
.ai-app-usage-card span {
  display: block;
  overflow-wrap: anywhere;
}

.ai-app-usage-card strong {
  color: var(--ink);
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.ai-app-usage-card span,
.ai-usage-empty {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

.ai-usage-empty {
  padding: 12px;
  border: 1px dashed rgba(168, 137, 255, 0.4);
  border-radius: 8px;
}

.ai-request-log {
  min-width: 0;
  border-top: 1px solid rgba(245, 164, 0, 0.26);
  padding-top: 12px;
}

.ai-request-log > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.ai-request-log > summary small {
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.ai-request-log-list {
  display: grid;
  max-height: 420px;
  overflow: auto;
  margin-top: 10px;
  border: 1px solid rgba(168, 137, 255, 0.3);
  border-radius: 8px;
}

.ai-request-log-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(150px, 1.2fr) repeat(4, minmax(90px, 0.7fr));
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(122, 137, 151, 0.2);
}

.ai-request-log-row:last-child {
  border-bottom: 0;
}

.ai-request-log-row.unmetered {
  background: rgba(254, 243, 199, 0.42);
}

.ai-request-log-row strong,
.ai-request-log-row span {
  display: block;
  overflow-wrap: anywhere;
}

.ai-request-log-row strong {
  color: var(--ink);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.ai-request-log-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: calc(10px * var(--hub-ui-scale, 1));
  font-weight: 700;
}

@media (max-width: 760px) {
  .openai-usage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-usage-heading,
  .ai-usage-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-limit-health {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .ai-limit-health-count {
    grid-column: 2;
    text-align: left;
  }

  .ai-user-usage-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }

  .ai-app-usage-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-request-log-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .ai-usage-last {
    grid-column: auto;
  }

  .ai-user-usage-title {
    align-items: flex-start;
  }

  .ai-user-usage-metrics,
  .ai-app-usage-card,
  .ai-request-log-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-request-log > summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(122, 137, 151, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  max-height: min(72vh, 720px);
  overflow: auto;
  align-items: start;
}

.user-form[hidden] {
  display: none;
}

.user-form > button[type="submit"],
.user-form > #cancelUserEditButton {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.user-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(122, 137, 151, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.user-toolbar input {
  width: 100%;
}

.user-toolbar span,
.edit-state {
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.edit-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.user-admin-head {
  margin-top: 18px;
}

.security-workflow,
.package-flow-hint {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: rgba(255, 248, 237, 0.88);
  color: #4b2b00;
}

.security-workflow strong,
.package-flow-hint strong {
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.security-workflow span,
.package-flow-hint span {
  color: #6b3a00;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 700;
  line-height: 1.35;
}

.role-permission-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.role-permission-preview strong {
  display: block;
  margin-bottom: 8px;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.role-permission-preview p {
  margin: 0 0 10px;
  color: var(--muted);
}

.role-rule-note {
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 8px;
  background: rgba(245, 164, 0, 0.1);
  color: #6b3a00;
  padding: 8px 10px;
  font-weight: 800;
}

.role-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-chip-row span {
  border: 1px solid rgba(245, 164, 0, 0.35);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.1);
  color: var(--text);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  padding: 5px 8px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.user-access-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-access-panel {
  min-width: 0;
  border: 1px solid rgba(122, 137, 151, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
}

.user-access-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.85fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.user-access-head strong {
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.user-access-head input {
  min-height: 34px;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pilot-access-preset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 8px;
  background: rgba(245, 164, 0, 0.08);
}

.pilot-access-preset strong,
.pilot-access-preset small,
.access-selection-summary strong,
.access-selection-summary span {
  display: block;
}

.pilot-access-preset small {
  margin-top: 3px;
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1.35;
}

.access-selection-summary {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 3px solid rgba(122, 137, 151, 0.55);
  border-radius: 6px;
  background: rgba(122, 137, 151, 0.08);
}

.access-selection-summary.is-pilot {
  border-left-color: #18a67b;
  background: rgba(24, 166, 123, 0.09);
}

.access-selection-summary strong {
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.access-selection-summary span {
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  line-height: 1.35;
}

.access-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(122, 137, 151, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
}

.access-check input {
  width: auto;
  margin-top: 2px;
}

.access-check span,
.access-check strong,
.access-check small {
  display: block;
  min-width: 0;
}

.access-check strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.access-check small {
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.user-app-grid,
.user-list {
  display: grid;
  gap: 8px;
}

.user-app-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}

.user-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

@media screen and (max-width: 880px) {
  .pilot-access-preset {
    grid-template-columns: minmax(0, 1fr);
  }

  .pilot-access-preset button {
    width: 100%;
  }
}

.user-card-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
}

.user-row-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.user-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.role-badge,
.user-status-pill {
  width: fit-content;
  border: 1px solid rgba(245, 164, 0, 0.36);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.1);
  color: #7a4300;
  padding: 4px 8px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
}

.role-admin .role-badge,
.role-masteradmin .role-badge {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.role-reader .role-badge {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.11);
  color: #1d4ed8;
}

.user-status-pill.credential-ok {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.13);
  color: #047857;
}

.user-status-pill.credential-warning {
  border-color: rgba(245, 164, 0, 0.48);
  background: rgba(245, 164, 0, 0.14);
  color: #7a4300;
}

.user-status-pill.credential-danger {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
}

.user-status-pill.ai-usage {
  color: #39235f;
  background: #e7ddff;
  border-color: #b99cff;
}

.user-status-pill.ai-usage.near-limit {
  color: #713f12;
  background: #fef3c7;
  border-color: #f59e0b;
}

.user-status-pill.ai-usage.limit-reached {
  color: #7f1d1d;
  background: #fee2e2;
  border-color: #ef4444;
}

.user-form label small,
.ai-gateway-connection-grid label small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted, #a9a4b3);
  font-size: 0.76rem;
  line-height: 1.35;
}

.user-credential-result {
  margin-top: 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.12), transparent 54%),
    rgba(0, 0, 0, 0.78);
  color: #fffaf0;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.user-credential-result[hidden] {
  display: none;
}

.user-credential-result.sent {
  border-color: rgba(34, 197, 94, 0.42);
}

.user-credential-result.manual {
  border-color: rgba(245, 164, 0, 0.46);
}

.user-credential-result > div {
  display: grid;
  gap: 3px;
}

.user-credential-result strong,
.user-credential-result span,
.user-credential-result small {
  color: #fffaf0;
}

.user-credential-result small,
.user-credential-result span {
  color: rgba(255, 250, 240, 0.78);
}

.user-credential-result pre {
  margin: 0;
  border: 1px solid rgba(245, 164, 0, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.64);
  color: #fffaf0;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.user-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-meta-grid small {
  border: 1px solid rgba(122, 137, 151, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  padding: 4px 8px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.user-warning {
  color: #b91c1c;
  font-style: normal;
  font-weight: 900;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tenant-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.tenant-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.tenant-create-panel {
  border: 1px solid rgba(245, 164, 0, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  margin: 10px 0 12px;
  overflow: hidden;
}

.tenant-create-panel > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 11px 12px;
  font-weight: 900;
}

.tenant-create-panel > summary small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 800;
}

.tenant-create-panel .tenant-form {
  margin: 0;
  padding: 12px;
  border-top: 1px solid rgba(245, 164, 0, 0.2);
}

.onboarding-assistant-panel {
  border-color: rgba(245, 164, 0, 0.28);
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.12), transparent 46%),
    rgba(8, 8, 6, 0.92);
  color: #fffaf0;
}

.onboarding-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.onboarding-form .wide,
.onboarding-output {
  grid-column: 1 / -1;
}

.onboarding-form label,
.onboarding-form strong,
.onboarding-output strong,
.onboarding-output span,
.onboarding-output small,
.onboarding-output li {
  color: #fffaf0;
}

.onboarding-form input {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(245, 164, 0, 0.42);
  color: #fffaf0;
}

.onboarding-reader-limit {
  align-self: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.onboarding-app-picker,
.onboarding-output {
  border: 1px solid rgba(245, 164, 0, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  padding: 12px;
}

.onboarding-subhead,
.onboarding-result,
.onboarding-summary-grid,
.onboarding-chip-row {
  display: flex;
  gap: 10px;
}

.onboarding-subhead,
.onboarding-result {
  justify-content: space-between;
  align-items: center;
}

.onboarding-subhead small,
.onboarding-output small {
  color: rgba(255, 250, 240, 0.72);
}

.onboarding-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}

.onboarding-app-check {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 164, 0, 0.25);
}

.onboarding-output {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.onboarding-result {
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.onboarding-result > div,
.onboarding-summary-grid article {
  display: grid;
  gap: 3px;
}

.onboarding-result.ok {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.onboarding-result.warning,
.onboarding-checklist.warning {
  border-color: rgba(245, 164, 0, 0.52);
  background: rgba(245, 164, 0, 0.11);
}

.onboarding-result.danger,
.onboarding-checklist.danger {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.22);
}

.onboarding-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.onboarding-summary-grid article,
.onboarding-checklist {
  border: 1px solid rgba(245, 164, 0, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
  padding: 10px;
}

.onboarding-summary-grid article span {
  color: rgba(255, 250, 240, 0.62);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
  text-transform: uppercase;
}

.onboarding-checklist ul,
.onboarding-checklist ol {
  margin: 8px 0 0;
  padding-left: 18px;
}

.onboarding-chip-row {
  flex-wrap: wrap;
  margin-top: 8px;
}

.onboarding-chip-row span {
  border: 1px solid rgba(245, 164, 0, 0.3);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.12);
  padding: 5px 8px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
}

.tenant-form-extended {
  grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1fr) minmax(120px, 0.55fr) minmax(120px, 0.55fr) auto auto;
}

.tenant-reader-limit {
  align-self: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.tenant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.tenant-row.tenant-card-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px;
}

.tenant-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tenant-title-line em,
.tenant-chip-row small {
  display: inline-flex;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.1);
  color: #7a4300;
  padding: 4px 8px;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-style: normal;
  font-weight: 900;
}

.tenant-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.tenant-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tenant-row:not(.is-expanded) .tenant-limit-panel,
.tenant-row:not(.is-expanded) .tenant-branding-panel,
.tenant-row:not(.is-expanded) .tenant-app-access {
  display: none;
}

.tenant-row.is-expanded {
  align-items: start;
}

.tenant-main {
  min-width: 0;
}

.tenant-app-access {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

.tenant-limit-panel {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

.tenant-branding-panel {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

.tenant-branding-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tenant-branding-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tenant-branding-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.tenant-branding-preview {
  display: grid;
  place-items: center;
  min-height: 78px;
  padding: 12px;
  border: 1px dashed rgba(245, 164, 0, 0.36);
  border-radius: 8px;
  background: #11100d;
  color: rgba(255, 250, 240, 0.72);
  text-align: center;
}

.tenant-branding-preview img {
  display: block;
  width: auto;
  max-width: min(360px, 100%);
  max-height: 74px;
  object-fit: contain;
}

.tenant-limit-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(140px, 0.5fr) minmax(160px, auto);
  gap: 8px;
  align-items: end;
}

.tenant-app-access-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.tenant-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding-right: 4px;
}

.tenant-row.is-suspended {
  background: #fff7ed;
  border-color: rgba(245, 164, 0, 0.42);
}

.tenant-row strong,
.tenant-row span {
  display: block;
}

.tenant-row span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.tenant-user-scope {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  margin: 12px 0;
}

.tenant-user-scope > div {
  display: grid;
  gap: 3px;
}

.tenant-user-scope strong,
.tenant-user-scope span,
.tenant-user-scope small {
  display: block;
}

.tenant-user-scope strong small {
  margin-top: 3px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 600;
  color: var(--muted);
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.backup-action-card:not([hidden]) {
  max-width: 980px;
}

.user-row strong,
.user-row span {
  display: block;
}

.user-row span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.user-status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(245, 164, 0, 0.36);
  border-radius: 999px;
  background: rgba(245, 164, 0, 0.1);
  color: #92400e;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-top: 7px;
  padding: 4px 8px;
}

.user-row.user-card-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
}

.user-row.user-card-row .user-title-line span,
.user-row.user-card-row .user-title-line strong,
.user-row.user-card-row .user-meta-grid small {
  display: inline-flex;
  margin-top: 0;
}

.user-status-pill.warning {
  border-color: rgba(245, 164, 0, 0.52);
}

.danger-button {
  color: var(--danger);
}

.settings-link-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.settings-link-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.settings-link-row strong,
.settings-link-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-link-row span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.theme-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.theme-preview {
  min-height: 118px;
  border: 1px solid rgba(245, 164, 0, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42)),
    var(--customer-bg-image);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.header-theme-preview {
  min-height: 82px;
  border-color: rgba(245, 164, 0, 0.52);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28)),
    var(--hub-shell-header-image);
  background-size: cover;
  background-position: center;
}

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

.lock-row {
  grid-template-columns: minmax(180px, 1fr) 130px minmax(170px, 0.6fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.lock-row strong,
.lock-row span,
.backup-row strong,
.backup-row span {
  display: block;
}

.lock-row span,
.backup-row span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
}

.checkbox-label input {
  width: auto;
}

.backup-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-width: 0;
}

.backup-list-full {
  gap: 14px;
}

.backup-workbench {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.backup-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.backup-nav > strong {
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.backup-nav > strong:first-child {
  margin-top: 0;
}

.backup-app-nav {
  display: grid;
  gap: 8px;
  max-height: 230px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.backup-nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f7faf9;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.backup-nav-button.active,
.backup-nav-button:hover {
  border-color: #9fd1ca;
  background: #eaf7f4;
}

.backup-nav-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.backup-nav-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.backup-nav-empty {
  border: 1px dashed #d6dde4;
  border-radius: 8px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin: 0;
  padding: 10px;
}

.backup-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.backup-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.backup-overview-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.backup-overview-card:not(.readonly) {
  cursor: pointer;
}

.backup-overview-card.active,
.backup-overview-card:not(.readonly):hover {
  border-color: #9fd1ca;
  background: #eaf7f4;
}

.backup-overview-card.warning {
  border-color: rgba(217, 119, 6, 0.55);
  background: rgba(255, 247, 237, 0.94);
}

.backup-overview-card.warning strong {
  color: #92400e;
}

.backup-status-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(122, 137, 151, 0.28);
  background: rgba(255, 255, 255, 0.78);
}

.backup-status-panel.ok {
  border-color: rgba(22, 163, 74, 0.32);
}

.backup-status-panel.warning {
  border-color: rgba(217, 119, 6, 0.42);
  background: rgba(255, 247, 237, 0.92);
}

.backup-status-panel strong,
.backup-status-panel span,
.backup-status-panel small {
  display: block;
}

.backup-status-panel > div:first-child span,
.backup-status-panel small {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.backup-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.backup-status-grid span {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(122, 137, 151, 0.22);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.backup-status-grid b {
  color: var(--accent);
  margin-right: 4px;
}

.backup-overview-card span {
  color: var(--muted);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.backup-overview-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(22px * var(--hub-ui-scale, 1));
}

.backup-overview-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.backup-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.package-result {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: rgba(255, 248, 237, 0.92);
  color: #4b2b00;
}

.package-result code {
  display: block;
  overflow-x: auto;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
  color: #111827;
}

.backup-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 750;
}

.backup-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  min-width: 0;
  overflow: hidden;
}

.backup-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.backup-group-head strong,
.backup-group-head span {
  display: block;
}

.backup-group-head span {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 3px;
}

.backup-table {
  display: grid;
  gap: 8px;
  max-height: 370px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
}

.pagination-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(122, 137, 151, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 8px 10px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 750;
}

.pagination-strip.readonly {
  justify-content: flex-end;
}

.pagination-strip > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pagination-strip strong {
  color: var(--text);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  white-space: nowrap;
}

.document-pagination-row td {
  padding: 8px 0;
}

.backup-row > div {
  min-width: 0;
  overflow: hidden;
}

.backup-row span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.backup-row code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-lock-note {
  color: var(--muted);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 750;
  text-align: right;
}

/* Backup view dark contrast sweep */
#backupsView {
  color: #fff8e8;
}

body[data-view="backups"] .workspace {
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.92), rgba(12, 8, 2, 0.94)),
    var(--customer-bg-image);
  background-size: cover;
  background-position: center;
}

body[data-view="operations"] .content {
  background:
    linear-gradient(180deg, rgba(18, 20, 23, 0.96), rgba(8, 9, 11, 0.98)),
    var(--customer-bg-image);
}

#operationsView {
  display: none;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

#operationsView.active {
  display: grid;
}

.operations-overview,
.operations-panel {
  border: 1px solid rgba(245, 164, 0, 0.3);
  border-radius: 8px;
  background: rgba(22, 24, 28, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.operations-overview {
  padding: 16px;
  border-left-width: 4px;
}

.operations-overview[data-status="ok"] { border-left-color: #27b77d; }
.operations-overview[data-status="warning"] { border-left-color: #f5b942; }
.operations-overview[data-status="critical"] { border-left-color: #e05252; }

.operations-overview-head,
.operations-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.operations-overview-head > div,
.operations-panel-head > div {
  display: grid;
  gap: 3px;
}

.operations-overview-head span,
.operations-panel-head span,
.operations-metric > span {
  color: #d3b36e;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.operations-overview-head strong {
  color: #f6f7f9;
  font-size: 22px;
}

.operations-overview-head small,
.operations-panel-head small {
  color: #aeb5bf;
}

.operations-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.operations-metric {
  min-width: 0;
  min-height: 108px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 12px;
  border: 1px solid #3d4148;
  border-radius: 6px;
  background: #191c20;
}

.operations-metric strong {
  color: #f6f7f9;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.operations-metric small {
  color: #aeb5bf;
  line-height: 1.35;
}

.operations-metric.ok { border-color: rgba(39, 183, 125, 0.64); background: rgba(20, 80, 59, 0.28); }
.operations-metric.warning { border-color: rgba(245, 185, 66, 0.72); background: rgba(104, 74, 17, 0.27); }
.operations-metric.critical { border-color: rgba(224, 82, 82, 0.75); background: rgba(105, 29, 29, 0.3); }

.operations-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.operations-panel {
  min-width: 0;
  padding: 14px;
}

.operations-panel-head {
  padding-bottom: 10px;
  border-bottom: 1px solid #3a3d42;
}

.operations-panel-head strong {
  color: #f5f6f8;
  font-size: 15px;
}

.operations-findings,
.operations-events {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.operations-finding,
.operations-event {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #373b42;
  border-radius: 6px;
  background: #15171a;
}

.operations-finding > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8d96a3;
}

.operations-finding.ok > span { background: #27b77d; }
.operations-finding.warning > span { background: #f5b942; }
.operations-finding.critical > span { background: #e05252; }

.operations-finding div,
.operations-event div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.operations-finding strong,
.operations-event strong {
  color: #f1f3f5;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.operations-finding small,
.operations-event small {
  color: #aeb5bf;
  line-height: 1.35;
}

.operations-event {
  grid-template-columns: 48px minmax(0, 1fr);
}

.operations-event-status {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 5px;
  background: #842f2f;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.operations-table-wrap {
  min-width: 0;
  overflow-x: auto;
  margin-top: 10px;
}

.operations-table {
  width: 100%;
  border-collapse: collapse;
  color: #e8ebef;
}

.operations-table th,
.operations-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #373b42;
  text-align: left;
  vertical-align: top;
}

.operations-table th {
  color: #d3b36e;
  font-size: 11px;
  text-transform: uppercase;
}

.operations-table code {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #dce3ec;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .operations-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operations-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  #operationsView { gap: 10px; }
  .operations-overview,
  .operations-panel { padding: 11px; }
  .operations-overview-head { display: grid; }
  .operations-overview-head strong { font-size: 19px; }
  .operations-metrics { grid-template-columns: 1fr 1fr; }
  .operations-metric { min-height: 98px; padding: 10px; }
  .operations-metric strong { font-size: 17px; }
  .operations-table { min-width: 560px; }
}

#backupsView .section-head h2,
#backupsView .section-head h3,
#backupsView .backup-action-head strong,
#backupsView .backup-group-head strong,
#backupsView .backup-row strong,
#backupsView .backup-overview-card strong,
#backupsView .backup-status-panel strong,
#backupsView .pagination-strip strong {
  color: #fff8e8;
}

#backupsView .section-head p,
#backupsView .backup-action-head small,
#backupsView .backup-control-row small,
#backupsView .backup-group-head span,
#backupsView .backup-row span,
#backupsView .backup-status-panel small,
#backupsView .backup-status-panel > div:first-child span,
#backupsView .backup-overview-card small,
#backupsView .pagination-strip,
#backupsView .admin-lock-note {
  color: rgba(255, 248, 232, 0.72);
}

#backupsView .backup-action-card,
#backupsView .backup-nav,
#backupsView .backup-toolbar,
#backupsView .backup-group,
#backupsView .backup-overview-card,
#backupsView .backup-status-panel,
#backupsView .backup-row,
#backupsView .pagination-strip,
#backupsView .package-result {
  border-color: rgba(245, 164, 0, 0.30);
  background:
    linear-gradient(135deg, rgba(18, 18, 16, 0.96), rgba(4, 4, 3, 0.94)),
    radial-gradient(circle at 18% 0%, rgba(245, 164, 0, 0.16), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 34px rgba(0, 0, 0, 0.25);
  color: #fff8e8;
}

#backupsView .backup-action-card input,
#backupsView .backup-action-card select,
#backupsView .backup-toolbar input,
#backupsView .backup-toolbar select {
  border-color: rgba(245, 164, 0, 0.38);
  background: rgba(0, 0, 0, 0.72);
  color: #fff8e8;
}

#backupsView select option {
  background: #11100d;
  color: #fff8e8;
}

#backupsView .backup-action-kicker,
#backupsView .backup-nav > strong,
#backupsView .backup-overview-card span,
#backupsView .backup-toolbar label {
  color: #f5a400;
}

#backupsView .backup-nav-button {
  border-color: rgba(245, 164, 0, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #fff8e8;
}

#backupsView .backup-nav-button.active,
#backupsView .backup-nav-button:hover,
#backupsView .backup-overview-card.active,
#backupsView .backup-overview-card:not(.readonly):hover {
  border-color: rgba(245, 164, 0, 0.72);
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.24), rgba(20, 13, 2, 0.94)),
    rgba(0, 0, 0, 0.66);
}

#backupsView .backup-nav-button strong {
  background: rgba(245, 164, 0, 0.18);
  color: #fff8e8;
}

#backupsView .backup-overview-card.warning,
#backupsView .backup-status-panel.warning {
  border-color: rgba(245, 164, 0, 0.62);
  background:
    linear-gradient(135deg, rgba(49, 28, 2, 0.96), rgba(7, 6, 4, 0.96)),
    radial-gradient(circle at 10% 0%, rgba(245, 164, 0, 0.22), transparent 48%);
}

#backupsView .backup-overview-card.warning strong {
  color: #fff8e8;
}

#backupsView .backup-status-panel.ok {
  border-color: rgba(88, 199, 141, 0.34);
}

#backupsView .backup-status-grid span {
  border-color: rgba(245, 164, 0, 0.22);
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 248, 232, 0.76);
}

#backupsView .backup-status-grid b {
  color: #f5a400;
}

#backupsView .backup-nav-empty,
#backupsView .empty-cell,
#backupsView .empty-state {
  border-color: rgba(245, 164, 0, 0.30);
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 248, 232, 0.72);
}

#backupsView code,
#backupsView .package-result code,
#backupsView .backup-row code {
  border: 1px solid rgba(245, 164, 0, 0.24);
  background: rgba(0, 0, 0, 0.46);
  color: #fff8e8;
}

.compact-head {
  margin-bottom: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.right-panel {
  display: none;
  border-left: 1px solid rgba(245, 164, 0, 0.34);
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.88), rgba(19, 11, 2, 0.92)),
    var(--customer-bg-image);
  background-size: cover;
  background-position: right center;
  color: #fff8e8;
  padding: 14px 12px;
}

.right-panel .panel-head {
  border-bottom-color: rgba(245, 164, 0, 0.26);
}

.right-panel .panel-head span,
.right-panel p {
  color: rgba(255, 248, 232, 0.72);
}

.right-panel input {
  border-color: rgba(245, 164, 0, 0.3);
  background: rgba(255, 255, 255, 0.96);
}

.right-panel .customer-item {
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-color: rgba(245, 164, 0, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff8e8;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.right-panel .customer-avatar {
  width: 34px;
  height: 34px;
}

.right-panel .customer-item:hover,
.right-panel .customer-item.active {
  border-color: rgba(245, 164, 0, 0.86);
  background: rgba(245, 164, 0, 0.18);
}

.right-panel .customer-card-main span,
.right-panel .customer-card-title span,
.right-panel .customer-card-meta small {
  color: rgba(255, 248, 232, 0.72);
}

.right-panel .customer-card-title strong {
  color: #ffffff;
}

body[data-view="customers"] .right-panel {
  border-left-color: rgba(245, 164, 0, 0.34);
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.88), rgba(19, 11, 2, 0.92)),
    var(--customer-bg-image);
  background-size: cover;
  background-position: right center;
  color: #fff8e8;
}

body[data-view="customers"] .right-panel .panel-head {
  border-bottom-color: rgba(245, 164, 0, 0.26);
}

body[data-view="customers"] .right-panel .panel-head span,
body[data-view="customers"] .right-panel p {
  color: rgba(255, 248, 232, 0.72);
}

body[data-view="customers"] .right-panel input {
  border-color: rgba(245, 164, 0, 0.3);
  background: rgba(255, 255, 255, 0.96);
}

body[data-view="customers"] .right-panel .customer-item {
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-color: rgba(245, 164, 0, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff8e8;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

body[data-view="customers"] .right-panel .customer-item:hover,
body[data-view="customers"] .right-panel .customer-item.active {
  border-color: rgba(245, 164, 0, 0.86);
  background: rgba(245, 164, 0, 0.18);
}

body[data-view="customers"] .right-panel .customer-card-main span,
body[data-view="customers"] .right-panel .customer-card-title span,
body[data-view="customers"] .right-panel .customer-card-meta small {
  color: rgba(255, 248, 232, 0.72);
}

body[data-view="customers"] .right-panel .customer-card-title strong {
  color: #ffffff;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.panel-head span {
  color: var(--muted);
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.side-searchbar {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

body[data-view="customers"] .customer-layout {
  grid-template-columns: minmax(0, 1fr);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.doc-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
  display: grid;
  gap: 8px;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #374151;
  padding: 5px 7px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }

  .customer-list {
    max-height: none;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-visual {
    min-height: 280px;
  }

  .auth-card {
    border-left: 0;
    border-top: 1px solid rgba(245, 164, 0, 0.24);
  }

  .right-panel {
    display: none;
  }
}

@media (max-height: 760px) {
  .auth-card {
    align-content: start;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
  }

  .brand {
    margin-bottom: 2px;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item span:last-child {
    display: none;
  }

  .runtime-status {
    margin-top: 0;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 10px;
    padding: 8px 10px;
  }

  .runtime-status span {
    grid-row: 1 / 3;
  }

  .runtime-status strong,
  .runtime-status small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-customer-list {
    max-height: 150px;
  }

  .content {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .customer-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .customer-browser {
    position: static;
  }

  .app-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .app-logo {
    width: 52px;
    height: 52px;
  }

  .tag-strip,
  .state,
  .port,
  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .editor-form,
  .customer-layout,
  .sync-grid,
  .document-upload-grid,
  .document-filter-grid,
  .document-workspace,
  .docs-grid,
  .form-grid,
  .nested-row,
  .site-row,
  .customer-link-form,
  .customer-link-tile,
  .customer-link-row,
  .customer-open-points,
  .open-points-apps,
  .customer-insights,
  .customer-insight-grid,
  .security-form,
  .openai-form,
  .tenant-form,
  .tenant-limit-grid,
  .tenant-user-scope,
  .user-form,
  .user-toolbar,
  .user-app-grid,
  .user-access-panels,
  .user-access-head,
  .app-connection-grid,
  .single-sync-grid,
  .theme-form,
  .tenant-row,
  .user-row,
  .lock-row,
  .settings-link-row,
  .backup-status-panel,
  .backup-status-grid,
  .backup-row {
    grid-template-columns: 1fr;
  }

  .customer-link-form .wide {
    grid-column: auto;
  }

  .customer-link-actions {
    justify-content: flex-start;
  }

  .legal-hub-card {
    min-height: auto;
    padding: 10px;
  }

  .legal-hub-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-hub-links a {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .legal-frame-shell,
  .legal-frame-shell iframe {
    min-height: 560px;
  }

  .backup-workbench {
    grid-template-columns: 1fr;
  }

  .backup-nav {
    position: static;
  }

  .backup-action-grid {
    grid-template-columns: 1fr;
  }

  .package-form-grid,
  .package-output-row {
    grid-template-columns: 1fr;
  }

  .offsite-config-grid,
  .offsite-retention-grid,
  .offsite-custodian-grid,
  .offsite-custodian {
    grid-template-columns: 1fr;
  }

  .offsite-custodian > strong {
    grid-column: auto;
  }

  .backup-toolbar {
    grid-template-columns: 1fr;
  }

  .backup-overview {
    grid-template-columns: 1fr;
  }

  .customer-searchbar {
    grid-template-columns: 1fr;
  }

  .row-actions {
    flex-wrap: wrap;
  }
}

@media screen and (min-width: 861px) and (max-width: 1100px) {
  html,
  body {
    overflow-x: hidden;
  }

  .shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .sidebar {
    min-width: 0;
    padding: 12px 8px;
    gap: 10px;
  }

  .brand span,
  .sidebar-info {
    display: none;
  }

  .brand {
    align-items: center;
    padding-bottom: 8px;
  }

  nav {
    gap: 6px;
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item span:last-child {
    display: none;
  }

  .runtime-status {
    padding: 8px 6px;
  }

  .runtime-status strong,
  .runtime-status small {
    display: none;
  }

  .content {
    min-width: 0;
  }

  .sidebar-customer-picker {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .sidebar-customer-head span {
    display: none;
  }

  .sidebar-customer-list {
    max-height: 118px;
  }
}

@media screen and (min-width: 761px) and (max-width: 860px) {
  .sidebar {
    max-height: 46vh;
    overflow: auto;
  }

  .brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
  }

  .brand span,
  .sidebar-info {
    display: none;
  }

  .sidebar-customer-picker {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .sidebar-customer-list {
    max-height: 104px;
  }

  .content {
    min-width: 0;
  }
}

@media screen and (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .shell {
    display: block;
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    max-height: 42vh;
    overflow: auto;
    padding: 8px;
    gap: 8px;
  }

  .brand,
  .sidebar-info,
  .runtime-status {
    display: none;
  }

  .sidebar-customer-picker {
    display: grid;
    gap: 6px;
    padding: 8px;
  }

  .sidebar-customer-head {
    gap: 8px;
  }

  .sidebar-customer-head span {
    display: none;
  }

  .sidebar-customer-search {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .sidebar-customer-list {
    max-height: 112px;
  }

  nav {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 4px;
  }

  .nav-item {
    min-height: 42px;
    padding: 0 6px;
  }

  .content {
    min-width: 0;
    padding: 12px;
  }

  .topbar-actions,
  .inline-actions,
  .row-actions,
  .access-actions,
  .customer-link-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .status-pill,
  .state,
  .port {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .app-row,
  .tenant-row,
  .user-row,
  .backup-row {
    padding: 10px;
  }

  .tenant-app-grid {
    grid-template-columns: 1fr;
    max-height: 240px;
  }

  .auth-gate {
    align-items: start;
    padding: 12px;
    min-height: 100dvh;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-visual {
    min-height: 118px;
  }

  .auth-visual img {
    object-position: left top;
  }

  .auth-card {
    width: 100%;
    gap: 12px;
    padding: 14px;
  }

  .auth-heading h1 {
    font-size: calc(22px * var(--hub-ui-scale, 1));
    color: #10233a;
  }

  .auth-logo {
    width: min(104px, 36vw);
    padding: 8px;
  }

  .auth-form,
  .admin-login-panel,
  .tenant-app-grid,
  .onboarding-form,
  .onboarding-app-grid,
  .onboarding-summary-grid,
  .user-app-grid,
  .user-access-panels {
    grid-template-columns: 1fr;
  }

  .toast {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform: translateY(12px);
  }

  .toast.show {
    transform: translateY(0);
  }
}

/* hub-workspace-clarity-20260721 */
.nav-item[hidden],
.backup-allowed[hidden],
.master-only[hidden] {
  display: none !important;
}

.app-launcher-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 8px;
  background: #171a20;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.app-launcher-toolbar > div span,
.app-launcher-toolbar > div strong {
  display: block;
}

.app-launcher-toolbar > div span {
  color: #ffb51f;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 800;
  text-transform: uppercase;
}

.app-launcher-toolbar > div strong {
  margin-top: 2px;
  color: #f8fafc;
  font-size: calc(18px * var(--hub-ui-scale, 1));
}

.app-launcher-search {
  width: min(420px, 46vw);
  margin: 0;
}

.app-launcher-search input {
  width: 100%;
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.18);
  background: #0f1115;
  color: #f8fafc;
}

.app-list {
  display: grid;
  gap: 14px;
}

.app-list .app-tile-group {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #f5a400;
  border-radius: 8px;
  background: #171a20;
}

.app-list .app-tile-group:nth-child(2) { border-left-color: #20b8a6; }
.app-list .app-tile-group:nth-child(3) { border-left-color: #4f8ee8; }
.app-list .app-tile-group:nth-child(4) { border-left-color: #8b6ce8; }
.app-list .app-tile-group:nth-child(5) { border-left-color: #94a3b8; }

.app-list .app-tile-group-head {
  margin-bottom: 10px;
}

.app-list .app-tile-group-head h3 {
  color: #f8fafc;
  font-size: calc(15px * var(--hub-ui-scale, 1));
}

.app-list .app-tile-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.app-launcher-empty {
  display: grid;
  gap: 5px;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed rgba(245, 164, 0, 0.42);
  border-radius: 8px;
  color: #f8fafc;
  background: #171a20;
}

.app-launcher-empty span {
  color: #aeb6c2;
}

body[data-view="customers"] .customer-editor-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  grid-template-areas:
    "logo main actions"
    "access access access";
  min-height: 0;
  padding: 14px 16px;
  gap: 12px 16px;
  border-radius: 8px;
  background: #171a20;
}

body[data-view="customers"] .customer-editor-logo {
  grid-area: logo;
  width: 68px;
  height: 68px;
  border-radius: 8px;
}

body[data-view="customers"] .customer-editor-main {
  grid-area: main;
  align-self: center;
  min-width: 0;
}

body[data-view="customers"] .customer-editor-main > strong {
  display: -webkit-box;
  overflow: hidden;
  color: #f8fafc;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-view="customers"] .customer-editor-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: end;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 460px;
}

body[data-view="customers"] .customer-access-card {
  grid-area: access;
}

.customer-workspace-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 4px;
  margin: 10px 0;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: rgba(15, 17, 21, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  scrollbar-width: thin;
}

.customer-workspace-tabs button {
  flex: 1 0 auto;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #aeb6c2;
  font: inherit;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 750;
  cursor: pointer;
}

.customer-workspace-tabs button:hover,
.customer-workspace-tabs button:focus-visible {
  border-color: rgba(245, 164, 0, 0.4);
  color: #fff;
}

.customer-workspace-tabs button.active {
  border-color: rgba(245, 164, 0, 0.76);
  background: rgba(245, 164, 0, 0.15);
  color: #ffd36a;
}

.customer-panel-inactive {
  display: none !important;
}

body[data-view="customers"] .customer-link-tiles,
body[data-view="customers"] .customer-open-points,
body[data-view="customers"] .customer-insights,
body[data-view="customers"] .customer-form .form-block,
body[data-view="customers"] .customer-organigramm-inline {
  margin-top: 10px;
}

body[data-view="customers"] .customer-open-points {
  grid-template-columns: 88px minmax(220px, 1fr);
  gap: 12px 16px;
  padding: 16px;
  border-radius: 8px;
  background: #171a20;
}

body[data-view="customers"] .open-points-ring {
  width: 78px;
  height: 78px;
}

.customer-priorities {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 8px;
  background: #101318;
}

.customer-priorities > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.customer-priorities > header span,
.customer-priorities > header small {
  display: block;
}

.customer-priorities > header span {
  color: #fff;
  font-size: calc(14px * var(--hub-ui-scale, 1));
  font-weight: 850;
}

.customer-priorities > header small {
  margin-top: 2px;
  color: #98a2b3;
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.customer-priorities > header > b {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #f5a400;
  color: #111;
  font-size: 12px;
}

.customer-priorities > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
}

.customer-priority {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "app arrow"
    "value arrow"
    "detail arrow";
  gap: 2px 10px;
  min-width: 0;
  min-height: 78px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 181, 31, 0.35);
  border-radius: 7px;
  background: #1c1b17;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.customer-priority:hover,
.customer-priority:focus-visible {
  border-color: #ffb51f;
  background: #282216;
  transform: translateY(-1px);
}

.customer-priority > span { grid-area: app; color: #d6dae1; font-size: 11px; }
.customer-priority > strong { grid-area: value; font-size: 15px; }
.customer-priority > small { grid-area: detail; overflow: hidden; color: #9da6b3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.customer-priority > b { grid-area: arrow; align-self: center; color: #ffb51f; font-size: 24px; }
.customer-priority--danger { border-color: rgba(239, 68, 68, 0.55); background: #261718; }
.customer-priority--danger > strong,
.customer-priority--danger > b { color: #ff8a8a; }

.customer-priority-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid rgba(32, 184, 166, 0.42);
  border-radius: 7px;
  background: rgba(32, 184, 166, 0.08);
  color: #ecfdf5;
}

.customer-priority-empty span { color: #a7f3d0; font-size: 12px; }

body[data-view="customers"] .customer-app-group {
  padding-block: 14px;
  background: color-mix(in srgb, var(--group-accent) 5%, #171a20);
}

body[data-view="customers"] .open-point-app {
  min-height: 102px;
  background: #22262d;
}

body[data-view="customers"] .open-point-app > em {
  font-size: calc(17px * var(--hub-ui-scale, 1));
  font-style: normal;
}

body[data-view="customers"] .open-point-app > b {
  background: rgba(255, 255, 255, 0.1);
}

body[data-view="customers"] .open-points-track {
  background: rgba(255, 255, 255, 0.1);
}

body[data-view="customers"] .open-points-track i {
  background: linear-gradient(90deg, #f5a400, #20b8a6);
}

@media screen and (max-width: 760px) {
  .app-launcher-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 11px;
  }

  .app-launcher-search {
    width: 100%;
  }

  .app-list .app-tile-group {
    padding: 9px;
  }

  .app-list .app-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-view="customers"] .customer-editor-card {
    grid-template-columns: 50px minmax(0, 1fr);
    grid-template-areas:
      "logo main"
      "actions actions"
      "access access";
    padding: 10px;
    gap: 9px;
  }

  body[data-view="customers"] .customer-editor-logo {
    width: 50px;
    height: 50px;
  }

  body[data-view="customers"] .customer-editor-main > strong {
    font-size: 18px;
  }

  body[data-view="customers"] .customer-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: none;
  }

  body[data-view="customers"] .customer-editor-actions > :first-child {
    grid-column: 1 / -1;
  }

  body[data-view="customers"] .customer-editor-actions button {
    min-height: 40px;
    white-space: normal;
  }

  .customer-workspace-tabs {
    top: 0;
    margin-block: 8px;
    padding: 4px;
  }

  .customer-workspace-tabs button {
    flex: 0 0 auto;
    min-height: 40px;
    padding-inline: 12px;
  }

  body[data-view="customers"] .customer-open-points {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 11px;
    gap: 10px;
  }

  body[data-view="customers"] .open-points-ring {
    width: 60px;
    height: 60px;
  }

  body[data-view="customers"] .open-points-ring::after {
    inset: 8px;
  }

  body[data-view="customers"] .open-points-ring strong {
    font-size: 18px;
  }

  body[data-view="customers"] .open-points-copy strong {
    font-size: 15px;
  }

  .customer-priorities {
    padding: 9px;
  }

  .customer-priorities > div,
  body[data-view="customers"] .customer-app-group-grid {
    grid-template-columns: 1fr;
  }

  body[data-view="customers"] .customer-app-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-view="customers"] .customer-app-group-summary {
    width: 100%;
  }
}

/* customer-picker-compact-20260528 */
.hub-customer-context.sidebar-customer-picker {
  padding: 10px 12px;
  gap: 8px;
  margin-bottom: 12px;
}

.hub-customer-picker-tools {
  gap: 6px;
}

.hub-customer-context .sidebar-customer-search {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.hub-customer-context .sidebar-customer-search input,
.hub-customer-context .sidebar-customer-add {
  height: 34px;
  min-height: 34px;
}

.hub-customer-context .sidebar-customer-add {
  width: 34px;
}

.hub-customer-context .sidebar-customer-list {
  min-height: 64px;
  gap: 7px;
}

.hub-customer-context .customer-item {
  flex-basis: clamp(205px, 22vw, 285px);
  min-height: 58px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  padding: 6px;
}

.hub-customer-context .customer-avatar {
  width: 44px;
  height: 44px;
}

.hub-customer-context .customer-card-title strong {
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.hub-customer-context .customer-card-main > span {
  font-size: calc(10px * var(--hub-ui-scale, 1));
}

@media screen and (max-width: 760px) {
  .hub-customer-context .customer-item {
    flex-basis: min(72vw, 260px);
  }
}

/* customer-picker-logo-polish-20260602 */
.hub-customer-context .customer-item {
  min-height: 68px;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
}

.hub-customer-context .customer-avatar {
  width: 58px;
  height: 58px;
  border-radius: 10px;
}

.hub-customer-context .customer-avatar img {
  padding: 5px;
}

@media screen and (max-width: 760px) {
  .hub-customer-context .customer-item {
    grid-template-columns: 50px minmax(0, 1fr);
    min-height: 60px;
  }

  .hub-customer-context .customer-avatar {
    width: 50px;
    height: 50px;
  }
}

/* customer-notes-20260528 */
.customer-note-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.14), rgba(245, 164, 0, 0.035) 42%, rgba(0, 0, 0, 0.46)),
    rgba(0, 0, 0, 0.42);
  padding: 14px;
}

.customer-note-composer::before {
  content: "Neue Notiz - noch nicht gespeichert";
  position: absolute;
  top: -10px;
  left: 14px;
  border: 1px solid rgba(245, 164, 0, 0.36);
  border-radius: 999px;
  background: rgba(10, 8, 2, 0.94);
  color: #ffc247;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  text-transform: uppercase;
}

.customer-note-composer label {
  color: #ffd16a;
}

.customer-note-composer textarea {
  background: rgba(0, 0, 0, 0.68);
  border-color: rgba(255, 194, 71, 0.74);
}

.customer-note-composer textarea::placeholder {
  color: rgba(255, 248, 232, 0.58);
}

.customer-note-list {
  display: grid;
  gap: 10px;
}

.customer-note-empty {
  border: 1px dashed rgba(255, 248, 232, 0.20);
  border-radius: 12px;
  background: rgba(255, 248, 232, 0.035);
  color: rgba(255, 248, 232, 0.72);
  padding: 13px 14px;
}

.customer-note-empty.warning {
  border-color: rgba(245, 164, 0, 0.38);
  background: rgba(245, 164, 0, 0.08);
  color: #ffe2a3;
}

.customer-note-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  gap: 10px;
  margin: 0 0 12px;
}

.customer-note-hint {
  margin: 0 0 12px;
  border: 1px solid rgba(245, 164, 0, 0.22);
  border-radius: 10px;
  background: rgba(245, 164, 0, 0.08);
  color: rgba(255, 248, 232, 0.76);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1.4;
  padding: 8px 10px;
}

.customer-note-card {
  border: 1px solid rgba(63, 196, 132, 0.28);
  border-left: 4px solid rgba(63, 196, 132, 0.86);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(63, 196, 132, 0.10), transparent 38%),
    rgba(0, 0, 0, 0.50);
  color: #fff8e8;
  padding: 12px;
}

.customer-note-card--legacy {
  border-color: rgba(245, 164, 0, 0.34);
  border-left-color: rgba(245, 164, 0, 0.86);
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.10), transparent 38%),
    rgba(0, 0, 0, 0.50);
}

.customer-note-card::before {
  content: "Gespeichert";
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  border: 1px solid rgba(63, 196, 132, 0.34);
  border-radius: 999px;
  background: rgba(63, 196, 132, 0.10);
  color: #9cf0c3;
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  text-transform: uppercase;
}

.customer-note-card--legacy::before {
  content: "Aus Stammdaten";
  border-color: rgba(245, 164, 0, 0.34);
  background: rgba(245, 164, 0, 0.10);
  color: #ffd16a;
}

.customer-note-card > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(245, 164, 0, 0.18);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.customer-note-card > header div,
.customer-note-comment > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.customer-note-card strong,
.customer-note-comment strong {
  color: #ffffff;
}

.customer-note-card span,
.customer-note-comment span {
  color: rgba(255, 248, 232, 0.62);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.customer-note-card p,
.customer-note-comment p {
  margin: 0;
  color: rgba(255, 248, 232, 0.86);
  line-height: 1.45;
}

.customer-note-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-note-count {
  color: rgba(255, 248, 232, 0.58);
  display: inline-block;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  margin-top: 8px;
}

.customer-note-toggle {
  margin-top: 10px;
  width: fit-content;
}

.customer-note-details {
  border-top: 1px solid rgba(245, 164, 0, 0.18);
  margin-top: 10px;
  padding-top: 10px;
}

.customer-note-comments {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.customer-note-comment {
  border-left: 2px solid rgba(245, 164, 0, 0.42);
  background: rgba(255, 248, 232, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
}

.customer-note-comment.empty,
.customer-note-empty {
  border: 1px dashed rgba(245, 164, 0, 0.3);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 248, 232, 0.7);
  padding: 10px 12px;
}

.customer-note-empty.warning {
  border-color: rgba(255, 178, 67, 0.55);
  color: #ffd995;
}

.customer-note-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.customer-note-comment-form textarea {
  min-height: 48px;
}

@media screen and (max-width: 760px) {
  .customer-note-composer,
  .customer-note-tools,
  .customer-note-comment-form {
    grid-template-columns: 1fr;
  }
}

.hub-customer-context.sidebar-customer-picker {
  padding: 10px 12px;
  gap: 8px;
  margin-bottom: 12px;
}

.hub-customer-picker-tools {
  gap: 6px;
}

.hub-customer-context .sidebar-customer-search {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.hub-customer-context .sidebar-customer-search input,
.hub-customer-context .sidebar-customer-add {
  height: 34px;
  min-height: 34px;
}

.hub-customer-context .sidebar-customer-add {
  width: 34px;
}

.hub-customer-context .sidebar-customer-list {
  min-height: 64px;
  gap: 7px;
}

.hub-customer-context .customer-item {
  flex-basis: clamp(205px, 22vw, 285px);
  min-height: 58px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  padding: 6px;
}

.hub-customer-context .customer-avatar {
  width: 44px;
  height: 44px;
}

.hub-customer-context .customer-card-title strong {
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.hub-customer-context .customer-card-main > span {
  font-size: calc(10px * var(--hub-ui-scale, 1));
}

@media screen and (max-width: 760px) {
  .customer-note-composer,
  .customer-note-comment-form {
    grid-template-columns: 1fr;
  }

  .hub-customer-context .customer-item {
    flex-basis: min(72vw, 260px);
  }
}

/* sites-collapse-20260528 */
.site-add-button {
  min-width: 88px;
  justify-content: center;
}

.site-empty-state {
  border: 1px dashed rgba(245, 164, 0, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.08), transparent 42%),
    rgba(0, 0, 0, 0.36);
  color: rgba(255, 248, 232, 0.78);
  padding: 12px 14px;
  line-height: 1.45;
}

.site-empty-state strong {
  color: var(--accent);
}

.customer-form .site-row,
.site-row {
  --site-level-color: #f5a400;
  --site-level-rgb: 245, 164, 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  padding: 0;
  position: relative;
  overflow: visible;
  border-color: rgba(var(--site-level-rgb), 0.48);
  border-left: 3px solid var(--site-level-color);
  background:
    linear-gradient(135deg, rgba(var(--site-level-rgb), 0.1), rgba(255, 255, 255, 0.02)),
    rgba(0, 0, 0, 0.56);
}

.site-row[data-site-level="werk"] {
  --site-level-color: #60a5fa;
  --site-level-rgb: 96, 165, 250;
}

.site-row[data-site-level="halle"] {
  --site-level-color: #2dd4bf;
  --site-level-rgb: 45, 212, 191;
}

.site-row[data-site-level="bereich"] {
  --site-level-color: #4ade80;
  --site-level-rgb: 74, 222, 128;
}

.site-row[data-site-depth="1"] { margin-left: 22px; }
.site-row[data-site-depth="2"] { margin-left: 44px; }
.site-row[data-site-depth="3"] { margin-left: 66px; }

.site-row[data-site-depth]:not([data-site-depth="0"])::before {
  content: "";
  position: absolute;
  left: -17px;
  top: -11px;
  width: 13px;
  height: 38px;
  border-left: 1px solid rgba(var(--site-level-rgb), 0.55);
  border-bottom: 1px solid rgba(var(--site-level-rgb), 0.55);
  border-bottom-left-radius: 7px;
  pointer-events: none;
}

.site-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.site-row-toggle {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(var(--site-level-rgb), 0.3);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  justify-self: stretch;
  text-align: left;
  cursor: pointer;
}

.site-row button.site-row-toggle {
  justify-self: stretch;
}

.site-row-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(var(--site-level-rgb), 0.16);
  color: var(--site-level-color);
  border: 1px solid rgba(var(--site-level-rgb), 0.46);
  font-weight: 900;
}

.site-row-summary {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.site-row-summary-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.site-row-type {
  flex: 0 0 auto;
  min-width: 68px;
  border: 1px solid rgba(var(--site-level-rgb), 0.46);
  border-radius: 999px;
  background: rgba(var(--site-level-rgb), 0.16);
  color: var(--site-level-color);
  padding: 2px 8px;
  font-size: calc(10px * var(--hub-ui-scale, 1));
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.site-row-summary-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row-summary strong,
.site-row-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-row-summary small {
  color: rgba(255, 248, 232, 0.68);
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.site-row-summary small.is-empty {
  color: rgba(255, 248, 232, 0.48);
}

.site-row-body {
  border-top: 1px solid rgba(245, 164, 0, 0.2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.site-row[data-collapsed="true"] .site-row-body {
  display: none;
}

.site-row .danger-button {
  align-self: center;
  justify-self: end;
}

@media screen and (max-width: 760px) {
  .site-row[data-site-depth="1"] { margin-left: 10px; }
  .site-row[data-site-depth="2"] { margin-left: 20px; }
  .site-row[data-site-depth="3"] { margin-left: 30px; }

  .site-row[data-site-depth]:not([data-site-depth="0"])::before {
    left: -8px;
    width: 6px;
  }

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

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

  .site-row .danger-button {
    justify-self: stretch;
  }

  .site-row-summary-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media screen and (max-height: 700px) and (max-width: 760px) {
  .auth-visual {
    min-height: 86px;
  }
}

@media (max-width: 1180px) {
  .user-access-panels,
  .user-app-grid {
    grid-template-columns: 1fr;
  }
}


.customer-editor-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  justify-self: center;
  align-self: center;
  min-width: 150px;
}

.customer-editor-actions .primary {
  white-space: nowrap;
}

.mobile-customer-picker-toggle {
  display: none;
}

.quick-todo-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.quick-todo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.quick-todo-dialog form {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(245, 164, 0, 0.5);
  border-radius: 12px;
  background: #080705;
  padding: 18px;
  box-shadow: var(--shadow-lg, 0 28px 80px rgba(0,0,0,.38));
}

.quick-todo-head,
.quick-todo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-todo-head h2 {
  margin: 0;
}

.quick-todo-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.quick-todo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .customer-editor-actions,
  .quick-todo-head,
  .quick-todo-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-todo-grid {
    grid-template-columns: 1fr;
  }
}


.quick-todo-dialog,
.quick-todo-dialog label,
.quick-todo-dialog h2 {
  color: #fff8e8;
}

.quick-todo-dialog label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.quick-todo-dialog input,
.quick-todo-dialog select,
.quick-todo-dialog textarea {
  width: 100%;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 10px;
  background: rgba(5, 5, 5, 0.86);
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
}

.quick-todo-dialog input::placeholder,
.quick-todo-dialog textarea::placeholder {
  color: rgba(255, 248, 232, 0.58);
  -webkit-text-fill-color: rgba(255, 248, 232, 0.58);
}

.quick-todo-dialog select option {
  background: #080705;
  color: #fff8e8;
}

.quick-todo-dialog .secondary {
  border-color: rgba(245, 164, 0, 0.36);
  background: rgba(255, 255, 255, 0.06);
  color: #fff8e8;
}

.quick-todo-head p {
  color: rgba(255, 248, 232, 0.68);
}

body .quick-todo-dialog input,
body .quick-todo-dialog select,
body .quick-todo-dialog textarea {
  border-color: rgba(245, 164, 0, 0.42) !important;
  background: rgba(5, 5, 5, 0.9) !important;
  background-color: rgba(5, 5, 5, 0.9) !important;
  color: #fff8e8 !important;
  -webkit-text-fill-color: #fff8e8 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

body .quick-todo-dialog input::placeholder,
body .quick-todo-dialog textarea::placeholder {
  color: rgba(255, 248, 232, 0.58) !important;
  -webkit-text-fill-color: rgba(255, 248, 232, 0.58) !important;
}

/* customer-access-position */


body[data-view="customers"] .customer-editor-card {
  grid-template-columns: 86px minmax(260px, 1fr) auto minmax(250px, 320px);
  align-items: center;
}

body[data-view="customers"] .customer-access-card {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  width: min(320px, 100%);
  max-height: none;
  overflow: visible;
}

body[data-view="customers"] .customer-access-list {
  max-height: 130px;
  overflow: auto;
}

body[data-view="customers"] .customer-access-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

body[data-view="customers"] .customer-access-add button {
  width: 100%;
  min-width: 0;
}

@media (max-width: 980px) {
  body[data-view="customers"] .customer-editor-card {
    grid-template-columns: 86px minmax(0, 1fr) auto;
  }

  body[data-view="customers"] .customer-access-card {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
    overflow: visible;
  }
}


/* customer-access-hard-fix */
body[data-view="customers"] .customer-editor-card {
  grid-template-columns: 86px minmax(260px, 1fr) auto minmax(280px, 330px) !important;
  align-items: center !important;
}

body[data-view="customers"] #customerAccessPanel.customer-access-card {
  grid-column: 4 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: center !important;
  width: min(330px, 100%) !important;
  min-width: 280px !important;
  max-width: 330px !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-add {
  grid-template-columns: minmax(0, 1fr) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-add button {
  width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
}

/* customer-access-menu-polish */
body[data-view="customers"] #customerAccessPanel.customer-access-card {
  max-height: 270px !important;
  overflow: hidden !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 2px 10px !important;
  align-items: start !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head small {
  grid-column: 1 / -1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-list {
  max-height: 138px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  padding-right: 3px !important;
}

body[data-view="customers"] #customerAccessPanel.has-open-menu .customer-access-list {
  max-height: 202px !important;
}

body[data-view="customers"] #customerAccessPanel.has-open-menu .customer-access-manage {
  display: none !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user-text {
  min-width: 0 !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user-text strong,
body[data-view="customers"] #customerAccessPanel .customer-access-user-text small {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-menu {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin-top: 6px !important;
  padding: 8px !important;
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px rgba(255, 194, 71, 0.06) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-menu-actions {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 980px) {
  body[data-view="customers"] #customerAccessPanel.customer-access-card {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* quick-todo-specific-fields */
#quickTodoDialog.quick-todo-dialog #quickTodoTitle,
#quickTodoDialog.quick-todo-dialog #quickTodoDue,
#quickTodoDialog.quick-todo-dialog #quickTodoPriority,
#quickTodoDialog.quick-todo-dialog #quickTodoDescription {
  border: 1px solid rgba(245, 164, 0, 0.48) !important;
  background: #0b0a08 !important;
  background-color: #0b0a08 !important;
  color: #fff8e8 !important;
  -webkit-text-fill-color: #fff8e8 !important;
  caret-color: #fff8e8 !important;
  color-scheme: dark !important;
}

#quickTodoDialog.quick-todo-dialog #quickTodoTitle::placeholder,
#quickTodoDialog.quick-todo-dialog #quickTodoDescription::placeholder {
  color: rgba(255, 248, 232, 0.62) !important;
  -webkit-text-fill-color: rgba(255, 248, 232, 0.62) !important;
}

#quickTodoDialog.quick-todo-dialog #quickTodoPriority option {
  background: #0b0a08 !important;
  color: #fff8e8 !important;
}

#quickTodoDialog.quick-todo-dialog input:-webkit-autofill,
#quickTodoDialog.quick-todo-dialog textarea:-webkit-autofill,
#quickTodoDialog.quick-todo-dialog select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0b0a08 inset !important;
  -webkit-text-fill-color: #fff8e8 !important;
}

/* customer-hero-spacing */
body[data-view="customers"] .customer-editor-card {
  grid-template-columns: 92px minmax(360px, 1fr) auto minmax(280px, 330px) !important;
  column-gap: 28px !important;
}

body[data-view="customers"] .customer-editor-logo {
  width: 82px !important;
  height: 82px !important;
  align-self: center !important;
}

body[data-view="customers"] .customer-editor-main {
  max-width: min(100%, 520px);
  padding-left: 12px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

body[data-view="customers"] #customerEditorName {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(28px, 3vw, 44px) !important;
  line-height: 1.05 !important;
}

body[data-view="customers"] #customerEditorFacts {
  margin-top: 8px;
}

@media (max-width: 1260px) {
  body[data-view="customers"] .customer-editor-card {
    grid-template-columns: 86px minmax(280px, 1fr) auto minmax(260px, 310px) !important;
    column-gap: 22px !important;
  }

  body[data-view="customers"] #customerEditorName {
    font-size: clamp(26px, 2.6vw, 36px) !important;
  }
}

@media (max-width: 980px) {
  body[data-view="customers"] .customer-editor-card {
    grid-template-columns: 82px minmax(0, 1fr) auto !important;
  }

  body[data-view="customers"] .customer-editor-main {
    max-width: none;
    padding-left: 0;
  }
}

/* customer todo mirror */
.customer-todo-mirror {
  border-color: rgba(245, 164, 0, 0.36) !important;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.13), rgba(5, 5, 5, 0.86) 42%, rgba(255, 255, 255, 0.035)) !important;
  color: #fff8e8;
}
.customer-todo-head,
.customer-todo-actions,
.customer-todo-list-head,
.customer-todo-metrics { display: flex; align-items: center; gap: 10px; }
.customer-todo-head { justify-content: space-between; margin-bottom: 12px; }
.customer-todo-head h3 { margin: 2px 0 2px; color: #fff8e8; }
.customer-todo-kicker,
.customer-todo-head small,
.customer-todo-list-head { color: rgba(255, 248, 232, 0.72); }
.customer-todo-actions,
.customer-todo-list-head { flex-wrap: wrap; }
.customer-todo-mirror-body { display: grid; grid-template-columns: 190px minmax(280px, 0.95fr) minmax(260px, 1fr); gap: 12px; align-items: stretch; }
.customer-todo-metrics { flex-direction: column; align-items: stretch; }
.customer-todo-metrics button,
.customer-todo-item,
.customer-todo-calendar { border: 1px solid rgba(245, 164, 0, 0.3); border-radius: 10px; background: rgba(0, 0, 0, 0.38); color: #fff8e8; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.customer-todo-metrics button { min-height: 68px; display: grid; place-items: center; gap: 2px; }
.customer-todo-metrics strong { font-size: 28px; line-height: 1; color: #ffc042; }
.customer-todo-metrics span { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.customer-todo-calendar { padding: 12px; cursor: pointer; }
.customer-todo-calendar-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.customer-todo-calendar-head span { color: rgba(255, 248, 232, 0.62); font-size: 12px; font-weight: 800; }
.customer-todo-weekdays,
.customer-todo-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.customer-todo-weekdays span { color: rgba(255, 248, 232, 0.52); font-size: 11px; font-weight: 900; text-align: center; }
.customer-todo-day { min-height: 30px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 7px; background: rgba(255, 255, 255, 0.035); color: #fff8e8; padding: 3px; display: grid; place-items: center; position: relative; }
.customer-todo-day.is-muted { opacity: 0.34; }
.customer-todo-day.is-today { border-color: #ffc042; box-shadow: 0 0 0 1px rgba(255, 192, 66, 0.18); }
.customer-todo-day.has-items { background: rgba(245, 164, 0, 0.18); border-color: rgba(245, 164, 0, 0.48); }
.customer-todo-day b { position: absolute; right: 3px; bottom: 2px; min-width: 14px; height: 14px; border-radius: 999px; background: #ffc042; color: #060504; font-size: 10px; line-height: 14px; }
.customer-todo-upcoming { display: grid; gap: 8px; align-content: start; }
.customer-todo-list-head { justify-content: space-between; }
.customer-todo-item { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 3px 10px; text-align: left; padding: 10px 12px; }
.customer-todo-item:hover,
.customer-todo-metrics button:hover,
.customer-todo-day:hover { border-color: rgba(245, 164, 0, 0.72); background: rgba(245, 164, 0, 0.16); }
.customer-todo-item span { grid-row: span 2; color: #ffc042; font-weight: 900; }
.customer-todo-item strong { color: #fff8e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-todo-item small { color: rgba(255, 248, 232, 0.62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-todo-empty { border: 1px dashed rgba(245, 164, 0, 0.32); border-radius: 10px; padding: 14px; color: rgba(255, 248, 232, 0.72); background: rgba(0, 0, 0, 0.24); }
.customer-todo-empty.compact { padding: 10px 12px; }
.customer-todo-overdue-hint { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; border: 1px solid rgba(248, 113, 113, 0.4); border-radius: 10px; padding: 9px 11px; text-align: left; color: rgba(255, 248, 232, 0.76); background: linear-gradient(135deg, rgba(127, 29, 29, 0.2), rgba(0, 0, 0, 0.28)); }
.customer-todo-overdue-hint strong { color: #fecaca; font-size: 18px; line-height: 1; }
.customer-todo-overdue-hint span { font-size: 11px; font-weight: 800; }
@media (max-width: 1120px) {
  .customer-todo-mirror-body { grid-template-columns: 1fr; }
  .customer-todo-metrics { flex-direction: row; }
  .customer-todo-metrics button { flex: 1 1 120px; }
}
@media (max-width: 700px) {
  .customer-todo-head,
  .customer-todo-actions,
  .customer-todo-list-head,
  .customer-todo-metrics { align-items: stretch; flex-direction: column; }
  .customer-todo-item { grid-template-columns: 1fr; }
}


.customer-todo-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: rgba(255,248,232,.68); font-size: 11px; font-weight: 850; }
.customer-todo-legend.compact { margin: 6px 0 8px; }
.customer-todo-legend span { display: inline-flex; align-items: center; gap: 5px; }
.customer-todo-day-markers { position: absolute; left: 3px; right: 3px; bottom: 3px; display: flex; height: 3px; gap: 2px; }
.calendar-day-marker { display: inline-block; min-width: 8px; height: 8px; border-radius: 999px; background: #38bdf8; box-shadow: 0 0 10px rgba(56,189,248,.28); }
.customer-todo-day-marker { flex: 1 1 0; height: 100%; min-width: 0; border-radius: 999px; }
.cat-todo { background: #38bdf8; }
.cat-holiday { background: #f97316; }
.cat-gbu { background: #eab308; }
.cat-begehung { background: #14b8a6; }
.cat-zertifikate { background: #a78bfa; }
.cat-qualimatrix { background: #f43f5e; }
.customer-todo-day.has-categories { border-color: rgba(255,255,255,.18); background: linear-gradient(180deg, rgba(245,164,0,.11), rgba(255,255,255,.035)); }
.customer-todo-item.calendar-source-todo { border-left: 4px solid #38bdf8; }
.customer-todo-item.calendar-source-gbu { border-left: 4px solid #eab308; }
.customer-todo-item.calendar-source-begehung { border-left: 4px solid #14b8a6; }
.customer-todo-item.calendar-source-zertifikate { border-left: 4px solid #a78bfa; }
.customer-todo-item.calendar-source-qualimatrix { border-left: 4px solid #f43f5e; }
.customer-todo-item.status-overdue span { color: #fecaca; }
.customer-todo-item.status-overdue { border-color: rgba(248,113,113,.62); }

/* ui-sweep-20260525-contrast-guards */
.document-preview-placeholder span {
  color: #050505 !important;
}

/* ui-sweep-20260525-hub-contrast-overrides */
body[data-view="settings"] input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
body[data-view="settings"] select,
body[data-view="settings"] textarea,
body[data-view="backups"] input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
body[data-view="backups"] select,
body[data-view="backups"] textarea {
  background: rgba(0, 0, 0, 0.78) !important;
  color: #fff8e8 !important;
  -webkit-text-fill-color: #fff8e8 !important;
  border-color: rgba(245, 164, 0, 0.58) !important;
  color-scheme: dark;
}

body[data-view="settings"] input::placeholder,
body[data-view="settings"] textarea::placeholder,
body[data-view="backups"] input::placeholder,
body[data-view="backups"] textarea::placeholder {
  color: rgba(255, 248, 232, 0.60) !important;
  -webkit-text-fill-color: rgba(255, 248, 232, 0.60) !important;
}

body[data-view="settings"] select option,
body[data-view="settings"] select optgroup,
body[data-view="backups"] select option,
body[data-view="backups"] select optgroup {
  background: #11100d !important;
  color: #fff8e8 !important;
}

body[data-view="settings"] .settings-panel,
body[data-view="settings"] .settings-section,
body[data-view="settings"] .settings-card,
body[data-view="backups"] .backup-action-card,
body[data-view="backups"] .backup-nav,
body[data-view="backups"] .backup-toolbar,
body[data-view="backups"] .backup-overview-card,
body[data-view="backups"] .backup-status-panel,
body[data-view="backups"] .backup-row,
body[data-view="backups"] .pagination-strip,
body[data-view="backups"] .package-result {
  color: #fff8e8 !important;
}

/* ui-sweep-20260525-button-contrast */
.restore-action {
  color: #171006 !important;
  background: #f0a32b !important;
}
.restore-action:hover {
  background: #ffb13b !important;
}

/* hub-customer-context-20260526 */
.hub-customer-context.sidebar-customer-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: -4px 0 16px;
  padding: 14px;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.16), rgba(0, 0, 0, 0.08) 34%, rgba(0, 0, 0, 0.52)),
    rgba(5, 5, 5, 0.68);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.hub-active-customer-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(245, 164, 0, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.08), rgba(0, 0, 0, 0.32)),
    rgba(0, 0, 0, 0.42);
  padding: 11px 12px;
}

.hub-active-customer-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(245, 164, 0, 0.48);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf5, #ebe5d8);
  color: #6d4500;
  font-weight: 950;
  font-size: calc(17px * var(--hub-ui-scale, 1));
  letter-spacing: 0;
}

.hub-active-customer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.hub-active-customer-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.hub-active-customer-main span,
.hub-customer-context .sidebar-customer-head span {
  color: #f5a400;
  font-size: calc(10px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-active-customer-main strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: calc(21px * var(--hub-ui-scale, 1));
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-active-customer-main small {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 248, 232, 0.72);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-customer-picker-tools {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
}

.hub-customer-context .sidebar-customer-search {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.hub-customer-context .sidebar-customer-search input {
  height: 38px;
  border-color: rgba(245, 164, 0, 0.46);
  background: rgba(0, 0, 0, 0.72);
  color: #fff8e8;
  font-weight: 760;
}

.hub-customer-context .sidebar-customer-search input::placeholder {
  color: rgba(255, 248, 232, 0.58);
}

.hub-customer-context .sidebar-customer-add {
  width: 38px;
  height: 38px;
  box-shadow: 0 8px 16px rgba(245, 164, 0, 0.16);
}

.hub-customer-context .sidebar-customer-list {
  display: flex;
  gap: 10px;
  min-height: 82px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 3px 0;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.hub-customer-context .sidebar-customer-empty {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 78px;
}

.hub-customer-context .customer-item {
  flex: 0 0 clamp(250px, 27vw, 360px);
  width: auto;
  min-height: 76px;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  border-color: rgba(245, 164, 0, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.08), rgba(0, 0, 0, 0.22)),
    rgba(255, 255, 255, 0.06);
  color: #fff8e8;
  padding: 8px;
  box-shadow: none;
  scroll-snap-align: start;
}

.hub-customer-context .customer-item:hover,
.hub-customer-context .customer-item.active {
  border-color: rgba(245, 164, 0, 0.82);
  background: rgba(245, 164, 0, 0.18);
  transform: none;
}

.hub-customer-context .customer-avatar {
  width: 56px;
  height: 56px;
}

.hub-customer-context .customer-card-title strong {
  color: #ffffff;
  font-size: calc(14px * var(--hub-ui-scale, 1));
}

.hub-customer-context .customer-card-main > span {
  color: rgba(255, 248, 232, 0.68);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.hub-customer-context .customer-card-title span {
  display: none;
}

@media (max-width: 1180px) {
  .hub-customer-context.sidebar-customer-picker {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hub-customer-context.sidebar-customer-picker {
    margin-top: -2px;
    padding: 10px;
  }

  .hub-active-customer-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .hub-active-customer-logo {
    width: 58px;
    height: 58px;
  }

  .hub-active-customer-card .secondary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hub-customer-context .customer-item {
    flex-basis: min(86vw, 310px);
  }
}

/* stabilisierung-paket5-empty-states */
.empty-tile-note,
.customer-empty,
.empty-cell,
.layout-empty-note,
.sidebar-customer-empty {
  border: 1px solid rgba(245, 164, 0, 0.26);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 232, 0.06), rgba(0, 0, 0, 0.26)),
    rgba(5, 5, 5, 0.78);
  color: rgba(255, 248, 232, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 10px 22px rgba(0, 0, 0, 0.18);
}

.empty-tile-note strong,
.customer-empty strong,
.layout-empty-note strong,
.empty-cell strong,
.sidebar-customer-empty strong {
  color: #fff8e8;
}

.empty-tile-note p,
.customer-empty p,
.layout-empty-note p,
.empty-cell p,
.sidebar-customer-empty p {
  color: rgba(255, 248, 232, 0.72);
}

html[data-hub-resolved-theme="light"] .empty-tile-note,
html[data-hub-resolved-theme="light"] .customer-empty,
html[data-hub-resolved-theme="light"] .empty-cell,
html[data-hub-resolved-theme="light"] .layout-empty-note,
html[data-hub-resolved-theme="light"] .sidebar-customer-empty {
  border-color: rgba(128, 81, 0, 0.24);
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.12), transparent 34%),
    #fffaf0;
  color: #2b2111;
  box-shadow: 0 10px 22px rgba(20, 20, 20, 0.08);
}

html[data-hub-resolved-theme="light"] .empty-tile-note strong,
html[data-hub-resolved-theme="light"] .customer-empty strong,
html[data-hub-resolved-theme="light"] .layout-empty-note strong,
html[data-hub-resolved-theme="light"] .empty-cell strong,
html[data-hub-resolved-theme="light"] .sidebar-customer-empty strong {
  color: #17120a;
}

/* ux-polish-20260527: calmer cards, clearer mobile touch targets and broader empty states */
.auth-error {
  color: #7f1d1d;
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
}

.app-row,
.customer-link-tile,
.customer-insight-card,
.work-instruction-card,
.certificate-hub-tile,
.document-source-tile,
.backup-overview-card:not(.readonly),
.backup-action-card {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-row:hover,
.customer-link-open-tile:hover,
.customer-link-open-tile:focus-visible,
.customer-insight-card:hover,
.document-source-tile:hover,
.backup-overview-card:not(.readonly):hover {
  box-shadow:
    0 0 0 1px rgba(245, 164, 0, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.26);
}

.empty-state,
.sync-empty,
.backup-nav-empty,
.customer-link-empty,
.customer-link-list-empty,
.customer-todo-empty,
.customer-access-empty,
.document-preview span,
.package-release-list .empty-state,
.backup-folder-preview-card .empty-state {
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.08), transparent 36%),
    rgba(0, 0, 0, 0.44);
  color: rgba(255, 248, 232, 0.78);
  line-height: 1.45;
  padding: 12px 14px;
}

.empty-state strong,
.sync-empty strong,
.backup-nav-empty strong,
.customer-link-empty strong,
.customer-link-list-empty strong,
.customer-todo-empty strong,
.customer-access-empty strong {
  color: #fff8e8;
}

.app-row,
.customer-link-tile,
.customer-insight-card,
.work-instruction-card,
.certificate-hub-tile {
  border-color: rgba(245, 164, 0, 0.24);
}

@media screen and (max-width: 760px) {
  .auth-card .auth-form input,
  .auth-card .auth-form select,
  .auth-card .auth-form textarea,
  .auth-card .auth-form button,
  .password-reset-disclosure summary,
  .auth-legal-links a {
    min-height: 44px;
  }

  .auth-card .auth-form input,
  .auth-card .auth-form select,
  .auth-card .auth-form textarea {
    font-size: 16px;
  }

  .nav-item {
    min-height: 46px;
  }

  .sidebar-customer-search,
  .hub-customer-context .sidebar-customer-search {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .sidebar-customer-search input,
  .sidebar-customer-add,
  .hub-customer-context .sidebar-customer-search input,
  .hub-customer-context .sidebar-customer-add {
    min-height: 44px;
    height: 44px;
  }
}

/* customer-picker-compact-final-20260528 */
.hub-customer-context.sidebar-customer-picker {
  padding: 10px 12px;
  gap: 8px;
  margin-bottom: 12px;
}

.hub-customer-picker-tools {
  gap: 6px;
}

.hub-customer-context .sidebar-customer-search {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.hub-customer-context .sidebar-customer-search input,
.hub-customer-context .sidebar-customer-add {
  height: 34px;
  min-height: 34px;
}

.hub-customer-context .sidebar-customer-add {
  width: 34px;
}

.hub-customer-context .sidebar-customer-list {
  min-height: 64px;
  gap: 7px;
}

.hub-customer-context .customer-item {
  flex-basis: clamp(205px, 22vw, 285px);
  min-height: 58px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  padding: 6px;
}

.hub-customer-context .customer-avatar {
  width: 44px;
  height: 44px;
}

.hub-customer-context .customer-card-title strong {
  font-size: calc(12px * var(--hub-ui-scale, 1));
}

.hub-customer-context .customer-card-main > span {
  font-size: calc(10px * var(--hub-ui-scale, 1));
}

@media screen and (max-width: 760px) {
  .hub-customer-context .customer-item {
    flex-basis: min(72vw, 260px);
  }
}

/* customer-logo-compact-fix-20260602 */
.hub-customer-context .customer-item {
  min-height: 62px !important;
  grid-template-columns: 52px minmax(0, 1fr) !important;
  gap: 8px !important;
}

.hub-customer-context .customer-avatar {
  width: 52px !important;
  height: 52px !important;
  border-radius: 9px !important;
}

.hub-customer-context .customer-avatar img {
  padding: 4px !important;
}

.hub-active-customer-card {
  grid-template-columns: 64px minmax(0, 1fr) auto !important;
}

.hub-active-customer-logo {
  width: 64px !important;
  height: 64px !important;
  border-radius: 10px !important;
}

@media screen and (max-width: 760px) {
  .hub-customer-context .customer-item {
    min-height: 58px !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
  }

  .hub-customer-context .customer-avatar {
    width: 46px !important;
    height: 46px !important;
  }

  .hub-active-customer-card {
    grid-template-columns: 54px minmax(0, 1fr) !important;
  }

  .hub-active-customer-logo {
    width: 54px !important;
    height: 54px !important;
  }
}

/* customer-overflow-guard-20260606: keep customer detail cards inside the workspace. */
body[data-view="customers"] #customersView,
body[data-view="customers"] .customer-layout,
body[data-view="customers"] .customer-form {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden;
  overflow-x: clip;
}

body[data-view="customers"] .customer-form > *,
body[data-view="customers"] .customer-editor-card,
body[data-view="customers"] .customer-link-tiles,
body[data-view="customers"] .customer-open-points,
body[data-view="customers"] .customer-insights,
body[data-view="customers"] .customer-form .form-block,
body[data-view="customers"] .customer-form details.form-block {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-view="customers"] .customer-editor-card,
body[data-view="customers"] .customer-link-tiles,
body[data-view="customers"] .customer-open-points,
body[data-view="customers"] .customer-insights {
  width: 100% !important;
}

/* hub-polish-20260606: compact hub rhythm and customer logo/settings polish */
.content {
  width: 100%;
  max-width: none;
}

.app-tile-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.app-row {
  min-height: 132px;
  padding: 10px;
  gap: 8px;
}

.app-logo {
  width: 38px;
  height: 38px;
}

.app-title strong {
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.app-title span {
  font-size: calc(11px * var(--hub-ui-scale, 1));
  -webkit-line-clamp: 2;
}

.customer-logo-preview {
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(86px, 120px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(245, 164, 0, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.12), rgba(0, 0, 0, 0.42)),
    rgba(6, 6, 5, 0.9);
  color: #fff8e8;
  padding: 10px;
}

.customer-logo-preview > span {
  color: rgba(255, 248, 232, 0.68);
  font-size: calc(11px * var(--hub-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-logo-preview-frame {
  width: 96px;
  height: 72px;
  display: grid;
  place-items: center;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(245, 164, 0, 0.48);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf5, #ebe5d8);
  color: #6d4500;
  font-size: calc(16px * var(--hub-ui-scale, 1));
  font-weight: 950;
}

.customer-logo-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.hub-signature-background .file-button,
.hub-signature-background .secondary,
.signature-opacity-control {
  border-color: rgba(245, 164, 0, 0.46);
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.12), rgba(0, 0, 0, 0.48)),
    rgba(8, 8, 6, 0.92);
  color: #fff8e8;
}

.signature-opacity-control span,
.signature-opacity-control strong {
  color: #fff8e8;
}

.signature-opacity-control input {
  width: 100%;
}

.hub-signature-preview,
.hub-signature-pad-wrap {
  border-color: rgba(245, 164, 0, 0.38);
}

html[data-hub-resolved-theme="dark"] .hub-signature-preview,
html[data-hub-resolved-theme="dark"] .hub-signature-pad-wrap {
  background: rgba(255, 255, 255, 0.96);
  color: #172022;
}

@media (max-width: 760px) {
  .app-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-row {
    min-height: 112px;
  }

  .customer-logo-preview {
    grid-template-columns: 1fr;
  }

  .customer-logo-preview-frame {
    justify-self: start;
  }
}

/* customer-access-dialog-final */
body[data-view="customers"] #customerAccessPanel.customer-access-card {
  width: min(300px, 100%) !important;
  min-width: 260px !important;
  max-width: 300px !important;
  max-height: 230px !important;
  overflow: hidden !important;
  padding: 9px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-list {
  max-height: 120px !important;
  overflow-y: auto !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user {
  border-radius: 12px !important;
  padding: 7px 8px !important;
  align-items: center !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user-text strong {
  max-width: 185px !important;
  line-height: 1.12 !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user-text small {
  line-height: 1.15 !important;
}

.customer-access-modal-current {
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.72), rgba(36, 25, 4, 0.76));
  padding: 12px;
  color: #fff8e8;
}

.customer-access-modal-current h3 {
  margin: 0 0 10px;
  color: #fff3d2;
  font-size: calc(15px * var(--hub-ui-scale, 1));
}

.customer-access-modal-current p {
  margin: 0;
  color: rgba(255, 239, 199, 0.76);
}

.customer-access-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.customer-access-modal-user {
  min-width: 0;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  padding: 8px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(120px, 150px) auto;
  gap: 9px;
  align-items: center;
}

.customer-access-modal-user strong,
.customer-access-modal-user small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-access-modal-user strong {
  color: #fff8e8;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.customer-access-modal-user small {
  color: rgba(255, 206, 118, 0.86);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.customer-access-preview {
  min-width: 0;
  border: 1px solid rgba(245, 164, 0, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.1), rgba(0, 0, 0, 0.64));
  padding: 9px;
  display: grid;
  gap: 5px;
}

.customer-access-preview-avatars {
  display: flex;
  align-items: center;
}

.customer-access-preview-avatars .customer-access-avatar + .customer-access-avatar {
  margin-left: -7px;
}

.customer-access-preview strong,
.customer-access-preview small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-access-preview strong {
  color: #fff8e8;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

.customer-access-preview small {
  color: rgba(255, 239, 199, 0.72);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.customer-access-modal-user select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: #050505;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
  padding: 6px 10px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 900;
}

.customer-access-modal-user select option {
  background: #050505;
  color: #fff8e8;
}

/* customer-access-and-users-polish */
body[data-view="customers"] #customerAccessPanel .customer-access-head strong {
  min-width: max-content !important;
  white-space: nowrap !important;
  font-size: calc(13px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head span {
  font-size: calc(11px * var(--hub-ui-scale, 1)) !important;
  letter-spacing: 0.02em !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-user {
  min-height: 48px !important;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.08), rgba(0, 0, 0, 0.72)),
    rgba(0, 0, 0, 0.64) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-avatar {
  flex: 0 0 auto !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-manage summary {
  width: 100% !important;
  text-align: center !important;
}

.user-row-actions {
  align-items: center;
}

.user-quick-role {
  min-width: 150px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: calc(10px * var(--hub-ui-scale, 1));
  font-weight: 900;
  text-transform: uppercase;
}

.user-quick-role select {
  min-height: 34px;
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  background: #050505;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  color-scheme: dark;
  padding: 6px 10px;
  font-size: calc(12px * var(--hub-ui-scale, 1));
  font-weight: 900;
}

.user-quick-role select option {
  background: #050505;
  color: #fff8e8;
}

@media (max-width: 720px) {
  .customer-access-modal-user {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .customer-access-modal-user select,
  .customer-access-modal-user button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* customer-access-card-compact-v2 */
body[data-view="customers"] #customerAccessPanel.customer-access-card {
  width: min(280px, 100%) !important;
  min-width: 240px !important;
  max-width: 280px !important;
  max-height: 210px !important;
  gap: 8px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 2px 8px !important;
  align-items: start !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head small {
  grid-column: 1 / -1 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: rgba(255, 239, 199, 0.84) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-list {
  max-height: 62px !important;
  overflow: hidden !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview {
  padding: 7px 8px !important;
  gap: 3px !important;
  border-radius: 11px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview strong {
  font-size: calc(12px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.12 !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview small {
  color: rgba(255, 239, 199, 0.82) !important;
  font-size: calc(10.5px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.2 !important;
  white-space: normal !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview-empty {
  border-style: dashed !important;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.06), rgba(0, 0, 0, 0.78)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-manage summary {
  min-height: 34px !important;
  padding: 0 12px !important;
  font-size: calc(11px * var(--hub-ui-scale, 1)) !important;
}

/* customer-access-card-readable-v3 */
body[data-view="customers"] #customerAccessPanel.customer-access-card {
  width: min(340px, 100%) !important;
  min-width: min(300px, 100%) !important;
  max-width: 340px !important;
  max-height: 214px !important;
  padding: 12px !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(245, 164, 0, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(0, 0, 0, 0.94), rgba(20, 14, 5, 0.94)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head {
  grid-template-columns: minmax(0, 1fr) minmax(62px, max-content) !important;
  gap: 4px 10px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head strong {
  min-width: 62px !important;
  overflow: visible !important;
  text-align: right !important;
  white-space: nowrap !important;
  font-size: calc(13px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head small {
  font-size: calc(10.5px * var(--hub-ui-scale, 1)) !important;
  line-height: 1.2 !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-list {
  max-height: 74px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview {
  padding: 8px 9px !important;
  background:
    linear-gradient(135deg, rgba(245, 164, 0, 0.12), rgba(0, 0, 0, 0.82)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview strong {
  font-size: calc(13px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview small {
  color: rgba(255, 245, 220, 0.9) !important;
  font-size: calc(11px * var(--hub-ui-scale, 1)) !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-manage summary {
  min-height: 38px !important;
  border-radius: 13px !important;
  color: #fff8e8 !important;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.2), rgba(0, 0, 0, 0.72)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 196, 66, 0.3), 0 8px 24px rgba(0, 0, 0, 0.26) !important;
  font-size: calc(12px * var(--hub-ui-scale, 1)) !important;
}

/* customer-access-card-contained-v4 */
body[data-view="customers"] .customer-editor-card {
  grid-template-columns: 86px minmax(220px, 1fr) auto minmax(220px, 240px) !important;
  overflow: hidden !important;
}

body[data-view="customers"] #customerAccessPanel.customer-access-card {
  box-sizing: border-box !important;
  width: min(240px, 100%) !important;
  min-width: 220px !important;
  max-width: 240px !important;
  max-height: 174px !important;
  padding: 10px !important;
  gap: 7px !important;
  overflow: hidden !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 3px 8px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head strong {
  min-width: 22px !important;
  font-size: calc(15px * var(--hub-ui-scale, 1)) !important;
  line-height: 1 !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-head small {
  display: none !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-list {
  max-height: 48px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview {
  padding: 7px 8px !important;
  gap: 1px !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview strong,
body[data-view="customers"] #customerAccessPanel .customer-access-preview small {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview strong {
  font-size: calc(12px * var(--hub-ui-scale, 1)) !important;
  white-space: nowrap !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-preview small {
  font-size: calc(10px * var(--hub-ui-scale, 1)) !important;
  white-space: nowrap !important;
}

body[data-view="customers"] #customerAccessPanel .customer-access-manage summary {
  min-height: 34px !important;
  padding: 0 10px !important;
  font-size: calc(11px * var(--hub-ui-scale, 1)) !important;
  white-space: nowrap !important;
}

/* nav-app-order-20260629: make compact navigation understandable and expose app order controls in settings. */
.app-order-admin {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.34);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.08), rgba(0, 0, 0, 0.36));
}

.app-order-admin-head strong,
.app-order-copy strong {
  display: block;
  color: #fff8e8;
  font-weight: 800;
}

.app-order-admin-head span,
.app-order-copy span,
.app-order-copy small {
  display: block;
  color: rgba(255, 248, 232, 0.72);
  font-size: calc(12px * var(--hub-ui-scale, 1));
  line-height: 1.35;
}

.app-order-admin-list {
  display: grid;
  gap: 8px;
}

.app-order-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(245, 164, 0, 0.26);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.38);
}

.app-order-row .app-logo {
  width: 38px;
  height: 38px;
}

.app-order-copy {
  min-width: 0;
}

.app-order-copy strong,
.app-order-copy span,
.app-order-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-order-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

@media screen and (min-width: 861px) and (max-width: 1100px) {
  .nav-item {
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .nav-item span:last-child {
    display: inline !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }
}

@media screen and (max-width: 860px) {
  .nav-item {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: start !important;
    gap: 5px !important;
    text-align: left;
  }

  .nav-item span:last-child {
    display: block !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 1.05;
  }
}

@media screen and (max-width: 760px) {
  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .nav-item {
    min-height: 38px !important;
    padding: 0 7px !important;
  }

  .app-order-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .app-order-row .app-logo {
    width: 34px;
    height: 34px;
  }

  .app-order-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* customer-report-preview-20260629: scoped report styling for the Hub preview dialog. */
.customer-report-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-width: min(1180px, calc(100vw - 28px));
  max-height: min(920px, calc(100dvh - 28px));
  border: 1px solid rgba(245, 164, 0, 0.46);
  border-radius: 18px;
  padding: 0;
  background: #101010;
  color: #fff8e8;
  overflow: hidden;
}

.customer-report-dialog,
.customer-report-dialog * {
  box-sizing: border-box;
}

.customer-report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.customer-report-dialog > form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
  margin: 0;
}

.customer-report-dialog-head,
.customer-report-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(245, 164, 0, 0.22);
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.13), rgba(0, 0, 0, 0.86));
}

.customer-report-dialog-actions {
  border-top: 1px solid rgba(245, 164, 0, 0.22);
  border-bottom: 0;
  justify-content: flex-end;
}

.customer-report-dialog-head span {
  display: block;
  color: #ffb31f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-report-dialog-head h2 {
  margin: 2px 0 3px;
  color: #fff;
  font-size: 22px;
}

.customer-report-dialog-head p {
  margin: 0;
  color: rgba(255, 248, 232, 0.72);
}

.customer-report-dialog-body {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.customer-report-options {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.customer-report-archive-control {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.52);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(245, 164, 0, 0.14), rgba(0, 0, 0, 0.42));
}

.customer-report-archive-control label {
  color: #ffb31f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.customer-report-archive-control select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(245, 164, 0, 0.5);
  border-radius: 9px;
  padding: 0 10px;
  background: #080808;
  color: #fff8e8;
}

.customer-report-archive-control small {
  color: rgba(255, 248, 232, 0.68);
  font-size: 11px;
  line-height: 1.35;
}

.customer-report-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(245, 164, 0, 0.24);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.38);
}

.customer-report-option input {
  width: 20px;
  height: 20px;
  accent-color: #f5a400;
}

.customer-report-option strong,
.customer-report-option small {
  display: block;
  min-width: 0;
}

.customer-report-option strong {
  color: #fff8e8;
  font-size: 13px;
}

.customer-report-option small {
  margin-top: 2px;
  color: rgba(255, 248, 232, 0.66);
  font-size: 11px;
  line-height: 1.3;
}

.customer-report-preview {
  min-height: 0;
  overflow: auto;
  border-radius: 16px;
  padding: 18px;
  background: #e9eef5;
  color: #111827;
}

.customer-report-loading,
.customer-report-preview .customer-report-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  color: #475569;
  font-weight: 700;
}

.customer-report-preview .customer-report-page {
  width: min(100%, 190mm);
  min-height: auto;
  margin: 0 auto;
  padding: 0;
  background: #fff;
  color: #0f172a;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  box-shadow: 0 18px 56px rgba(15, 23, 42, 0.18);
}

.customer-report-preview .customer-report-page > * {
  margin: 0;
}

.customer-report-preview .customer-report-page > * + * {
  margin-top: 18px;
}

.customer-report-preview .customer-report-cover,
.customer-report-preview .customer-report-hero-summary,
.customer-report-preview .customer-report-summary,
.customer-report-preview .customer-report-section {
  border: 1px solid #d9e2ec;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  padding: 24px;
  overflow: hidden;
}

.customer-report-preview .customer-report-cover {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 120px;
  align-items: center;
  gap: 22px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86) 58%, rgba(255, 255, 255, 0.44)),
    url("/assets/audit-cover-banner-default.jpg") center/cover;
  border-color: rgba(245, 164, 0, 0.54);
}

.customer-report-preview .customer-report-cover-copy > span,
.customer-report-preview .customer-report-section-head > span,
.customer-report-preview .customer-report-summary span {
  display: block;
  color: #b87500;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-report-preview .customer-report-cover h1 {
  margin: 8px 0;
  color: #0f172a;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.03;
}

.customer-report-preview .customer-report-cover p,
.customer-report-preview p,
.customer-report-preview small {
  color: #475569;
  line-height: 1.5;
}

.customer-report-preview .customer-report-badges,
.customer-report-preview .customer-report-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.customer-report-preview .customer-report-badges b,
.customer-report-preview .customer-report-chip-list span {
  border: 1px solid rgba(245, 164, 0, 0.42);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff7ed;
  color: #7a4b00;
  font-size: 12px;
}

.customer-report-preview .customer-report-logo {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 164, 0, 0.55);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
}

.customer-report-preview .customer-report-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 10px;
}

.customer-report-preview .customer-report-score {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 999px;
  background: conic-gradient(#f5a400 0 var(--report-ring), #e5e7eb var(--report-ring) 100%);
  position: relative;
}

.customer-report-preview .customer-report-score::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: inherit;
  background: #fff;
}

.customer-report-preview .customer-report-score strong,
.customer-report-preview .customer-report-score span {
  position: relative;
  z-index: 1;
  display: block;
}

.customer-report-preview .customer-report-score strong {
  color: #0f172a;
  font-size: 30px;
}

.customer-report-preview .customer-report-score span {
  color: #475569;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.customer-report-preview .customer-report-hero-summary {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  border-left: 7px solid #f5a400;
  background: #fff7ed;
}

.customer-report-preview .customer-report-hero-summary.good {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.customer-report-preview .customer-report-hero-summary.critical {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.customer-report-preview .customer-report-hero-summary strong {
  display: block;
  margin: 7px 0;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.2;
}

.customer-report-preview .customer-report-progress b,
.customer-report-preview .customer-report-app-card b,
.customer-report-preview .customer-report-bar-row b {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.customer-report-preview .customer-report-progress i,
.customer-report-preview .customer-report-app-card i,
.customer-report-preview .customer-report-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.customer-report-preview .customer-report-summary {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  gap: 18px;
  background: #f8fafc;
}

.customer-report-preview .customer-report-signal,
.customer-report-preview .customer-report-kpi,
.customer-report-preview .customer-report-card,
.customer-report-preview .customer-report-app-card,
.customer-report-preview .customer-report-link,
.customer-report-preview .customer-report-note,
.customer-report-preview .customer-report-recommendation,
.customer-report-preview .customer-report-ai-card,
.customer-report-preview .customer-report-donut-card,
.customer-report-preview .customer-report-bars {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  padding: 16px;
}

.customer-report-preview .customer-report-kpis,
.customer-report-preview .customer-report-app-grid,
.customer-report-preview .customer-report-split,
.customer-report-preview .customer-report-link-grid,
.customer-report-preview .customer-report-ai-grid,
.customer-report-preview .customer-report-real-org-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-report-preview .customer-report-ai-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-report-preview .customer-report-kpi strong,
.customer-report-preview .customer-report-big-number {
  display: block;
  color: #0f172a;
  font-size: 34px;
  line-height: 1;
}

.customer-report-preview .customer-report-section h2 {
  margin: 4px 0 16px;
  color: #0f172a;
  font-size: 26px;
}

.customer-report-preview .customer-report-section h3,
.customer-report-preview .customer-report-card h3 {
  color: #0f172a;
}

.customer-report-preview .customer-report-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

.customer-report-preview .customer-report-table th,
.customer-report-preview .customer-report-table td {
  border: 1px solid #d9e2ec;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.customer-report-preview .customer-report-table th {
  background: #111827;
  color: #fff;
}

.customer-report-preview .customer-report-chart-board {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.customer-report-preview .customer-report-org-frame-wrap,
.customer-report-preview .customer-report-real-org {
  border: 1px solid #d9e2ec;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  overflow: auto;
}

.customer-report-preview .customer-report-org-original {
  border: 1px solid #d9e2ec;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  overflow: visible;
}

.customer-report-preview .customer-report-org-frame {
  display: block;
  width: 100%;
  height: min(62vh, 780px);
  border: 0;
  background: #fff;
}

@media screen and (max-width: 900px) {
  .customer-report-dialog-body,
  .customer-report-preview .customer-report-cover,
  .customer-report-preview .customer-report-hero-summary,
  .customer-report-preview .customer-report-summary,
  .customer-report-preview .customer-report-chart-board {
    grid-template-columns: 1fr;
  }

  .customer-report-preview .customer-report-kpis,
  .customer-report-preview .customer-report-app-grid,
  .customer-report-preview .customer-report-split,
  .customer-report-preview .customer-report-link-grid,
  .customer-report-preview .customer-report-ai-grid,
  .customer-report-preview .customer-report-real-org-grid {
    grid-template-columns: 1fr;
  }
}

/* Hub size contract 2026-06-29
   Keeps dashboard, customer, backup and settings views on one visual scale.
   App shells use .hub-shell-navigation and are intentionally not targeted here. */
body.hub-shell-ready {
  --hub-main-sidebar-width: clamp(196px, calc(214px * var(--hub-ui-scale, 1)), 232px);
  --hub-main-nav-height: clamp(34px, calc(42px * var(--hub-ui-scale, 1)), 50px);
  --hub-main-nav-font: clamp(11px, calc(12px * var(--hub-ui-scale, 1)), 13px);
  --hub-main-icon-size: clamp(26px, calc(30px * var(--hub-ui-scale, 1)), 34px);
  --hub-main-card-min: clamp(108px, calc(138px * var(--hub-ui-scale, 1)), 152px);
  --hub-main-card-title: clamp(11px, calc(12px * var(--hub-ui-scale, 1)), 13px);
}

body.hub-shell-ready .shell {
  grid-template-columns: var(--hub-main-sidebar-width) minmax(0, 1fr) !important;
}

body.hub-shell-ready .sidebar {
  width: auto !important;
  min-width: 0 !important;
  padding: clamp(10px, calc(12px * var(--hub-ui-scale, 1)), 16px) 10px !important;
  gap: clamp(10px, calc(12px * var(--hub-ui-scale, 1)), 16px) !important;
}

body.hub-shell-ready .sidebar nav {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: clamp(5px, calc(6px * var(--hub-ui-scale, 1)), 8px) !important;
}

body.hub-shell-ready .sidebar .nav-item {
  min-height: var(--hub-main-nav-height) !important;
  padding: 0 clamp(8px, calc(10px * var(--hub-ui-scale, 1)), 12px) !important;
  gap: clamp(7px, calc(8px * var(--hub-ui-scale, 1)), 10px) !important;
  border-radius: clamp(8px, calc(10px * var(--hub-ui-scale, 1)), 12px) !important;
  font-size: var(--hub-main-nav-font) !important;
}

body.hub-shell-ready .sidebar .nav-item .icon {
  width: var(--hub-main-icon-size) !important;
  height: var(--hub-main-icon-size) !important;
  flex: 0 0 var(--hub-main-icon-size) !important;
}

body.hub-shell-ready .sidebar .brand-logo {
  width: min(clamp(92px, calc(118px * var(--hub-ui-scale, 1)), 136px), 100%) !important;
  max-height: clamp(92px, calc(118px * var(--hub-ui-scale, 1)), 136px) !important;
}

body.hub-shell-ready .sidebar .brand,
body.hub-shell-ready .sidebar .runtime-status,
body.hub-shell-ready .sidebar .sidebar-info {
  font-size: clamp(10px, calc(11px * var(--hub-ui-scale, 1)), 12px) !important;
}

body.hub-shell-ready .topbar {
  min-height: clamp(64px, calc(74px * var(--hub-ui-scale, 1)), 86px) !important;
  height: clamp(64px, calc(74px * var(--hub-ui-scale, 1)), 86px) !important;
  max-height: clamp(64px, calc(74px * var(--hub-ui-scale, 1)), 86px) !important;
  padding: clamp(10px, calc(14px * var(--hub-ui-scale, 1)), 18px) !important;
  overflow: hidden !important;
}

body.hub-shell-ready .app-tile-grid {
  grid-template-columns: repeat(auto-fill, minmax(var(--hub-main-card-min), 1fr)) !important;
  gap: clamp(9px, calc(12px * var(--hub-ui-scale, 1)), 14px) !important;
}

body.hub-shell-ready .app-row.hub-app-card,
body.hub-shell-ready .hub-app-card {
  min-height: calc(var(--hub-main-card-min) * 0.88) !important;
  aspect-ratio: 1.16 / 1 !important;
  padding: clamp(8px, calc(10px * var(--hub-ui-scale, 1)), 12px) !important;
  gap: clamp(6px, calc(8px * var(--hub-ui-scale, 1)), 10px) !important;
}

body.hub-shell-ready .hub-app-card .app-logo {
  width: clamp(44px, calc(58px * var(--hub-ui-scale, 1)), 66px) !important;
  height: clamp(44px, calc(58px * var(--hub-ui-scale, 1)), 66px) !important;
}

body.hub-shell-ready .hub-app-card .app-title strong {
  font-size: var(--hub-main-card-title) !important;
  line-height: 1.18 !important;
}

body.hub-shell-ready .hub-app-card .app-title span,
body.hub-shell-ready .hub-app-card .state,
body.hub-shell-ready .hub-app-card .port {
  font-size: clamp(9px, calc(10px * var(--hub-ui-scale, 1)), 11px) !important;
}
/* hub-access-report-org-20260709 */
body[data-view="customers"] #customerAccessPanel .customer-access-preview-users {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
body[data-view="customers"] #customerAccessPanel .customer-access-preview-user {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(245, 164, 0, .28);
  border-radius: 10px;
  background: rgba(0,0,0,.32);
}
body[data-view="customers"] #customerAccessPanel .customer-access-preview-user b {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(245, 164, 0, .18);
  color: #ffd36a;
  font-size: 10px;
}
body[data-view="customers"] #customerAccessPanel .customer-access-preview-user span,
body[data-view="customers"] #customerAccessPanel .customer-access-preview-user small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-report-preview .customer-report-task-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.customer-report-preview .customer-report-task-list h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #111827;
}
.customer-report-preview .customer-report-task-row {
  display: grid;
  grid-template-columns: 10px minmax(120px, .8fr) minmax(0, 1.6fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.customer-report-preview .customer-report-task-row > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.customer-report-preview .customer-report-task-row strong,
.customer-report-preview .customer-report-task-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.organigramm-source-tile {
  border-color: rgba(20, 184, 166, .55) !important;
}





/* customer-org-card-20260710 */
body[data-view="customers"] .customer-organigramm-inline {
  display: grid;
  gap: 14px;
  margin: 22px 0 14px;
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid rgba(245, 170, 24, 0.58);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 183, 45, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(8, 8, 7, 0.98), rgba(29, 23, 13, 0.96));
  color: #f8fafc;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
body[data-view="customers"] .customer-organigramm-inline[hidden] {
  display: none !important;
}
body[data-view="customers"] .customer-organigramm-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(245, 170, 24, 0.22);
}
body[data-view="customers"] .customer-organigramm-inline-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
body[data-view="customers"] .customer-organigramm-inline-head span {
  display: block;
  color: #ffb51f;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
body[data-view="customers"] .customer-organigramm-inline-head strong {
  display: block;
  color: #ffffff;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
body[data-view="customers"] .customer-organigramm-inline-head small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
}
body[data-view="customers"] .customer-organigramm-inline-head .secondary.compact {
  flex: 0 0 auto;
  min-height: 38px;
  padding-inline: 16px;
  border-color: rgba(255, 184, 46, 0.72);
  background: linear-gradient(180deg, rgba(255, 184, 46, 0.22), rgba(0, 0, 0, 0.62));
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}
body[data-view="customers"] .customer-organigramm-inline-frame {
  display: block;
  width: 100%;
  height: clamp(560px, 74vh, 860px);
  min-height: 560px;
  border: 1px solid rgba(255, 184, 46, 0.28);
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
body[data-view="customers"] .customer-organigramm-inline-empty {
  padding: 24px;
  border: 1px dashed rgba(255, 184, 46, 0.42);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 184, 46, 0.07);
}
@media (max-width: 760px) {
  body[data-view="customers"] .customer-organigramm-inline-head {
    align-items: flex-start;
    flex-direction: column;
  }
  body[data-view="customers"] .customer-organigramm-inline-frame {
    height: 68vh;
    min-height: 430px;
  }
}

/* hub-mobile-workspace-20260714
   The Hub uses a compact command rail on phones. App wrappers have their own
   shell rules and are excluded through data-hub-shell-view. */
@media screen and (max-width: 760px) {
  body.hub-shell-ready {
    --hub-main-card-min: 96px;
  }

  body.hub-shell-ready .shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 56px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.hub-shell-ready .sidebar {
    position: sticky !important;
    inset: 0 0 auto !important;
    z-index: 100 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 56px !important;
    max-height: 56px !important;
    padding: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    border-bottom: 1px solid rgba(245, 164, 0, 0.42);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  }

  body.hub-shell-ready .sidebar .brand,
  body.hub-shell-ready .sidebar .runtime-status,
  body.hub-shell-ready .sidebar .sidebar-info,
  body.hub-shell-ready .sidebar > .sidebar-customer-picker {
    display: none !important;
  }

  body.hub-shell-ready .sidebar nav {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 5px !important;
    width: max-content !important;
    min-width: 100% !important;
    height: 44px !important;
  }

  body.hub-shell-ready .sidebar .nav-item {
    display: grid !important;
    grid-template-columns: 24px auto !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 96px !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 9px !important;
    gap: 7px !important;
    border: 1px solid rgba(245, 164, 0, 0.2) !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    font-size: 11px !important;
  }

  body.hub-shell-ready .sidebar .nav-item.active {
    border-color: rgba(245, 164, 0, 0.72) !important;
    background: rgba(245, 164, 0, 0.18) !important;
  }

  body.hub-shell-ready .sidebar .nav-item .icon {
    width: 24px !important;
    height: 24px !important;
    flex-basis: 24px !important;
    border: 0 !important;
    background: transparent !important;
  }

  body.hub-shell-ready .sidebar .nav-item span:last-child {
    display: block !important;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px !important;
    line-height: 1.1;
  }

  body.hub-shell-ready .content {
    width: 100% !important;
    min-width: 0 !important;
    min-height: calc(100dvh - 56px) !important;
    padding: 8px !important;
  }

  body.hub-shell-ready .topbar {
    min-height: 48px !important;
    height: 48px !important;
    max-height: 48px !important;
    margin-bottom: 8px !important;
    padding: 6px 8px !important;
    border-radius: 7px !important;
  }

  body.hub-shell-ready .topbar-actions {
    width: 100% !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    overflow: hidden;
  }

  body.hub-shell-ready .topbar-actions > * {
    min-width: 0;
    font-size: 10px !important;
  }

  body.hub-shell-ready .hub-customer-context.sidebar-customer-picker {
    margin: 0 0 8px !important;
    padding: 7px !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    grid-template-rows: 34px 48px !important;
    gap: 6px !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-head {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-content: center !important;
    height: 34px !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-search {
    grid-column: 2 !important;
    grid-row: 1 !important;
    height: 34px !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-list {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: flex !important;
    min-height: 48px !important;
    max-height: 48px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.hub-shell-ready .hub-customer-context .customer-item {
    flex: 0 0 min(82vw, 292px) !important;
    min-height: 46px !important;
    height: 46px !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    padding: 4px 7px !important;
  }

  body.hub-shell-ready .hub-customer-context .customer-avatar {
    width: 36px !important;
    height: 36px !important;
  }

  body.hub-shell-ready .app-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body.hub-shell-ready .app-row.hub-app-card,
  body.hub-shell-ready .hub-app-card {
    min-height: 96px !important;
    height: 96px !important;
    aspect-ratio: auto !important;
    padding: 7px !important;
    gap: 5px !important;
    border-radius: 7px !important;
  }

  body.hub-shell-ready .hub-app-card .app-logo {
    width: 36px !important;
    height: 36px !important;
  }

  body.hub-shell-ready .hub-app-card .app-title {
    gap: 2px !important;
  }

  body.hub-shell-ready .hub-app-card .app-title strong {
    font-size: 11px !important;
    line-height: 1.14 !important;
  }

  body.hub-shell-ready .hub-app-card .app-title span {
    font-size: 9px !important;
    line-height: 1.12 !important;
    -webkit-line-clamp: 1 !important;
  }
}

/* hub-workspace-clarity-cascade-lock-20260721 */
body.hub-shell-ready .nav-item[hidden],
body.hub-shell-ready .backup-allowed[hidden],
body.hub-shell-ready .master-only[hidden],
body.hub-shell-ready .customer-panel-inactive {
  display: none !important;
}

body[data-view="customers"].hub-shell-ready .customer-editor-card {
  min-height: 0 !important;
  border-radius: 8px !important;
  background: #171a20 !important;
}

body[data-view="customers"].hub-shell-ready .customer-workspace-tabs {
  display: flex !important;
}

body[data-view="customers"].hub-shell-ready .customer-open-points {
  background: #171a20 !important;
  border-radius: 8px !important;
}

@media screen and (max-width: 760px) {
  body.hub-shell-ready .app-list .app-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-editor-card {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    grid-template-areas:
      "logo main"
      "actions actions"
      "access access" !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-priorities > div,
  body[data-view="customers"].hub-shell-ready .customer-app-group-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media screen and (min-width: 761px) {
  body.hub-shell-ready .hub-customer-context {
    padding: 9px 11px !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools {
    display: grid !important;
    grid-template-columns: 145px minmax(220px, 320px) minmax(0, 1fr) !important;
    grid-template-rows: 62px !important;
    align-items: center !important;
    gap: 10px !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-head,
  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-search,
  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-list {
    min-height: 0 !important;
    height: 62px !important;
    max-height: 62px !important;
    margin: 0 !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-head {
    align-content: center !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-search {
    display: grid !important;
    align-content: center !important;
  }

  body.hub-shell-ready .hub-customer-picker-tools .sidebar-customer-list {
    display: flex !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-editor-card {
    display: grid !important;
    grid-template-columns: 68px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "logo main actions"
      "access access access" !important;
    align-items: center !important;
    gap: 12px 16px !important;
    padding: 14px 16px !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-editor-logo {
    grid-area: logo !important;
    width: 68px !important;
    height: 68px !important;
    margin: 0 !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-editor-main {
    grid-area: main !important;
    margin: 0 !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-editor-actions {
    grid-area: actions !important;
    margin: 0 !important;
  }

  body[data-view="customers"].hub-shell-ready .customer-access-card {
    grid-area: access !important;
  }
}
