:root {
  /* Brand base — neskôr prepisovateľné z nastavení inštalácie */
  --navy: #0d1b2a;
  --orange: #ff7a00;
  --amber: #ffc107;
  --ok: #047857;
  --danger: #b91c1c;
  --warn: #b45309;

  /* Neutrálne povrchy a text */
  --text: var(--navy);
  --text-muted: #4b5563;
  --slate: #4b5563;
  --mist: #e5e7eb;
  --canvas: #f4f6f8;
  --panel: #fff;
  --header-bg: var(--panel);
  --sidebar-bg: var(--navy);
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #9ca3af;
  --input-bg: var(--panel);
  --surface-subtle: #fafbfc;
  --surface-hover: #f3f4f6;
  --line: #e5e7eb;
  --tag-muted: #9ca3af;
  --on-dark: #fff;
  --on-dark-muted: #cbd5e1;
  --white: #fff;

  /* Oranžová — odvodené */
  --orange-hover: #e56e00;
  --orange-border: #fdba74;
  --orange-soft: color-mix(in srgb, var(--orange) 10%, transparent);
  --orange-soft-strong: color-mix(in srgb, var(--orange) 18%, transparent);
  --orange-bg: color-mix(in srgb, var(--orange) 8%, var(--panel));
  --orange-ring: color-mix(in srgb, var(--orange) 25%, transparent);

  /* Stavy — odvodené */
  --ok-fg: var(--ok);
  --ok-bg: color-mix(in srgb, var(--ok) 8%, var(--panel));
  --ok-border: color-mix(in srgb, var(--ok) 25%, var(--panel));
  --ok-soft: color-mix(in srgb, var(--ok) 12%, transparent);
  --ok-on-dark: #6ee7b7;

  --danger-fg: var(--danger);
  --danger-bg: color-mix(in srgb, var(--danger) 8%, var(--panel));
  --danger-border: color-mix(in srgb, var(--danger) 22%, var(--panel));
  --danger-soft: color-mix(in srgb, var(--danger) 12%, transparent);
  --danger-on-dark: #fca5a5;

  --warn-fg: var(--warn);
  --warn-bg: color-mix(in srgb, var(--warn) 15%, transparent);
  --warn-border: color-mix(in srgb, var(--warn) 35%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 20%, transparent);
  --warn-on-dark: #fcd34d;

  /* Toast — tmavý panel + oranžový nadpis, stav cez accent */
  --toast-bg: var(--navy);
  --toast-text: var(--on-dark);
  --toast-text-muted: var(--on-dark-muted);
  --toast-title: var(--orange);
  --toast-border: color-mix(in srgb, var(--on-dark) 8%, transparent);
  --toast-shadow: 0 16px 40px color-mix(in srgb, var(--navy) 28%, transparent);
  --toast-accent: var(--orange);
  --toast-close-bg: color-mix(in srgb, var(--on-dark) 8%, transparent);
  --toast-close-hover: color-mix(in srgb, var(--on-dark) 14%, transparent);

  /* UI chrome */
  --focus-ring: var(--orange-border);
  --backdrop: color-mix(in srgb, var(--navy) 45%, transparent);
  --modal-backdrop: color-mix(in srgb, var(--navy) 50%, transparent);
  --header-shadow: 0 1px 0 color-mix(in srgb, var(--navy) 4%, transparent);
  --modal-shadow: 0 24px 60px color-mix(in srgb, var(--navy) 22%, transparent);
  --sidebar-hover: color-mix(in srgb, var(--on-dark) 6%, transparent);
  --sidebar-who-bg: var(--sidebar-hover);
  --switch-off: #d1d5db;
  --switch-knob: var(--white);
  --switch-knob-shadow: 0 1px 3px color-mix(in srgb, var(--navy) 15%, transparent);

  /* Checkbox — znovupoužiteľný, farby prepisovateľné z brandingu */
  --check-size: 18px;
  --check-radius: 6px;
  --check-bg: var(--panel);
  --check-border: color-mix(in srgb, var(--navy) 18%, var(--line));
  --check-hover-border: color-mix(in srgb, var(--orange) 40%, var(--line));
  --check-checked-bg: var(--orange);
  --check-checked-border: var(--orange);
  --check-mark: var(--on-dark);
  --check-focus-ring: var(--orange-ring);

  /* Radio — rovnaká paleta ako checkbox, vlastné tokeny pre budúci branding */
  --radio-size: var(--check-size);
  --radio-bg: var(--check-bg);
  --radio-border: var(--check-border);
  --radio-hover-border: var(--check-hover-border);
  --radio-checked-border: var(--check-checked-border);
  --radio-checked-dot: var(--check-checked-bg);
  --radio-focus-ring: var(--check-focus-ring);

  --secondary-hover-bg: #f8fafc;
  --secondary-hover-border: #cbd5e1;
  --modal-panel: var(--panel);

  --radius: 16px;
  --shadow: 0 8px 24px color-mix(in srgb, var(--navy) 5%, transparent);
  --font: Poppins, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); background: var(--canvas); color: var(--text); }
a { color: var(--orange); }
img { max-width: 100%; }

.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; flex-shrink: 0; }
.brand > span { display: flex; flex-direction: column; min-width: 0; }
.word { display: block; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em; line-height: 1.1; }
.word em { color: var(--orange); font-style: normal; }
.tag { display: block; margin: 0.15rem 0 0; font-size: 0.65rem; letter-spacing: 0.2em; color: var(--tag-muted); font-weight: 500; }

.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin: 0 0 1.2rem; }
.page-head h1 { margin: 0; font-size: 1.55rem; }
.page-head p { margin: 0.25rem 0 0; color: var(--text-muted); }
h2 { font-size: 1.05rem; margin: 1.4rem 0 0.7rem; }

.muted { color: var(--text-muted); }
.empty { color: var(--text-muted); padding: 0.8rem 1.1rem; }

.kpis, .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.kpi, .card { background: var(--panel); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.kpi i, .kpi .kpi-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--orange); color: var(--on-dark); font-style: normal; font-weight: 700; font-size: 0.8rem; margin-bottom: 0.7rem; }
.kpi .kpi-mark svg { display: block; }
a.kpi-link { text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--navy) 8%, transparent); }
.kpi strong, .card strong { display: block; font-size: 1.55rem; }
.kpi span, .card span { color: var(--text-muted); font-size: 0.8rem; }
.kpi.warn strong, .card.warn strong { color: var(--warn-fg); }

.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; overflow: hidden; padding: 1.1rem; border: 1px solid var(--line); }
.panel-pad { padding: 1.1rem; }
.panel:has(table):not(.import-upload-panel), .panel:has(.list-row), .panel-tabs { padding: 0; }
.panel:has(table):not(.import-upload-panel) h2, .panel:has(.list-row) h2 { margin: 0; padding: 1rem 1.1rem 0; }

.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }
.list-row { padding: 0.9rem 1.1rem; border-top: 1px solid var(--surface-hover); }
.list-row:first-child { border-top: 0; }

label { display: block; font-size: 0.8rem; font-weight: 500; margin: 0 0 0.35rem; }
.field { margin-bottom: 0.95rem; }

/* File upload */
.ui-file-upload {
  display: grid;
  gap: 0.55rem;
}
.ui-file-upload-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin: 0;
}
.ui-file-upload-zone {
  display: block;
  position: relative;
  border: 1px dashed color-mix(in srgb, var(--text-muted) 28%, var(--line));
  border-radius: 12px;
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ui-file-upload-zone:hover,
.ui-file-upload-zone.is-dragover {
  border-color: color-mix(in srgb, var(--orange) 50%, var(--line));
  background: color-mix(in srgb, var(--orange-bg) 55%, var(--surface-subtle));
  box-shadow: 0 8px 20px -16px color-mix(in srgb, var(--orange) 45%, transparent);
}
.ui-file-upload-zone.has-file {
  border-style: solid;
  border-color: color-mix(in srgb, var(--orange) 38%, var(--line));
  background: color-mix(in srgb, var(--orange-bg) 35%, var(--panel));
}
.ui-file-upload-zone.is-error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}
.ui-file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ui-file-upload-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
}
.ui-file-upload-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  color: var(--orange);
  flex-shrink: 0;
}
.ui-file-upload-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.ui-file-upload-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  word-break: break-word;
}
.ui-file-upload-zone.has-file .ui-file-upload-title {
  color: color-mix(in srgb, var(--orange) 82%, var(--text));
}
.ui-file-upload-meta,
.ui-file-upload-hint {
  margin: 0.3rem 0 0;
  line-height: 1.45;
}
.ui-file-upload-hint {
  margin-top: 0.45rem;
}
.ui-file-upload-btn {
  flex-shrink: 0;
  margin-left: auto;
}
.import-upload-panel {
  padding: 1.25rem 1.35rem 1.35rem;
}
.import-upload-panel .panel-title {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  font-weight: 600;
}
.import-upload-form {
  display: grid;
  gap: 0;
}
.import-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.15rem;
}
.ui-file-upload.is-loading .ui-file-upload-zone {
  pointer-events: none;
}
.ui-file-upload-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: inherit;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.ui-file-upload.is-loading .ui-file-upload-loader {
  display: flex;
}
.ui-file-upload-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid color-mix(in srgb, var(--orange) 25%, var(--line));
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: ui-file-upload-spin 0.75s linear infinite;
}
@keyframes ui-file-upload-spin {
  to { transform: rotate(360deg); }
}
.import-start-row-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.import-start-row-head {
  margin-bottom: 0.9rem;
}
.import-start-row-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.import-start-row-help {
  margin: 0;
}
.import-start-row-warn {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line));
  background: color-mix(in srgb, var(--orange-bg) 40%, var(--panel));
  color: var(--text);
}
.import-start-row-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.import-start-row-table {
  font-size: 0.84rem;
}
.import-start-row-table th,
.import-start-row-table td {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-start-row-table tbody tr {
  cursor: pointer;
}
.import-start-row-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--orange-bg) 55%, transparent);
}
.import-start-row-table tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--orange);
}
.import-start-row-pick {
  width: 1px;
  text-align: center;
}
.import-start-row-pick .ui-radio {
  margin: 0 auto;
}
.import-start-row-radio {
  justify-content: center;
}
.import-start-row-num {
  width: 1px;
  text-align: center;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.import-start-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}
.import-template-notice {
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--orange) 28%, var(--line));
  background: color-mix(in srgb, var(--orange-bg) 45%, var(--panel));
}
.import-template-notice-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.import-template-notice-warn {
  margin: 0.65rem 0 0;
  color: var(--warn-fg);
}
.import-template-notice-info {
  margin: 0.45rem 0 0;
}
.import-duration-estimate {
  margin: 0.35rem 0 0;
}
.import-duration-estimate-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82em;
  opacity: 0.85;
}
.import-map-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.import-map-submit-hint {
  flex: 1 1 100%;
  margin: 0;
  text-align: right;
}
.import-map-actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.import-pending-filename,
.import-active-filename {
  margin: 0.75rem 0 0.5rem;
}
.import-phase-label {
  margin: 0.15rem 0 0.5rem;
}
.import-progress-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.import-status-card {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-hover) 55%, var(--panel));
}
.import-status-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.import-status-badge {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}
.import-progress-panel:not(.is-finished) .import-status-badge {
  color: var(--orange);
}
.import-progress-panel.is-finished .import-status-badge {
  color: var(--ok);
}
.import-status-card-head .import-phase-label {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-fg);
  font-size: 0.82rem;
  line-height: 1.3;
}
.import-progress-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.import-progress-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.import-progress-value {
  margin: 0;
  font-size: 0.95rem;
}
.import-progress-value strong {
  font-size: 1.05rem;
}
.import-stat-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.import-stat-card {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.import-stat-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.import-stat-card strong {
  display: block;
  font-size: 1.65rem;
  line-height: 1.1;
}
.import-stat-card--created strong { color: var(--ok); }
.import-stat-card--updated strong { color: var(--orange); }
.import-stat-card--skipped strong { color: var(--text-muted); }
.import-stat-card--errors strong { color: var(--text-muted); }
.import-stat-card--errors.has-errors {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger-bg) 45%, var(--panel));
}
.import-stat-card--errors.has-errors strong { color: var(--danger); }
.import-error-panel {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--danger-bg) 30%, var(--panel));
}
.import-error-panel .panel-subtitle {
  margin: 0 0 0.65rem;
}
.import-progress-actions {
  margin-top: 0.15rem;
}
@media (min-width: 860px) {
  .import-stat-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .import-progress-track.is-active,
  .import-progress-track.is-active::after,
  .import-progress-bar.is-active::after {
    animation: none;
  }
}
.import-pending-actions,
.import-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.import-active-progress-track {
  margin: 0.5rem 0;
}
.import-active-progress-text {
  margin: 0 0 1rem;
}
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
input, textarea, select {
  width: 100%; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--input-bg); color: var(--text); font: 400 1rem var(--font);
}
textarea { min-height: 6rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus-ring); border-color: var(--orange); }
.check { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.9rem; margin: 0.2rem 0 1.1rem; cursor: pointer; }
.check.ui-check { margin: 0.2rem 0 1.1rem; }
.check.ui-check .ui-check-label { color: var(--text-muted); font-size: 0.9rem; }
.check > span:not(.ui-check-box):not(.ui-check-label) { color: var(--text-muted); }
.check input { width: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
[hidden] { display: none !important; }
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.65rem 1rem;
  border-radius: 10px; border: 1px solid transparent; background: var(--orange); color: var(--on-dark);
  text-decoration: none; font: 600 0.92rem var(--font); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--orange-hover); }
.btn.secondary:hover { background: var(--secondary-hover-bg); border-color: var(--secondary-hover-border); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--panel); color: var(--danger-fg); border-color: var(--danger-border); }
.btn.danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.btn.small { padding: 0.4rem 0.65rem; font-size: 0.82rem; }
.btn.has-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.btn.has-icon .ui-icon { flex-shrink: 0; }
.btn.icon-only {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  padding: 0;
  flex: 0 0 auto;
}
.btn.is-busy, .btn.is-busy:hover { opacity: 0.72; cursor: wait; }
.btn.is-loading,
.btn.is-loading:hover {
  opacity: 0.92;
  cursor: wait;
  pointer-events: none;
}
.btn .btn-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: ui-file-upload-spin 0.75s linear infinite;
  flex-shrink: 0;
}
.btn.is-loading {
  gap: 0.5rem;
}
.btn.is-loading .btn-spinner {
  display: inline-block;
}
.module-tile.row-busy { opacity: 0.62; pointer-events: none; }
tr.row-busy { opacity: 0.62; }
.btn.block { width: 100%; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.75rem 1.1rem; border-top: 1px solid var(--surface-hover); vertical-align: top; }
th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

.flash, .secret, .errors { padding: 0.85rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.flash { background: var(--ok-bg); color: var(--ok-fg); }
.errors { background: var(--danger-bg); color: var(--danger-fg); }
.secret { background: var(--orange-bg); border: 1px dashed var(--orange-border); }
.secret code, .mono { font-family: ui-monospace, monospace; word-break: break-all; }
.error { color: var(--danger-fg); font-size: 0.85rem; margin: 0.3rem 0 0; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok-fg); font-size: 0.72rem; font-weight: 600; }

/* App shell */
.nav-check { position: absolute; opacity: 0; pointer-events: none; }
.app { min-height: 100vh; }
.side {
  background: var(--sidebar-bg); color: var(--on-dark); padding: 1.1rem 0.85rem 1rem;
  display: none; flex-direction: column; gap: 0.4rem;
}
.side .brand { padding: 0.25rem 0.5rem 1rem; color: var(--on-dark); }
.nav-links { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-links a, .nav-links button.link {
  display: flex; width: 100%; align-items: center; gap: 0.65rem;
  color: var(--sidebar-text); text-decoration: none; background: none; border: 0; text-align: left;
  padding: 0.65rem 0.75rem; border-radius: 10px; font: 500 0.92rem var(--font); cursor: pointer;
}
.nav-links a.active { background: var(--orange); color: var(--on-dark); }
.nav-links a:not(.active):hover, .nav-links button.link:hover { background: var(--sidebar-hover); }
.who {
  margin-top: auto; background: var(--sidebar-who-bg); border-radius: 12px;
  padding: 0.8rem; display: flex; gap: 0.65rem; align-items: center;
}
.who > div:last-child { min-width: 0; }
.who > div:last-child > div:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ava { width: 36px; height: 36px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; letter-spacing: -0.03em; flex-shrink: 0; }
.who small { color: var(--sidebar-muted); display: block; font-size: 0.75rem; }

/* Main column + white header */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: 100%;
}
.app-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.7rem 1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--header-shadow);
  position: sticky;
  top: 0;
  z-index: 15;
}
.app-header a { text-decoration: none; }
.app-header-start {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}
.app-header-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.app-header-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.app-header-menu:hover { background: var(--surface-hover); }
.app-header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
}
.app-header-icon:hover { background: var(--surface-hover); }
.app-header-icon.is-active {
  border-color: var(--orange-border);
  background: var(--orange-soft);
  color: var(--orange);
}
.app-header-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--on-dark);
  border: 2px solid var(--header-bg);
  font: 700 0.68rem var(--font);
  display: grid;
  place-items: center;
}
.app-header-user {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  max-width: 220px;
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}
.app-header-user:hover { background: var(--surface-hover); }
.app-header-user .ava { width: 32px; height: 32px; font-size: 0.68rem; }
.app-header-user-meta {
  display: none;
  min-width: 0;
  line-height: 1.2;
}
.app-header-user-meta strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header-user-meta small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--on-dark);
  font: 700 0.7rem var(--font);
  display: inline-grid;
  place-items: center;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.notification-list { display: grid; gap: 0; }
.notification-item {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.1rem; border-bottom: 1px solid var(--line);
}
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: var(--orange-soft); }
.notification-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.notification-head time { font-size: 0.8rem; white-space: nowrap; }
.notification-main p { margin: 0.35rem 0 0; font-size: 0.9rem; }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.main { padding: 1.15rem 1rem 2.2rem; width: 100%; max-width: none; box-sizing: border-box; }
.backdrop { display: none; }

@media (max-width: 859px) {
  .nav-check:checked ~ .app .side {
    display: flex; position: fixed; inset: 0 auto 0 0; width: min(260px, 86vw); z-index: 30;
  }
  .nav-check:checked ~ .backdrop {
    display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 20;
  }
}

@media (min-width: 860px) {
  .app { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .side {
    display: flex;
    grid-column: 1;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .app-shell { grid-column: 2; }
  .app-header { padding: 0.75rem 1.6rem; }
  .app-header-menu { display: none; }
  .app-header-user-meta { display: block; }
  .side .who { display: none; }
  .main { padding: 1.25rem 1.6rem 2.4rem; }
  .kpis, .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Guest / login */
body.guest { background: var(--canvas); }
.login { min-height: 100vh; display: grid; }
.hero {
  background: var(--navy); color: var(--on-dark); padding: 2.2rem 1.6rem;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; min-height: 220px;
}
.hero:after {
  content: ""; position: absolute; inset: auto -20% -40% 15%; height: 80%;
  border: 2px solid var(--orange-ring); border-radius: 50%; pointer-events: none;
}
.hero .brand { color: var(--on-dark); }
.hero h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); margin: 2.2rem 0 0.55rem; line-height: 1.2; }
.hero p { color: var(--on-dark-muted); max-width: 22rem; line-height: 1.55; margin: 0; }
.form-wrap { display: grid; place-items: center; padding: 2rem 1.25rem; }
.form-wrap .inner { width: min(24rem, 100%); }

@media (min-width: 860px) {
  .login { grid-template-columns: 1.1fr 0.9fr; }
  .hero { min-height: 100vh; padding: 2.6rem 2.2rem; }
}

[x-cloak] { display: none !important; }
body.modal-open { overflow: hidden; }
html.is-loading,
body.is-loading { overflow: hidden; }

/* Global page loader */
.global-loader {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  place-items: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--navy) 38%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.global-loader.is-active {
  display: grid;
  animation: global-loader-fade-in 0.15s ease;
}
.global-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  min-width: 9rem;
  padding: 1.15rem 1.35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.global-loader-spinner {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--orange) 16%, var(--line));
  border-top-color: var(--orange);
  border-right-color: color-mix(in srgb, var(--orange) 55%, transparent);
  animation: global-loader-spin 0.8s linear infinite;
}
.global-loader-label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
@keyframes global-loader-spin {
  to { transform: rotate(360deg); }
}
@keyframes global-loader-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Navigation — collapsible sidebar menu */
.nav-menu {
  gap: 0.35rem;
}

.nav-separator {
  display: block;
  margin: 0.85rem 0.75rem 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  font-weight: 600;
}

.nav-section {
  border-radius: 12px;
}

.nav-section-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  color: var(--sidebar-text);
  font: 600 0.82rem var(--font);
  user-select: none;
  transition: background .15s ease, color .15s ease;
}

.nav-section-head::-webkit-details-marker,
.nav-section-head::marker {
  display: none;
  content: '';
}

.nav-section-head:hover {
  background: var(--sidebar-hover);
  color: var(--on-dark);
}

.nav-section[open] > .nav-section-head {
  color: var(--on-dark);
  background: color-mix(in srgb, var(--orange) 9%, transparent);
}

.nav-section-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  color: var(--sidebar-muted);
  transition: transform .2s ease, color .15s ease, background .15s ease;
}

.nav-section[open] .nav-section-chevron {
  transform: rotate(180deg);
  color: var(--orange);
}

.nav-section-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0.2rem 0 0.35rem;
  padding: 0.15rem 0 0.15rem 0.45rem;
  border-left: 1px solid color-mix(in srgb, var(--orange) 22%, transparent);
}

html.sidebar-nav-ready .nav-section.nav-section--animating[open] > .nav-section-body {
  animation: nav-section-in 0.18s ease;
}

@keyframes nav-section-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-section-nested {
  margin-left: 0.35rem;
}

.nav-section-nested .nav-section-head {
  font-size: 0.78rem;
  padding: 0.42rem 0.5rem;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.52rem 0.55rem;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font: 500 0.88rem var(--font);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.nav-item-link.is-nested {
  padding-left: 0.45rem;
  font-size: 0.86rem;
}

.nav-item-link:hover {
  background: var(--sidebar-hover);
  color: var(--on-dark);
}

.nav-item-link.active {
  background: linear-gradient(135deg, var(--orange) 0%, color-mix(in srgb, var(--orange) 82%, var(--amber)) 100%);
  color: var(--on-dark);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--orange) 32%, transparent);
}

.nav-item-icon {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--on-dark) 7%, transparent);
  color: color-mix(in srgb, var(--on-dark) 88%, var(--orange));
  transition: background .15s ease, color .15s ease;
}

.nav-item-link:hover .nav-item-icon,
.nav-section-head:hover .nav-item-icon {
  background: color-mix(in srgb, var(--on-dark) 11%, transparent);
  color: var(--on-dark);
}

.nav-item-link.active .nav-item-icon {
  background: color-mix(in srgb, var(--on-dark) 20%, transparent);
  color: var(--on-dark);
}

.nav-section-head .nav-item-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
}

.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-icon {
  display: block;
  flex-shrink: 0;
}

.menu-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
  grid-auto-rows: 2.5rem;
  gap: 0.35rem;
  max-height: calc(2.5rem * 2 + 0.35rem + 0.3rem);
  overflow: auto;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.menu-icon-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.menu-icon-picker-btn:hover,
.menu-icon-picker-btn:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.menu-icon-picker-btn.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.nav-section-chevron-icon {
  display: block;
}

/* Legacy navigation groups (admin labels) */
.nav-label {
  margin: 1rem 0.75rem 0.35rem; font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--sidebar-muted); font-weight: 600;
}
.nav-label:first-of-type { margin-top: 0.35rem; }
.nav-tree {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-tree-link.is-nested {
  padding-left: calc(0.75rem + (var(--nav-depth, 1) * 0.65rem));
  font-size: 0.88rem;
}
.nav-tree-label {
  margin-top: 0.15rem;
}
.app-header-account {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.app-header-logout {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.app-header-logout button.app-header-icon {
  cursor: pointer;
}
.account-profile-section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

/* Tabs — inside panel */
.panel-tabs { padding: 0; overflow: hidden; }
.tab-bar {
  display: flex; gap: 0; border-bottom: 1px solid var(--line);
  background: var(--surface-subtle); padding: 0 0.35rem; overflow-x: auto;
}
.tab-item {
  position: relative; display: inline-flex; align-items: center;
  padding: 0.9rem 1rem; text-decoration: none; color: var(--text-muted);
  font: 600 0.88rem var(--font); white-space: nowrap;
  border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; cursor: pointer;
}
.tab-item:hover { color: var(--text); }
.tab-item.is-active {
  color: var(--text); border-bottom-color: var(--orange); background: var(--panel);
}
.tab-item { transition: color .15s ease, border-color .15s ease; }
.tab-body { padding: 1.25rem 1.35rem 1.4rem; }
.panel-narrow { max-width: 32rem; }

.panel-header {
  padding: 1rem 1.35rem 0.25rem; border-bottom: 1px solid var(--surface-hover);
}
.panel-header h2 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.panel-header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.panel-header-row h2 { margin: 0 0 0.75rem; }

.profile-fields-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.profile-fields-head .muted { margin: 0; flex: 1; }
.profile-fields-table td .small { display: block; margin-top: 0.15rem; }
.profile-field-name {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
}
.profile-field-name .small { margin-top: 0; width: 100%; }
.field-kind-system {
  background: var(--surface-subtle); color: var(--text-muted); font-weight: 600;
}
.field-kind-custom {
  background: var(--orange-bg); color: var(--orange); font-weight: 600;
}
.field-kind-module {
  background: var(--surface-subtle); color: var(--text-muted); font-weight: 600;
}
.profile-field-row--custom { background: color-mix(in srgb, var(--orange) 4%, var(--panel)); }
.profile-field-row--custom:hover { background: color-mix(in srgb, var(--orange) 7%, var(--panel)); }
.profile-field-row--module { background: color-mix(in srgb, var(--navy) 3%, var(--panel)); }
.profile-field-row--module:hover { background: color-mix(in srgb, var(--navy) 5%, var(--panel)); }
.check-list { display: grid; gap: 0.35rem; }

.account-profile-panel {
  max-width: none;
}
.account-profile-identity {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.45rem 1rem 0.45rem 0.45rem;
  margin-bottom: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.ava-lg {
  width: 48px;
  height: 48px;
  font-size: 0.95rem;
}
.account-profile-identity-meta {
  display: block;
  min-width: 0;
  line-height: 1.25;
}
.account-profile-identity-meta strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.account-profile-identity-meta small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.account-profile-identity-email {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-profile-notice {
  margin: -0.65rem 0 1.1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--orange) 22%, var(--line));
  background: var(--orange-bg);
  color: var(--text);
  font-size: 0.9rem;
}
.account-profile-form {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: 1fr;
}
.account-profile-form .form-actions,
.account-profile-section {
  grid-column: 1 / -1;
}
.account-profile-section {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.account-profile-form > .field:first-child,
.account-profile-form > .account-profile-section:first-child {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.account-profile-custom-fields {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .account-profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .account-profile-custom-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.users-pending-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.users-pending-card {
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
}
.users-pending-card[open] {
  border-color: color-mix(in srgb, var(--orange) 18%, var(--line));
}
.users-pending-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.users-pending-summary::-webkit-details-marker {
  display: none;
}
.users-pending-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.users-pending-label .ui-icon {
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.users-pending-card[open] .users-pending-label .ui-icon {
  transform: rotate(180deg);
}
.users-pending-card[open] > .users-pending-summary {
  border-bottom: 1px solid var(--line);
}
.users-pending-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--orange-bg);
  border: 1px solid color-mix(in srgb, var(--orange) 22%, var(--line));
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
}
.users-pending-list {
  display: grid;
  gap: 0.5rem;
  padding: 0.55rem;
}
.users-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 94%, var(--orange-bg));
  transition: border-color 0.15s ease, background 0.15s ease;
}
.users-pending-item--invite {
  border-left: 3px solid color-mix(in srgb, var(--orange) 65%, transparent);
}
.users-pending-item--reset {
  border-left: 3px solid color-mix(in srgb, var(--text-muted) 35%, transparent);
}
.users-pending-item:hover,
.users-pending-item:focus-within {
  border-color: color-mix(in srgb, var(--orange) 22%, var(--line));
  background: color-mix(in srgb, var(--orange-bg) 45%, var(--panel));
}
.users-pending-item-lead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.users-pending-ava {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.78rem;
  background: linear-gradient(145deg, color-mix(in srgb, var(--orange) 88%, white), var(--orange));
  color: #fff;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--orange) 30%, transparent);
}
.users-pending-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--text-muted) 10%, var(--panel));
  border: 1px solid var(--line);
  color: var(--text-muted);
}
.users-pending-item-main {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.users-pending-item-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}
.users-pending-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.users-pending-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-muted);
}
.users-pending-tag--expiry {
  border-color: color-mix(in srgb, var(--orange) 20%, var(--line));
  color: color-mix(in srgb, var(--orange) 82%, var(--text));
  background: color-mix(in srgb, var(--orange-bg) 70%, var(--panel));
}
.users-main-panel {
  padding: 0;
  margin-bottom: 0;
}
.users-table {
  font-size: 0.875rem;
}
.users-table-row {
  cursor: pointer;
}
.users-table-row.is-modal-loading {
  opacity: 0.65;
  cursor: wait;
}
[data-modal-lazy].is-modal-loading {
  opacity: 0.65;
  cursor: wait;
}
.users-table.data-table thead th,
.users-table.data-table tbody td {
  padding: 0.45rem 0.85rem;
  vertical-align: middle;
}
.users-table.data-table thead th {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.users-row-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.users-row-user-meta {
  display: block;
  min-width: 0;
  line-height: 1.25;
}
.users-row-user-meta strong {
  display: block;
  font-weight: 600;
}
.users-row-user-meta small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.users-device-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
}
a.records-action-btn {
  text-decoration: none;
}
.users-detail-modal .users-detail-section-first {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.users-detail-section {
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.users-detail-section-label {
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.users-detail-reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.users-detail-reset-row .users-detail-section-label {
  margin: 0;
}
.users-detail-reset-row-end {
  justify-content: flex-end;
}
.users-detail-reset-note-only {
  margin: 0;
  text-align: right;
}
.users-detail-reset-meta {
  min-width: 0;
}
.users-detail-reset-meta .users-detail-section-label {
  margin-bottom: 0.15rem;
}
.users-detail-reset-note {
  margin: 0;
  text-align: right;
}
.users-detail-section-help {
  margin: 0 0 0.85rem;
}
.users-detail-role-form .users-detail-role-actions {
  margin-top: 0.75rem;
}
.users-detail-readonly-value {
  margin: 0;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}
.users-reset-pending-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}
.users-assignments-panel {
  max-width: none;
}
.users-assignments-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.users-assignments-help {
  margin: 0 0 1.25rem;
}
.users-assignments-form {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: 1fr;
}
.users-assignments-form .form-actions {
  grid-column: 1 / -1;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .users-assignments-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ms-modal-trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ms-modal-trigger:hover {
  border-color: color-mix(in srgb, var(--line) 70%, var(--text));
}
.ms-modal-trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.ms-modal-trigger.is-loading {
  cursor: wait;
  opacity: 0.85;
}
.ms-modal-trigger.is-loading .ms-modal-summary::before {
  content: '';
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  margin-right: 0.35rem;
  border: 2px solid color-mix(in srgb, var(--orange) 20%, var(--line));
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: global-loader-spin 0.8s linear infinite;
  vertical-align: middle;
}
.ms-modal-summary,
.ms-modal-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}
.ms-modal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--orange-bg);
  border: 1px solid color-mix(in srgb, var(--orange) 22%, var(--line));
  color: var(--orange);
  white-space: nowrap;
}
.ms-modal-placeholder {
  font-size: 0.9rem;
}
.ms-modal-readonly {
  padding: 0.2rem 0;
}
.ms-modal-options {
  gap: 0.2rem;
}
.ms-modal-option {
  margin: 0;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
}
.ms-modal-option:hover {
  background: var(--surface-subtle);
}
.ms-modal-option .ui-check {
  width: 100%;
}

.list-manager-field {
  margin-top: 1.25rem;
  margin-bottom: 0;
}
.list-manager-sheet.sl-sheet {
  margin-bottom: 0;
  overflow: visible;
}
.list-manager-sheet .sl-items:empty {
  display: none;
}
.list-manager-add.is-open {
  border-color: var(--orange);
  background: var(--orange-bg);
  box-shadow: 0 0 0 3px var(--orange-ring);
}
.list-manager-suggest {
  margin: 0;
  padding: 0.35rem 0.5rem 0.5rem;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--orange) 18%, var(--line));
  max-height: 16rem;
  overflow: auto;
}
.list-manager-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.list-manager-suggest-item:hover,
.list-manager-suggest-item.is-active {
  background: var(--surface-subtle);
}
.list-manager-suggest-item.is-active {
  background: color-mix(in srgb, var(--orange) 10%, var(--surface-subtle));
}
.list-manager-suggest-body {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.list-manager-suggest-empty {
  padding: 0.65rem 0.5rem;
  font-size: 0.8125rem;
}
.panel.list-instance-settings {
  overflow: visible;
}
.list-instance-settings .form-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table thead th {
  padding: 0.8rem 1.35rem; text-align: left; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
  background: var(--surface-subtle); border-bottom: 1px solid var(--line);
}
.data-table tbody td {
  padding: 0.9rem 1.35rem; border-bottom: 1px solid var(--surface-hover); vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--surface-subtle); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.pagination-nav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-top: 1rem; padding: 0 1.35rem 1.1rem;
}
.pagination-meta { margin: 0; }
.pagination-links { display: flex; align-items: center; gap: 0.5rem; }
.pagination-current { min-width: 4rem; text-align: center; }
.btn.small.disabled { opacity: 0.45; pointer-events: none; }

.records-load-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem 1.35rem 1.2rem;
  border-top: 1px solid var(--line);
}
.records-load-action {
  grid-column: 2;
  justify-self: center;
}
.records-load-meta {
  grid-column: 3;
  justify-self: end;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.records-load-footer [data-load-more] {
  min-width: 9rem;
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--orange) 45%, transparent);
}
.records-load-footer [data-load-more]:hover {
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--orange) 55%, transparent);
}
.records-load-footer [data-load-more]:disabled {
  opacity: 0.75;
  cursor: wait;
}
.records-bulk-head {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem 0.35rem;
}
.records-toolbar .records-bulk-slot {
  flex: 0 0 auto;
}
.records-panel-head {
  margin-bottom: 0;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--surface-hover);
}
.records-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.records-lazy.is-loading .records-table tbody {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.records-toolbar-loading {
  display: none;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--orange) 22%, var(--line));
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.records-toolbar-loading.is-visible {
  display: inline-flex;
  animation: global-loader-fade-in 0.15s ease;
}
.records-toolbar-spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--orange) 16%, var(--line));
  border-top-color: var(--orange);
  border-right-color: color-mix(in srgb, var(--orange) 55%, transparent);
  animation: global-loader-spin 0.8s linear infinite;
  flex-shrink: 0;
}
.records-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.records-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
}
.records-table thead tr:first-child th:not(.records-actions-col):not(.records-check-col),
.records-table tbody td:not(.records-actions-col):not(.records-check-col) {
  width: 1px;
  white-space: nowrap;
}
.records-table .records-actions-col {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 1px;
  min-width: 6.75rem;
  white-space: nowrap;
  text-align: right;
  background: var(--panel);
  padding-left: 0.65rem;
  padding-right: 0.85rem;
}
.records-table thead th.records-actions-col {
  z-index: 5;
  background: var(--surface-subtle);
  box-shadow: none;
  text-align: right;
}
.records-table tbody td.records-actions-col {
  box-shadow: -4px 0 10px -5px color-mix(in srgb, var(--navy) 14%, transparent);
}
.records-table tbody td.records-actions-col::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 0.75rem;
  pointer-events: none;
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, var(--navy) 8%, transparent) 65%,
    color-mix(in srgb, var(--navy) 12%, transparent)
  );
}
.records-table tbody td.records-actions-col::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--orange);
  pointer-events: none;
  z-index: 1;
}
.records-table tbody tr:hover td.records-actions-col {
  background: var(--surface-subtle);
  box-shadow: -4px 0 10px -5px color-mix(in srgb, var(--navy) 14%, transparent);
}
.records-table tbody tr:hover td.records-actions-col::after {
  background: var(--orange-hover);
}
.records-lazy:not(.column-filters-open) .records-filter-row {
  display: none;
}
.records-column-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}
.records-column-filters-toggle.is-active {
  color: var(--orange);
}
.records-column-filters-chevron {
  display: inline-flex;
  transition: transform 0.15s ease;
}
.records-lazy.column-filters-open .records-column-filters-chevron {
  transform: rotate(180deg);
}
.records-filter-row th:not(.records-actions-col):not(.records-check-col) {
  width: 1px;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  padding-top: 0.2rem;
  padding-bottom: 0.45rem;
  vertical-align: top;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.records-filter-row th.records-check-col,
.records-filter-row th.records-actions-col {
  width: 1px;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  padding-top: 0.2rem;
  padding-bottom: 0.45rem;
  vertical-align: top;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.records-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--surface-hover);
}
.records-toolbar-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.records-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.records-search-field {
  position: relative;
  display: block;
  flex: 1 1 16rem;
  max-width: 28rem;
}
.records-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--text-muted);
  pointer-events: none;
}
.records-search-input {
  width: 100%;
  padding: 0.62rem 2.25rem 0.62rem 2.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: 400 0.9rem var(--font);
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--navy) 4%, transparent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.records-search-input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 88%, transparent);
}
.records-search-input:hover {
  border-color: color-mix(in srgb, var(--text-muted) 35%, var(--line));
}
.records-search-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow:
    inset 0 1px 2px color-mix(in srgb, var(--navy) 4%, transparent),
    0 0 0 3px color-mix(in srgb, var(--orange) 16%, transparent);
}
.records-search-field:focus-within .records-search-icon {
  color: var(--orange);
}
.records-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 1rem;
  width: 1rem;
  margin-right: 0.15rem;
  background:
    linear-gradient(45deg, transparent 43%, var(--text-muted) 45%, var(--text-muted) 55%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, var(--text-muted) 45%, var(--text-muted) 55%, transparent 57%);
  cursor: pointer;
  opacity: 0.65;
}
.records-search-input::-webkit-search-cancel-button:hover {
  opacity: 1;
}
.records-col-filter {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 1.75rem;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  font: 400 0.78rem/1.2 var(--font);
  box-sizing: border-box;
}
.records-col-filter:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--orange);
}
.records-col-filter-select {
  cursor: pointer;
  padding-right: 1.4rem;
  text-overflow: ellipsis;
}
.records-filter-clear {
  white-space: nowrap;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.records-empty-cell {
  padding: 1.25rem 1.35rem !important;
  text-align: center;
}
.records-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.records-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.18rem;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--panel));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--panel) 75%, transparent);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.records-action-form {
  display: inline-flex;
  margin: 0;
}
.records-action-btn {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.records-action-btn:hover {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--navy) 8%, transparent);
}
.records-action-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
.records-action-btn--success:hover {
  background: color-mix(in srgb, #16a34a 10%, var(--panel));
  color: #15803d;
}
.records-action-btn--danger {
  color: color-mix(in srgb, var(--danger-fg) 78%, var(--text-muted));
}
.records-action-btn--danger:hover {
  background: var(--danger-bg);
  color: var(--danger-fg);
  box-shadow: none;
}
.data-table tbody tr:hover .records-actions-group,
.data-table tbody tr:focus-within .records-actions-group,
.users-pending-item:hover .records-actions-group,
.users-pending-item:focus-within .records-actions-group {
  border-color: color-mix(in srgb, var(--orange) 22%, var(--line));
  background: color-mix(in srgb, var(--orange-bg) 55%, var(--panel));
}
.records-check-col {
  width: 1px;
}
@media (max-width: 640px) {
  .records-load-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .records-load-meta { align-self: flex-end; }
  .records-load-action { align-self: center; }
}

/* List instance overview */
.list-dash {
  display: grid;
  gap: 1rem;
}
.list-dash-head {
  margin-bottom: 0;
}
.list-dash-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}
.list-dash-title-line h1 {
  margin: 0;
}
.list-dash-lead {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}
.list-dash-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
.list-dash-edit {
  padding: 0.85rem 1rem 1rem;
}
.list-dash-edit-summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--orange);
  list-style: none;
}
.list-dash-edit-summary::-webkit-details-marker {
  display: none;
}
.list-dash-edit-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--surface-hover);
}
.list-dash-edit-form .field:last-of-type {
  margin-bottom: 0.65rem;
}
.list-dash-edit-status {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--surface-hover);
}
.list-dash-kpis {
  margin: 0;
}
.list-dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.list-dash-card {
  margin-bottom: 0;
  height: 100%;
}
.list-dash-card h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}
.list-dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.list-dash-card-head h2 {
  margin: 0;
}
.list-dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.list-dash-import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.list-dash-import-name {
  margin: 0.35rem 0 0.15rem;
  font-weight: 600;
  word-break: break-word;
}
.list-dash-import-side {
  flex: 0 0 auto;
}
.list-dash-import-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}
.list-dash-import-stats dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.list-dash-import-stats dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.list-dash-import-active-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}
.list-dash-meta {
  margin: 0;
}
.list-dash-about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--surface-hover);
}
.list-dash-grid:has(.list-dash-card:only-child) {
  grid-template-columns: 1fr;
}
.list-instance-settings .setting-row:first-of-type {
  padding-top: 0;
}
.list-instance-settings-panel {
  margin: 0.35rem 0 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  background: var(--surface-subtle);
}
.list-instance-settings-panel-help {
  margin: 0;
}
.list-menu-options {
  margin-top: 0.65rem;
}
.list-menu-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
}
.list-menu-option .ui-check {
  margin: 0;
  flex-shrink: 0;
}
.list-instance-settings-panel .field:last-child {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .list-dash-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 860px) {
  .list-dash-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Meta list (health) */
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem; margin: 0;
}
.meta-item {
  margin: 0; padding: 0.9rem 1rem; border: 1px solid var(--surface-hover);
  border-radius: 12px; background: var(--surface-subtle);
}
.meta-item dt {
  margin: 0 0 0.35rem; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600;
}
.meta-item dd { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); }

/* Settings row */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 0 1.1rem; border-bottom: 1px solid var(--surface-hover);
}
.setting-row:last-of-type { border-bottom: 0; padding-bottom: 0.35rem; }
.setting-row strong { display: block; margin-bottom: 0.2rem; }
.setting-row p { margin: 0; font-size: 0.88rem; }

.switch { position: relative; display: inline-flex; flex-shrink: 0; align-items: center; }
.switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.switch-ui {
  position: relative;
  width: 44px; height: 26px; border-radius: 999px; background: var(--switch-off);
  transition: background .2s ease;
  pointer-events: none;
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--switch-knob); box-shadow: var(--switch-knob-shadow);
  transition: transform .2s ease;
}
.switch input:checked + .switch-ui { background: var(--orange); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.switch-table { margin: 0 auto; width: 44px; height: 26px; }
.switch-inline { align-items: center; gap: 0.55rem; cursor: pointer; }
.switch-label { font-size: 0.9rem; color: var(--text); user-select: none; }

/* UI checkbox — skrytý natívny input + vlastný box (brandové CSS premenné) */
.ui-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
}
.ui-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.ui-check-box {
  position: relative;
  flex-shrink: 0;
  width: var(--check-size);
  height: var(--check-size);
  border: 1.5px solid var(--check-border);
  border-radius: var(--check-radius);
  background: var(--check-bg);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}
.ui-check:hover .ui-check-box {
  border-color: var(--check-hover-border);
}
.ui-check input:focus-visible + .ui-check-box {
  box-shadow: 0 0 0 3px var(--check-focus-ring);
}
.ui-check input:checked + .ui-check-box {
  background: var(--check-checked-bg);
  border-color: var(--check-checked-border);
}
.ui-check-box::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.ui-check input:checked + .ui-check-box::after {
  opacity: 1;
  transform: scale(1);
  background-color: var(--check-mark);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.2 4.8 8.8 9.8 3.2' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.2 4.8 8.8 9.8 3.2' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
.ui-check input:indeterminate + .ui-check-box {
  background: var(--check-checked-bg);
  border-color: var(--check-checked-border);
}
.ui-check input:indeterminate + .ui-check-box::after {
  inset: auto;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: var(--check-mark);
  mask: none;
  -webkit-mask: none;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.ui-check:active .ui-check-box {
  transform: scale(0.94);
}
.ui-check-label {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.35;
}
.ui-check--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ui-check--disabled .ui-check-box {
  background: var(--surface-subtle);
}

/* UI radio — skrytý natívny input + vlastný kruh (brandové CSS premenné) */
.ui-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
}
.ui-radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.ui-radio-dot {
  position: relative;
  flex-shrink: 0;
  width: var(--radio-size);
  height: var(--radio-size);
  border: 1.5px solid var(--radio-border);
  border-radius: 50%;
  background: var(--radio-bg);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}
.ui-radio:hover .ui-radio-dot {
  border-color: var(--radio-hover-border);
}
.ui-radio input:focus-visible + .ui-radio-dot {
  box-shadow: 0 0 0 3px var(--radio-focus-ring);
}
.ui-radio input:checked + .ui-radio-dot {
  border-color: var(--radio-checked-border);
}
.ui-radio-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--radio-size) - 8px);
  height: calc(var(--radio-size) - 8px);
  border-radius: 50%;
  background: var(--radio-checked-dot);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.ui-radio input:checked + .ui-radio-dot::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.ui-radio:active .ui-radio-dot {
  transform: scale(0.94);
}
.ui-radio-label {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.35;
}
.ui-radio--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ui-radio--disabled .ui-radio-dot {
  background: var(--surface-subtle);
}

.custom-field-form-grid {
  display: grid; gap: 0.85rem; margin-top: 0.85rem;
}
.custom-field-form-grid:first-child { margin-top: 0; }
.field-switches {
  display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center;
}
.custom-field-options { margin-top: 0.85rem; }
.custom-field-options-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.custom-field-options-head label { margin: 0; font-weight: 600; font-size: 0.88rem; }
.custom-field-option-row + .custom-field-option-row { margin-top: 0.35rem; }
.custom-field-option-row input { width: 100%; }

.profile-fields-table select {
  min-width: 9rem; padding: 0.55rem 0.65rem; font-size: 0.88rem;
}

.form-actions { display: flex; gap: 0.5rem; padding-top: 0.5rem; }
.empty-state { padding: 2rem 0.5rem; text-align: center; color: var(--text-muted); }

.permission-modules {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.permission-module {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
  overflow: hidden;
}
.permission-module-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.permission-module-summary::-webkit-details-marker {
  display: none;
}
.permission-module-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.permission-module-label .ui-icon {
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.permission-module[open] > .permission-module-summary .permission-module-label .ui-icon {
  transform: rotate(180deg);
}
.permission-module[open] > .permission-module-summary {
  border-bottom: 1px solid var(--line);
}
.permission-module-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--orange-bg);
  border: 1px solid color-mix(in srgb, var(--orange) 22%, var(--line));
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
}
.permission-module-children {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem;
  background: var(--panel);
}
.permission-module-nested {
  background: var(--surface-subtle);
}
.permission-module-nested > .permission-module-summary {
  padding: 0.65rem 0.75rem;
}
.permission-module-nested .permission-module-label {
  font-size: 0.84rem;
}
.permission-list { display: grid; gap: 0; }
.permission-item {
  display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--surface-hover); cursor: pointer;
}
.permission-item:first-child { border-top: 0; }
.permission-item .ui-check { margin-top: 0.2rem; flex-shrink: 0; }
.permission-item strong { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.permission-item small { display: block; margin-top: 0.15rem; color: var(--text-muted); font-size: 0.75rem; }
.permission-item:hover { background: var(--panel); }

.actions-cell { white-space: nowrap; text-align: right; }
.device-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem;
}
.device-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-size: 0.85rem;
}
.device-list form { display: inline; }
.btn-link {
  border: 0; background: none; color: var(--orange); font: 600 0.85rem var(--font);
  cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.btn-link:hover { background: var(--orange-bg); }
.btn-link.danger { color: var(--danger-fg); }
.btn-link.danger:hover { background: var(--danger-bg); }
form.inline { display: inline; }
.badge.bad { background: var(--danger-bg); color: var(--danger-fg); }

/* Toasts — navy panel, oranžový nadpis, stav = accent pruh + ikona */
.toast-root {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  z-index: 300;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.65rem;
  width: min(22rem, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
  position: relative; width: 100%; overflow: hidden;
  border-radius: var(--radius); color: var(--toast-text);
  border: 1px solid var(--toast-border);
  border-left: 4px solid var(--toast-accent);
  background: var(--toast-bg);
  box-shadow: var(--toast-shadow);
  opacity: 0; transform: translateX(calc(100% + 1rem));
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  pointer-events: auto;
}
.toast-success { --toast-accent: var(--ok-fg); }
.toast-error { --toast-accent: var(--danger-fg); }
.toast-warn { --toast-accent: var(--warn-fg); }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.leave { opacity: 0; transform: translateX(calc(100% + 1rem)); transition-duration: 0.28s; }
.toast-inner {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem;
  align-items: center; padding: 0.95rem 0.85rem 0.95rem 1rem;
}
.toast-icon {
  width: 2.35rem; height: 2.35rem; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  color: var(--toast-accent); background: transparent;
}
.toast-icon svg { width: 1.35rem; height: 1.35rem; }
.toast-icon .toast-ring,
.toast-icon .toast-mark {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.toast.show .toast-icon .toast-ring {
  stroke-dasharray: 63; stroke-dashoffset: 63;
  animation: toast-draw 0.5s ease forwards 0.05s;
}
.toast.show .toast-icon .toast-mark {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: toast-draw 0.38s ease forwards 0.28s;
}
.toast-body { min-width: 0; }
.toast-title {
  margin: 0 0 0.15rem;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--toast-title);
}
.toast-message {
  margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.4;
  color: var(--toast-text);
}
.toast-close {
  border: 0; background: var(--toast-close-bg); width: 2rem; height: 2rem; border-radius: 8px;
  font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--toast-text-muted);
  transition: background 0.15s ease, color 0.15s ease; flex-shrink: 0;
}
.toast-close:hover { background: var(--toast-close-hover); color: var(--toast-text); }
.toast-progress {
  height: 3px; background: var(--toast-close-bg); overflow: hidden;
}
.toast-progress span {
  display: block; height: 100%; width: 100%; transform-origin: left center;
  background: var(--toast-accent);
  animation: toast-progress var(--toast-duration, 4.2s) linear forwards;
}
.toast-progress.paused span { animation-play-state: paused; }
.toast-rich .toast-body { display: grid; gap: 0.45rem; }
.toast-copy-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--toast-text-muted); font-weight: 600;
}
.toast-copy-row { display: flex; justify-content: flex-start; }
@keyframes toast-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Modals */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed; inset: 0; background: var(--modal-backdrop);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative; width: min(28rem, 100%); background: var(--modal-panel);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--modal-shadow);
  animation: modal-in .2s ease;
  margin: auto 0;
  flex-shrink: 0;
}
.modal-card.modal-sm { width: min(24rem, 100%); }
.modal.modal-anchor-end {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem 1.25rem 1.25rem;
}
.modal.modal-anchor-end .modal-card {
  margin: 0;
}
.modal-card.modal-lg { width: min(36rem, 100%); }
.modal-card.modal-xl { width: min(72rem, calc(100vw - 2rem)); }
.roles-form-modal.modal-card {
  width: min(56rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 1.5rem);
}
.roles-form-modal .modal-stacked-body {
  min-height: min(58vh, 34rem);
}
@media (min-width: 720px) {
  .roles-form-modal .permission-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.75rem;
  }
}
.record-form-modal.modal-card {
  width: min(56rem, calc(100vw - 2rem));
}
.record-form-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .record-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.record-form-grid .field {
  margin: 0;
  min-width: 0;
}
.record-form-grid .field.is-locked input[readonly] {
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}
.record-field-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.modal-card.modal-stacked {
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  padding-bottom: 0;
}
.modal-stacked-form {
  display: flex; flex-direction: column;
  min-height: 0; flex: 1;
}
.modal-stacked-body {
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.modal-stacked .modal-actions {
  flex-shrink: 0;
  margin-top: 0;
  padding: 1rem 0 1.35rem;
  border-top: 1px solid var(--surface-hover);
  background: var(--panel);
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--surface-hover);
}
.modal-head-text {
  min-width: 0;
}
.modal-head-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.modal-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.modal-head-meta .badge {
  font-size: 0.72rem;
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal:not([hidden]):has(.modal-card--alert) {
  align-items: center;
}
.modal-card--alert .modal-head {
  justify-content: center;
  text-align: center;
}
.modal-card--alert .modal-head h2 {
  width: 100%;
  text-align: center;
}
.modal-card--alert [data-confirm-text] {
  text-align: center;
}
.modal-card--alert .modal-actions {
  justify-content: center;
}
.modal-alert-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-border);
  animation: modal-alert-pop .45s cubic-bezier(.34, 1.56, .64, 1);
}
.modal-alert-icon svg {
  animation: modal-alert-pulse 1.35s ease-in-out infinite;
}
@keyframes modal-alert-pop {
  from { transform: scale(0.55); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes modal-alert-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.modal-close {
  border: 0; background: var(--surface-hover); width: 2rem; height: 2rem; border-radius: 8px;
  font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--text-muted);
  transition: background .15s ease;
}
.modal-close:hover { background: var(--line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.55rem; margin-top: 1.1rem; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-subsection {
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--surface-hover);
}
.panel-subsection h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.branding-preview {
  margin: 0 0 1.25rem; padding: 1rem 1.1rem; border-radius: 12px; background: var(--navy);
  max-width: 260px;
}
.branding-preview .brand { color: var(--on-dark); padding: 0.25rem 0.5rem; }
.branding-preview .tag { color: var(--tag-muted); }
.logo-current { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.logo-current img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: var(--white); padding: 0.35rem; }
.smtp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }

.modules-page { display: grid; gap: 1rem; }
.modules-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.modules-title { margin: 0 0 0.35rem; font-size: 1.15rem; }
.modules-intro {
  margin: 0;
  max-width: 42rem;
  font-size: 0.9rem;
  line-height: 1.55;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text-muted); text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--secondary-hover-border); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

@keyframes module-tile-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes module-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes module-update-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn-fg) 0%, transparent); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn-fg) 18%, transparent); }
}

.module-tile {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--navy) 6%, transparent);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
  animation: module-tile-in 0.45s ease both;
}

.module-grid .module-tile:nth-child(1) { animation-delay: 0.03s; }
.module-grid .module-tile:nth-child(2) { animation-delay: 0.06s; }
.module-grid .module-tile:nth-child(3) { animation-delay: 0.09s; }
.module-grid .module-tile:nth-child(4) { animation-delay: 0.12s; }
.module-grid .module-tile:nth-child(n+5) { animation-delay: 0.15s; }

.module-tile:hover {
  border-color: color-mix(in srgb, var(--orange) 28%, var(--line));
  box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--navy) 22%, transparent);
  transform: translateY(-3px);
}

.module-tile-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.module-tile-open:hover { background: color-mix(in srgb, var(--surface-hover) 40%, transparent); }
.module-tile-open:focus { outline: none; }
.module-tile-open:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.module-tile-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem 0.45rem;
  text-align: left;
}

.module-tile-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--orange-bg), var(--surface-hover));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent),
    0 4px 12px -6px color-mix(in srgb, var(--navy) 14%, transparent);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.module-tile:hover .module-tile-icon {
  transform: scale(1.04);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--orange) 24%, var(--line)),
    0 8px 18px -8px color-mix(in srgb, var(--orange) 22%, transparent);
  animation: module-icon-float 2.4s ease-in-out infinite;
}

.module-tile-icon--lg {
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 22px;
}

.module-tile-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.module-tile:hover .module-tile-icon-img {
  transform: scale(1.06);
}

.module-tile-icon-fallback {
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--orange);
}

.module-tile-icon--lg .module-tile-icon-fallback { font-size: 2.25rem; }

.module-tile-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.85rem;
}

.module-tile-head {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.module-tile-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text);
}

.module-tile-title::after {
  content: '';
  display: block;
  width: 1.75rem;
  height: 2px;
  margin-top: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), color-mix(in srgb, var(--orange) 20%, transparent));
  opacity: 0.85;
}

.module-tile-statusline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-tile-status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex-shrink: 1;
}

.module-tile-status-item:first-child {
  flex-shrink: 0;
}

.module-tile-status-sep {
  margin-right: 0.1rem;
  color: color-mix(in srgb, var(--text-muted) 70%, transparent);
}

.module-tile-status-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--text-muted);
}

.module-tile-status-item.is-on .module-tile-status-dot {
  background: var(--ok-fg);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok-fg) 22%, transparent);
}

.module-tile-status-item.is-off .module-tile-status-dot {
  background: var(--text-muted);
}

.module-tile-status-item.is-current .module-tile-status-dot {
  background: var(--ok-fg);
}

.module-tile-status-item.is-update {
  color: var(--warn-fg);
}

.module-tile-status-item.is-update .module-tile-status-dot {
  background: var(--warn-fg);
  animation: module-update-pulse 2.2s ease-in-out infinite;
}

.module-tile-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.module-tile-badge.is-active {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.module-tile-badge.is-muted {
  background: var(--surface-hover);
  color: var(--text-muted);
}

.module-tile-badge.is-current {
  background: color-mix(in srgb, var(--ok-bg) 85%, var(--panel));
  color: var(--ok-fg);
}

.module-tile-badge.is-update {
  background: var(--warn-bg);
  color: var(--warn-fg);
  animation: module-update-pulse 2.2s ease-in-out infinite;
}

.module-tile-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-deps-list {
  display: grid;
  gap: 0.55rem;
}

.module-dep-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-hover) 35%, var(--panel));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.module-dep-card.is-ok {
  border-color: var(--ok-border);
  background: color-mix(in srgb, var(--ok-bg) 55%, var(--panel));
}

.module-dep-card.is-missing {
  border-color: var(--danger-border);
  background: color-mix(in srgb, var(--danger-bg) 55%, var(--panel));
}

.module-dep-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange);
  background: linear-gradient(145deg, var(--orange-bg), var(--surface-hover));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}

.module-dep-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.module-dep-name {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.module-dep-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.module-dep-badge.is-ok {
  color: var(--ok-fg);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
}

.module-dep-badge.is-missing {
  color: var(--danger-fg);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.module-dep-badge-icon {
  display: block;
}

.module-install-blocked {
  margin: 0.65rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 0.84rem;
  line-height: 1.45;
}

.module-tile-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.module-tile-price {
  font-size: 0.95rem;
  font-weight: 700;
}

.module-tile-version {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.module-tile-more {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--orange);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.module-tile:hover .module-tile-more {
  transform: translateX(3px);
}

.module-tile-footer {
  margin-top: auto;
  padding: 0.75rem 1rem 0.95rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-hover) 45%, var(--panel));
}

.module-tile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.module-tile-actions .btn.block {
  width: 100%;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .module-tile,
  .module-tile-icon,
  .module-tile-icon-img,
  .module-tile-more,
  .module-tile-badge.is-update {
    animation: none;
    transition: none;
  }

  .module-tile:hover {
    transform: none;
  }

  .module-tile:hover .module-tile-icon,
  .module-tile:hover .module-tile-icon-img {
    transform: none;
  }
}

.module-detail-body { display: grid; gap: 1rem; }
.module-detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.module-detail-media {
  flex-shrink: 0;
}
.module-detail-meta { flex: 1; min-width: 0; }
.module-detail-text { white-space: pre-wrap; line-height: 1.55; }
.module-detail-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Module product modal */
.module-product-modal {
  width: min(44rem, 100%);
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  animation: module-product-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes module-product-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.module-product-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--text-muted);
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--navy) 10%, transparent);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.module-product-close:hover {
  background: var(--panel);
  color: var(--text);
  transform: scale(1.05);
}

.module-product-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.5rem 1.5rem 1.35rem;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--orange) 16%, transparent), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--orange-bg) 90%, var(--panel)), var(--panel));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
}

.module-product-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, color-mix(in srgb, var(--on-dark) 4%, transparent) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: module-product-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes module-product-shimmer {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

.module-product-icon {
  flex-shrink: 0;
}

.module-tile-icon--xl {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--line) 65%, transparent),
    0 10px 24px -10px color-mix(in srgb, var(--orange) 28%, transparent);
}

.module-tile-icon--xl .module-tile-icon-fallback {
  font-size: 2rem;
}

.module-product-hero-copy {
  flex: 1;
  min-width: 0;
  padding-right: 2rem;
}

.module-product-hero-copy h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.module-product-tagline {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.module-product-body {
  display: grid;
  gap: 1.35rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.module-product-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.module-product-spec {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-hover) 35%, var(--panel));
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.module-product-modal:hover .module-product-spec {
  border-color: color-mix(in srgb, var(--orange) 12%, var(--line));
}

.module-product-spec-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.module-product-spec-value {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.module-product-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.module-product-desc {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 0.94rem;
  color: var(--text);
}

.module-product-actions {
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-hover) 40%, var(--panel));
}

.module-product-actions .btn {
  min-width: 7.5rem;
}

@media (max-width: 640px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-product-hero {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding-top: 2.75rem;
  }

  .module-product-hero-copy {
    padding-right: 0;
  }

  .module-product-specs {
    grid-template-columns: 1fr;
  }

  .module-product-actions {
    flex-direction: column;
  }

  .module-product-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .module-product-modal,
  .module-product-hero::after {
    animation: none;
  }

  .module-product-close:hover {
    transform: none;
  }
}


.impersonation-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem; background: var(--orange-soft); border-bottom: 1px solid var(--orange-ring);
  color: var(--text);
}
.impersonation-banner strong { display: block; margin-bottom: 0.15rem; }
.impersonation-banner .muted { font-size: 0.85rem; }

.app-header-theme { display: inline; margin: 0; padding: 0; border: 0; background: none; }
.app-header-locale {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  isolation: isolate;
}
.app-header-locale-indicator {
  position: absolute;
  top: 0.15rem;
  left: 0;
  z-index: 0;
  height: calc(100% - 0.3rem);
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--orange) 35%, transparent);
  pointer-events: none;
  transform: translateX(0);
  width: 0;
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
    width 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.18s ease;
}
.app-header-locale.is-ready .app-header-locale-indicator {
  opacity: 1;
}
.app-header-locale-form {
  position: relative;
  z-index: 1;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.app-header-locale-btn {
  min-width: 2.15rem;
  height: 1.85rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.22s ease, transform 0.18s ease;
}
.app-header-locale-btn:hover {
  color: var(--text);
}
.app-header-locale-btn.is-active {
  color: var(--on-dark);
}
.app-header-locale-btn.is-active:hover {
  color: var(--on-dark);
}
.app-header-locale.is-switching .app-header-locale-btn {
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .app-header-locale-indicator {
    transition: none;
  }
  .app-header-locale-btn {
    transition: none;
  }
}
.app-header-theme button.app-header-icon {
  margin: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
}
.app-header-theme button.app-header-icon [data-theme-icon] {
  display: contents;
}

[data-theme="dark"] body.guest .form-wrap { background: var(--canvas); }

.import-col-picker th,
.import-col-picker td {
  vertical-align: middle;
}
.import-col-picker thead th.import-col-picker-check,
.import-col-picker tbody td.import-col-picker-check,
.import-col-picker thead th.import-col-picker-unique,
.import-col-picker tbody td.import-col-picker-unique {
  position: relative;
  width: 1px;
  white-space: nowrap;
  padding-left: 1rem;
  padding-right: 1rem;
}
.import-col-picker .ui-check,
.import-col-picker .ui-radio {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.import-col-picker-check .ui-check,
.import-col-picker-unique .ui-radio {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
.import-col-picker-check .ui-check {
  display: inline-flex;
  justify-content: center;
}
.import-col-picker-unique .ui-radio {
  display: inline-flex;
  justify-content: center;
}
.import-col-picker-map {
  min-width: 14rem;
}
.import-col-picker-type {
  min-width: 7.5rem;
}
.import-col-type {
  min-width: 7rem;
}
.import-col-map-field {
  position: relative;
}
.import-col-map-field.is-custom .import-col-target {
  display: none;
}
.import-col-map-field:not(.is-custom) .import-col-custom-wrap {
  display: none;
}
.import-col-custom-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.import-col-custom-input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font: 500 0.8125rem var(--font);
}
.import-col-custom-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-ring);
}
.import-col-custom-input:disabled {
  opacity: 0.55;
}
.import-col-custom-back {
  flex-shrink: 0;
  padding: 0.15rem 0.35rem;
  font-size: 1.1rem;
  line-height: 1;
}
.import-col-target {
  width: 100%;
  max-width: 16rem;
}
.import-col-name-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  word-break: break-word;
}
.import-col-name-btn:hover {
  color: var(--orange-border);
  text-decoration: underline;
}
.import-col-row:not(.is-included-row) .import-col-name-btn {
  color: var(--text-muted);
}
.import-col-picker-name {
  word-break: break-word;
}
.import-col-picker-sample {
  max-width: 18rem;
  word-break: break-word;
}
.import-col-row.is-unique {
  background: color-mix(in srgb, var(--ok-bg) 35%, transparent);
}
.import-preview-details {
  margin-top: 1.25rem;
}
.import-preview-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.65rem;
}
.import-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.import-map-toolbar-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.import-map-actions-dock {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 35;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.25rem);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.28s;
  pointer-events: none;
}
.import-map-actions-dock.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.import-map-actions-dock-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem 0.55rem 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow), 0 14px 36px color-mix(in srgb, var(--navy) 14%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .import-map-actions-dock {
    transition: none;
  }
}
.import-preview-modal .modal-head {
  margin-bottom: 0;
}
.import-preview-modal .modal-stacked-body {
  padding-top: 1rem;
  padding-bottom: 0;
}
.import-preview-modal-table-wrap {
  max-height: min(72vh, 44rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.import-preview-modal-table-wrap .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.import-preview-modal-table-wrap .data-table tbody td {
  white-space: nowrap;
  font-size: 0.85rem;
}
.import-map-table-wrap { max-height: 22rem; overflow: auto; }
.import-map-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  font-size: 0.72rem;
  white-space: nowrap;
}
.import-map-table td,
.import-map-table th {
  transition: background 0.15s ease;
}
.import-map-table .is-included {
  background: color-mix(in srgb, var(--orange-bg) 25%, transparent);
}
.import-map-table .is-unique-col {
  background: color-mix(in srgb, var(--ok-bg) 40%, transparent);
}
.import-progress-track {
  height: 10px;
  margin-bottom: 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--orange-bg);
  border: 1px solid color-mix(in srgb, var(--orange) 18%, var(--line));
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--navy) 4%, transparent);
  position: relative;
}
.import-progress-track.is-active {
  background: linear-gradient(
    90deg,
    var(--orange-bg) 0%,
    color-mix(in srgb, var(--orange) 22%, var(--orange-bg)) 50%,
    var(--orange-bg) 100%
  );
  background-size: 220% 100%;
  animation: import-progress-track-flow 2.2s ease-in-out infinite;
}
.import-progress-track.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--orange) 18%, transparent) 45%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: import-progress-track-shimmer 1.6s ease-in-out infinite;
}
.import-progress-bar {
  position: relative;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-hover) 100%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--orange) 40%, transparent);
  transition: width 0.35s ease;
  min-width: 0;
}
.import-progress-bar.is-active {
  min-width: 2.5%;
}
.import-progress-bar.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.42) 48%,
    transparent 100%
  );
  transform: translateX(-120%);
  animation: import-progress-bar-shine 1.35s ease-in-out infinite;
}
@keyframes import-progress-track-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes import-progress-track-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes import-progress-bar-shine {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}
#import-progress-panel.is-finished .import-progress-track,
.import-progress-panel.is-finished .import-progress-track {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 22%, var(--line));
  animation: none;
}
#import-progress-panel.is-finished .import-progress-track::after,
.import-progress-panel.is-finished .import-progress-track::after {
  display: none;
}
#import-progress-panel.is-finished .import-progress-bar,
.import-progress-panel.is-finished .import-progress-bar {
  background: linear-gradient(90deg, var(--ok) 0%, color-mix(in srgb, var(--ok) 80%, #0f766e) 100%);
  box-shadow: 0 0 10px var(--ok-soft);
  min-width: 0;
}
#import-progress-panel.is-finished .import-progress-bar::after,
.import-progress-panel.is-finished .import-progress-bar::after {
  display: none;
}

/* -----------------------------------------------------------------------------
   SETTINGS LIST (sl-*) — inšpirované Linear / Notion property list
   Karty riadkov s avatarom, hover akcie, dashed „pridať“ zóna
   ----------------------------------------------------------------------------- */
.sl-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--navy) 4%, transparent),
    0 8px 28px color-mix(in srgb, var(--navy) 6%, transparent);
  overflow: hidden;
  margin-bottom: 1rem;
}
.sl-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-subtle) 0%, var(--panel) 100%);
}
.sl-sheet-intro {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}
.sl-sheet-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid color-mix(in srgb, var(--orange) 20%, var(--line));
  flex-shrink: 0;
}
.sl-sheet-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.sl-sheet-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.sl-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  min-width: 1.75rem;
  text-align: center;
}
.sl-items {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.5rem;
}
.sl-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  transition: background 0.18s ease, transform 0.18s ease;
}
.sl-item:hover {
  background: var(--surface-subtle);
}
.sl-avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.sl-avatar--0 { background: #fff4e6; color: #c2410c; }
.sl-avatar--1 { background: #eff6ff; color: #1d4ed8; }
.sl-avatar--2 { background: #ecfdf5; color: #047857; }
.sl-avatar--3 { background: #faf5ff; color: #7e22ce; }
.sl-avatar--4 { background: #fef2f2; color: #b91c1c; }
.sl-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.sl-item-body--static {
  padding: 0.15rem 0;
}
.sl-item-name {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 600 0.875rem var(--font);
  letter-spacing: -0.01em;
}
.sl-item-name:focus {
  outline: none;
}
.sl-item-name-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sl-item-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.sl-item-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.sl-item:hover .sl-item-actions,
.sl-item:focus-within .sl-item-actions {
  opacity: 1;
  transform: translateX(0);
}
.sl-icon-btn {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sl-icon-btn:hover {
  background: var(--panel);
  border-color: var(--line);
  color: var(--orange);
}
.sl-icon-btn--danger:hover {
  color: var(--danger-fg);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}
.sl-empty {
  padding: 2rem 1.15rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.sl-empty p { margin: 0; }
.sl-add {
  margin: 0.35rem 0.65rem 0.75rem;
  border: 1.5px dashed color-mix(in srgb, var(--orange) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--orange-bg) 40%, transparent);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.sl-add:focus-within {
  border-color: var(--orange);
  background: var(--orange-bg);
  box-shadow: 0 0 0 3px var(--orange-ring);
}
.sl-add-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
}
.sl-add-icon {
  display: grid;
  place-items: center;
  color: var(--orange);
  flex-shrink: 0;
}
.sl-add-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: 500 0.875rem var(--font);
  color: var(--text);
}
.sl-add-input:focus { outline: none; }
.sl-add-input::placeholder { color: var(--text-muted); }
.sl-add-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: var(--on-dark);
  font: 600 0.75rem var(--font);
  cursor: pointer;
  transition: background 0.15s ease;
}
.sl-add-btn:hover { background: var(--orange-hover); }
.sl-form-error {
  margin: 0;
  padding: 0.45rem 1rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--danger-fg);
}
@media (hover: none) {
  .sl-item-actions {
    opacity: 1;
    transform: none;
  }
}
[data-theme="dark"] .sl-avatar--0 { background: color-mix(in srgb, #c2410c 18%, var(--panel)); color: #fdba74; }
[data-theme="dark"] .sl-avatar--1 { background: color-mix(in srgb, #1d4ed8 18%, var(--panel)); color: #93c5fd; }
[data-theme="dark"] .sl-avatar--2 { background: color-mix(in srgb, #047857 18%, var(--panel)); color: #6ee7b7; }
[data-theme="dark"] .sl-avatar--3 { background: color-mix(in srgb, #7e22ce 18%, var(--panel)); color: #d8b4fe; }
[data-theme="dark"] .sl-avatar--4 { background: color-mix(in srgb, #b91c1c 18%, var(--panel)); color: #fca5a5; }

/* Fields table — kompaktná tabuľka s inline úpravou */
.fields-panel .profile-fields-head,
.profile-links-panel .profile-fields-head {
  margin-bottom: 0;
  padding: 0.85rem 1rem 0.65rem;
}
.profile-links-table {
  font-size: 0.875rem;
}
.profile-links-table.data-table thead th,
.profile-links-table.data-table tbody td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}
.fields-bulk-slot {
  flex: 1;
  min-width: 0;
}
.fields-table {
  font-size: 0.875rem;
}
.fields-table.data-table thead th,
.fields-table.data-table tbody td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}
.fields-check-col {
  width: 1px;
  white-space: nowrap;
  text-align: center;
}
.fields-drag-col {
  width: 2rem;
  min-width: 2rem;
  white-space: nowrap;
  text-align: center;
  padding-left: 0.65rem;
  padding-right: 0.2rem;
}
.fields-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.fields-drag-handle .ui-icon {
  width: 18px;
  height: 18px;
}
.fields-drag-handle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.fields-drag-handle:hover {
  background: var(--orange-bg);
  color: var(--orange);
}
.fields-drag-handle:active,
.fields-table tr.is-dragging .fields-drag-handle {
  cursor: grabbing;
  background: var(--orange-bg);
  color: var(--orange);
}
.fields-table.is-reordering tbody tr {
  transition: opacity 0.15s ease;
}
.fields-table.is-reordering tbody tr:not(.is-dragging) {
  opacity: 0.62;
}
.fields-table tr.is-dragging {
  opacity: 1;
  position: relative;
  z-index: 3;
  box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--navy) 32%, transparent);
  transform: scale(1.01);
  outline: 2px solid color-mix(in srgb, var(--orange) 55%, transparent);
  outline-offset: -1px;
}
.fields-table tr.is-dragging td {
  background: var(--panel);
}
.fields-table tr.is-drop-before td {
  box-shadow: inset 0 3px 0 var(--orange);
}
.fields-table tr.is-drop-after td {
  box-shadow: inset 0 -3px 0 var(--orange);
}
.fields-check-col .ui-check {
  justify-content: center;
}
.fields-actions-col {
  width: 1px;
  text-align: right;
  white-space: nowrap;
}
.fields-delete-btn {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.fields-table tbody tr:hover .fields-delete-btn,
.fields-table tbody tr:focus-within .fields-delete-btn {
  opacity: 1;
}
.field-label-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.field-unique-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ok-fg);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  white-space: nowrap;
}
.modal-stacked-body .setting-row {
  padding-left: 0;
  padding-right: 0;
}
.modal-stacked-body .setting-row:first-of-type {
  margin-top: 0.15rem;
}
.modal-stacked-body .field:last-child {
  margin-bottom: 0;
}
.profile-link-edit-context {
  margin: 0 0 0.85rem;
}
.modal-stacked-body .ui-check {
  margin: 0;
}
.field-check-center {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}
@media (hover: none) {
  .fields-delete-btn { opacity: 1; }
}
.field-label-input {
  width: 100%;
  min-width: 10rem;
  max-width: 28rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text);
  font: 500 0.875rem var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field-label-input:hover {
  border-color: color-mix(in srgb, var(--orange) 30%, var(--line));
  background: var(--panel);
}
.field-label-input:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--orange-ring);
}
.field-label-input.is-saving {
  opacity: 0.65;
}
.field-label-input.is-saved {
  border-color: color-mix(in srgb, #16a34a 45%, var(--line));
  background: color-mix(in srgb, #16a34a 6%, var(--panel));
}
.field-label-input.is-error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

/* Legacy compact UI — prefer sl-* for new screens */
.c-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}
.c-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.c-toolbar-hint {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.c-toolbar-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
}
.c-toolbar-form .c-input {
  width: min(15rem, 46vw);
}
.c-input {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font: 400 0.8125rem var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.c-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-ring);
}
.c-input--ghost {
  border-color: transparent;
  background: transparent;
}
.c-input--ghost:hover {
  border-color: var(--line);
  background: var(--input-bg);
}
.c-input--ghost:focus {
  border-color: var(--orange);
  background: var(--input-bg);
  box-shadow: 0 0 0 3px var(--orange-ring);
}
.c-table-wrap {
  overflow-x: auto;
}
.c-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.c-table thead th {
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.c-table tbody td {
  padding: 0.375rem 1rem;
  border-bottom: 1px solid var(--surface-hover);
  vertical-align: middle;
}
.c-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-subtle) 80%, var(--panel));
}
.c-table tbody tr:last-child td {
  border-bottom: 0;
}
.c-col-key {
  width: 9rem;
  white-space: nowrap;
}
.c-col-actions {
  width: 5rem;
  text-align: right;
}
.c-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.c-inline .c-input--ghost {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 18rem;
}
.c-save {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: 600 0.75rem var(--font);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.c-inline:focus-within .c-save,
.c-inline:hover .c-save,
.c-save:focus {
  opacity: 1;
  color: var(--orange);
}
.c-code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
}
.c-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.c-form-error {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--danger-fg);
  background: var(--danger-bg);
  border-top: 1px solid var(--danger-border);
}

[data-theme="dark"] {
  --text: #e8eef5;
  --text-muted: #94a3b8;
  --slate: #94a3b8;
  --canvas: #0b1220;
  --panel: #131c2e;
  --header-bg: var(--panel);
  --sidebar-bg: #070d14;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #64748b;
  --input-bg: #0b1220;
  --surface-subtle: #0f172a;
  --surface-hover: #1a2538;
  --line: #243044;
  --shadow: 0 8px 24px color-mix(in srgb, var(--navy) 40%, transparent);
  --modal-panel: #182236;
  --modal-backdrop: color-mix(in srgb, var(--navy) 72%, transparent);
  --secondary-hover-bg: var(--surface-hover);
  --secondary-hover-border: var(--line);

  --ok-fg: var(--ok-on-dark);
  --ok-bg: var(--ok-soft);
  --danger-fg: #fca8a8;
  --danger-bg: color-mix(in srgb, #7f1d1d 32%, var(--panel));
  --danger-border: color-mix(in srgb, #b91c1c 42%, var(--line));
  --danger-soft: color-mix(in srgb, #b91c1c 14%, transparent);
  --danger-on-dark: #fca8a8;
  --warn-fg: var(--warn-on-dark);
  --warn-bg: var(--warn-soft);
  --orange-bg: color-mix(in srgb, var(--orange) 10%, var(--panel));
  --orange-soft: color-mix(in srgb, var(--orange) 10%, transparent);
  --orange-soft-strong: color-mix(in srgb, var(--orange) 18%, transparent);

  --toast-bg: var(--panel);
  --toast-text: var(--text);
  --toast-text-muted: var(--text-muted);
  --toast-border: var(--line);
  --toast-shadow: var(--shadow);
  --toast-close-bg: var(--surface-hover);
  --toast-close-hover: var(--line);

  --check-bg: var(--input-bg);
  --check-border: color-mix(in srgb, var(--text-muted) 35%, var(--line));
  --check-hover-border: color-mix(in srgb, var(--orange) 50%, var(--line));

  --radio-bg: var(--input-bg);
  --radio-border: color-mix(in srgb, var(--text-muted) 35%, var(--line));
  --radio-hover-border: color-mix(in srgb, var(--orange) 50%, var(--line));
}
[data-theme="dark"] .panel { border-color: var(--line); }
[data-theme="dark"] .modal-card {
  background: var(--modal-panel);
  border: 1px solid color-mix(in srgb, var(--text-muted) 28%, transparent);
  box-shadow:
    0 24px 80px color-mix(in srgb, var(--navy) 65%, transparent),
    0 0 0 1px color-mix(in srgb, var(--on-dark) 4%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--on-dark) 4%, transparent);
}
[data-theme="dark"] .modal-stacked .modal-actions {
  border-top-color: color-mix(in srgb, var(--text-muted) 20%, transparent);
  background: var(--modal-panel);
}
[data-theme="dark"] .modal-head { border-bottom-color: color-mix(in srgb, var(--text-muted) 20%, transparent); }
[data-theme="dark"] .module-product-hero {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--orange) 12%, transparent), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--orange) 8%, var(--modal-panel)), var(--modal-panel));
}
[data-theme="dark"] .module-product-close {
  background: color-mix(in srgb, var(--modal-panel) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-muted) 18%, transparent);
}
[data-theme="dark"] .module-product-desc {
  background: color-mix(in srgb, var(--surface-hover) 35%, var(--modal-panel));
}
[data-theme="dark"] .module-product-actions {
  background: color-mix(in srgb, var(--surface-hover) 28%, var(--modal-panel));
  border-top-color: color-mix(in srgb, var(--text-muted) 20%, transparent);
}
[data-theme="dark"] .btn.secondary:hover { background: var(--surface-hover); border-color: var(--line); }
[data-theme="dark"] .btn.danger {
  background: color-mix(in srgb, #7f1d1d 28%, var(--panel));
  color: #fecaca;
  border-color: color-mix(in srgb, #b91c1c 48%, var(--line));
}
[data-theme="dark"] .btn.danger:hover {
  background: color-mix(in srgb, #7f1d1d 42%, var(--panel));
  border-color: color-mix(in srgb, #ef4444 55%, var(--line));
  color: #fff;
}
[data-theme="dark"] .btn.danger .ui-icon { color: currentColor; }
[data-theme="dark"] .btn-link:hover { background: var(--orange-soft); }
[data-theme="dark"] .btn-link.danger:hover { background: var(--danger-soft); }
[data-theme="dark"] .field-kind-custom { background: var(--orange-soft-strong); color: var(--orange-border); }
[data-theme="dark"] .field-kind-system { background: var(--surface-hover); color: var(--text-muted); }
[data-theme="dark"] .profile-field-row--custom { background: color-mix(in srgb, var(--orange) 7%, var(--panel)); }
[data-theme="dark"] .profile-field-row--custom:hover { background: color-mix(in srgb, var(--orange) 12%, var(--panel)); }
[data-theme="dark"] .notification-item.unread { background: var(--orange-soft); }
[data-theme="dark"] .logo-current img { background: var(--panel); }
[data-theme="dark"] body.guest { background: var(--canvas); }

.menu-visibility-summary {
  margin: 0 0 0.85rem;
}
.menu-visibility-modes {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.menu-visibility-legend {
  padding: 0;
  margin: 0 0 0.65rem;
  font-weight: 600;
}
.menu-visibility-restricted {
  display: grid;
  gap: 0.65rem;
}
.menu-visibility-restricted .permission-module {
  margin: 0;
}

.menu-target-section {
  margin: 0.25rem 0 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  background: var(--surface-subtle);
}

.menu-target-fields {
  margin-bottom: 0;
}

.menu-target-fields .field:last-child {
  margin-bottom: 0;
}

.menu-target-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  background: var(--panel);
}

.menu-target-path-item {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.menu-target-path-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.menu-target-path-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.menu-target-path-sep {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.7;
}

.menu-list-scope {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.menu-target-section .menu-list-scope {
  margin-top: 1rem;
}

.menu-list-scope-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.menu-list-scope-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.menu-list-scope-lead {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.menu-list-scope-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.menu-scope-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.menu-scope-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 100%;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.menu-scope-mode-card:hover {
  border-color: var(--border-strong, var(--line));
  background: var(--surface-3, var(--panel));
}

.menu-scope-mode-card.is-selected,
.menu-scope-mode-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.menu-scope-mode-card .ui-radio {
  margin: 0.15rem 0 0;
  flex-shrink: 0;
}

.menu-scope-mode-card-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.menu-scope-mode-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.menu-scope-mode-card.is-selected .menu-scope-mode-card-icon,
.menu-scope-mode-card:has(input:checked) .menu-scope-mode-card-icon {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
}

.menu-scope-mode-card-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.menu-scope-mode-card-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.menu-list-scope-panel {
  margin-top: 0.85rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  background: var(--panel);
}

.menu-list-scope-panel-lead {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.menu-list-scope-panel-example {
  margin: -0.35rem 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm, 8px);
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.menu-list-scope-match-grid {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
}

.menu-list-scope-match-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  margin-top: 1.65rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.menu-list-scope-panel .field:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .menu-scope-mode-grid {
    grid-template-columns: 1fr;
  }

  .menu-list-scope-head {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-list-scope-status {
    align-self: flex-start;
  }

  .menu-list-scope-match-grid {
    grid-template-columns: 1fr;
  }

  .menu-list-scope-match-arrow {
    margin-top: 0;
    min-height: auto;
    transform: rotate(90deg);
  }
}

[data-theme="dark"] body.guest .form-wrap { background: var(--canvas); }
