html {
  font-size: clamp(14px, calc(13px + 0.18vw), 16px);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

body.idle-sensitive-locking main {
  visibility: hidden;
}

.comune-crest-navbar {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.fastwaylive-logo-navbar {
  width: 11.5rem;
  height: 2rem;
  object-fit: contain;
}

.home-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.comune-crest-home {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
}

.auth-landing {
  display: flex;
  justify-content: center;
  padding: 4rem 1rem;
}

.auth-landing-card {
  width: min(100%, 28rem);
}

.auth-landing-logo {
  width: min(100%, 16rem);
  height: auto;
}

.app-navbar {
  margin-bottom: 0;
  padding-bottom: 0;
}

.app-navbar .container-fluid,
.app-navbar .navbar-collapse {
  min-width: 0;
}

.app-navbar .navbar-brand {
  flex: 0 1 auto;
  min-width: 0;
  margin-right: clamp(0.35rem, 0.6vw, 1rem);
}

.app-navbar .fastwaylive-logo-navbar {
  width: clamp(7.5rem, 8vw, 11.5rem);
}

.navbar-nav .nav-item {
  margin-right: 0.15rem;
  display: flex;
  align-items: flex-end;
}

.navbar-nav .nav-link {
  margin: 0 0 -1px 0;
  padding: 0.45rem clamp(0.28rem, calc(-0.2rem + 0.55vw), 0.9rem);
  border: 1px solid #b8c7d9;
  border-bottom: 0;
  border-radius: 0.45rem 0.45rem 0 0;
  background: #eef3f9;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.85);
  font-size: var(--app-navbar-font-size, clamp(0.68rem, calc(0.18rem + 0.55vw), 1rem));
  line-height: 1.25;
  white-space: nowrap;
}

.app-navbar .account-nav-link {
  font-size: var(--app-navbar-font-size, clamp(0.65rem, calc(0.14rem + 0.52vw), 0.95rem));
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  border-color: #6ea8fe;
  background: #fff;
  color: #0d6efd !important;
}

.navbar-nav .nav-link.active {
  position: relative;
  z-index: 1;
  border-color: #0d6efd;
  border-bottom-color: #fff;
  background: #fff;
  color: #0d6efd !important;
  box-shadow: inset 0 3px 0 #0d6efd;
  font-weight: 600;
}

.night-mode-nav-item {
  align-items: center !important;
  margin: 0 0.35rem 0 0.2rem !important;
}

.night-mode-button {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--theme-border, #b8c7d9);
  border-radius: 50%;
  color: var(--theme-primary, #0d6efd);
  background: var(--theme-surface-alt, #eef3f9);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.night-mode-button:hover,
.night-mode-button:focus-visible {
  border-color: var(--theme-primary, #0d6efd);
  background: var(--theme-surface, #fff);
  transform: translateY(-1px);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb, 13, 110, 253), 0.2);
}

@media (min-width: 1400px) {
  .app-navbar .navbar-collapse {
    align-self: stretch;
    align-items: flex-end;
  }

  .app-navbar .night-mode-nav-item {
    align-items: flex-end !important;
  }

  .app-navbar .night-mode-button {
    height: 2.5rem;
    margin-bottom: -1px;
    border-bottom: 0;
    border-radius: 0.7rem 0.7rem 0 0;
  }
}

@media (max-width: 1399.98px) {
  .app-navbar .navbar-collapse {
    padding: 0.75rem 0 1rem;
  }

  .app-navbar .navbar-nav {
    width: 100%;
    gap: 0.4rem;
  }

  .app-navbar .navbar-nav + .navbar-nav {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--theme-border, #d7dee8);
  }

  .app-navbar .navbar-nav .nav-item,
  .app-navbar .navbar-nav .nav-item form {
    width: 100%;
    margin: 0 !important;
    align-items: stretch;
  }

  .app-navbar .navbar-nav .nav-link {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    margin: 0;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--theme-border, #b8c7d9);
    border-radius: 0.5rem;
    overflow-wrap: anywhere;
    font-size: 1rem;
    white-space: normal;
  }

  .app-navbar .navbar-nav .nav-link.active {
    border-bottom-color: var(--theme-primary, #0d6efd);
    box-shadow: inset 0.25rem 0 var(--theme-accent, #0d6efd);
  }

  .app-navbar .night-mode-button {
    width: 100%;
    height: 2.75rem;
    border-radius: 0.5rem;
  }
}

.legacy-section {
  display: flex;
  border: 1px solid #b8c7d9;
  background: #fff;
}

.legacy-section-title {
  width: 2.5rem;
  padding: 1rem 0.45rem;
  color: #fff;
  background: #9fb8d4;
  font-weight: 600;
  letter-spacing: 0.05rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
}

.legacy-section-body {
  flex: 1;
  min-width: 0;
  padding: 1.25rem;
}

.legacy-required {
  background-color: #fffde1;
}

body .form-select.contestation-reason-select:disabled {
  border-color: #adb5bd;
  color: #6c757d;
  background-color: #dee2e6;
  opacity: 1;
  cursor: not-allowed;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #dee2e6;
}

.photo-review-image {
  display: block;
  width: 100%;
  height: min(70vh, 760px);
  object-fit: contain;
}

.photo-decision {
  padding: 1rem;
  border: 1px solid #ced4da;
  background: #f8f9fa;
}

.verbale-photo-thumb {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  background: #f8f9fa;
  text-align: center;
}

.verbale-photo-thumb img {
  display: block;
  width: 100%;
  height: 12rem;
  object-fit: contain;
  margin-bottom: 0.5rem;
  background: #111827;
}

.verbale-photo-thumb span {
  color: #0d6efd;
  font-weight: 600;
}

.verbale-photo-fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 4.5rem);
}

.verbale-photo-fullscreen img {
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
}

.verbale-photo-pdf-preview {
  display: flex;
  width: 100%;
  height: calc(100vh - 6rem);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.verbale-photo-pdf-preview img {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  object-fit: contain;
}

.verbale-photo-pdf-preview .btn {
  flex: 0 0 auto;
}

.verbale-events-list {
  max-height: 11rem;
  overflow-y: auto;
  border: 1px solid #dee2e6;
}

.text-pre-wrap {
  white-space: pre-wrap;
}

.verbale-events-list thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f9fa;
}

.permissions-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

.permissions-table {
  min-width: 1100px;
  margin-bottom: 0;
}

.permissions-table th,
.permissions-table td {
  white-space: nowrap;
}

.permissions-collapse-toggle {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.permissions-collapse-toggle:hover,
.permissions-collapse-toggle:focus {
  color: inherit;
  text-decoration: underline;
}

.permissions-collapse-toggle[aria-expanded="false"] .permissions-collapse-icon {
  display: inline-block;
  transform: rotate(-90deg);
}

.permissions-collapse-icon {
  display: inline-block;
  width: 1rem;
  transition: transform 0.15s ease-in-out;
}

.user-config-link {
  color: #0d6efd;
  text-decoration: none;
}

.user-config-link:hover,
.user-config-link:focus {
  color: #0a58ca;
  text-decoration: underline;
}

.config-comune-tabs {
  row-gap: 0.15rem;
}

.config-comune-tabs .nav-link {
  padding: 0.4rem 0.85rem;
  border-color: #c8d3df #c8d3df #dee2e6;
  border-radius: 0.35rem 0.35rem 0 0;
  background: #f4f6f8;
  color: #111827;
}

.config-comune-tabs .nav-link.active {
  border-bottom-color: #fff;
  background: #fff;
  font-weight: 600;
}

.config-comune-tab-content {
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-top: 0;
  background: #fff;
}

.config-field-card {
  border-color: #d7dee8;
}

@media (max-width: 767.98px) {
  .legacy-section {
    display: block;
  }

  .legacy-section-title {
    width: auto;
    padding: 0.5rem 1rem;
    writing-mode: horizontal-tb;
    transform: none;
    text-align: left;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Temi globali FastWayLive */
.general-settings-form {
  display: grid;
  gap: 1.25rem;
}

.settings-section {
  padding: 1rem;
  border: 1px solid var(--theme-border, #d7dee8);
  border-radius: 0.5rem;
  background: var(--theme-surface-alt, #f7f9fb);
}

.settings-section-title {
  margin: 0 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--theme-border, #d7dee8);
  font-size: 1rem;
  font-weight: 700;
  color: var(--theme-text, #172b3f);
}

.settings-actions {
  display: grid;
  grid-template-columns: minmax(12rem, 24rem) 1fr;
  gap: 1rem;
  align-items: center;
}

.settings-actions .btn {
  width: 100%;
}

body[data-theme="civic-blue"] {
  --theme-page: #f3f7fb;
  --theme-surface: #ffffff;
  --theme-surface-alt: #eaf1f8;
  --theme-text: #172b3f;
  --theme-muted: #62758a;
  --theme-border: #b8c9da;
  --theme-primary: #1f5f99;
  --theme-primary-hover: #174a78;
  --theme-primary-rgb: 31, 95, 153;
  --theme-accent: #c62828;
  --theme-shadow: 0 0.25rem 0.85rem rgba(28, 69, 105, 0.1);
}

body[data-theme="road-safety"] {
  --theme-page: #f5f3ef;
  --theme-surface: #fffdf9;
  --theme-surface-alt: #e9e6df;
  --theme-text: #242424;
  --theme-muted: #68625b;
  --theme-border: #bdb7ae;
  --theme-primary: #b42318;
  --theme-primary-hover: #891b13;
  --theme-primary-rgb: 180, 35, 24;
  --theme-accent: #2d3338;
  --theme-shadow: 0 0.25rem 0.85rem rgba(43, 39, 35, 0.12);
}

body[data-theme="operations-center"] {
  --theme-page: #f1f7f4;
  --theme-surface: #ffffff;
  --theme-surface-alt: #e3f0eb;
  --theme-text: #18352d;
  --theme-muted: #5d756c;
  --theme-border: #a9c8bc;
  --theme-primary: #19705b;
  --theme-primary-hover: #125442;
  --theme-primary-rgb: 25, 112, 91;
  --theme-accent: #d88922;
  --theme-shadow: 0 0.25rem 0.85rem rgba(25, 112, 91, 0.12);
}

body[data-theme="high-visibility"] {
  --theme-page: #f1f2e9;
  --theme-surface: #ffffff;
  --theme-surface-alt: #fff4a8;
  --theme-text: #172027;
  --theme-muted: #4d5961;
  --theme-border: #263238;
  --theme-primary: #263238;
  --theme-primary-hover: #11181c;
  --theme-primary-rgb: 38, 50, 56;
  --theme-accent: #f4cf20;
  --theme-shadow: 0.25rem 0.25rem 0 #f4cf20;
}

body[data-night-mode="true"] {
  --theme-page: #071018;
  --theme-surface: #101d27;
  --theme-surface-alt: #182a37;
  --theme-text: #edf5f9;
  --theme-muted: #a9bbc7;
  --theme-border: #3b5363;
  --theme-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

body[data-theme="civic-blue"][data-night-mode="true"] {
  --theme-primary: #6bb8f3;
  --theme-primary-hover: #9bd2fb;
  --theme-primary-rgb: 107, 184, 243;
  --theme-accent: #ff6d6d;
}

body[data-theme="road-safety"][data-night-mode="true"] {
  --theme-primary: #ed665b;
  --theme-primary-hover: #ff9189;
  --theme-primary-rgb: 237, 102, 91;
}

body[data-theme="operations-center"][data-night-mode="true"] {
  --theme-primary: #60d4b3;
  --theme-primary-hover: #8be6cd;
  --theme-primary-rgb: 96, 212, 179;
  --theme-accent: #ffb454;
}

body[data-theme="high-visibility"][data-night-mode="true"] {
  --theme-primary: #f4cf20;
  --theme-primary-hover: #ffe56e;
  --theme-primary-rgb: 244, 207, 32;
}

body[data-theme] {
  --bs-body-bg: var(--theme-page);
  --bs-body-color: var(--theme-text);
  --bs-primary: var(--theme-primary);
  --bs-primary-rgb: var(--theme-primary-rgb);
  min-height: 100vh;
  color: var(--theme-text);
  background-color: var(--theme-page);
}

body[data-theme] a {
  color: var(--theme-primary);
}

body[data-theme] a:hover {
  color: var(--theme-primary-hover);
}

body[data-theme] .app-navbar {
  border-color: var(--theme-border) !important;
  background: var(--theme-surface) !important;
  box-shadow: var(--theme-shadow);
}

body[data-theme] .navbar-nav .nav-link {
  border-color: var(--theme-border);
  color: var(--theme-text) !important;
  background: var(--theme-surface-alt);
  box-shadow: none;
}

body[data-theme] .navbar-nav .nav-link:hover,
body[data-theme] .navbar-nav .nav-link:focus {
  border-color: var(--theme-primary);
  color: var(--theme-primary) !important;
  background: var(--theme-surface);
}

body[data-theme] .navbar-nav .nav-link.active {
  border-color: var(--theme-primary);
  border-bottom-color: var(--theme-surface);
  color: var(--theme-primary) !important;
  background: var(--theme-surface);
  box-shadow: inset 0 3px 0 var(--theme-accent);
}

body[data-theme] .navbar-toggler {
  border-color: var(--theme-border);
  background-color: #fff;
}

body[data-theme] .card,
body[data-theme] .modal-content,
body[data-theme] .dropdown-menu,
body[data-theme] .legacy-section,
body[data-theme] .config-comune-tab-content {
  border-color: var(--theme-border);
  color: var(--theme-text);
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
}

body[data-theme] .card-header,
body[data-theme] .modal-header,
body[data-theme] .modal-footer {
  border-color: var(--theme-border);
  color: var(--theme-text);
  background: var(--theme-surface-alt);
}

body[data-theme] .card-header {
  border-left: 0.25rem solid var(--theme-accent);
}

body[data-theme] .text-muted,
body[data-theme] .form-text {
  color: var(--theme-muted) !important;
}

body[data-theme] .form-control,
body[data-theme] .form-select,
body[data-theme] .input-group-text {
  border-color: var(--theme-border);
  color: var(--theme-text);
  background-color: var(--theme-surface);
}

body[data-theme] .form-control:focus,
body[data-theme] .form-select:focus,
body[data-theme] .form-check-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.22);
}

body[data-theme] .form-check-input:checked {
  border-color: var(--theme-primary);
  background-color: var(--theme-primary);
}

body[data-theme] .night-mode-toggle {
  min-height: 4.4rem;
  padding: 0.75rem 0.75rem 0.75rem 3.25rem;
  border: 1px solid var(--theme-border);
  border-radius: 0.4rem;
  background: var(--theme-surface-alt);
}

body[data-theme] .night-mode-toggle .form-check-input {
  margin-left: -2.5rem;
}

body[data-theme] .btn-primary {
  border-color: var(--theme-primary);
  color: #fff;
  background-color: var(--theme-primary);
}

body[data-night-mode="true"] .btn-primary,
body[data-night-mode="true"] .btn-outline-primary:hover,
body[data-night-mode="true"] .btn-outline-primary:focus {
  color: #071018;
}

body[data-theme="road-safety"][data-night-mode="true"] .btn-primary {
  color: #fff;
}

body[data-theme] .btn-primary:hover,
body[data-theme] .btn-primary:focus {
  border-color: var(--theme-primary-hover);
  background-color: var(--theme-primary-hover);
}

body[data-theme] .btn-outline-primary {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

body[data-theme] .btn-outline-primary:hover,
body[data-theme] .btn-outline-primary:focus {
  border-color: var(--theme-primary);
  color: var(--theme-surface);
  background-color: var(--theme-primary);
}

body[data-theme] .btn-secondary,
body[data-theme] .btn-outline-secondary:hover {
  border-color: var(--theme-muted);
  color: var(--theme-surface);
  background-color: var(--theme-muted);
}

body[data-theme] .btn-outline-secondary {
  border-color: var(--theme-muted);
  color: var(--theme-muted);
}

body[data-theme] .table {
  --bs-table-color: var(--theme-text);
  --bs-table-bg: var(--theme-surface);
  --bs-table-border-color: var(--theme-border);
  --bs-table-striped-color: var(--theme-text);
  --bs-table-striped-bg: var(--theme-surface-alt);
  color: var(--theme-text);
}

body[data-theme] .table thead th,
body[data-theme] .verbale-events-list thead th {
  color: var(--theme-text);
  background: var(--theme-surface-alt);
}

body[data-night-mode="true"] .list-group-item,
body[data-night-mode="true"] .text-bg-light {
  border-color: var(--theme-border);
  color: var(--theme-text) !important;
  background: var(--theme-surface-alt) !important;
}

body[data-theme] .footer {
  border-color: var(--theme-border) !important;
  color: var(--theme-muted) !important;
  background: var(--theme-surface);
}

body[data-theme] .legacy-section-title {
  background: var(--theme-primary);
}

body[data-theme] .sticky-actions,
body[data-theme] .photo-decision,
body[data-theme] .verbale-photo-thumb,
body[data-theme] .config-comune-tabs .nav-link {
  border-color: var(--theme-border);
  color: var(--theme-text);
  background: var(--theme-surface-alt);
}

body[data-theme] .config-comune-tabs .nav-link.active {
  border-bottom-color: var(--theme-surface);
  color: var(--theme-primary);
  background: var(--theme-surface);
}

body[data-theme="road-safety"] .app-navbar {
  border-top: 0.3rem solid var(--theme-primary) !important;
}

body[data-theme="road-safety"] .card,
body[data-theme="road-safety"] .form-control,
body[data-theme="road-safety"] .form-select {
  border-radius: 0.15rem;
}

body[data-theme="road-safety"] .btn:not(.nav-link) {
  border-radius: 0.7rem;
}

body[data-theme="road-safety"] .app-navbar .nav-link {
  border-radius: 0.7rem 0.7rem 0 0;
}

@media (max-width: 1399.98px) {
  body[data-theme="road-safety"] .app-navbar .nav-link,
  body[data-theme="road-safety"] .app-navbar .night-mode-button {
    border-radius: 0.7rem;
  }
}

body[data-theme="high-visibility"] .app-navbar {
  border-bottom: 0.25rem solid var(--theme-accent) !important;
}

body[data-theme="high-visibility"] .card,
body[data-theme="high-visibility"] .form-control,
body[data-theme="high-visibility"] .form-select,
body[data-theme="high-visibility"] .btn {
  border-width: 2px;
}

body[data-theme="high-visibility"] .navbar-nav .nav-link.active {
  box-shadow: inset 0 0.3rem 0 var(--theme-accent);
}

.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.theme-preview {
  position: relative;
  display: grid;
  gap: 0.2rem;
  min-height: 6.5rem;
  padding: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--preview-border);
  border-radius: 0.5rem;
  color: var(--preview-text);
  background: var(--preview-page);
}

.theme-choice {
  width: 100%;
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-choice:hover,
.theme-choice:focus-visible {
  transform: translateY(-2px);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb, 13, 110, 253), 0.28);
}

.theme-choice.is-selected {
  box-shadow: 0 0 0 3px var(--theme-primary, #0d6efd);
}

.theme-choice-status {
  display: none;
  position: absolute;
  right: 0.55rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  color: var(--preview-page);
  background: var(--preview-primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.theme-choice.is-selected .theme-choice-status {
  display: inline-block;
}

.theme-preview-bar {
  display: block;
  height: 1.15rem;
  margin: -0.75rem -0.75rem 0.45rem;
  background: linear-gradient(90deg, var(--preview-primary) 0 68%, var(--preview-accent) 68%);
}

.theme-preview small {
  color: var(--preview-muted);
}

.theme-preview-civic-blue {
  --preview-page: #f3f7fb;
  --preview-text: #172b3f;
  --preview-muted: #62758a;
  --preview-border: #b8c9da;
  --preview-primary: #1f5f99;
  --preview-accent: #c62828;
}

.theme-preview-road-safety {
  --preview-page: #fffdf9;
  --preview-text: #242424;
  --preview-muted: #68625b;
  --preview-border: #bdb7ae;
  --preview-primary: #b42318;
  --preview-accent: #2d3338;
}

.theme-preview-operations-center {
  --preview-page: #f1f7f4;
  --preview-text: #18352d;
  --preview-muted: #5d756c;
  --preview-border: #a9c8bc;
  --preview-primary: #19705b;
  --preview-accent: #d88922;
}

.theme-preview-high-visibility {
  --preview-page: #ffffff;
  --preview-text: #172027;
  --preview-muted: #4d5961;
  --preview-border: #263238;
  --preview-primary: #263238;
  --preview-accent: #f4cf20;
}

@media (max-width: 991.98px) {
  .theme-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .theme-preview-grid {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1399.98px) {
  body[data-theme] .app-navbar .navbar-nav .nav-link.active {
    border-bottom-color: var(--theme-primary);
    box-shadow: inset 0.25rem 0 var(--theme-accent);
  }
}

/* Layout fluido per monitor Full HD e ad alta risoluzione. */
@media (min-width: 1200px) {
  .app-content-container,
  .app-footer-container {
    width: 94%;
    max-width: 3200px;
  }
}

.article-search-field {
  position: relative;
}

.online-agents-list {
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--theme-border, #dee2e6);
  border-radius: var(--bs-border-radius);
}

.online-agents-list .list-group-item {
  border-width: 0 0 1px;
}

.online-agents-list .list-group-item:last-child {
  border-bottom-width: 0;
}

.online-agents-empty {
  padding: 1rem;
  text-align: center;
}

.online-agent-indicator {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--bs-success);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-success) 18%, transparent);
}

.online-admin-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  margin-left: 0.2rem;
  border-radius: 50%;
  color: #fff;
  background: var(--theme-primary, var(--bs-primary));
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.1rem;
}

.audit-log-table-wrapper {
  max-height: calc(100vh - 20rem);
  min-height: 14rem;
  overflow: auto;
}

.audit-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.article-popup {
  position: absolute;
  right: calc(var(--bs-gutter-x) * 0.5);
  left: calc(var(--bs-gutter-x) * 0.5);
  z-index: 1080;
  max-height: 20rem;
  overflow-y: auto;
}

.results-navigation {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--theme-border, #dee2e6);
  border-radius: 0.65rem;
  background: var(--theme-surface-alt, #f8f9fa);
}

.results-count {
  font-size: 1rem;
}

body[data-theme] .home-action-card {
  --home-card-color: var(--theme-primary);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--home-card-color) 45%, var(--theme-border));
  border-top: 0.35rem solid var(--home-card-color);
  border-radius: 1rem;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--home-card-color) 12%, var(--theme-surface)),
    var(--theme-surface) 72%
  );
  box-shadow: 0 0.65rem 1.4rem color-mix(in srgb, var(--home-card-color) 18%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body[data-theme] .home-action-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.9rem 1.8rem color-mix(in srgb, var(--home-card-color) 25%, transparent);
}

.home-action-card--verbali {
  --home-card-color: #2878c8 !important;
}

.home-action-card--amministrazione {
  --home-card-color: #7556b8 !important;
}

.home-action-card--fotogrammi {
  --home-card-color: #178f7a !important;
}

.home-action-card--nuovo-verbale {
  --home-card-color: #d17a16 !important;
}

.home-action-card--nuovo-preavviso {
  --home-card-color: #bd445c !important;
}

/* Richiama la scheda Home della sezione senza sostituire i colori del tema. */
body[data-theme][data-page-section="verbali"] {
  --page-section-color: #2878c8;
}

body[data-theme][data-page-section="amministrazione"] {
  --page-section-color: #7556b8;
}

body[data-theme][data-page-section="fotogrammi"] {
  --page-section-color: #178f7a;
}

body[data-theme][data-page-section="nuovo-verbale"] {
  --page-section-color: #d17a16;
}

body[data-theme][data-page-section="nuovo-preavviso"] {
  --page-section-color: #bd445c;
}

body[data-theme][data-page-section]:not([data-page-section="none"]) main > h1 {
  padding: clamp(0.55rem, 0.4rem + 0.35vw, 0.8rem)
    clamp(0.75rem, 0.55rem + 0.5vw, 1.15rem);
  border-left: 0.35rem solid var(--page-section-color);
  border-radius: 0.65rem;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--page-section-color) 16%, var(--theme-surface)),
    var(--theme-surface) 72%
  );
}

body[data-theme][data-page-section]:not([data-page-section="none"]) main > form.card,
body[data-theme][data-page-section]:not([data-page-section="none"]) main > .results-navigation,
body[data-theme][data-page-section]:not([data-page-section="none"]) main .legacy-section,
body[data-theme][data-page-section]:not([data-page-section="none"]) main .photo-review-card {
  border-left-color: color-mix(in srgb, var(--page-section-color) 72%, var(--theme-border));
  box-shadow: inset 0.25rem 0 var(--page-section-color), var(--theme-shadow);
}

body[data-theme][data-page-section]:not([data-page-section="none"]) main > table > thead {
  box-shadow: inset 0 0.2rem var(--page-section-color);
}

@media (max-width: 575.98px) {
  .results-navigation {
    align-items: stretch;
    flex-direction: column;
  }

  .results-navigation .btn {
    flex: 1 1 auto;
  }
}
