:root {
  color-scheme: light dark;
  --background: #f7f9fb;
  --background-dark: #222831;
  --text: #1d1f21;
  --text-dark: #f0f4f8;
  --accent: #0061a8;
  --accent-hover: #004b80;
  --border: #d0d7de;
  --border-dark: #3a3f47;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

body.auth-page {
  overflow: auto;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--background-dark);
    color: var(--text-dark);
  }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 76, 117, 0.15);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.top-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

@media (prefers-color-scheme: dark) {
  .top-bar {
    background: rgba(15, 76, 117, 0.25);
    border-bottom: 1px solid var(--border-dark);
  }
}

.top-bar__content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .top-bar__content {
    flex-direction: row;
    align-items: center;
  }
}

.app-title-wrapper {
  display: flex;
  align-items: center;
}

.app-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.app-title__screen {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-greeting {
  font-weight: 600;
}

main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  gap: 2rem;
  align-items: stretch;
  overflow: hidden;
}

.screen-tabs {
  display: flex;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.top-bar__content .screen-tabs {
  width: 100%;
}

@media (min-width: 768px) {
  .top-bar__content .screen-tabs {
    width: auto;
  }
}

.screen-tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: inherit;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.screen-tab:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 97, 168, 0.18);
}

.screen-tab[aria-pressed='true'],
.screen-tab.screen-tab--active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 6px 14px rgba(0, 97, 168, 0.25);
}

main.auth-layout {
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.card {
  width: min(100%, 520px);
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(15, 76, 117, 0.18);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  .card {
    background-color: rgba(34, 40, 49, 0.92);
    box-shadow: 0 15px 35px rgba(15, 76, 117, 0.35);
  }
}

.section-intro {
  margin: 0;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .section-intro {
    color: rgba(255, 255, 255, 0.75);
  }
}

.form {
  display: grid;
  gap: 1rem;
}

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

.form.form-grid .form-field {
  min-width: 0;
}

.form.form-grid .form-field.full-width,
.form.form-grid .form-actions {
  grid-column: 1 / -1;
}

.form.form-grid.two-columns .form-field.span-two {
  grid-column: 1 / -1;
}

@media (min-width: 680px) {
  .form.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-field input,
.form-field select {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.checkbox-group {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-group.manual-caratteristiche-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem 1rem;
  align-items: center;
}

.checkbox-group legend {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  padding-bottom: 0.35rem;
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.checkbox-option input[type='checkbox'] {
  height: 1rem;
  width: 1rem;
  accent-color: var(--accent);
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 97, 168, 0.2);
}

@media (prefers-color-scheme: dark) {
  .form-field input,
  .form-field select {
    background: rgba(34, 40, 49, 0.85);
    border: 1px solid var(--border-dark);
  }

  .form-field input:focus,
  .form-field select:focus {
    box-shadow: 0 0 0 3px rgba(0, 97, 168, 0.45);
  }

  .checkbox-group {
    border: 1px solid var(--border-dark);
    background: rgba(34, 40, 49, 0.6);
  }

  .screen-tab {
    background: rgba(34, 40, 49, 0.85);
    border: 1px solid var(--border-dark);
  }
}

.form-message {
  min-height: 1.25rem;
  font-size: 0.95rem;
  margin: 0;
  color: rgba(0, 0, 0, 0.65);
}

.form-message[data-state='error'] {
  color: #c53030;
}

.form-message[data-state='success'] {
  color: #2f855a;
}

.form-message[data-state='loading'] {
  color: #b7791f;
}

.form-message[data-state='info'] {
  color: #2b6cb0;
}

@media (prefers-color-scheme: dark) {
  .form-message {
    color: rgba(255, 255, 255, 0.7);
  }
}

.association-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.association-button {
  flex: 0 0 auto;
}

.association-summary {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(29, 31, 33, 0.75);
}

@media (prefers-color-scheme: dark) {
  .association-summary {
    color: rgba(240, 244, 248, 0.75);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 94vw);
  max-height: 90vh;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1rem;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

@media (prefers-color-scheme: dark) {
  .modal-dialog {
    background: rgba(34, 40, 49, 0.98);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.45);
  }
}

.modal-header,
.modal-footer {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  justify-content: flex-end;
}

@media (prefers-color-scheme: dark) {
  .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }
}

.modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

button.modal-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

button.modal-close:hover {
  color: var(--accent);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  min-height: 0;
}

.association-modal {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.association-modal__search label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.association-modal__input-row {
  display: flex;
  align-items: center;
}

.association-modal__input-row input[type='search'] {
  flex: 1 1 auto;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 1rem;
}

@media (prefers-color-scheme: dark) {
  .association-modal__input-row input[type='search'] {
    border: 1px solid var(--border-dark);
    background: rgba(34, 40, 49, 0.75);
    color: inherit;
  }
}

.association-modal__results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  max-height: 16rem;
  overflow: auto;
  background: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
  .association-modal__results {
    border: 1px solid var(--border-dark);
    background: rgba(34, 40, 49, 0.85);
  }
}

.association-modal__results li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.association-modal__results li:last-child {
  border-bottom: none;
}

.association-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.association-option.selected {
  background: rgba(0, 97, 168, 0.12);
}

.association-option__title {
  font-weight: 600;
}

.association-option__subtitle {
  font-size: 0.9rem;
  color: rgba(29, 31, 33, 0.7);
}

.association-hint {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: rgba(29, 31, 33, 0.7);
}

@media (prefers-color-scheme: dark) {
  .association-option.selected {
    background: rgba(0, 97, 168, 0.25);
  }

  .association-option__subtitle,
  .association-hint {
    color: rgba(240, 244, 248, 0.75);
  }
}

.association-modal__selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.association-selected__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(247, 249, 251, 0.9);
}

.association-selected__label {
  font-size: 0.95rem;
}

.association-selected__remove {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.association-selected__empty {
  margin: 0;
  padding: 0.75rem 0;
  font-size: 0.95rem;
  color: rgba(29, 31, 33, 0.65);
}

@media (prefers-color-scheme: dark) {
  .association-selected__item {
    border: 1px solid var(--border-dark);
    background: rgba(34, 40, 49, 0.85);
  }

  .association-selected__empty {
    color: rgba(240, 244, 248, 0.7);
  }
}

#app-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filters-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filters-panel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1 1 auto;
}

.filters-panel__toggle {
  align-self: flex-start;
  white-space: nowrap;
}

.filters {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.9);
}

@media (prefers-color-scheme: dark) {
  .filters {
    background-color: rgba(34, 40, 49, 0.9);
    border-color: var(--border-dark);
  }
}

.filters__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-field label {
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-field input {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  .filter-field input {
    background-color: rgba(24, 29, 36, 0.85);
    border-color: var(--border-dark);
  }
}

.filters__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  min-height: 1.25rem;
}

.status__spinner {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2.5px solid rgba(0, 97, 168, 0.18);
  border-top-color: var(--accent);
  animation: modal-loading-spin 0.9s linear infinite;
  display: none;
}

.status[data-state='loading'] .status__spinner {
  display: inline-block;
}

.status__message {
  margin: 0;
}

button {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.secondary {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

button.secondary:hover:not(:disabled) {
  background-color: var(--accent);
  color: #ffffff;
}

button.secondary:disabled {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

button.danger {
  background-color: #c53030;
  color: #ffffff;
}

button.danger:hover:not(:disabled) {
  background-color: #9b2c2c;
}

button.table-action {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 0.6rem;
}

button.table-action:hover:not(:disabled) {
  background-color: var(--accent);
  color: #ffffff;
}

button.table-action.danger {
  border-color: #c53030;
  color: #c53030;
}

button.table-action.danger:hover:not(:disabled) {
  background-color: #c53030;
  color: #ffffff;
}

.status[data-state='loading'] {
  color: #b7791f;
}

.status[data-state='error'] {
  color: #c53030;
}

.status[data-state='success'] {
  color: #2f855a;
}

.status[data-state='empty'] {
  color: #4a5568;
}

.status[data-state='partial'] {
  color: #2b6cb0;
}

body.user-management-page {
  overflow: auto;
}

body.user-management-page main {
  overflow: visible;
}

.surface {
  background-color: rgba(255, 255, 255, 0.92);
  border-radius: 1.35rem;
  padding: 1.75rem 2rem;
  box-shadow: 0 20px 45px rgba(15, 76, 117, 0.18);
  backdrop-filter: blur(4px);
}

@media (prefers-color-scheme: dark) {
  .surface {
    background-color: rgba(34, 40, 49, 0.92);
    box-shadow: 0 20px 45px rgba(15, 76, 117, 0.32);
  }
}

.user-management-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 1.5rem 3rem;
  min-height: 0;
}

.user-management-hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-management-hero .hero-text h2 {
  margin: 0;
}

.user-management-hero .hero-text p {
  margin: 0;
  color: rgba(0, 0, 0, 0.65);
  max-width: 60ch;
}

@media (prefers-color-scheme: dark) {
  .user-management-hero .hero-text p {
    color: rgba(255, 255, 255, 0.7);
  }
}

.user-management-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
  align-items: start;
  min-height: 0;
}

@media (max-width: 1024px) {
  .user-management-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.panel-header h3 {
  margin: 0;
}

.panel-header p {
  margin: 0;
  color: rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  .panel-header p {
    color: rgba(255, 255, 255, 0.65);
  }
}

.user-list-table-wrapper {
  border: 1px solid rgba(0, 97, 168, 0.18);
  background: rgba(255, 255, 255, 0.8);
}

@media (prefers-color-scheme: dark) {
  .user-list-table-wrapper {
    border-color: rgba(144, 205, 244, 0.25);
    background: rgba(34, 40, 49, 0.85);
  }
}

.form-card.surface {
  padding: 1.5rem 1.75rem;
}

.user-management-hero.surface {
  padding: 2rem 2.25rem;
}

.user-list-section.surface {
  padding: 1.75rem 2rem;
}

.table-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(15, 76, 117, 0.15);
  border-radius: 0.75rem;
  background-color: rgba(255, 255, 255, 0.85);
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .table-wrapper {
    background-color: rgba(34, 40, 49, 0.85);
  }
}

#moveco-table {
  width: 100%;
  border-collapse: collapse;
}

#moveco-table thead {
  background: #0f4c75;
  color: #ffffff;
}

#moveco-table th,
#moveco-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
}

#user-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

#user-list-table thead {
  background: rgba(15, 76, 117, 0.12);
}

#user-list-table th,
#user-list-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

#user-list-table td.column-actions {
  text-align: right;
  white-space: nowrap;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

#user-list-table tbody tr.selected {
  background-color: rgba(15, 76, 117, 0.18);
}

#user-list-table tbody tr.selected:hover {
  background-color: rgba(15, 76, 117, 0.24);
}

@media (prefers-color-scheme: dark) {
  #user-list-table thead {
    background: rgba(15, 76, 117, 0.28);
  }

  #user-list-table th,
  #user-list-table td {
    border-bottom: 1px solid var(--border-dark);
  }

  #user-list-table tbody tr.selected {
    background-color: rgba(144, 205, 244, 0.22);
  }

  #user-list-table tbody tr.selected:hover {
    background-color: rgba(144, 205, 244, 0.3);
  }
}

#moveco-table th.column-date,
#moveco-table td.column-date {
  white-space: nowrap;
  width: 1%;
  text-align: center;
}

#moveco-table th.column-weight,
#moveco-table td.column-weight {
  white-space: nowrap;
  width: 1%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  #moveco-table th,
  #moveco-table td {
    border-bottom: 1px solid var(--border-dark);
  }
}

#moveco-table tbody tr:nth-child(even) {
  background-color: rgba(15, 76, 117, 0.08);
}

@media (prefers-color-scheme: dark) {
  #moveco-table tbody tr:nth-child(even) {
    background-color: rgba(236, 240, 243, 0.05);
  }
}

#moveco-table tbody tr:hover {
  background-color: rgba(50, 130, 184, 0.15);
}

#moveco-table tbody tr {
  cursor: pointer;
}

#moveco-table tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.detail-modal {
  width: min(720px, 94vw);
}

.detail-modal__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-section__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.35em;
}

.detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 0.5rem 1rem;
}

.detail-list dt {
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
  color: inherit;
}

.detail-empty {
  margin: 0;
  color: rgba(0, 0, 0, 0.6);
}

.detail-extra-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-extra-grid {
  display: grid;
  gap: 1rem;
}

.detail-extra-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.detail-extra-field textarea {
  width: 100%;
  max-width: 28rem;
  min-height: 2.5rem;
  resize: vertical;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.detail-extra-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(50, 130, 184, 0.25);
}

.detail-extra-field textarea:disabled {
  opacity: 0.65;
  box-shadow: none;
}

.detail-extra-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.detail-extra-status {
  margin: 0;
  font-size: 0.95rem;
}

.detail-extra-status[hidden] {
  display: none !important;
}

.detail-extra-status[data-state='success'] {
  color: #2e7d32;
}

.detail-extra-status[data-state='error'] {
  color: #c62828;
}

.detail-extra-status[data-state='info'] {
  color: #1565c0;
}

.app-shell.role-produttore .detail-extra-form {
  display: none !important;
}

.manual-form-modal {
  width: min(1080px, 96vw);
  max-height: 92vh;
}

.change-password-modal {
  width: min(480px, 92vw);
  max-height: 85vh;
}

.manual-form-modal__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.manual-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.manual-form-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.manual-form-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.manual-form-grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.manual-form-grid--three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.manual-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.manual-form-field label,
.manual-form-field .manual-form-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.manual-form-field input,
.manual-form-field textarea,
.manual-form-field select {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.manual-form-field textarea {
  resize: vertical;
  min-height: 2.75rem;
  line-height: 1.45;
}

.manual-form-field input:focus,
.manual-form-field textarea:focus,
.manual-form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 97, 168, 0.2);
}

.manual-form-field--wide {
  grid-column: 1 / -1;
}

.manual-form-field--double {
  grid-column: span 2;
}

.manual-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}

@media (min-width: 1200px) {
  .manual-form-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (prefers-color-scheme: dark) {
  .detail-empty {
    color: rgba(255, 255, 255, 0.65);
  }

  .detail-extra-field textarea {
    border-color: rgba(255, 255, 255, 0.25);
    background-color: rgba(255, 255, 255, 0.06);
    color: inherit;
  }

  .detail-extra-field textarea:focus {
    border-color: rgba(144, 202, 249, 0.85);
    box-shadow: 0 0 0 2px rgba(144, 202, 249, 0.25);
  }

  .detail-extra-status[data-state='success'] {
    color: #81c784;
  }

  .detail-extra-status[data-state='error'] {
    color: #ef9a9a;
  }

  .detail-extra-status[data-state='info'] {
    color: #90caf9;
  }

  .manual-form-field input,
  .manual-form-field textarea,
  .manual-form-field select {
    background: rgba(34, 40, 49, 0.85);
    border: 1px solid var(--border-dark);
  }

  .manual-form-field input:focus,
  .manual-form-field textarea:focus,
  .manual-form-field select:focus {
    box-shadow: 0 0 0 3px rgba(0, 97, 168, 0.45);
  }
}

@media (max-width: 720px) {
  .manual-form-field--double {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .detail-extra-field textarea {
    max-width: 100%;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list dt {
    color: rgba(0, 0, 0, 0.7);
  }
}

@media (max-width: 640px) and (prefers-color-scheme: dark) {
  .detail-list dt {
    color: rgba(255, 255, 255, 0.75);
  }
}

.user-list-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.user-list-table-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 0.85rem;
  padding: 0.75rem;
  max-height: 100%;
}

.user-forms {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.form-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-card-header h3 {
  margin: 0;
}

.form-card-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.65);
}

@media (prefers-color-scheme: dark) {
  .form-card-subtitle {
    color: rgba(255, 255, 255, 0.7);
  }
}

@media (min-width: 720px) {
  .user-forms {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.user-list-section table tr:nth-child(even) {
  background-color: rgba(15, 76, 117, 0.08);
}

@media (prefers-color-scheme: dark) {
  .user-list-section table tr:nth-child(even) {
    background-color: rgba(236, 240, 243, 0.05);
  }
}
