﻿: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/customer-background.png");
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  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 {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

body[data-auth="loading"] .shell {
  pointer-events: none;
  user-select: none;
}

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

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;
}

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;
  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;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.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;
}

.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;
}

.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;
}

.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(239, 68, 68, 0.55);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  font-size: calc(13px * var(--hub-ui-scale, 1));
  font-weight: 800;
  padding: 10px 12px;
}

.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;
}

.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;
}

.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-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;
}

.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);
  gap: 12px;
  align-items: center;
}

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: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 86px;
  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-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(170px, 0.8fr) minmax(260px, 1.2fr);
  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.08);
}

.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-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.open-point-app {
  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;
  padding: 10px;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.open-point-app:hover {
  border-color: rgba(245, 164, 0, 0.56);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.open-point-app > div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.open-point-app strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(13px * var(--hub-ui-scale, 1));
}

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

.open-point-app em {
  margin-top: 6px;
  color: #fff;
  font-style: normal;
  font-size: calc(19px * var(--hub-ui-scale, 1));
  font-weight: 850;
}

.open-point-app small {
  color: rgba(255, 255, 255, 0.62);
  font-size: calc(11px * var(--hub-ui-scale, 1));
}

.open-point-dot {
  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 {
  margin-top: 8px;
}

.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;
}

.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-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-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;
}

.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;
}

.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;
}

.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) auto auto;
  margin-bottom: 12px;
}

.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);
}

.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;
}

.user-form {
  grid-template-columns: repeat(3, 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);
}

.user-form[hidden] {
  display: none;
}

.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-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;
}

.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: nowrap;
  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(2, minmax(0, 1fr));
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.user-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.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-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:not(.is-expanded) .tenant-limit-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-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-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: 220px minmax(0, 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;
  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;
}

.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(4, 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;
  }

  .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;
  }

  .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(4, minmax(48px, 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;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-visual {
    min-height: 176px;
  }

  .auth-visual img {
    object-position: left top;
  }

  .auth-card {
    width: 100%;
    padding: 16px;
  }

  .auth-heading h1 {
    font-size: calc(24px * var(--hub-ui-scale, 1));
  }

  .auth-form,
  .admin-login-panel,
  .tenant-app-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);
  }
}
