:root {
  color-scheme: light;
  --endpoint-grid: minmax(160px, 1.5fr) minmax(58px, 0.46fr) minmax(64px, 0.48fr) minmax(64px, 0.5fr) minmax(72px, 0.54fr) minmax(72px, 0.54fr) minmax(156px, 1.388fr) minmax(98px, 0.875fr) minmax(92px, 0.817fr);
  --endpoint-table-min-width: 850px;
  --endpoint-grid-padding-x: 6px;
  --endpoint-scrollbar-gap: 6px;
  --endpoint-scrollbar-width: 10px;
  --pending-note-grid: minmax(130px, 1fr) minmax(150px, 1.15fr) 86px 106px 106px minmax(150px, 1.1fr) minmax(130px, 1fr) minmax(112px, 0.9fr) 150px;
  --pending-note-min-width: 1160px;
  --bg: #eef4f8;
  --bg-accent: #dbeafe;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --panel-soft: #f3f7fb;
  --text: #15222c;
  --muted: #667684;
  --line: rgba(31, 55, 69, 0.14);
  --primary: #2563eb;
  --primary-2: #0ea5e9;
  --primary-dark: #1d4ed8;
  --danger: #b42318;
  --ok: #067647;
  --hero-bg: linear-gradient(135deg, rgba(239, 246, 251, 0.98), rgba(222, 238, 247, 0.96)), linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.1));
  --hero-text: #102033;
  --ghost-bg: rgba(255, 255, 255, 0.58);
  --ghost-border: rgba(31, 55, 69, 0.2);
  --form-panel: linear-gradient(180deg, #ffffff, #f5f8fb);
  --row-hover: linear-gradient(90deg, rgba(37, 99, 235, 0.06), #f8fbfd);
  --endpoint-low-bg: rgba(37, 99, 235, 0.13);
  --endpoint-low-text: #1d4ed8;
  --endpoint-mid-bg: rgba(37, 99, 235, 0.13);
  --endpoint-mid-text: #1d4ed8;
  --endpoint-high-bg: rgba(37, 99, 235, 0.13);
  --endpoint-high-text: #1d4ed8;
  --shadow: 0 22px 70px rgba(24, 47, 63, 0.16);
  --soft-shadow: 0 12px 30px rgba(24, 47, 63, 0.1);
  --page-gradient: linear-gradient(135deg, var(--bg), #f8fbfd 48%, #e9f5ff);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08111c;
  --bg-accent: #102235;
  --panel: rgba(16, 27, 42, 0.9);
  --panel-strong: #121f31;
  --panel-soft: #17263a;
  --text: #edf3fa;
  --muted: #a3b0c2;
  --line: rgba(174, 194, 216, 0.18);
  --primary: #60a5fa;
  --primary-2: #38bdf8;
  --primary-dark: #93c5fd;
  --danger: #f87171;
  --ok: #4ade80;
  --hero-bg: linear-gradient(135deg, rgba(9, 23, 36, 0.98), rgba(13, 35, 56, 0.97)), linear-gradient(90deg, rgba(59, 130, 246, 0.17), rgba(56, 189, 248, 0.1));
  --hero-text: #ffffff;
  --ghost-bg: rgba(255, 255, 255, 0.16);
  --ghost-border: rgba(255, 255, 255, 0.32);
  --form-panel: linear-gradient(180deg, #17263a, #132237);
  --row-hover: linear-gradient(90deg, rgba(59, 130, 246, 0.08), #101c2c);
  --endpoint-low-bg: rgba(59, 130, 246, 0.16);
  --endpoint-low-text: #93c5fd;
  --endpoint-mid-bg: rgba(59, 130, 246, 0.16);
  --endpoint-mid-text: #93c5fd;
  --endpoint-high-bg: rgba(59, 130, 246, 0.16);
  --endpoint-high-text: #93c5fd;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  --soft-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  --page-gradient: linear-gradient(135deg, #07111c, #0d1b2b 50%, #111827);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 0;
  background:
    radial-gradient(circle at 15% 5%, var(--bg-accent), transparent 34%),
    var(--page-gradient, linear-gradient(135deg, var(--bg), #f8fbfd 48%, #e9f5ff));
  color: var(--text);
  font-family: "Segoe UI", Inter, Arial, Helvetica, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

body.app-loading .app-shell {
  visibility: hidden;
}

.auth-page {
  display: flex;
  padding-block: 16px;
}

.auth-shell {
  margin: auto;
  width: min(440px, calc(100% - 32px));
}

.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 28px;
  padding: 32px;
}

.auth-panel h1 {
  font-size: 44px;
}

.auth-kicker {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label,
.user-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.auth-form input,
.user-form input,
.user-form select {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 42px;
  padding: 0 12px;
}

.field-hint,
.form-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.field-hint {
  display: block;
}

.form-hint {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  margin: 0;
  padding: 10px 12px;
}

.auth-form .auth-check {
  align-items: center;
  display: flex;
  gap: 10px;
}

.auth-form .auth-check input {
  min-height: 18px;
  width: 18px;
}

.auth-message {
  color: var(--danger);
  font-weight: 700;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px 42px;
}

.hero {
  background: var(--hero-bg);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--hero-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  min-height: 176px;
  overflow: hidden;
  padding: 30px;
  position: relative;
}

.brand-title {
  align-items: center;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.hero::after {
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.08));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  background: linear-gradient(90deg, var(--hero-text) 0%, var(--primary-dark) 52%, var(--primary-2) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(37, 99, 235, 0.18));
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.18;
  padding-bottom: 4px;
}

h2 {
  font-size: 18px;
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-top: 12px;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.user-badge {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover {
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.24);
  filter: brightness(1.04);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

button.is-busy {
  cursor: wait;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.48);
  outline-offset: 2px;
}

.ghost-button {
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
  backdrop-filter: blur(16px);
  color: var(--hero-text);
}

.secondary-button {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--primary-dark);
}

.user-form {
  align-items: start;
  background: var(--form-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 16px;
}

.user-form > label {
  grid-template-rows: 18px 42px auto;
  min-width: 0;
}

.user-form input,
.user-form select {
  height: 42px;
  width: 100%;
}

.users-panel {
  margin-bottom: 18px;
}

.user-form-head {
  margin-top: 6px;
}

.permission-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 14px;
}

.permission-grid legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
}

.permission-grid label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.permission-grid input {
  min-height: auto;
}

.tenant-access-options {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#tenantAccessFieldset:disabled {
  opacity: 0.58;
}

#tenantAccessFieldset {
  grid-template-columns: 1fr;
}

#tenantAccessFieldset .tenant-access-options label {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.2;
  min-height: 38px;
  padding: 7px 9px;
}

#tenantAccessFieldset .tenant-access-options input {
  height: 14px;
  margin: 0;
  min-height: 14px;
  width: 14px;
}

.user-item .settings-actions {
  flex-wrap: wrap;
}

.toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.tenant-sidebar,
.content-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.content-panel,
.tenant-sidebar,
.app-nav,
.metric,
.group-card,
.settings-item,
.api-step {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.tenant-toggle:hover,
.group-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
}

.section-head span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 86px;
  padding: 16px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.metric:hover {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 16px 34px rgba(24, 47, 63, 0.13);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
}

.settings-form {
  margin-bottom: 18px;
}

.tenant-settings-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tenant-settings-form .form-actions {
  grid-column: 1 / -1;
}

.pending-note-create-panel {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 14px;
}

.pending-note-create-panel > strong {
  display: block;
  font-size: 15px;
  margin-bottom: 12px;
}

.pending-note-form-scroll,
.pending-note-table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.pending-note-form {
  align-items: end;
  gap: 10px;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.15fr) 86px 128px 128px minmax(150px, 1.1fr) minmax(130px, 1fr) minmax(112px, 0.9fr);
  min-width: var(--pending-note-min-width);
}

.pending-note-form textarea {
  height: 42px;
  min-height: 42px;
  overflow-y: auto;
  padding: 10px 12px;
  resize: none;
}

.pending-note-form .form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.tenant-settings-toolbar {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(220px, 420px);
  padding-top: 18px;
}

.tenant-settings-toolbar label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.settings-item,
.api-step {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.settings-item {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.settings-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pending-note-table-section {
  margin-top: 18px;
}

.pending-note-section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pending-note-section-head > div > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.pending-note-table-head,
.pending-note-row {
  align-items: stretch;
  display: grid;
  grid-template-columns: var(--pending-note-grid);
  min-width: var(--pending-note-min-width);
}

.pending-note-table-head {
  background: rgba(145, 160, 179, 0.12);
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  min-height: 32px;
  text-transform: uppercase;
}

.pending-note-table-head span,
.pending-note-cell {
  align-items: center;
  display: flex;
  min-width: 0;
  padding: 7px 8px;
}

.pending-note-table-head span + span,
.pending-note-cell + .pending-note-cell {
  border-left: 1px solid var(--line);
}

.pending-note-list {
  display: grid;
  min-width: var(--pending-note-min-width);
}

.pending-note-row {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-top: 0;
  font-size: 12px;
  min-height: 52px;
}

.pending-note-row:last-child {
  border-radius: 0 0 6px 6px;
}

.pending-note-row:hover {
  background: var(--row-hover);
}

.pending-note-cell {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pending-note-cell[data-label="Acquistate"],
.pending-note-cell[data-label="Inizio"],
.pending-note-cell[data-label="Fine"],
.pending-note-cell[data-label="Inserito il"] {
  justify-content: center;
  text-align: center;
}

.pending-note-cell::before {
  display: none;
}

.pending-note-row .settings-actions {
  flex-wrap: nowrap;
  justify-content: center;
  padding: 7px;
}

.pending-note-row .settings-actions button {
  font-size: 11px;
  min-height: 32px;
  padding: 0 6px;
  white-space: nowrap;
}

.pending-note-trash {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.pending-note-trash-summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
}

.pending-note-trash-summary::-webkit-details-marker { display: none; }
.pending-note-trash-summary::before { content: "›"; font-size: 24px; line-height: 1; }
.pending-note-trash[open] > .pending-note-trash-summary::before { transform: rotate(90deg); }
.pending-note-trash[open] > .pending-note-trash-summary { margin-bottom: 14px; }
.pending-note-trash-summary > div { flex: 1; min-width: 0; }
.pending-note-trash-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

.pending-note-trash .pending-note-row {
  background: rgba(145, 160, 179, 0.08);
  color: var(--muted);
}

.danger-button {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: var(--primary-dark);
  min-height: 34px;
  padding: 0 12px;
}

.settings-item strong,
.api-step strong {
  display: block;
  overflow-wrap: anywhere;
}

.settings-item span:not(.mini-pill),
.api-step span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 5px;
  text-transform: uppercase;
}

.api-flow {
  display: grid;
  gap: 12px;
}

.api-step {
  display: grid;
  gap: 8px;
}

.api-step code {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: block;
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
  padding: 10px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 7px;
}

label.wide {
  grid-column: 1 / -1;
}

.group-contact-form .wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
}

input:not([type="checkbox"]):focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(14, 165, 233, 0.18);
}

input[type="checkbox"]:focus {
  outline: 0;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.message {
  border-radius: 6px;
  padding: 12px 14px;
}

.message.error {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
}

.message.ok {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-dark);
}

.main-layout {
  align-items: start;
  display: grid;
  flex: 1 1 auto;
  gap: 16px;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
}

.app-nav {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 8px;
  padding: 12px;
  position: sticky;
  top: 16px;
}

.nav-item {
  background: transparent;
  color: var(--text);
  justify-content: flex-start;
  min-height: 46px;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.1);
  box-shadow: none;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(37, 99, 235, 0.86));
  color: #fff;
}

.screen-stack {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.screen {
  display: none;
  min-height: 0;
}

.screen.active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.workspace.workspace-group-detail {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.workspace-group-detail .tenant-sidebar {
  display: none;
}

#endpointsScreen .workspace > .content-panel {
  max-height: calc(100dvh - 128px);
  min-height: min(440px, calc(100dvh - 128px));
}

.dashboard-recap {
  display: grid;
  gap: 16px;
}

.billing-alert-panel {
  background: var(--panel-strong);
  min-height: 260px;
}

.billing-alert-panel .section-head > div > span {
  color: var(--danger);
}

.billing-alert-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.billing-alert-actions .red-license-pill {
  align-items: center;
  display: inline-flex;
  font-size: 14px;
  margin: 0;
  min-height: 42px;
}

.billing-alert-head,
.billing-alert-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) 90px 90px 110px;
}

.billing-alert-head {
  background: rgba(145, 160, 179, 0.12);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 6px;
  padding: 7px 10px;
  text-transform: uppercase;
}

.billing-alert-list {
  display: grid;
  gap: 6px;
}

.billing-alert-row {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 10px;
}

.billing-alert-row span,
.billing-alert-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.billing-alert-head span:nth-child(n+3),
.billing-alert-row > :nth-child(n+3) {
  justify-self: center;
  text-align: center;
  width: 100%;
}

.billing-alert-installed {
  align-items: center;
  background: rgba(191, 219, 254, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(96, 165, 250, 0.12);
  color: #1d4ed8;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 28px;
  min-width: 48px;
  padding: 4px 12px;
}

.billing-alert-row .license-difference-pill {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-width: 0;
  padding: 0;
}

.tenant-sidebar,
.content-panel {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  min-width: 0;
  padding: 18px;
  scroll-margin-top: 16px;
}

.tenant-sidebar {
  position: sticky;
  top: 16px;
}

.screen-panel {
  min-height: 590px;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head strong {
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

.section-title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-pill {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.tenant-inline-stats {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.group-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.group-search {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.group-search:hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 10px 24px rgba(24, 47, 63, 0.09);
}

.group-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.group-search .search-icon {
  align-items: center;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 16px;
  height: 16px;
  justify-content: center;
  width: 16px;
}

.group-search .search-icon svg {
  display: block;
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
  width: 16px;
}

.group-search input {
  background: transparent;
  border: 0;
  min-height: 40px;
  padding: 0;
  width: min(220px, 34vw);
}

.group-search input:focus {
  outline: 0;
}

.group-search input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.billable-toggle {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  text-transform: uppercase;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.billable-toggle:hover {
  border-color: rgba(180, 35, 24, 0.38);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.billable-toggle:has(input:focus-visible) {
  border-color: rgba(180, 35, 24, 0.38);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.billable-toggle input {
  accent-color: var(--danger);
  height: 16px;
  margin: 0;
  width: 16px;
}

.tenant-list,
.groups-grid {
  display: grid;
  gap: 8px;
}

.endpoint-table-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.endpoint-table-scroll.group-detail-mode {
  overflow: hidden;
}

.endpoint-table-head {
  align-items: center;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  display: grid;
  font-size: 9px;
  font-weight: 900;
  gap: 0;
  grid-template-columns: var(--endpoint-grid);
  margin-bottom: 0;
  margin-right: auto;
  min-width: var(--endpoint-table-min-width);
  padding: 7px var(--endpoint-grid-padding-x);
  text-transform: uppercase;
  width: var(--endpoint-table-row-width, calc(100% - var(--endpoint-scrollbar-gap) - var(--endpoint-scrollbar-width)));
}

.endpoint-table-head span {
  align-items: center;
  display: flex;
  justify-content: center;
  line-height: 1.12;
  min-width: 0;
  min-height: 30px;
  overflow-wrap: anywhere;
  padding: 0 5px;
  text-align: center;
}

.endpoint-table-head span:first-child {
  justify-content: flex-start;
  padding-left: 0;
  text-align: left;
}

.endpoint-table-head span:nth-child(n + 2) {
  border-left: 1px solid var(--line);
}

.endpoint-table-head span:nth-child(n + 2) {
  text-align: center;
}

.tenant-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.tenant-item.tenant-reorderable,
.tenant-item.tenant-reorderable .tenant-toggle {
  cursor: grab;
}

.tenant-item.tenant-dragging {
  cursor: grabbing;
  opacity: 0.48;
}

.tenant-item.tenant-drop-before {
  box-shadow: inset 0 3px 0 var(--primary);
}

.tenant-item.tenant-drop-after {
  box-shadow: inset 0 -3px 0 var(--primary);
}

.tenant-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr auto;
  min-height: 44px;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
  transition: background 160ms ease, transform 160ms ease;
}

.tenant-toggle > span:first-child {
  display: grid;
  gap: 1px;
}

.tenant-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.13), rgba(59, 130, 246, 0.1));
}

.tenant-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tenant-meta,
.group-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.tenant-error {
  color: var(--danger);
}

.chevron {
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
  transition: transform 160ms ease;
}

.tenant-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.group-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 16px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.endpoint-groups-grid {
  align-content: start;
  flex: 1 1 auto;
  gap: 0;
  grid-auto-rows: minmax(56px, auto);
  min-height: 220px;
  min-width: var(--endpoint-table-min-width);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: var(--endpoint-scrollbar-gap);
  scrollbar-gutter: stable;
}

.endpoint-table-scroll.group-detail-mode .endpoint-table-head {
  display: none;
}

.endpoint-groups-grid.group-detail-active {
  display: flex;
  flex-direction: column;
}

.endpoint-groups-grid::-webkit-scrollbar {
  width: var(--endpoint-scrollbar-width);
}

.endpoint-groups-grid::-webkit-scrollbar-track {
  background: rgba(102, 118, 132, 0.12);
  border-radius: 999px;
}

.endpoint-groups-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-radius: 999px;
}

.endpoint-groups-grid .group-card {
  align-items: center;
  border-radius: 0;
  border-top: 0;
  gap: 0;
  grid-template-columns: var(--endpoint-grid);
  min-height: 56px;
  min-width: 0;
  padding: 8px var(--endpoint-grid-padding-x);
}

.endpoint-groups-grid .group-card-head {
  align-self: stretch;
  align-items: center;
  display: flex;
  min-width: 0;
  padding-left: 6px;
}

.endpoint-groups-grid .group-card-head strong,
.endpoint-groups-grid .group-edit-name {
  display: block;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-groups-grid .group-edit-name {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
  filter: none;
  font-weight: 850;
  min-height: 0;
  padding: 0;
  text-align: left;
  width: 100%;
}

.endpoint-groups-grid .group-edit-name:hover {
  box-shadow: none;
  filter: none;
  text-decoration: none;
}

.endpoint-groups-grid .group-edit-name:focus-visible {
  color: var(--text);
  outline: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.endpoint-groups-grid .group-edit-name.has-contact {
  color: var(--text);
}

.endpoint-groups-grid .group-meta {
  display: none;
}

.endpoint-groups-grid .count {
  align-self: stretch;
  align-items: center;
  font-size: 13px;
  text-align: center;
}

.endpoint-groups-grid .license-cell,
.endpoint-groups-grid .license-difference-cell,
.endpoint-groups-grid .license-date-cell,
.endpoint-groups-grid .contact-cell {
  align-self: stretch;
  align-items: center;
  border-left: 1px solid var(--line);
  display: flex;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding-left: 8px;
  padding-right: 8px;
}

.endpoint-groups-grid .license-cell {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  text-align: center;
}

.endpoint-groups-grid .license-difference-cell {
  font-size: 13px;
  font-weight: 850;
  justify-content: center;
  margin: 0;
  min-height: 28px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.endpoint-groups-grid .license-date-cell {
  color: var(--text);
  font-size: 11px;
  font-weight: 760;
  justify-content: center;
  text-align: center;
}

.endpoint-groups-grid .license-difference-cell.positive {
  border-left-color: var(--ok);
  color: var(--ok);
}

.endpoint-groups-grid .license-difference-cell.negative {
  border-left-color: var(--danger);
  color: var(--danger);
}

.endpoint-groups-grid .license-difference-cell.zero {
  border-left-color: rgba(14, 165, 233, 0.42);
  color: var(--primary-2);
}

.endpoint-groups-grid .contact-cell {
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: normal;
}

.endpoint-groups-grid .count {
  border-left: 1px solid var(--line);
  display: inline-flex;
  justify-content: center;
  justify-self: stretch;
}

.endpoint-groups-grid .group-card-head span {
  font-size: 10px;
  padding: 3px 6px;
}

.endpoint-row {
  box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.38);
}

.endpoint-row:hover {
  background: var(--row-hover);
}

.endpoint-row.license-deficit-row {
  box-shadow: inset 3px 0 0 var(--danger);
}

.endpoint-row.license-deficit-row .group-card-head strong,
.endpoint-row.license-deficit-row .group-edit-name {
  color: var(--danger);
}

.endpoint-count {
  background: var(--endpoint-low-bg);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  justify-content: center;
  min-width: 42px;
  padding: 4px 6px;
}

.endpoint-groups-grid .endpoint-count {
  align-items: center;
  align-self: center;
  background: rgba(191, 219, 254, 0.72);
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(96, 165, 250, 0.12);
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 900;
  height: 28px;
  justify-self: center;
  min-height: 28px;
  min-width: 48px;
  padding: 4px 12px;
}

:root[data-theme="dark"] .endpoint-groups-grid .endpoint-count {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.24), rgba(30, 64, 175, 0.14));
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(2, 8, 23, 0.24);
  color: #bfdbfe;
}

.endpoint-count.low {
  background: var(--endpoint-low-bg);
  color: var(--primary-dark);
}

.endpoint-count.mid {
  background: var(--endpoint-low-bg);
  color: var(--primary-dark);
}

.endpoint-count.high {
  background: var(--endpoint-low-bg);
  color: var(--primary-dark);
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(37, 99, 235, 0.42);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 14px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  min-height: 28px;
  padding: 0;
  width: 28px;
}

.icon-button:hover,
.icon-button.has-contact {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.icon-button span {
  transform: translateY(-1px);
}

.group-contact-form {
  background: var(--form-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
  padding: 14px;
}

.group-contact-form[hidden] {
  display: none;
}

.group-contact-form textarea {
  min-height: 74px;
}

.group-contact-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.group-contact-form input,
.group-contact-form textarea {
  background: var(--panel-strong);
  border-color: var(--line);
}

.group-contact-form .form-actions {
  align-items: center;
  flex-wrap: wrap;
}

.group-detail-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  max-height: calc(100vh - 240px);
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.group-detail-hero,
.group-detail-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.group-detail-hero {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.group-detail-hero span,
.group-detail-card > span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.group-detail-hero strong {
  display: block;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.group-detail-hero p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.group-detail-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  min-width: min(100%, 420px);
}

.group-detail-metrics span {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  justify-items: center;
  margin: 0;
  min-height: 66px;
  min-width: 0;
  padding: 8px;
  text-transform: none;
  width: 100%;
}

.group-detail-metrics strong {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0;
  text-align: center;
  width: 100%;
}

.group-detail-metrics .group-metric-value {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  min-height: 0;
  min-width: 0;
  padding: 0;
  text-align: center;
}

.group-detail-metrics .metric-installed {
  color: var(--primary-dark);
}

.group-detail-metrics .metric-difference.negative {
  color: var(--danger);
}

.group-detail-metrics .metric-difference.zero {
  color: var(--primary-2);
}

.group-detail-metrics .metric-difference.positive {
  color: var(--ok);
}

.group-detail-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.installed-count,
.group-detail-metrics .endpoint-count {
  color: var(--primary-dark);
}

.group-detail-grid,
.group-info-card {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.group-info-card {
  align-items: start;
}

.group-detail-card dl,
.group-info-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.group-detail-card dl div,
.group-info-card dl div {
  display: grid;
  gap: 8px;
  grid-template-columns: 132px minmax(0, 1fr);
}

.group-detail-card dt,
.group-info-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.group-detail-card dd,
.group-info-card dd {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-detail-card-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.group-detail-card-title span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.group-detail-card-title strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.group-endpoint-card {
  min-height: 0;
}

.endpoint-host-filter-row {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  max-width: 680px;
}

.endpoint-host-notice {
  color: var(--danger);
  font-size: 12px;
  font-weight: 750;
  margin: 0 0 10px;
}

.endpoint-host-search {
  border-radius: 8px;
  flex: 1 1 260px;
  margin-bottom: 0;
  max-width: 420px;
  min-width: 0;
}

.endpoint-zero-ip-toggle {
  flex: 0 0 auto;
}

.endpoint-host-list {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  padding: 10px;
  scrollbar-gutter: stable;
}

.endpoint-host-column {
  align-content: start;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.endpoint-host-item {
  display: grid;
  min-width: 0;
}

.endpoint-host-item[hidden] {
  display: none;
}

.endpoint-host-summary {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 34px;
  min-width: 0;
}

.endpoint-host-row {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 0.7fr);
  min-height: 0;
  text-align: left;
  padding: 10px;
  width: 100%;
}

.endpoint-host-row:hover,
.endpoint-host-row.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: none;
}

.endpoint-host-row.active {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.endpoint-host-row > div {
  min-width: 0;
}

.endpoint-host-row strong,
.endpoint-host-row span {
  display: block;
  overflow-wrap: anywhere;
}

.endpoint-host-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.endpoint-host-os {
  align-self: center;
}

.endpoint-delete-button {
  align-items: center;
  align-self: stretch;
  background: var(--panel-strong);
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 6px;
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 850;
  justify-content: center;
  min-height: 0;
  padding: 0;
  width: 34px;
}

.endpoint-delete-button:hover,
.endpoint-delete-button:focus-visible {
  background: rgba(180, 35, 24, 0.1);
  border-color: rgba(180, 35, 24, 0.46);
  outline: 0;
}

.endpoint-delete-button span {
  border: 2px solid currentColor;
  border-top: 0;
  display: block;
  height: 12px;
  position: relative;
  width: 11px;
}

.endpoint-delete-button span::before {
  background: currentColor;
  content: "";
  height: 2px;
  left: -3px;
  position: absolute;
  top: -4px;
  width: 17px;
}

.endpoint-delete-button span::after {
  background: currentColor;
  content: "";
  height: 2px;
  left: 2px;
  position: absolute;
  top: -7px;
  width: 7px;
}

.endpoint-host-detail {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  border-top: 0;
  margin-top: 0;
  padding: 14px;
}

.endpoint-host-detail pre {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.group-detail-form {
  margin-top: 0;
  order: 2;
}

.group-endpoint-card {
  order: 3;
}

.manual-union-field {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
}

.manual-union-field legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

.union-options {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 190px;
  overflow: auto;
}

.union-option {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
}

.union-option.selected {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.34);
}

.union-option input {
  min-height: auto;
  accent-color: var(--primary);
  width: auto;
}

.union-option span {
  overflow-wrap: anywhere;
  white-space: normal;
}

.endpoint-bar {
  background: rgba(102, 118, 132, 0.14);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.endpoint-bar span {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.group-card:hover {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 14px 30px rgba(24, 47, 63, 0.12);
}

.group-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.group-card-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.group-card-head span {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.endpoint-pill {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0.14));
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  padding: 8px 12px;
  white-space: nowrap;
}

.red-license-pill {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(180, 35, 24, 0.32);
  color: var(--danger);
}

.count {
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 850;
}

.empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 120px;
  padding: 32px 12px;
  text-align: center;
}

.insight-list {
  display: grid;
  gap: 12px;
}

.analysis-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 10px;
}

.analysis-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-rows: 1fr auto;
  min-height: 104px;
  padding: 10px;
}

.analysis-card span,
.analysis-counts span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.analysis-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.analysis-card button {
  align-self: end;
  width: 100%;
}

.analysis-card button.active {
  outline: 3px solid rgba(37, 99, 235, 0.18);
}

.manual-analysis-card {
  grid-template-columns: minmax(160px, 0.8fr) minmax(260px, 1.4fr) minmax(110px, 0.4fr);
  grid-template-rows: auto;
  min-height: auto;
}

.manual-analysis-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manual-analysis-controls label {
  display: grid;
  gap: 5px;
}

.manual-analysis-controls select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.analysis-filter-bar {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  margin-bottom: 10px;
}

.comparison-search {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
}

.comparison-search span {
  color: var(--muted);
  font-weight: 900;
}

.comparison-search input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-weight: 750;
  min-width: 0;
  outline: 0;
  width: 100%;
}

.analysis-status-filter {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 42px;
  padding: 0 8px 0 12px;
}

.analysis-status-filter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-right: 8px;
  text-transform: uppercase;
}

.analysis-status-filter select {
  background: transparent;
  border: 0;
  color: var(--text);
  min-height: 40px;
  outline: 0;
  padding: 0;
  width: 100%;
}

.analysis-billable-toggle {
  min-height: 42px;
  margin: 0;
}

.analysis-results {
  margin-top: 0;
}

.history-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.history-select-all {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 850;
  gap: 8px;
  text-transform: uppercase;
}

.history-list {
  display: grid;
  gap: 2px;
}

.history-table-head,
.history-row {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: 26px minmax(170px, 1fr) 72px 72px 82px;
}

.history-table-head > span:nth-child(n+3),
.history-row > span {
  justify-self: center;
  text-align: center;
  width: 100%;
}

.history-table-head > span:first-child,
.history-check {
  justify-self: center;
}

.history-table-head {
  background: rgba(145, 160, 179, 0.12);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  margin-bottom: 3px;
  padding: 4px 8px;
  text-transform: uppercase;
}

.history-row {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  min-height: 28px;
  padding: 4px 8px;
}

.history-row strong,
.history-row span {
  overflow-wrap: anywhere;
}

.history-row span {
  color: var(--text);
  font-weight: 760;
}

.history-check {
  display: grid;
  justify-items: center;
}

.history-check input,
.history-select-all input {
  height: 12px;
  margin: 0;
  width: 12px;
}

.log-management-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
}

.log-main-panel {
  min-width: 0;
}

.log-catalog-panel {
  min-width: 0;
}

.log-catalog-panel .user-form-head {
  margin-top: 0;
}

.log-catalog-panel .section-head strong {
  font-size: 16px;
}

.log-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, 240px) minmax(260px, 1fr);
  margin-bottom: 14px;
}

.log-toolbar label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  text-transform: uppercase;
}

.log-toolbar select,
.log-toolbar input {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

.log-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.log-summary article,
.possible-error-item {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.log-summary span,
.possible-error-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.log-summary strong {
  display: block;
  font-size: 20px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.log-list,
.possible-errors-list {
  display: grid;
  gap: 4px;
}

.log-table-head,
.log-row {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(140px, 0.9fr) 74px minmax(100px, 0.7fr) minmax(120px, 0.8fr) 76px minmax(180px, 1.4fr);
}

.log-table-head {
  background: rgba(145, 160, 179, 0.12);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 4px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.log-table-head > span:nth-child(2),
.log-table-head > span:nth-child(5),
.log-row > span:nth-child(2),
.log-row > span:nth-child(5) {
  justify-self: center;
  text-align: center;
}

.log-row {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  min-height: 38px;
  padding: 7px 8px;
}

.log-row.error-log-row {
  border-left: 3px solid rgba(37, 99, 235, 0.62);
}

.log-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.log-row .mini-pill,
.log-row .log-status {
  display: inline-flex;
  justify-content: center;
  min-width: 66px;
}

.log-status {
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 7px;
  text-align: center;
  text-transform: uppercase;
}

.log-status.success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ok);
}

.log-status.warning,
.log-status.failed {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
}

.possible-errors-list {
  gap: 6px;
  grid-template-columns: 1fr;
}

.possible-error-item {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
}

.possible-error-item strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.possible-error-item span {
  font-size: 9px;
}

.possible-error-item p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  margin: 0;
}

.danger-button {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary-dark);
}

.analysis-tenant-section {
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 280px minmax(0, 1fr);
  padding: 12px;
}

.analysis-tenant-menu {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  padding: 12px;
  position: sticky;
  top: 16px;
}

.analysis-tenant-menu span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.analysis-tenant-menu strong {
  color: var(--text);
  display: block;
  overflow-wrap: anywhere;
}

.analysis-tenant-menu > strong {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 18px;
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
}

.analysis-tenant-menu > strong.up {
  color: var(--danger);
}

.analysis-tenant-menu > strong.down {
  color: var(--ok);
}

.analysis-tenant-menu > strong.unchanged {
  color: var(--primary-2);
}

.analysis-group-table {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.analysis-counts {
  text-align: center;
}

.change-row .analysis-counts:first-of-type {
  text-align: center;
}

.analysis-counts strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.change-summary,
.change-row {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 16px;
  padding: 10px 12px;
}

.change-summary {
  grid-template-columns: minmax(0, 1fr) auto;
}

.change-row {
  grid-template-columns: minmax(220px, 1fr) 126px 126px 112px 126px;
  padding-bottom: 8px;
  padding-top: 8px;
}

.analysis-table-head {
  align-items: center;
  background: rgba(145, 160, 179, 0.12);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) 126px 126px 112px 126px;
  padding: 8px 12px;
  text-transform: uppercase;
}

.analysis-table-head span {
  display: block;
  text-align: center;
  white-space: nowrap;
}

.analysis-table-head span:nth-child(n+2) {
  text-align: center;
}

.change-summary > div,
.change-row > div {
  min-width: 0;
}

.change-summary span,
.change-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.change-summary strong,
.change-row strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.change-summary > strong,
.change-row > strong {
  align-items: center;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.26);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 18px;
  justify-content: center;
  justify-self: end;
  min-width: 112px;
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
}

.change-row > strong:last-child {
  min-width: 104px;
}

.change-summary.negative > strong,
.change-row.negative > strong {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: var(--danger);
}

.change-summary.positive > strong,
.change-row.positive > strong {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.28);
  color: var(--ok);
}

.change-summary.zero > strong,
.change-row.zero > strong {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: var(--primary-2);
}

.license-difference-pill {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-width: 82px;
  padding: 5px 8px;
  white-space: nowrap;
}

.license-difference-pill.negative {
  color: var(--danger);
}

.license-difference-pill.zero {
  color: var(--primary-2);
}

.license-difference-pill.positive {
  color: var(--ok);
}

@media (max-width: 920px) {
  .hero,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .brand-title {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 36px;
  }

  .group-tools {
    justify-content: flex-start;
  }

  .group-search,
  .group-search input,
  .billable-toggle {
    width: 100%;
  }

  .endpoint-host-filter-row .endpoint-host-search {
    width: auto;
  }

  .endpoint-host-filter-row .billable-toggle {
    width: auto;
  }

  .metric-strip,
  .form-grid,
  .user-form,
  .permission-grid,
  .main-layout,
  .workspace,
  .log-management-layout,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .tenant-settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-note-form {
    min-width: var(--pending-note-min-width);
  }

  .manual-analysis-card,
  .manual-analysis-controls,
  .log-toolbar,
  .analysis-filter-bar {
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .history-table-head {
    display: none;
  }

  .history-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .history-row span {
    grid-column: 2;
    text-align: left;
  }

  .analysis-table-head {
    display: none;
  }

  .analysis-counts {
    text-align: left;
  }

  .billing-alert-head {
    display: none;
  }

  .billing-alert-row {
    grid-template-columns: 1fr;
  }

  .analysis-tenant-section {
    grid-template-columns: 1fr;
  }

  .analysis-tenant-menu {
    align-items: stretch;
    position: static;
  }

  .analysis-tenant-menu > strong {
    text-align: left;
  }

  .change-summary,
  .change-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .change-summary > strong,
  .change-row > strong {
    text-align: left;
  }

  .endpoint-groups-grid .group-card {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .endpoint-groups-grid .license-cell,
  .endpoint-groups-grid .license-difference-cell,
  .endpoint-groups-grid .license-date-cell,
  .endpoint-groups-grid .contact-cell,
  .endpoint-groups-grid .count {
    border-left: 0;
    justify-content: flex-start;
    min-height: 28px;
    padding-left: 0;
    text-align: left;
  }

  .endpoint-groups-grid .license-cell::before {
    content: "Acquistate";
  }

  .endpoint-groups-grid .endpoint-count::before {
    content: "Installate";
  }

  .endpoint-groups-grid .license-difference-cell::before {
    content: "Differenza";
  }

  .endpoint-groups-grid .license-date-cell:nth-of-type(4)::before {
    content: "Inizio";
  }

  .endpoint-groups-grid .license-date-cell:nth-of-type(5)::before {
    content: "Fine";
  }

  .endpoint-groups-grid .contact-cell:nth-of-type(6)::before {
    content: "Contatto";
  }

  .endpoint-groups-grid .contact-cell:nth-of-type(7)::before {
    content: "Referente";
  }

  .endpoint-groups-grid .contact-cell:nth-of-type(8)::before {
    content: "Telefono";
  }

  .endpoint-groups-grid .contact-cell::before,
  .endpoint-groups-grid .endpoint-count::before,
  .endpoint-groups-grid .license-cell::before,
  .endpoint-groups-grid .license-difference-cell::before,
  .endpoint-groups-grid .license-date-cell::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    margin-right: 8px;
    min-width: 86px;
    text-transform: uppercase;
  }

  .endpoint-groups-grid .endpoint-count {
    color: var(--primary-dark);
    justify-content: flex-start;
    justify-self: flex-start;
    padding-left: 12px;
  }

  .endpoint-groups-grid {
    min-width: 0;
  }

  .group-detail-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .group-detail-grid,
  .group-detail-metrics,
  .group-detail-card dl div {
    grid-template-columns: 1fr;
  }

  .endpoint-host-list {
    grid-template-columns: 1fr;
  }

  .group-contact-form {
    grid-template-columns: 1fr;
  }

  .endpoint-table-head {
    display: none;
  }

  .endpoint-groups-grid .count {
    text-align: left;
  }

  .app-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }

  .nav-item {
    justify-content: center;
    text-align: center;
  }

}

@media (max-width: 600px) {
  .billing-alert-actions,
  .billing-alert-actions button {
    justify-content: stretch;
    width: 100%;
  }

  .tenant-settings-form,
  .tenant-settings-toolbar {
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding: 12px 10px 28px;
  }

  .hero,
  .content-panel,
  .tenant-sidebar {
    padding: 14px;
  }

  .hero {
    min-height: auto;
  }

  .hero-actions,
  .hero-actions button {
    width: 100%;
  }

  .auth-panel {
    gap: 20px;
    padding: 22px 18px;
  }

  .auth-panel h1 {
    font-size: 38px;
  }
}

@media (max-height: 560px) {
  .auth-shell {
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Pannello compatto nel dettaglio gruppo. */
.group-detail-page > .group-detail-hero,
.group-detail-page > .group-detail-form,
.group-detail-page > .group-endpoint-card { flex-shrink: 0; }
.group-information { container-type: inline-size; flex: 0 0 auto; order: 2; }
.tenant-information-form { display: grid; gap: 16px; min-width: 0; }
.information-contact-row, .information-choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.information-text-field { min-width: 0; }
.information-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; margin-bottom: 8px; flex-wrap: wrap; }
.group-information h2, .group-information legend { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.group-information h2 label { font: inherit; color: inherit; }
.group-information textarea { display: block; width: 100%; min-height: 70px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.information-contact-row textarea { height: 90px; }
.information-24h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; white-space: nowrap; }
.information-section { margin: 0; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.information-section legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; }
.information-section .information-options { clear: both; }
.information-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.information-uba .information-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.information-uba .information-option:last-child { grid-column: 1 / -1; }
.information-option { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-strong); cursor: pointer; }
.group-information input[type="checkbox"] { flex: 0 0 17px; width: 17px; height: 17px; min-height: 17px; margin: 0; accent-color: var(--primary); }
.information-option > span { min-width: 0; overflow-wrap: anywhere; }
.information-option-name { display: block; font-size: 14px; font-weight: 400; line-height: 1.35; }
.information-section:disabled .information-option { cursor: default; }
.information-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.information-footer p { flex: 1 1 160px; margin: 0; overflow-wrap: anywhere; }
.information-footer .form-actions { flex-wrap: wrap; margin: 0; }
.information-error { color: var(--danger); }
.group-information textarea:disabled { opacity: 0.65; cursor: not-allowed; }
@container (max-width: 900px) {
  .information-choice-row { grid-template-columns: 1fr; }
}
@container (max-width: 550px) {
  .information-contact-row { grid-template-columns: 1fr; }
  .information-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 340px) {
  .information-options, .information-uba .information-options { grid-template-columns: 1fr; }
  .information-footer .form-actions { width: 100%; }
  .information-footer button { flex: 1 1 auto; }
}
