:root {
  color-scheme: light;

  /* Rosso e nero del logo Malo Padel */
  --mp-brand: #e30613;
  --mp-brand-strong: #c1040f;
  --mp-brand-soft: #fdecec;
  --mp-brand-tint: rgba(227, 6, 19, .10);

  /* Grafite della barra laterale */
  --mp-ink-900: #0d0e10;
  --mp-ink-800: #141618;
  --mp-ink-700: #1c1f22;
  --mp-ink-600: #262a2e;

  --mp-canvas: #f4f5f6;
  --mp-canvas-2: #eceef0;
  --mp-surface: #ffffff;
  --mp-surface-2: #f8f9fa;
  --mp-surface-3: #eff1f3;

  --mp-text: #14171a;
  --mp-text-2: #444b52;
  --mp-muted: #6b747c;
  --mp-border: #e0e4e8;
  --mp-border-strong: #c8cfd6;

  --mp-danger: #c1040f;
  --mp-danger-soft: #fdecec;
  --mp-warning: #a56b00;
  --mp-warning-soft: #fdf4e3;
  --mp-success: #0f7a4d;
  --mp-success-soft: #e6f5ee;
  --mp-info: #1c6bb8;
  --mp-info-soft: #e9f1fa;

  --mp-radius-sm: 10px;
  --mp-radius: 14px;
  --mp-radius-lg: 20px;
  --mp-radius-xl: 26px;

  --mp-shadow-1: 0 1px 2px rgba(16, 20, 24, .05), 0 1px 3px rgba(16, 20, 24, .04);
  --mp-shadow-2: 0 2px 4px rgba(16, 20, 24, .04), 0 8px 20px rgba(16, 20, 24, .08);
  --mp-shadow-3: 0 14px 36px rgba(16, 20, 24, .16), 0 2px 8px rgba(16, 20, 24, .07);
  --mp-ring: 0 0 0 3px rgba(227, 6, 19, .20);

  --mp-sidebar-width: 268px;
  --mp-font: "Inter var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --mp-brand: #ff3b48;
  --mp-brand-strong: #e30613;
  --mp-brand-soft: #2a1214;
  --mp-brand-tint: rgba(255, 59, 72, .14);

  --mp-canvas: #0c0d0f;
  --mp-canvas-2: #101214;
  --mp-surface: #16181b;
  --mp-surface-2: #1c1f22;
  --mp-surface-3: #23272b;

  --mp-text: #eef1f4;
  --mp-text-2: #bcc4cb;
  --mp-muted: #8b959e;
  --mp-border: #2c3136;
  --mp-border-strong: #3b4249;

  --mp-danger: #ff5c66;
  --mp-danger-soft: #33181b;
  --mp-warning: #e0a23a;
  --mp-warning-soft: #33280f;
  --mp-success: #35c489;
  --mp-success-soft: #12291f;
  --mp-info: #5aa9f0;
  --mp-info-soft: #14212e;

  --mp-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --mp-shadow-2: 0 6px 18px rgba(0, 0, 0, .45);
  --mp-shadow-3: 0 18px 44px rgba(0, 0, 0, .6);
  --mp-ring: 0 0 0 3px rgba(255, 59, 72, .26);
}

html[data-theme='contrast'] {
  --mp-canvas: #000000;
  --mp-surface: #0a0a0a;
  --mp-surface-2: #131313;
  --mp-surface-3: #1c1c1c;
  --mp-text: #ffffff;
  --mp-text-2: #e6e6e6;
  --mp-muted: #c6c6c6;
  --mp-border: #6a6a6a;
  --mp-border-strong: #909090;
}

/* --------------------------------------------------------------------------
   2. Base tipografica
   -------------------------------------------------------------------------- */

html,
body {
  background: var(--mp-canvas);
  color: var(--mp-text);
  font-family: var(--mp-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

h1, h2, h3, h4 {
  color: var(--mp-text);
  letter-spacing: -0.022em;
  font-weight: 700;
  margin: 0;
}

h1 { font-size: clamp(24px, 2.4vw, 31px); line-height: 1.18; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 16.5px; line-height: 1.3; }

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mp-brand);
  margin: 0 0 6px;
}

.page-description,
.settings-note,
small {
  color: var(--mp-muted);
}

.page-description {
  font-size: 14px;
  max-width: 68ch;
  margin: 6px 0 0;
}

::selection {
  background: var(--mp-brand-tint);
}

/* --------------------------------------------------------------------------
   3. Struttura: barra laterale e area principale
   -------------------------------------------------------------------------- */

.app-shell,
.malo-shell {
  background: var(--mp-canvas);
  color: var(--mp-text);
}

.sidebar,
.malo-sidebar {
  width: var(--mp-sidebar-width);
  padding: 22px 16px 18px;
  background:
    radial-gradient(130% 60% at 0% 0%, rgba(227, 6, 19, .20), transparent 60%),
    linear-gradient(180deg, var(--mp-ink-900), var(--mp-ink-800) 58%, #101215);
  border-right: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
}

.main-content,
.malo-main {
  width: calc(100% - var(--mp-sidebar-width));
  margin-left: var(--mp-sidebar-width);
  padding: 30px 34px 56px;
  background: var(--mp-canvas);
}

.brand,
.malo-brand {
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 14px;
}

.brand strong,
.malo-brand strong {
  color: #fff;
  font-size: 15.5px;
  letter-spacing: -.015em;
}

.brand span,
.malo-brand span {
  color: rgba(255, 255, 255, .55);
  font-size: 11.5px;
  letter-spacing: .01em;
}

.malo-brand-logo {
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

/* Navigazione raggruppata */
.navigation {
  gap: 2px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
}

.nav-section-label {
  padding: 12px 14px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .38);
}

.nav-item {
  padding: 10px 13px;
  gap: 11px;
  border-radius: var(--mp-radius-sm);
  color: rgba(255, 255, 255, .68);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(227, 6, 19, .30), rgba(227, 6, 19, .06));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--mp-brand);
}

.nav-item:active { transform: scale(.99); }

.nav-icon {
  width: 20px;
  color: var(--mp-brand);
  opacity: .9;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon svg .filled-dot {
  fill: currentColor;
  stroke: none;
}

.sidebar-footer .profile {
  margin-top: 12px;
  padding: 14px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.avatar {
  background: linear-gradient(140deg, var(--mp-brand), var(--mp-brand-strong));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}

.profile strong { color: #fff; font-size: 13.5px; }
.profile span { color: rgba(255, 255, 255, .5); font-size: 11.5px; }

.logout-button {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .85);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s ease;
}

.logout-button:hover { background: rgba(255, 255, 255, .12); }

.cloud-status-badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
}

.cloud-status-badge.cloud-synced { background: rgba(47, 190, 132, .2); color: #8ef0c0; }
.cloud-status-badge.cloud-error { background: rgba(217, 45, 63, .22); color: #ffb3bb; }

/* --------------------------------------------------------------------------
   4. Intestazioni di pagina e pannelli
   -------------------------------------------------------------------------- */

.topbar {
  margin-bottom: 24px;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  box-shadow: var(--mp-shadow-1);
  padding: 22px;
  margin-bottom: 18px;
  transition: box-shadow .18s ease, border-color .18s ease;
}

.panel:hover { box-shadow: var(--mp-shadow-2); }

.panel-heading {
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--mp-border);
}

.panel-heading h2,
.panel-heading h3 { margin: 0; }
.panel-heading p { margin: 4px 0 0; color: var(--mp-muted); font-size: 13.5px; }

/* Riquadri statistici */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  box-shadow: var(--mp-shadow-1);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--mp-brand);
  opacity: .9;
}

.stat-card p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mp-muted);
}

.stat-card strong {
  display: block;
  margin: 7px 0 3px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--mp-text);
}

.stat-card span { font-size: 12.5px; color: var(--mp-muted); }

/* --------------------------------------------------------------------------
   5. Bottoni
   -------------------------------------------------------------------------- */

.primary-button,
.outline-button,
.text-button,
.danger-button,
.whatsapp-button {
  border-radius: 11px;
  padding: 10px 17px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease,
    transform .1s ease, color .15s ease;
}

.primary-button {
  border: 1px solid transparent;
  background: linear-gradient(180deg, #ec1a26, var(--mp-brand-strong));
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 20, 24, .18), 0 6px 16px rgba(193, 4, 15, .28);
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(180deg, #f52332, #ad0410);
  box-shadow: 0 2px 4px rgba(16, 20, 24, .2), 0 10px 24px rgba(193, 4, 15, .32);
}

.primary-button:active:not(:disabled) { transform: translateY(1px); }

.outline-button {
  border: 1px solid var(--mp-border-strong);
  background: var(--mp-surface);
  color: var(--mp-text);
}

.outline-button:hover:not(:disabled) {
  border-color: var(--mp-brand);
  color: var(--mp-brand-strong);
  background: var(--mp-surface-2);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--mp-brand-strong);
  padding: 8px 10px;
}

.text-button:hover { background: var(--mp-brand-tint); }

.danger-button {
  border: 1px solid transparent;
  background: var(--mp-danger);
  color: #fff;
}

.danger-button:hover { background: #c0202f; }

.whatsapp-button {
  border: 1px solid transparent;
  background: #1fab5a;
  color: #fff;
}

.whatsapp-button:hover { background: #189049; }

button:disabled,
.primary-button:disabled,
.outline-button:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--mp-ring);
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   6. Moduli
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mp-text-2);
  letter-spacing: -.003em;
}

input,
select,
textarea {
  padding: 10px 12px;
  border: 1px solid var(--mp-border-strong);
  border-radius: var(--mp-radius-sm);
  background: var(--mp-surface);
  color: var(--mp-text);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input::placeholder,
textarea::placeholder { color: var(--mp-muted); opacity: .8; }

input:hover,
select:hover,
textarea:hover { border-color: var(--mp-brand); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mp-brand);
  box-shadow: var(--mp-ring);
  outline: none;
}

input[type='checkbox'],
input[type='radio'] {
  width: 17px;
  height: 17px;
  accent-color: var(--mp-brand);
  cursor: pointer;
}

.check-field,
.permission-option {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--mp-text-2);
  cursor: pointer;
}

.inline-input {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form .form-field { min-width: 220px; }

/* Interruttore a levetta */
.switch-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.switch-field input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  border: 0;
  background: var(--mp-border-strong);
  transition: background .18s ease;
}

.switch-field input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .18s ease;
}

.switch-field input[type='checkbox']:checked { background: var(--mp-brand); }
.switch-field input[type='checkbox']:checked::after { transform: translateX(18px); }

fieldset.permissions-box {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  padding: 16px 18px 18px;
  margin: 16px 0 0;
  background: var(--mp-surface-2);
}

fieldset.permissions-box > legend {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mp-muted);
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 9px 18px;
}

/* --------------------------------------------------------------------------
   7. Tabelle
   -------------------------------------------------------------------------- */

.table-panel { padding: 22px 22px 8px; }

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  -webkit-overflow-scrolling: touch;
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: transparent;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: var(--mp-surface-3);
  color: var(--mp-text-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--mp-border);
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--mp-border);
  color: var(--mp-text-2);
  vertical-align: middle;
}

.data-table tbody td strong { color: var(--mp-text); font-weight: 600; }
.data-table tbody td small { display: block; color: var(--mp-muted); font-size: 12px; }

.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--mp-surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   8. Etichette di stato
   -------------------------------------------------------------------------- */

.pilot-status,
.active-plan-badge,
.inactive-plan-badge,
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.active-plan-badge,
.pill-ok,
.status-delivered,
.status-read,
.status-processed {
  background: var(--mp-success-soft);
  color: var(--mp-success);
}

.inactive-plan-badge,
.status-queued,
.status-ignored {
  background: var(--mp-surface-3);
  color: var(--mp-muted);
}

.pill-warn,
.status-sent,
.status-received {
  background: var(--mp-info-soft);
  color: var(--mp-info);
}

.status-failed {
  background: var(--mp-danger-soft);
  color: var(--mp-danger);
}

/* Avvisi in linea */
.inline-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--mp-border);
  border-left: 3px solid var(--mp-brand);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  box-shadow: var(--mp-shadow-1);
  font-size: 14px;
}

.inline-notice.notice-ok { border-left-color: var(--mp-success); background: var(--mp-success-soft); }
.inline-notice.notice-error { border-left-color: var(--mp-danger); background: var(--mp-danger-soft); }
.inline-notice.notice-info { border-left-color: var(--mp-info); background: var(--mp-info-soft); }

.empty-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--mp-muted);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   9. Pagina WhatsApp Business e pannello accessi
   -------------------------------------------------------------------------- */

.connection-checklist {
  display: grid;
  gap: 10px;
}

.checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
}

.checklist-row.done {
  border-color: rgba(15, 122, 77, .34);
  background: var(--mp-success-soft);
}

.checklist-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 50%;
  background: var(--mp-border-strong);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}

.checklist-row.done .checklist-mark { background: var(--mp-success); }
.checklist-row strong { display: block; font-size: 14px; }
.checklist-row span { display: block; margin-top: 2px; font-size: 13px; color: var(--mp-muted); }

.template-preview {
  display: block;
  margin-top: 3px;
  max-width: 46ch;
  color: var(--mp-muted);
  font-size: 12px;
  line-height: 1.4;
}

.outbound-text-cell span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 44ch;
}

.outbound-error { color: var(--mp-danger); }

.bulk-send-state {
  font-size: 13px;
  color: var(--mp-muted);
  font-variant-numeric: tabular-nums;
}

/* Ruoli e profili di accesso */
.role-legend-grid,
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 11px;
}

.role-legend-card,
.preset-card {
  display: block;
  text-align: left;
  padding: 14px 15px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.role-legend-card:hover,
.preset-card:hover {
  border-color: var(--mp-brand);
  box-shadow: var(--mp-shadow-2);
}

.role-legend-card.selected,
.preset-card.selected {
  border-color: var(--mp-brand);
  background: var(--mp-success-soft);
  box-shadow: var(--mp-ring);
}

.role-legend-card strong,
.preset-card strong {
  display: block;
  font-size: 14.5px;
  color: var(--mp-text);
}

.role-legend-card span,
.preset-card span {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--mp-muted);
}

.role-legend-card em {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mp-brand-strong);
}

.permission-group {
  padding: 13px 0;
  border-bottom: 1px dashed var(--mp-border);
}

.permission-group:last-child { border-bottom: 0; padding-bottom: 0; }

.permission-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.permission-group-head strong { display: block; font-size: 14px; }
.permission-group-head span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mp-muted); }

.role-hint { margin: 10px 0 0; }

/* --------------------------------------------------------------------------
   10. Finestre modali
   -------------------------------------------------------------------------- */

.modal-backdrop {
  background: rgba(10, 12, 14, .6);
  padding: 24px;
}

.participant-modal,
.wide-modal {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-xl);
  background: var(--mp-surface);
  box-shadow: var(--mp-shadow-3);
  padding: 24px;
}

.modal-heading {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--mp-border);
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--mp-border);
  border-radius: 10px;
  background: var(--mp-surface-2);
  color: var(--mp-muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { border-color: var(--mp-danger); color: var(--mp-danger); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--mp-border);
}

.form-spacer { flex: 1; }

/* --------------------------------------------------------------------------
   11. Schede utente
   -------------------------------------------------------------------------- */

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.user-card { margin-bottom: 0; padding: 18px; }

.user-card > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-card h3 { font-size: 15px; }
.user-card p { margin: 2px 0 0; font-size: 12.5px; color: var(--mp-muted); word-break: break-all; }

.user-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: linear-gradient(140deg, #ec1a26, var(--mp-brand-strong));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.user-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--mp-border);
  border-bottom: 1px solid var(--mp-border);
  font-size: 13px;
}

.user-meta span { color: var(--mp-muted); font-size: 12.5px; }
.user-permission-summary { margin: 11px 0 0; font-size: 13px; color: var(--mp-muted); }
.card-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   12. Accesso, registrazione e schermata di avvio
   -------------------------------------------------------------------------- */

.route-loading {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 60vh;
  color: var(--mp-muted);
  font-size: 14px;
}

.permission-denied-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--mp-canvas);
}

.permission-denied-card { max-width: 460px; text-align: center; }

/* --------------------------------------------------------------------------
   13. Telefono e tablet
   -------------------------------------------------------------------------- */

.mobile-app-header {
  background: linear-gradient(180deg, var(--mp-ink-900), var(--mp-ink-800));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  gap: 12px;
}

.mobile-app-header strong { color: #fff; font-size: 14.5px; }
.mobile-app-header span { color: rgba(255, 255, 255, .55); font-size: 11.5px; }

.mobile-menu-button span { background: #fff; }

@media (max-width: 1024px) {
  .main-content,
  .malo-main { padding: 24px 20px 48px; }
}

@media (max-width: 860px) {
  body { font-size: 15.5px; }

  .main-content,
  .malo-main {
    width: 100%;
    margin-left: 0;
    padding: 18px 15px calc(40px + env(safe-area-inset-bottom));
  }

  .sidebar,
  .malo-sidebar {
    width: min(84vw, 320px);
    box-shadow: var(--mp-shadow-3);
  }

  .panel { padding: 17px; border-radius: var(--mp-radius); }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .topbar-actions { justify-content: flex-start; }

  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-card strong { font-size: 23px; }

  .users-grid,
  .role-legend-grid,
  .preset-grid { grid-template-columns: 1fr; }

  .form-grid,
  .permissions-grid { grid-template-columns: 1fr; }

  /* Sulle tabelle larghe si scorre in orizzontale invece di comprimere tutto */
  .data-table { font-size: 13px; }
  .data-table thead th,
  .data-table tbody td { padding: 10px 11px; }

  .participant-modal,
  .wide-modal {
    padding: 18px;
    border-radius: var(--mp-radius-lg);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  .form-actions { flex-wrap: wrap; }
  .form-actions .primary-button,
  .form-actions .outline-button { flex: 1 1 46%; justify-content: center; }

  /* Bersagli di tocco piu' comodi */
  .primary-button,
  .outline-button,
  .danger-button,
  .whatsapp-button { min-height: 44px; }

  input,
  select,
  textarea { font-size: 16px; /* evita lo zoom automatico su iPhone */ }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   14. Stampa
   -------------------------------------------------------------------------- */

@media print {
  .sidebar, .malo-sidebar, .mobile-app-header, .topbar-actions { display: none !important; }
  .main-content, .malo-main { margin: 0; width: 100%; padding: 0; }
  .panel { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ==========================================================================
   15. Correzioni con precedenza su app.css
   Queste regole usano selettori piu' specifici per vincere sulle vecchie
   dichiarazioni rimaste in app.css. Non servirebbero se app.css fosse
   riscritto, ma cosi' l'aggiornamento resta reversibile.
   ========================================================================== */

/* I pannelli non devono piu' avere un'altezza minima fissa: lasciavano
   grandi spazi vuoti sotto ai contenuti corti. */
html .panel,
html .panel.table-panel,
html .panel.user-card {
  min-height: 0;
}

html .empty-state {
  min-height: 0;
}

/* Barra laterale: icone e barretta attiva nel rosso del marchio. */
html .malo-sidebar .nav-icon,
html .kpadel-sidebar .nav-icon,
html .sidebar .nav-icon {
  color: var(--mp-brand);
}

html .malo-sidebar .nav-item.active,
html .sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(227, 6, 19, .30), rgba(227, 6, 19, .06));
  box-shadow: inset 3px 0 0 var(--mp-brand);
  color: #fff;
}

html .malo-sidebar,
html .kpadel-sidebar {
  background:
    radial-gradient(130% 60% at 0% 0%, rgba(227, 6, 19, .20), transparent 60%),
    linear-gradient(180deg, var(--mp-ink-900), var(--mp-ink-800) 58%, #101215);
}

html .malo-sidebar .brand > div,
html .sidebar .brand > div {
  min-width: 0;
  flex: 1;
}

html .logout-button:hover {
  border-color: var(--mp-brand);
  color: #fff;
  background: rgba(227, 6, 19, .28);
}

/* Nota gialla -> riquadro informativo neutro. */
html .settings-note {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--mp-border);
  border-left: 3px solid var(--mp-border-strong);
  border-radius: var(--mp-radius-sm);
  background: var(--mp-surface-2);
  color: var(--mp-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Bottoni: le vecchie regole di app.css usavano bordi e sfondi chiari. */
html .danger-button {
  border: 1px solid transparent;
  background: var(--mp-danger);
  color: #fff;
}

html .danger-button:hover { background: #a10310; }

html .text-button { color: var(--mp-brand-strong); }

html .modal-close:hover {
  border-color: var(--mp-brand);
  color: var(--mp-brand);
}

/* Intestazioni scure di calendario e colonne campi, allineate al grafite. */
html .court-column > header,
html .calendar-corner,
html .calendar-court-header,
html .club-hero {
  background: linear-gradient(180deg, var(--mp-ink-800), var(--mp-ink-700));
  color: #fff;
}

html .club-kpi {
  border-color: var(--mp-ink-600);
  background: var(--mp-ink-700);
  border-radius: var(--mp-radius);
}

html .club-kpi strong { color: #fff; }

/* Slot liberi del calendario: evidenziazione rossa invece del verde lime. */
html .calendar-slot:hover:not(:disabled),
html .scheduler-empty-slot:hover {
  background: var(--mp-brand-soft);
  box-shadow: inset 0 0 0 1px rgba(227, 6, 19, .45);
}

/* Schede campo e giocatore allineate alle altre superfici. */
html .court-card,
html .player-card,
html .staff-card,
html .notification-card,
html .settings-card,
html .cash-kpi-card,
html .reception-kpi-card {
  border-color: var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  box-shadow: var(--mp-shadow-1);
}

html .player-icon-card.selected,
html .player-icon-card:hover,
html .player-picker-list > button:hover {
  border-color: var(--mp-brand);
  background: var(--mp-brand-soft);
}

html .nav-subitem:hover,
html .nav-subitem.active {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

/* Tema scuro: superfici e testi presi dai nuovi token. */
html[data-theme='dark'] body,
html[data-theme='dark'] .app-shell,
html[data-theme='dark'] .malo-shell,
html[data-theme='dark'] .main-content,
html[data-theme='dark'] .malo-main {
  background: var(--mp-canvas) !important;
  color: var(--mp-text) !important;
}

html[data-theme='dark'] .panel,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .table-wrapper,
html[data-theme='dark'] .participant-modal,
html[data-theme='dark'] .checklist-row,
html[data-theme='dark'] .role-legend-card,
html[data-theme='dark'] .preset-card {
  background: var(--mp-surface) !important;
  border-color: var(--mp-border) !important;
  color: var(--mp-text) !important;
}

html[data-theme='dark'] .data-table thead th {
  background: var(--mp-surface-3) !important;
  color: var(--mp-text-2) !important;
}

html[data-theme='dark'] .data-table tbody tr:hover {
  background: var(--mp-surface-2) !important;
}

html[data-theme='dark'] .switch-field,
html[data-theme='dark'] fieldset.permissions-box,
html[data-theme='dark'] .settings-note {
  background: var(--mp-surface-2) !important;
  border-color: var(--mp-border) !important;
}

html[data-theme='dark'] .outline-button {
  background: var(--mp-surface-2);
  border-color: var(--mp-border-strong);
  color: var(--mp-text);
}

/* Intestazione della barra laterale su due righe: nome + area, poi lo stato cloud. */
html .malo-brand,
html .sidebar .brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
}

html .malo-brand > img,
html .sidebar .brand > img { flex: 0 0 auto; }

html .malo-brand > div,
html .sidebar .brand > div {
  flex: 1 1 auto;
  min-width: 0;
}

html .malo-brand strong,
html .sidebar .brand strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html .malo-brand > .cloud-status-badge,
html .sidebar .brand > .cloud-status-badge {
  flex: 0 0 auto;
  order: 3;
  margin-left: auto;
}

/* Etichette e bottoni testuali nel tema scuro: niente sfondi chiari residui. */
html[data-theme='dark'] .text-button,
html[data-theme='contrast'] .text-button {
  background: transparent !important;
  color: var(--mp-brand) !important;
}

html[data-theme='dark'] .text-button:hover {
  background: var(--mp-brand-tint) !important;
}

html[data-theme='dark'] .pilot-status,
html[data-theme='dark'] .active-plan-badge,
html[data-theme='dark'] .inactive-plan-badge,
html[data-theme='dark'] .connection-pill,
html[data-theme='dark'] .sport-chip,
html[data-theme='dark'] .payment-pill,
html[data-theme='dark'] .court-status {
  background: var(--mp-surface-3) !important;
  color: var(--mp-text-2) !important;
}

html[data-theme='dark'] .status-delivered,
html[data-theme='dark'] .status-read,
html[data-theme='dark'] .status-processed,
html[data-theme='dark'] .active-plan-badge,
html[data-theme='dark'] .pill-ok {
  background: var(--mp-success-soft) !important;
  color: var(--mp-success) !important;
}

html[data-theme='dark'] .status-failed {
  background: var(--mp-danger-soft) !important;
  color: var(--mp-danger) !important;
}

html[data-theme='dark'] .status-sent,
html[data-theme='dark'] .status-received,
html[data-theme='dark'] .pill-warn {
  background: var(--mp-info-soft) !important;
  color: var(--mp-info) !important;
}

html[data-theme='dark'] .inline-notice {
  background: var(--mp-surface) !important;
  border-color: var(--mp-border) !important;
}

html[data-theme='dark'] .inline-notice.notice-ok { border-left-color: var(--mp-success); }
html[data-theme='dark'] .inline-notice.notice-error { border-left-color: var(--mp-danger); }
html[data-theme='dark'] .inline-notice.notice-info { border-left-color: var(--mp-info); }

/* ==========================================================================
   16. Area giocatore — Alpha 38
   Primo accesso, home del giocatore, preferenze.
   Tutto costruito con le variabili sopra, quindi segue automaticamente
   il tema chiaro e quello scuro.
   ========================================================================== */

/* --- 16.1 Primo accesso (schermata senza menu) --------------------------- */

.setup-page {
  min-height: 100dvh;
  background:
    radial-gradient(1100px 520px at 12% -12%, var(--mp-brand-tint), transparent 62%),
    var(--mp-canvas);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 4vw, 48px) clamp(12px, 4vw, 32px) 64px;
}

.setup-card {
  width: min(760px, 100%);
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-xl);
  box-shadow: var(--mp-shadow-3);
  overflow: hidden;
}

.setup-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: clamp(20px, 4vw, 32px);
  background: linear-gradient(140deg, var(--mp-ink-900), var(--mp-ink-700));
  color: #fff;
}

.setup-header .malo-brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .08);
  padding: 6px;
}

.setup-header .eyebrow { color: var(--mp-brand); }
.setup-header h1 {
  margin: 2px 0 8px;
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  letter-spacing: -.02em;
  color: #fff;
}
.setup-intro {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: .95rem;
  line-height: 1.55;
  max-width: 52ch;
}

.setup-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(20px, 4vw, 32px);
  border-bottom: 1px solid var(--mp-border);
  background: var(--mp-surface-2);
}
.setup-progress > span {
  font-size: .78rem;
  font-weight: 700;
  color: var(--mp-muted);
  white-space: nowrap;
}
.setup-progress-track {
  flex: 1 1 auto;
  height: 7px;
  border-radius: 999px;
  background: var(--mp-surface-3);
  overflow: hidden;
}
.setup-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mp-brand), var(--mp-brand-strong));
  transition: width .3s ease;
}

.setup-form {
  display: grid;
  gap: 4px;
  padding: clamp(16px, 4vw, 28px);
}

.setup-step {
  border: 0;
  border-top: 1px solid var(--mp-border);
  margin: 0;
  padding: 22px 0 6px;
  display: grid;
  gap: 18px;
}
.setup-step:first-of-type { border-top: 0; padding-top: 4px; }

.setup-step > legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--mp-text);
  padding: 0;
  margin-bottom: 2px;
}

.setup-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--mp-brand);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}

.setup-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.setup-hint,
.setup-warning {
  margin: 6px 0 0;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--mp-muted);
}
.setup-warning { color: var(--mp-warning); }

/* Solo la PRIMA riga di un campo e' l'etichetta: i suggerimenti sotto
   restano piccoli e grigi. */
.setup-step .form-field > span:first-child,
.preferences-panel .form-field > span:first-child {
  font-weight: 600;
  font-size: .84rem;
  color: var(--mp-text-2);
}
.setup-step .form-field > span.setup-hint,
.preferences-panel .form-field > span.setup-hint,
.setup-step .form-field > span.setup-warning,
.preferences-panel .form-field > span.setup-warning {
  display: block;
  margin-top: 6px;
  font-weight: 400;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--mp-muted);
}
.setup-step .form-field > span.setup-warning,
.preferences-panel .form-field > span.setup-warning { color: var(--mp-warning); }
.setup-step .form-field em,
.preferences-panel .form-field em {
  font-style: normal;
  font-weight: 500;
  color: var(--mp-muted);
  font-size: .76rem;
}

/* --- 16.2 Pulsanti a pastiglia -------------------------------------------- */

.setup-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.setup-chip-row.wrap { gap: 6px; }

.setup-chip {
  appearance: none;
  border: 1px solid var(--mp-border-strong);
  background: var(--mp-surface);
  color: var(--mp-text-2);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  transition: background .16s ease, color .16s ease, border-color .16s ease,
    transform .1s ease;
}
.setup-chip:hover {
  border-color: var(--mp-brand);
  color: var(--mp-brand);
}
.setup-chip:active { transform: translateY(1px); }
.setup-chip.active {
  background: var(--mp-brand);
  border-color: var(--mp-brand);
  color: #fff;
}
.setup-chip:focus-visible { outline: none; box-shadow: var(--mp-ring); }

/* --- 16.3 Consensi -------------------------------------------------------- */

.setup-consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
  cursor: pointer;
}
.setup-consent:hover { border-color: var(--mp-border-strong); }
.setup-consent input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--mp-brand);
  cursor: pointer;
}
.setup-consent > span { display: grid; gap: 4px; }
.setup-consent strong { font-size: .92rem; color: var(--mp-text); }
.setup-consent em {
  font-style: normal;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--mp-muted);
}

.setup-actions {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-top: 22px;
  margin-top: 6px;
  border-top: 1px solid var(--mp-border);
}
.setup-submit {
  width: min(340px, 100%);
  min-height: 50px;
  font-size: 1rem;
}
.setup-footnote {
  margin: 0;
  font-size: .78rem;
  color: var(--mp-muted);
  text-align: center;
}

/* --- 16.4 Home del giocatore ---------------------------------------------- */

.player-home { display: grid; gap: 22px; }

.home-message { margin: 0; }

.home-block {
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  box-shadow: var(--mp-shadow-1);
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  gap: 16px;
}

.home-block-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.home-block-head h2 {
  margin: 2px 0 4px;
  font-size: 1.18rem;
  letter-spacing: -.015em;
}
.home-block-note {
  margin: 0;
  font-size: .84rem;
  color: var(--mp-muted);
}
.home-inline-notice {
  margin: 0;
  font-size: .84rem;
  color: var(--mp-info);
  background: var(--mp-info-soft);
  padding: 8px 12px;
  border-radius: var(--mp-radius-sm);
}

/* Circoli vicini */
.home-club-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.home-club-card {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  overflow: hidden;
  background: var(--mp-surface);
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.home-club-card:hover {
  box-shadow: var(--mp-shadow-2);
  transform: translateY(-2px);
}
.home-club-cover {
  height: 110px;
  background-size: cover;
  background-position: center;
  background-color: var(--mp-surface-3);
}
.home-club-cover.placeholder {
  height: 84px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--mp-ink-800), var(--mp-ink-600));
}
.home-club-cover.placeholder span {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .55);
}
.home-club-cover.placeholder img {
  max-height: 62px;
  max-width: 70%;
  object-fit: contain;
}
.home-club-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.home-club-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}
.home-club-title h3 { margin: 0; font-size: 1.02rem; }
.distance-badge {
  flex: 0 0 auto;
  font-size: .76rem;
  font-weight: 700;
  color: var(--mp-brand);
  background: var(--mp-brand-soft);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.home-club-address { margin: 0; font-size: .85rem; color: var(--mp-text-2); }
.home-club-meta {
  display: flex;
  gap: 14px;
  font-size: .78rem;
  color: var(--mp-muted);
}
.home-club-body .primary-button { margin-top: 6px; justify-self: start; }

/* Giocatori suggeriti */
.home-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.home-player-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
}
.home-player-body { display: grid; gap: 3px; min-width: 0; }
.home-player-body strong { font-size: .96rem; }
.home-player-where { font-size: .79rem; color: var(--mp-muted); }
.home-player-reasons {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.home-player-reasons li {
  font-size: .78rem;
  color: var(--mp-text-2);
  padding-left: 15px;
  position: relative;
  line-height: 1.4;
}
.home-player-reasons li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .48em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mp-brand);
}
.home-see-all {
  grid-column: 1 / -1;
  justify-self: center;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: .86rem;
  color: var(--mp-brand);
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--mp-radius-sm);
  min-height: 40px;
}
.home-see-all:hover { background: var(--mp-brand-soft); }

/* Partite aperte */
.home-match-controls {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.compact-field { min-width: 165px; }
.toggle-pill {
  appearance: none;
  border: 1px solid var(--mp-border-strong);
  background: var(--mp-surface);
  color: var(--mp-text-2);
  border-radius: 999px;
  padding: 0 16px;
  min-height: 44px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.toggle-pill.active {
  background: var(--mp-brand);
  border-color: var(--mp-brand);
  color: #fff;
}

.home-match-list { display: grid; gap: 10px; }
.home-match-card {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--mp-border);
  border-left: 4px solid var(--mp-border-strong);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
}
.home-match-card.from-friend { border-left-color: var(--mp-brand); }
.home-match-time {
  display: grid;
  gap: 2px;
  text-align: center;
  padding-right: 14px;
  border-right: 1px solid var(--mp-border);
}
.home-match-time strong { font-size: 1.2rem; letter-spacing: -.02em; }
.home-match-time span { font-size: .74rem; color: var(--mp-muted); }
.home-match-body { display: grid; gap: 4px; min-width: 0; }
.home-match-title {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.home-match-title strong { font-size: .98rem; }
.match-tag {
  font-size: .69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.match-tag.friend { background: var(--mp-brand-soft); color: var(--mp-brand-strong); }
.match-tag.club { background: var(--mp-info-soft); color: var(--mp-info); }
.match-tag.slot { background: var(--mp-success-soft); color: var(--mp-success); }
.home-match-meta,
.home-match-players {
  font-size: .8rem;
  color: var(--mp-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-match-action {
  display: grid;
  gap: 8px;
  justify-items: end;
}
.spots-badge {
  font-size: .74rem;
  font-weight: 700;
  color: var(--mp-success);
  background: var(--mp-success-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* --- 16.5 Preferenze ------------------------------------------------------ */

.preferences-form { display: grid; gap: 18px; }
.preferences-panel {
  display: grid;
  gap: 18px;
  min-height: 0;
}
.preferences-panel h2 { margin: 0; font-size: 1.1rem; }
.preferences-actions { border-top: 1px solid var(--mp-border); padding-top: 18px; }

/* --- 16.6 Amici: righe senza email --------------------------------------- */

.friend-row-body { display: grid; gap: 2px; min-width: 0; }
.friend-row-body strong { font-size: .94rem; }
.friend-row-body span { font-size: .79rem; color: var(--mp-muted); }
.friend-privacy-note {
  margin: 0;
  font-size: .79rem;
  color: var(--mp-muted);
  line-height: 1.5;
}

/* --- 16.7 Telefono -------------------------------------------------------- */

@media (max-width: 720px) {
  .setup-page { padding: 0 0 40px; }
  .setup-card { border-radius: 0; border-left: 0; border-right: 0; min-height: 100dvh; }
  .setup-submit { width: 100%; }

  .home-match-card {
    grid-template-columns: 72px 1fr;
    row-gap: 10px;
  }
  .home-match-action {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-items: stretch;
    justify-content: space-between;
    align-items: center;
  }
  .home-match-action .primary-button { min-width: 150px; }
  .home-match-meta,
  .home-match-players { white-space: normal; }

  .home-player-card { grid-template-columns: 40px 1fr; }
  .home-player-card > button { grid-column: 2; justify-self: start; }

  .home-block-head { flex-direction: column; align-items: stretch; }
  .home-match-controls { justify-content: space-between; }
}

/* --- 16.8 Tema scuro: correzioni mirate ---------------------------------- */

html[data-theme='dark'] .setup-header {
  background: linear-gradient(140deg, #16181b, #202427);
}
html[data-theme='dark'] .home-club-cover.placeholder {
  background: linear-gradient(135deg, #1c2024, #2a3036);
}
html[data-theme='dark'] .setup-chip.active,
html[data-theme='dark'] .toggle-pill.active {
  color: #14171a;
}
html[data-theme='dark'] .distance-badge {
  background: var(--mp-brand-tint);
  color: var(--mp-brand);
}

/* La striscia verde ereditata dal vecchio tema stonava con il rosso Malo. */
.friend-game-card { border-left-color: var(--mp-brand) !important; }

/* --- 16.9 Collegamento tramite contatti ---------------------------------- */

.consent-explainer {
  margin: 0;
  font-size: .87rem;
  line-height: 1.6;
  color: var(--mp-text-2);
  max-width: 68ch;
}

.setup-consent.consent-primary {
  border-color: var(--mp-brand);
  background: var(--mp-brand-soft);
}
.setup-consent.consent-primary strong { color: var(--mp-brand-strong); }

.contact-book {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--mp-border-strong);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
}
.contact-book-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}
.contact-book-head > div { display: grid; gap: 2px; }
.contact-book-head strong { font-size: .94rem; }
.contact-book-head span { font-size: .8rem; color: var(--mp-muted); }
.contact-book textarea {
  font-family: var(--mp-font);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}
.contact-book-note {
  margin: 0;
  font-size: .78rem;
  line-height: 1.55;
  color: var(--mp-muted);
  max-width: 70ch;
}
.contact-book > button { justify-self: start; }

/* --- 16.10 Schermata di blocco: non piu' un vicolo cieco ------------------ */

.permission-denied-card { display: grid; gap: 12px; text-align: left; }
.permission-denied-card h1 { margin: 0; font-size: 1.35rem; }
.permission-denied-card p { margin: 0; color: var(--mp-text-2); line-height: 1.6; }
.permission-denied-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.permission-denied-actions .primary-button,
.permission-denied-actions .outline-button {
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 20px;
}

html[data-theme='dark'] .setup-consent.consent-primary {
  background: var(--mp-brand-tint);
  border-color: var(--mp-brand);
}

/* --- 16.11 Provincia e comune, consenso del genitore, prezzi -------------- */

.city-picker { position: relative; }
.city-picker-note {
  grid-column: 1 / -1;
  margin: -6px 0 0;
}
.link-button {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 0 0;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: var(--mp-brand);
  cursor: pointer;
  justify-self: start;
  text-align: left;
}
.link-button:hover { text-decoration: underline; }

.setup-step-guardian {
  border-top: 0;
  padding: 18px;
  margin: 8px 0;
  border-radius: var(--mp-radius);
  background: var(--mp-warning-soft);
  border: 1px solid color-mix(in srgb, var(--mp-warning) 30%, transparent);
}
.setup-step-guardian > legend { color: var(--mp-warning); }
.setup-step-guardian .setup-step-number {
  background: var(--mp-warning);
  color: #fff;
}
.guardian-note {
  margin: 0 0 4px !important;
  line-height: 1.6;
  max-width: 66ch;
}
.guardian-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--mp-radius);
  background: var(--mp-warning-soft);
  border: 1px solid color-mix(in srgb, var(--mp-warning) 30%, transparent);
}

.booking-price-total {
  font-size: 1.15rem !important;
  font-weight: 800;
  color: var(--mp-text) !important;
  letter-spacing: -.02em;
}
.booking-price-share {
  font-weight: 600;
  color: var(--mp-brand) !important;
}
.booking-price-note {
  display: block;
  margin-top: 4px;
  font-size: .76rem;
  color: var(--mp-muted);
}

html[data-theme='dark'] .setup-step-guardian,
html[data-theme='dark'] .guardian-box {
  background: var(--mp-warning-soft);
  border-color: color-mix(in srgb, var(--mp-warning) 40%, transparent);
}

/* ==========================================================================
   17. Pagina di accesso — Alpha 38
   ========================================================================== */

/* --- 17.1 Il campo con i quattro giocatori ------------------------------- */

.padel-scene {
  display: block;
  width: min(460px, 100%);
  height: auto;
  margin: 22px 0 6px;
  overflow: visible;
}

.padel-scene-glass rect { transition: fill .3s ease; }

/* La pallina segue un rimbalzo fra i due campi. */
.padel-scene-ball {
  transform: translate(150px, 96px);
  animation: mp-ball-rally 3.4s cubic-bezier(.42, 0, .58, 1) infinite;
}

@keyframes mp-ball-rally {
  0%   { transform: translate(160px, 104px); }
  25%  { transform: translate(210px, 62px); }
  50%  { transform: translate(268px, 108px); }
  75%  { transform: translate(210px, 62px); }
  100% { transform: translate(160px, 104px); }
}

.padel-figure { transform-box: fill-box; transform-origin: bottom center; }
.figure-swing { animation: mp-figure-swing 3.4s ease-in-out infinite; }
.figure-sway { animation: mp-figure-sway 3.4s ease-in-out infinite; }
.figure-sway-slow { animation: mp-figure-sway 4.6s ease-in-out infinite; }

/* L'animazione agisce sul gruppo, che ha gia' la sua transform: usiamo
   quindi solo una leggera rotazione, applicata dal browser dopo quella. */
@keyframes mp-figure-swing {
  0%, 100% { rotate: 0deg; }
  22%      { rotate: -5deg; }
  46%      { rotate: 2deg; }
}
@keyframes mp-figure-sway {
  0%, 100% { rotate: 0deg; }
  50%      { rotate: 3deg; }
}

@media (prefers-reduced-motion: reduce) {
  .padel-scene-ball,
  .figure-swing,
  .figure-sway,
  .figure-sway-slow { animation: none; }
  .padel-scene-ball { transform: translate(210px, 74px); }
}

/* Il pannello di sinistra e' scuro: la scena deve reggere su quello sfondo. */
.login-brand-panel .padel-scene-glass rect {
  fill: rgba(227, 6, 19, .10);
  stroke: rgba(255, 255, 255, .28);
}
.login-brand-panel .padel-scene-glass path { stroke: rgba(255, 255, 255, .22); }
.login-brand-panel .padel-scene-net path,
.login-brand-panel .padel-scene-net rect { stroke: rgba(255, 255, 255, .55); }
.login-brand-panel .padel-scene > path { stroke: rgba(255, 255, 255, .45); }
.login-brand-panel .padel-figure.team-ospite { color: rgba(255, 255, 255, .88) !important; }
.login-brand-panel .padel-scene-glass rect { fill: rgba(227, 6, 19, .13); }

.login-message-subtitle {
  margin: 8px 0 0;
  font-size: .95rem;
  line-height: 1.6;
  opacity: .82;
  max-width: 46ch;
}

.register-role-note {
  margin: 2px 0 0;
  font-size: .8rem;
  line-height: 1.55;
  color: var(--mp-muted);
  background: var(--mp-surface-2);
  border-left: 3px solid var(--mp-brand);
  border-radius: 0 var(--mp-radius-sm) var(--mp-radius-sm) 0;
  padding: 10px 12px;
}

/* --- 17.2 Pagina di amministrazione dell'aspetto ------------------------- */

.appearance-page { display: grid; gap: 18px; }

.appearance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 18px;
  align-items: start;
}
.appearance-controls { display: grid; gap: 18px; min-width: 0; }

.appearance-logo-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.appearance-logo-preview {
  width: 210px;
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed var(--mp-border-strong);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
}
.appearance-logo-preview img { max-width: 100%; max-height: 92px; object-fit: contain; }
.appearance-logo-actions { display: grid; gap: 8px; justify-items: start; }

.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.appearance-text-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.appearance-sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.appearance-sponsor-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface-2);
}
.appearance-sponsor-preview {
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: var(--mp-radius-sm);
  background: var(--mp-surface-3);
  color: var(--mp-muted);
  font-size: .78rem;
  overflow: hidden;
}
.appearance-sponsor-preview img { max-width: 92%; max-height: 56px; object-fit: contain; }
.appearance-sponsor-actions { display: flex; gap: 10px; align-items: center; }

.appearance-preview-panel { position: sticky; top: 18px; }
.appearance-preview {
  border-radius: var(--mp-radius-lg);
  padding: 22px;
  background: linear-gradient(150deg, var(--mp-ink-900), var(--mp-ink-700));
  color: #fff;
  display: grid;
  gap: 10px;
}
.appearance-preview .eyebrow { color: var(--mp-brand); }
.appearance-preview h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  color: #fff;
}
.appearance-preview-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}
.appearance-preview-brand img {
  width: 74px;
  height: 46px;
  object-fit: contain;
  background: rgba(255, 255, 255, .96);
  border-radius: 8px;
  padding: 4px;
}
.appearance-preview-brand strong { display: block; font-size: .96rem; }
.appearance-preview-brand span { font-size: .76rem; opacity: .7; }
.appearance-preview .preview-scene { width: 100%; margin: 6px 0 2px; }
.appearance-preview .padel-scene-glass rect {
  fill: rgba(227, 6, 19, .12);
  stroke: rgba(255, 255, 255, .26);
}
.appearance-preview .padel-scene-glass path { stroke: rgba(255, 255, 255, .2); }
.appearance-preview .padel-scene-net path,
.appearance-preview .padel-scene-net rect { stroke: rgba(255, 255, 255, .5); }
.appearance-preview .padel-scene > path { stroke: rgba(255, 255, 255, .4); }
.appearance-preview .padel-figure.team-ospite { color: rgba(255, 255, 255, .86) !important; }

.appearance-preview-card {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border-radius: var(--mp-radius);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
}
.appearance-preview-card strong { font-size: 1rem; }
.appearance-preview-card span { font-size: .8rem; opacity: .72; }

@media (max-width: 980px) {
  .appearance-layout { grid-template-columns: 1fr; }
  .appearance-preview-panel { position: static; }
}

/* --- 17.3 Pannello di sinistra: colori corretti --------------------------
   Il tema premium impone un colore ai titoli, e su questo pannello scuro
   rendeva il titolo praticamente invisibile. Qui lo riportiamo al bianco e
   sostituiamo il verde lime rimasto dal tema precedente.                    */

.login-brand-panel {
  background:
    radial-gradient(circle at 18% 78%, rgba(227, 6, 19, .18), transparent 42%),
    radial-gradient(circle at 82% 8%, rgba(227, 6, 19, .10), transparent 46%),
    linear-gradient(165deg, #14161a 0%, #0d0e10 60%, #121417 100%) !important;
  color: #fff !important;
}

.login-brand-panel h1,
.login-brand-panel h2,
.login-brand-panel strong,
.login-message h1 {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  background: none !important;
}

.login-message .eyebrow,
.login-brand-panel .eyebrow {
  color: var(--mp-brand) !important;
  letter-spacing: .12em;
}

.login-brand-panel .login-brand > div span,
.login-message > p:not(.eyebrow) { color: rgba(255, 255, 255, .74) !important; }

.login-brand-logo {
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--mp-shadow-2);
}

.login-sponsors header span { color: rgba(255, 255, 255, .92) !important; }
.login-sponsors header small { color: rgba(255, 255, 255, .55) !important; }
.login-sponsors article {
  border-color: rgba(255, 255, 255, .18) !important;
  color: rgba(255, 255, 255, .6) !important;
}
.login-sponsors article img { max-width: 88%; max-height: 44px; object-fit: contain; }

/* --- 18. Qualifiche dello staff ------------------------------------------ */

.qualifications-page { display: grid; gap: 18px; }

.qualification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.qualification-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
}
.qualification-card.is-disabled { opacity: .62; }
.qualification-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.qualification-head h3 { margin: 0 0 6px; font-size: 1.05rem; }
.qualification-head > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qualification-head > div > h3 { flex: 1 1 100%; }
.qualification-description {
  margin: 0;
  font-size: .84rem;
  line-height: 1.55;
  color: var(--mp-text-2);
}
.qualification-permissions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.qualification-permissions li {
  font-size: .78rem;
  color: var(--mp-muted);
  padding-left: 15px;
  position: relative;
  line-height: 1.4;
}
.qualification-permissions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .48em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mp-brand);
}
.qualification-permissions li.muted-copy::before { display: none; }
.qualification-permissions li.muted-copy { padding-left: 0; font-style: italic; }

.qualification-permission-picker { display: grid; gap: 14px; margin-top: 4px; }
.qualification-permission-picker h3 { margin: 0; font-size: 1rem; }

/* ==========================================================================
   9. Leggibilita' — revisione del contrasto (Alpha 38.6)
   --------------------------------------------------------------------------
   Diversi testi stavano sotto la soglia AA delle linee guida WCAG (4.5:1 per
   il testo normale): si confondevano con lo sfondo. Ogni valore qui sotto e'
   stato misurato, e accanto e' annotato il rapporto ottenuto.
   ========================================================================== */

/* Le etichette delle sezioni del menu erano quasi invisibili: 3.59:1. */
html .nav-section-label {
  color: rgba(255, 255, 255, .62);          /* 7.46:1 */
}

/* Voci figlie del menu (Campi sotto Impostazioni). */
html .nav-submenu {
  padding: 2px 0 6px 46px;
}
html .nav-subitem {
  display: block;
  padding: 8px 12px;
  border-radius: var(--mp-radius-sm);
  color: rgba(255, 255, 255, .70);          /* 9.10:1 */
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
html .nav-subitem:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
html .nav-subitem.active {
  background: linear-gradient(90deg, rgba(227, 6, 19, .26), rgba(227, 6, 19, .04));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--mp-brand);
}

/* Il verde di WhatsApp e' pensato per le icone, non per il testo bianco:
   su #25d366 il bianco stava a 1.98:1, praticamente illeggibile. */
html .whatsapp-button {
  background: #0e7a3f !important;           /* bianco su questo: 5.42:1 */
  border-color: #0b6b37 !important;
  color: #fff !important;
}
html .whatsapp-button:hover {
  background: #0b6b37 !important;           /* 6.62:1 */
}

/* Grigi troppo chiari su fondo chiaro. */
html .inactive-plan-badge {
  color: #5f6862 !important;                /* 5.03:1 */
}
html .participants-table th,
html .data-table thead th {
  color: #4f585e;                           /* 6.66:1 */
}
html .player-icon-card {
  color: #5f6a64;                           /* 5.32:1 */
}
html .club-branding-preview,
html .club-image-upload-preview {
  color: #5c6660;                           /* 5.07:1 */
}
html .smart-date-trigger {
  color: var(--mp-text);
}
html .member-count,
html .wallet-ledger span,
html .wallet-ledger small,
html .selected-player-title span,
html .player-picker-list small {
  color: #525b62;                           /* 6.35:1 */
}

/* Testo attenuato: era a 4.36:1 sulla tela chiara, appena sotto la soglia. */
:root {
  --mp-muted: #5f686f;                      /* 5.20:1 */
}

/* --------------------------------------------------------------------------
   Tema Estate
   Il tema esiste da tempo in app.css, ma non aveva i token di questo foglio:
   restavano quelli chiari, e i due insiemi di regole si contraddicevano.
   -------------------------------------------------------------------------- */
html[data-theme='summer'] {
  color-scheme: light;
  --mp-brand: #d94a12;
  --mp-brand-strong: #b93a08;
  --mp-brand-soft: #ffeadd;
  --mp-brand-tint: rgba(217, 74, 18, .10);

  --mp-ink-900: #482317;
  --mp-ink-800: #63291c;
  --mp-ink-700: #7b3022;
  --mp-ink-600: #8d4030;

  --mp-canvas: #fff3df;
  --mp-canvas-2: #ffecd0;
  --mp-surface: #fffaf0;
  --mp-surface-2: #fff5e4;
  --mp-surface-3: #ffeed6;

  --mp-text: #442414;                       /* 13.38:1 */
  --mp-text-2: #6d452b;                     /*  7.96:1 */
  --mp-muted: #7a4f33;                      /*  6.74:1 */
  --mp-border: #e8b184;
  --mp-border-strong: #cf8f5c;

  --mp-danger: #b3200f;
  --mp-danger-soft: #ffe7e2;
  --mp-warning: #8a5b00;
  --mp-warning-soft: #fff2d4;
  --mp-success: #17663f;
  --mp-success-soft: #e2f3e8;
  --mp-info: #1a5f9e;
  --mp-info-soft: #e6f0fa;

  --mp-ring: 0 0 0 3px rgba(217, 74, 18, .22);
}
html[data-theme='summer'] .sidebar,
html[data-theme='summer'] .malo-sidebar {
  background: linear-gradient(180deg, var(--mp-ink-900), var(--mp-ink-700));
}
html[data-theme='summer'] .nav-item.active {
  background: #ffd166;
  color: #442414;                           /* 9.66:1 */
  box-shadow: inset 3px 0 0 #b93a08;
}
html[data-theme='summer'] .nav-item.active .nav-icon {
  color: #8d3a10;
}

/* Nel tema ad alto contrasto la barra laterale e' nera: le etichette
   attenuate vanno alzate anche li'. */
html[data-theme='contrast'] .nav-section-label {
  color: rgba(255, 255, 255, .72);
}
html[data-theme='contrast'] .nav-item {
  color: #fff;
}
html[data-theme='contrast'] .nav-subitem {
  color: rgba(255, 255, 255, .82);
}

/* Il marchio in cima al menu ora mostra il logo del circolo, che di solito e'
   quadrato: il riquadro largo 112x58 pensato per la scritta Malo lo lasciava
   sperduto in mezzo al bianco. */
html .malo-brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 11px;
  background: #fff;
  padding: 3px;
}
html .malo-brand-logo.compact {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
html .brand strong,
html .malo-brand strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

/* ==========================================================================
   10. Tema Inverno
   --------------------------------------------------------------------------
   Azzurri freddi, ghiaccio e neve, pensato per la stagione indoor.
   A differenza di Estate, che era nato solo con i token --malo-* di app.css e
   litigava con questo foglio, Inverno definisce entrambi gli insiemi: cosi'
   nessuna regola resta con i colori di un altro tema.
   Ogni valore e' misurato; il rapporto e' annotato accanto.
   ========================================================================== */

html[data-theme='winter'] {
  color-scheme: light;

  /* Insieme nuovo (theme-premium.css) */
  --mp-brand: #0d6091;                       /* bianco sopra: 6,78:1 */
  --mp-brand-strong: #094b73;
  --mp-brand-soft: #e2eff8;
  --mp-brand-tint: rgba(13, 96, 145, .10);

  --mp-ink-900: #0b1a26;
  --mp-ink-800: #12293a;
  --mp-ink-700: #17364c;
  --mp-ink-600: #1e455f;

  --mp-canvas: #e9f0f6;
  --mp-canvas-2: #dfe9f2;
  --mp-surface: #f7fafc;
  --mp-surface-2: #eef4f9;
  --mp-surface-3: #e3ecf4;

  --mp-text: #0f2231;                        /* 15,49:1 su superficie */
  --mp-text-2: #33566e;                      /*  7,43:1 */
  --mp-muted: #4a6b82;                       /*  5,39:1 */
  --mp-border: #c3d5e3;
  --mp-border-strong: #9db6ca;

  --mp-danger: #b3200f;                      /* 6,40:1 */
  --mp-danger-soft: #fbe6e3;
  --mp-warning: #8a5b00;                     /* 5,60:1 */
  --mp-warning-soft: #fdf1d9;
  --mp-success: #0f7a4d;                     /* 5,12:1 */
  --mp-success-soft: #e2f3ea;
  --mp-info: #0a6ea8;                        /* 5,26:1 */
  --mp-info-soft: #e2eff8;

  --mp-shadow-1: 0 1px 2px rgba(15, 34, 49, .06), 0 1px 3px rgba(15, 34, 49, .05);
  --mp-shadow-2: 0 2px 4px rgba(15, 34, 49, .05), 0 8px 20px rgba(15, 34, 49, .10);
  --mp-shadow-3: 0 14px 36px rgba(15, 34, 49, .18), 0 2px 8px rgba(15, 34, 49, .08);
  --mp-ring: 0 0 0 3px rgba(13, 96, 145, .22);

  /* Insieme storico (app.css): senza questo, le regole vecchie
     resterebbero con i colori del tema chiaro. */
  --malo-canvas: #e9f0f6;
  --malo-surface: #f7fafc;
  --malo-surface-soft: #eef4f9;
  --malo-text: #0f2231;
  --malo-muted: #4a6b82;
  --malo-border: #c3d5e3;
  --malo-input: #ffffff;
  --malo-shadow: rgba(15, 34, 49, .12);
}

html[data-theme='winter'] body,
html[data-theme='winter'] .app-shell,
html[data-theme='winter'] .malo-shell,
html[data-theme='winter'] .main-content,
html[data-theme='winter'] .malo-main,
html[data-theme='winter'] .route-loading {
  background: linear-gradient(160deg, #f2f7fb, #dfe9f2) fixed;
  color: var(--mp-text);
}

html[data-theme='winter'] .sidebar,
html[data-theme='winter'] .malo-sidebar {
  /* Il velo colorato in alto segue l'accento del tema, non il rosso. */
  background:
    radial-gradient(130% 60% at 0% 0%, rgba(90, 170, 220, .22), transparent 60%),
    linear-gradient(180deg, var(--mp-ink-900), var(--mp-ink-800) 58%, var(--mp-ink-700));
}

html[data-theme='winter'] .nav-item {
  color: rgba(255, 255, 255, .74);           /* 8,7:1 sul fondo della barra */
}
html[data-theme='winter'] .nav-section-label {
  color: rgba(255, 255, 255, .66);           /* 7,2:1 */
}
html[data-theme='winter'] .nav-subitem {
  color: rgba(255, 255, 255, .74);
}
html[data-theme='winter'] .nav-icon {
  color: #7ec8f2;                            /* 7,4:1 sul fondo della barra */
}
html[data-theme='winter'] .nav-item.active,
html[data-theme='winter'] .nav-subitem.active {
  background: linear-gradient(90deg, rgba(126, 200, 242, .30), rgba(126, 200, 242, .05));
  color: #fff;
  box-shadow: inset 3px 0 0 #7ec8f2;
}
html[data-theme='winter'] .nav-item.active .nav-icon {
  color: #cbe9fb;
}

html[data-theme='winter'] :where(.panel, .stat-card, .participant-modal, .smart-date-popover,
  .reception-date-picker, .court-card, .person-card, .staff-card, .notification-card,
  .cash-kpi-card, .reception-kpi-card, .appearance-mode-option, .player-photo-editor,
  .table-wrapper, .checklist-row, .preset-card) {
  background: var(--mp-surface);
  color: var(--mp-text);
  border-color: var(--mp-border);
  box-shadow: var(--mp-shadow-1);
}

html[data-theme='winter'] :where(input, select, textarea, output, .smart-date-trigger) {
  background: #ffffff;
  color: var(--mp-text);
  border-color: var(--mp-border-strong);
}
html[data-theme='winter'] :where(input, textarea)::placeholder {
  color: #5b7183;                            /* 5,08:1 sul bianco */
}

html[data-theme='winter'] .primary-button {
  background: linear-gradient(135deg, #0d6091, #094b73);
  border-color: transparent;
  color: #fff;                               /* 6,78:1 */
}
html[data-theme='winter'] .outline-button {
  border-color: var(--mp-border-strong);
  color: var(--mp-text);
  background: var(--mp-surface);
}
html[data-theme='winter'] .data-table thead th,
html[data-theme='winter'] .participants-table th {
  color: #33566e;                            /* 7,43:1 */
  background: var(--mp-surface-2);
}
html[data-theme='winter'] .settings-note {
  background: var(--mp-info-soft);
  color: #0d4a70;
}
html[data-theme='winter'] .scheduler-empty-slot.recommended-slot {
  background: transparent;
  color: #0a6ea8;
  box-shadow: none;
}
html[data-theme='winter'] .scheduler-empty-slot.recommended-slot span {
  background: #dbecf8;
}

/* ==========================================================================
   11. Correzioni (Alpha 38.7)
   ========================================================================== */

/* Il menu da telefono non si apriva.
   In app.css la barra laterale viene spinta fuori schermo con
   "transform: translateX(-105%)" su ".sidebar, .kpadel-sidebar", ma la regola
   che la riporta dentro e' scritta per ".kpadel-sidebar.mobile-open" - un nome
   di classe che l'applicazione non usa piu': oggi rende "sidebar malo-sidebar".
   Risultato: la barra veniva nascosta e nulla la riportava indietro, quindi le
   tre linee non aprivano niente. */
@media (max-width: 860px) {
  html .sidebar.mobile-open,
  html .malo-sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Il velo dietro al menu, che chiude toccando fuori. */
  html .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    border: 0;
    background: rgba(0, 0, 0, .45);
  }
  html .mobile-menu-close {
    display: inline-flex;
  }
}

/* I pulsanti + e - dei servizi extra, in modalita' scura.
   Erano bianchi con bordo grigio chiaro: su fondo scuro il segno spariva e il
   pulsante si confondeva con il pannello. */
html[data-theme='dark'] .quantity-stepper button,
html[data-theme='contrast'] .quantity-stepper button,
html[data-theme='winter'] .quantity-stepper button {
  background: var(--mp-surface-3);
  border-color: var(--mp-border-strong);
  color: var(--mp-text);                     /* 10:1 e oltre su tutti e tre */
  font-weight: 700;
}
html[data-theme='dark'] .quantity-stepper button:hover,
html[data-theme='contrast'] .quantity-stepper button:hover,
html[data-theme='winter'] .quantity-stepper button:hover {
  background: var(--mp-brand-soft);
  border-color: var(--mp-brand);
}
html[data-theme='dark'] .quantity-stepper button:disabled,
html[data-theme='contrast'] .quantity-stepper button:disabled,
html[data-theme='winter'] .quantity-stepper button:disabled {
  opacity: .45;
}
html .quantity-stepper strong {
  color: var(--mp-text);
}

/* La partita il cui orario e' finito con delle quote ancora da saldare.
   Non e' un dettaglio estetico: e' gente che se ne sta andando senza pagare. */
html .reception-booking.scaduta-non-saldata {
  border-color: var(--mp-danger) !important;
  box-shadow: 0 0 0 1px var(--mp-danger);
}
html .reception-booking.scaduta-non-saldata > header {
  background: var(--mp-danger-soft) !important;
}
html .reception-booking.scaduta-non-saldata .reception-time strong {
  color: var(--mp-danger);
}

/* ==========================================================================
   12. Correzioni (Alpha 38.8)
   ========================================================================== */

/* Le schede dei giocatori nella finestra della prenotazione.
   Il riquadro resta chiaro anche in modalita' scura - e' voluto, perche' e'
   una superficie di lavoro dove si legge molto - ma il testo era rimasto del
   colore del tema scuro: chiarissimo su fondo bianco, quindi illeggibile.
   Qui il testo torna scuro. Accanto il rapporto misurato. */
html[data-theme='dark'] .player-icon-card,
html[data-theme='contrast'] .player-icon-card,
html[data-theme='dark'] .player-picker-list > button,
html[data-theme='contrast'] .player-picker-list > button,
html[data-theme='dark'] .selected-player-panel,
html[data-theme='contrast'] .selected-player-panel,
html[data-theme='dark'] .guest-player-box,
html[data-theme='contrast'] .guest-player-box {
  background: #ffffff;
  border-color: #c8cfd6;
  color: #14171a;                          /* 17,99:1 */
}
html[data-theme='dark'] .player-icon-card strong,
html[data-theme='contrast'] .player-icon-card strong,
html[data-theme='dark'] .player-picker-list strong,
html[data-theme='contrast'] .player-picker-list strong,
html[data-theme='dark'] .selected-player-title strong,
html[data-theme='contrast'] .selected-player-title strong {
  color: #14171a;                          /* 17,99:1 */
}
html[data-theme='dark'] .player-icon-card small,
html[data-theme='contrast'] .player-icon-card small,
html[data-theme='dark'] .player-picker-list small,
html[data-theme='contrast'] .player-picker-list small,
html[data-theme='dark'] .selected-player-title span,
html[data-theme='contrast'] .selected-player-title span {
  color: #4f585e;                          /* 7,27:1 */
}
html[data-theme='dark'] .player-icon-card.selected,
html[data-theme='contrast'] .player-icon-card.selected,
html[data-theme='dark'] .player-icon-card:hover,
html[data-theme='contrast'] .player-icon-card:hover,
html[data-theme='dark'] .player-picker-list > button:hover,
html[data-theme='contrast'] .player-picker-list > button:hover {
  background: #fdecec;
  border-color: #c1040f;
  color: #14171a;                          /* 15,75:1 */
}
/* Il cerchietto con l'iniziale: era grigio chiarissimo su bianco. */
html[data-theme='dark'] .player-person-icon,
html[data-theme='contrast'] .player-person-icon {
  background: #e3e8ec;
  color: #14171a;                          /* 14,58:1 */
}
html[data-theme='dark'] .player-icon-card em,
html[data-theme='contrast'] .player-icon-card em {
  background: #fff2ce;
  color: #6b4e00;                          /* 6,94:1 */
}
/* Anche le caselle dentro quelle schede, altrimenti restano scure. */
html[data-theme='dark'] .guest-player-box input,
html[data-theme='contrast'] .guest-player-box input,
html[data-theme='dark'] .player-payment-compact input,
html[data-theme='contrast'] .player-payment-compact input,
html[data-theme='dark'] .player-payment-compact select,
html[data-theme='contrast'] .player-payment-compact select {
  background: #ffffff;
  border-color: #c8cfd6;
  color: #14171a;
}

/* ==========================================================================
   13. La partita aperta si riconosce a colpo d'occhio (Alpha 38.9)

   Finche' i quattro posti non sono coperti la prenotazione non e' ancora una
   prenotazione: il campo non e' bloccato e un gruppo completo puo' prenderlo.
   Chi guarda la dashboard deve vederlo subito, senza aprire la scheda, e con
   lo stesso verde con cui il calendario segna le partite aperte.

   Contrasti misurati sul testo: 7,88:1 in chiaro, 9,92:1 in scuro. La soglia
   AA per il testo piccolo e' 4,5:1.
   ========================================================================== */

.booking-status.status-prenotazione-aperta {
  background: #d8f3e4;
  color: #0a5233;
  border: 1px solid #9fd9bd;
}

:root[data-theme="dark"] .booking-status.status-prenotazione-aperta,
:root[data-theme="contrast"] .booking-status.status-prenotazione-aperta {
  background: #10301f;
  color: #8ee9bb;
  border-color: #2f6b4b;
}

/* Il pannello della prenotazione aperta porta un filo verde sul bordo
   sinistro: la stessa riga che il calendario usa per lo stesso stato. */
.reception-booking.partita-aperta {
  border-left: 4px solid #13a66a;
}

/* ==========================================================================
   14. Le finestre chiare in modalita' notte (Alpha 39.0)

   IL PROBLEMA
   Il tema scuro ricolora i pannelli principali, ma dentro quei pannelli
   c'erano riquadri con lo sfondo chiaro scritto a mano nel foglio di stile:
   la scheda delle mansioni dello staff, il riquadro del compenso del maestro,
   i box dei permessi, i riepiloghi. Quei riquadri restavano bianchi, mentre il
   testo diventava chiaro perche' quello si', il tema lo cambiava. Risultato:
   grigio chiaro su bianco, praticamente illeggibile.

   COME LI HO TROVATI
   Non a occhio, aprendo le pagine una per una: con un controllo che legge i
   due fogli di stile, prende ogni regola che fissa uno sfondo chiaro a mano,
   e verifica se il tema notturno lo rimette a posto. Quelli scoperti sono
   126, ed e' l'elenco qui sotto. Restano fuori di proposito gli
   sfondi dietro a foto e loghi, i pezzi di disegno e i blocchi del calendario,
   che hanno un trattamento loro poco sotto.

   I CONTRASTI
   Scuro:    testo #eef1f4 su superficie #1c1f22  ->  14,60:1
   Contrasto: testo #ffffff su superficie #131313  ->  18,58:1
   La soglia per il testo piccolo e' 4,5:1.
   ========================================================================== */

html[data-theme='dark'] .quick-actions button:hover,
html[data-theme='dark'] .pilot-command-list > div,
html[data-theme='dark'] .summary-card,
html[data-theme='dark'] .participants-panel,
html[data-theme='dark'] .search-box,
html[data-theme='dark'] .participants-table tbody tr:hover,
html[data-theme='dark'] .row-action:hover,
html[data-theme='dark'] .filter-reset:hover:not(:disabled),
html[data-theme='dark'] .profile-drawer,
html[data-theme='dark'] .login-page,
html[data-theme='dark'] .login-card,
html[data-theme='dark'] .auth-page,
html[data-theme='dark'] .booking-toolbar,
html[data-theme='dark'] .court-column,
html[data-theme='dark'] .booking-delete,
html[data-theme='dark'] .daily-calendar,
html[data-theme='dark'] .calendar-time-column,
html[data-theme='dark'] .calendar-court-column,
html[data-theme='dark'] .calendar-slot:hover:not(:disabled),
html[data-theme='dark'] .court-unavailable,
html[data-theme='dark'] .reminder-panel,
html[data-theme='dark'] .players-editor,
html[data-theme='dark'] .player-row > strong,
html[data-theme='dark'] .player-compact-card,
html[data-theme='dark'] .share-booking-box,
html[data-theme='dark'] .activity-status,
html[data-theme='dark'] .capacity-row div,
html[data-theme='dark'] .capacity-bar,
html[data-theme='dark'] .event-participants,
html[data-theme='dark'] .view-switch,
html[data-theme='dark'] .period-summary-grid article,
html[data-theme='dark'] .week-day-card,
html[data-theme='dark'] .month-summary,
html[data-theme='dark'] .tier-card,
html[data-theme='dark'] .vip-card,
html[data-theme='dark'] .task-picker label,
html[data-theme='dark'] .player-picker-list>button,
html[data-theme='dark'] .player-picker-list>button:hover,
html[data-theme='dark'] .notification-main blockquote,
html[data-theme='dark'] .wallet-summary-grid>div,
html[data-theme='dark'] .player-picker-filters,
html[data-theme='dark'] .player-picker-list > button:disabled,
html[data-theme='dark'] .team-panel,
html[data-theme='dark'] .payment-status-control > div,
html[data-theme='dark'] .preference-fieldset,
html[data-theme='dark'] .smart-share-filters,
html[data-theme='dark'] .smart-share-filters select,
html[data-theme='dark'] .smart-share-list > label,
html[data-theme='dark'] .smart-date-grid button:hover,
html[data-theme='dark'] .subscription-plan-card,
html[data-theme='dark'] .subscription-plan-summary,
html[data-theme='dark'] .booking-cost-summary > div,
html[data-theme='dark'] .booking-cost-summary .booking-cost-total,
html[data-theme='dark'] .match-result-access,
html[data-theme='dark'] .medical-file-preview,
html[data-theme='dark'] .history-summary-grid article,
html[data-theme='dark'] .expiration-filters select,
html[data-theme='dark'] .expiration-card,
html[data-theme='dark'] .expiration-priority,
html[data-theme='dark'] .public-result-page,
html[data-theme='dark'] .public-result-card,
html[data-theme='dark'] .public-teams article,
html[data-theme='dark'] .winner-options label,
html[data-theme='dark'] .payment-choice-grid,
html[data-theme='dark'] .payment-choice-grid button,
html[data-theme='dark'] .extras-payment-choice,
html[data-theme='dark'] .payment-section,
html[data-theme='dark'] .extras-section,
html[data-theme='dark'] .staff-activity-filters select,
html[data-theme='dark'] .staff-stats-grid article,
html[data-theme='dark'] .teacher-price-editor,
html[data-theme='dark'] .lesson-package-payment select,
html[data-theme='dark'] .owned-package-list article,
html[data-theme='dark'] .draft-authorization-box,
html[data-theme='dark'] .fatal-error-page,
html[data-theme='dark'] .fatal-error-card,
html[data-theme='dark'] .fatal-error-card code,
html[data-theme='dark'] .whatsapp-period-bar,
html[data-theme='dark'] .budget-progress,
html[data-theme='dark'] .whatsapp-summary-card,
html[data-theme='dark'] .whatsapp-panel,
html[data-theme='dark'] .slot-button:hover,
html[data-theme='dark'] .friend-game-card,
html[data-theme='dark'] .booking-date-box,
html[data-theme='dark'] .club-admin-item,
html[data-theme='dark'] .club-admin-item.selected,
html[data-theme='dark'] .calendar-kpi,
html[data-theme='dark'] .calendar-kpi.pending,
html[data-theme='dark'] .dashboard-timer-card,
html[data-theme='dark'] .dashboard-residual-card.attention,
html[data-theme='dark'] .reception-residual-button.attention,
html[data-theme='dark'] .residual-modal-summary,
html[data-theme='dark'] .club-image-upload-card,
html[data-theme='dark'] .manager-booking-players,
html[data-theme='dark'] .manager-team-panels > section,
html[data-theme='dark'] .manager-player-slot:hover,
html[data-theme='dark'] .manager-player-slot.registered,
html[data-theme='dark'] .player-form-section,
html[data-theme='dark'] .booking-color-legend,
html[data-theme='dark'] .scheduler-time-rail,
html[data-theme='dark'] .scheduler-court-area,
html[data-theme='dark'] .open-match-notice,
html[data-theme='dark'] .staff-person-card dl div,
html[data-theme='dark'] .staff-access-section,
html[data-theme='dark'] .compact-legend,
html[data-theme='dark'] .booking-multi-court-selector,
html[data-theme='dark'] .booking-multi-court-selector label,
html[data-theme='dark'] .booking-multi-court-selector label.selected,
html[data-theme='dark'] .calendar-day-arrow,
html[data-theme='dark'] .reception-booking.payment-pending,
html[data-theme='dark'] .reception-booking.payment-pending > header,
html[data-theme='dark'] .reception-booking.payment-complete,
html[data-theme='dark'] .reception-booking.payment-complete > header,
html[data-theme='dark'] .cash-toolbar-actions select,
html[data-theme='dark'] .reception-share-editor,
html[data-theme='dark'] .reception-share-editor:has(input:disabled),
html[data-theme='dark'] .residence-suggestion-list,
html[data-theme='dark'] .residence-suggestion-list button:hover,
html[data-theme='dark'] .wallet-package-settings-list article,
html[data-theme='dark'] .history-connection-list > span,
html[data-theme='dark'] .staff-access-profile,
html[data-theme='dark'] .staff-access-permission-list label,
html[data-theme='dark'] .staff-access-editor,
html[data-theme='dark'] .birth-abroad-toggle .inline-check,
html[data-theme='dark'] .player-form-subheading,
html[data-theme='dark'] .lesson-package-usage-list button:hover,
html[data-theme='contrast'] .quick-actions button:hover,
html[data-theme='contrast'] .pilot-command-list > div,
html[data-theme='contrast'] .summary-card,
html[data-theme='contrast'] .participants-panel,
html[data-theme='contrast'] .search-box,
html[data-theme='contrast'] .participants-table tbody tr:hover,
html[data-theme='contrast'] .row-action:hover,
html[data-theme='contrast'] .filter-reset:hover:not(:disabled),
html[data-theme='contrast'] .profile-drawer,
html[data-theme='contrast'] .login-page,
html[data-theme='contrast'] .login-card,
html[data-theme='contrast'] .auth-page,
html[data-theme='contrast'] .booking-toolbar,
html[data-theme='contrast'] .court-column,
html[data-theme='contrast'] .booking-delete,
html[data-theme='contrast'] .daily-calendar,
html[data-theme='contrast'] .calendar-time-column,
html[data-theme='contrast'] .calendar-court-column,
html[data-theme='contrast'] .calendar-slot:hover:not(:disabled),
html[data-theme='contrast'] .court-unavailable,
html[data-theme='contrast'] .reminder-panel,
html[data-theme='contrast'] .players-editor,
html[data-theme='contrast'] .player-row > strong,
html[data-theme='contrast'] .player-compact-card,
html[data-theme='contrast'] .share-booking-box,
html[data-theme='contrast'] .activity-status,
html[data-theme='contrast'] .capacity-row div,
html[data-theme='contrast'] .capacity-bar,
html[data-theme='contrast'] .event-participants,
html[data-theme='contrast'] .view-switch,
html[data-theme='contrast'] .period-summary-grid article,
html[data-theme='contrast'] .week-day-card,
html[data-theme='contrast'] .month-summary,
html[data-theme='contrast'] .tier-card,
html[data-theme='contrast'] .vip-card,
html[data-theme='contrast'] .task-picker label,
html[data-theme='contrast'] .player-picker-list>button,
html[data-theme='contrast'] .player-picker-list>button:hover,
html[data-theme='contrast'] .notification-main blockquote,
html[data-theme='contrast'] .wallet-summary-grid>div,
html[data-theme='contrast'] .player-picker-filters,
html[data-theme='contrast'] .player-picker-list > button:disabled,
html[data-theme='contrast'] .team-panel,
html[data-theme='contrast'] .payment-status-control > div,
html[data-theme='contrast'] .preference-fieldset,
html[data-theme='contrast'] .smart-share-filters,
html[data-theme='contrast'] .smart-share-filters select,
html[data-theme='contrast'] .smart-share-list > label,
html[data-theme='contrast'] .smart-date-grid button:hover,
html[data-theme='contrast'] .subscription-plan-card,
html[data-theme='contrast'] .subscription-plan-summary,
html[data-theme='contrast'] .booking-cost-summary > div,
html[data-theme='contrast'] .booking-cost-summary .booking-cost-total,
html[data-theme='contrast'] .match-result-access,
html[data-theme='contrast'] .medical-file-preview,
html[data-theme='contrast'] .history-summary-grid article,
html[data-theme='contrast'] .expiration-filters select,
html[data-theme='contrast'] .expiration-card,
html[data-theme='contrast'] .expiration-priority,
html[data-theme='contrast'] .public-result-page,
html[data-theme='contrast'] .public-result-card,
html[data-theme='contrast'] .public-teams article,
html[data-theme='contrast'] .winner-options label,
html[data-theme='contrast'] .payment-choice-grid,
html[data-theme='contrast'] .payment-choice-grid button,
html[data-theme='contrast'] .extras-payment-choice,
html[data-theme='contrast'] .payment-section,
html[data-theme='contrast'] .extras-section,
html[data-theme='contrast'] .staff-activity-filters select,
html[data-theme='contrast'] .staff-stats-grid article,
html[data-theme='contrast'] .teacher-price-editor,
html[data-theme='contrast'] .lesson-package-payment select,
html[data-theme='contrast'] .owned-package-list article,
html[data-theme='contrast'] .draft-authorization-box,
html[data-theme='contrast'] .fatal-error-page,
html[data-theme='contrast'] .fatal-error-card,
html[data-theme='contrast'] .fatal-error-card code,
html[data-theme='contrast'] .whatsapp-period-bar,
html[data-theme='contrast'] .budget-progress,
html[data-theme='contrast'] .whatsapp-summary-card,
html[data-theme='contrast'] .whatsapp-panel,
html[data-theme='contrast'] .slot-button:hover,
html[data-theme='contrast'] .friend-game-card,
html[data-theme='contrast'] .booking-date-box,
html[data-theme='contrast'] .club-admin-item,
html[data-theme='contrast'] .club-admin-item.selected,
html[data-theme='contrast'] .calendar-kpi,
html[data-theme='contrast'] .calendar-kpi.pending,
html[data-theme='contrast'] .dashboard-timer-card,
html[data-theme='contrast'] .dashboard-residual-card.attention,
html[data-theme='contrast'] .reception-residual-button.attention,
html[data-theme='contrast'] .residual-modal-summary,
html[data-theme='contrast'] .club-image-upload-card,
html[data-theme='contrast'] .manager-booking-players,
html[data-theme='contrast'] .manager-team-panels > section,
html[data-theme='contrast'] .manager-player-slot:hover,
html[data-theme='contrast'] .manager-player-slot.registered,
html[data-theme='contrast'] .player-form-section,
html[data-theme='contrast'] .booking-color-legend,
html[data-theme='contrast'] .scheduler-time-rail,
html[data-theme='contrast'] .scheduler-court-area,
html[data-theme='contrast'] .open-match-notice,
html[data-theme='contrast'] .staff-person-card dl div,
html[data-theme='contrast'] .staff-access-section,
html[data-theme='contrast'] .compact-legend,
html[data-theme='contrast'] .booking-multi-court-selector,
html[data-theme='contrast'] .booking-multi-court-selector label,
html[data-theme='contrast'] .booking-multi-court-selector label.selected,
html[data-theme='contrast'] .calendar-day-arrow,
html[data-theme='contrast'] .reception-booking.payment-pending,
html[data-theme='contrast'] .reception-booking.payment-pending > header,
html[data-theme='contrast'] .reception-booking.payment-complete,
html[data-theme='contrast'] .reception-booking.payment-complete > header,
html[data-theme='contrast'] .cash-toolbar-actions select,
html[data-theme='contrast'] .reception-share-editor,
html[data-theme='contrast'] .reception-share-editor:has(input:disabled),
html[data-theme='contrast'] .residence-suggestion-list,
html[data-theme='contrast'] .residence-suggestion-list button:hover,
html[data-theme='contrast'] .wallet-package-settings-list article,
html[data-theme='contrast'] .history-connection-list > span,
html[data-theme='contrast'] .staff-access-profile,
html[data-theme='contrast'] .staff-access-permission-list label,
html[data-theme='contrast'] .staff-access-editor,
html[data-theme='contrast'] .birth-abroad-toggle .inline-check,
html[data-theme='contrast'] .player-form-subheading,
html[data-theme='contrast'] .lesson-package-usage-list button:hover {
  background: var(--mp-surface-2) !important;
  color: var(--mp-text) !important;
  border-color: var(--mp-border) !important;
}

/* I blocchi del calendario tengono il loro significato: il colore dice lo
   stato della prenotazione, e serve a leggere la giornata senza fermarsi a
   guardare. In notturna diventano la versione scura dello stesso colore. */
html[data-theme='dark'] .calendar-booking.status-richiesta,
html[data-theme='contrast'] .calendar-booking.status-richiesta {
  background: #3a2f0c !important;
  color: #ffd875 !important;
  border-color: #6b5613 !important;
}
html[data-theme='dark'] .calendar-booking.status-confermata,
html[data-theme='contrast'] .calendar-booking.status-confermata {
  background: #16321f !important;
  color: #8fe6ab !important;
  border-color: #2c5c3a !important;
}
html[data-theme='dark'] .calendar-booking.status-bloccata,
html[data-theme='contrast'] .calendar-booking.status-bloccata {
  background: #262a2f !important;
  color: #c8d0d8 !important;
  border-color: #454c54 !important;
}
html[data-theme='dark'] .calendar-booking.coach-booking,
html[data-theme='contrast'] .calendar-booking.coach-booking {
  background: #33280f !important;
  color: #f0c968 !important;
  border-color: #5e4a1c !important;
}
