:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-court: #0c3b66;
  --bg-court-dark: #072542;
  --padel-blue: #0f4c81;
  --padel-blue-hover: #0a365c;
  --padel-lime: #c6f135;
  --padel-lime-dark: #3f6212;
  --padel-green: #15803d;
  --padel-green-bg: #dcfce7;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #cbd5e1;
  --border-strong: #64748b;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.10);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100vw;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hides content visually but keeps it in the accessibility tree */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Header & Navigation */
.top-banner {
  background: linear-gradient(135deg, var(--bg-court-dark) 0%, var(--padel-blue) 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.banner-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1rem 0.65rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ball-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e2ff66, #a3e635 70%, #65a30d);
  box-shadow: 0 0 0 3px rgba(198, 241, 53, 0.25);
  flex-shrink: 0;
}

.club-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.club-subtitle {
  font-size: 0.78rem;
  margin: 0;
  color: #cbd5e1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-pill {
  background-color: var(--padel-lime);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.sport-selector-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.sport-pill {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.10);
  color: #f8fafc;
  font: inherit;
  font-size: 0.80rem;
  font-weight: 700;
  min-height: 40px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.sport-pill.active {
  background-color: var(--padel-lime);
  color: #0f172a;
  border-color: var(--padel-lime);
  box-shadow: var(--shadow-sm);
}

.role-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.role-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  min-height: 44px;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background-color 0.15s, color 0.15s;
}

.role-tab.active {
  background-color: #ffffff;
  color: var(--bg-court-dark);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  background-color: var(--danger);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

/* Main container */
.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 0.85rem 3.5rem;
}

.view-section[hidden] {
  display: none !important;
}

/* Cards & Typography */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--padel-blue);
  margin-bottom: 0.15rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.section-title-sm {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.card-header-row,
.section-header-row,
.player-selector-header,
.manager-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* Quick Paths Bar (Mobile-first) */
.quick-paths-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 58px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.quick-action-btn.primary {
  background-color: var(--padel-blue);
  color: #ffffff;
}

.quick-action-btn.accent {
  background-color: #ecfccb;
  color: #1a2e05;
  border-color: #84cc16;
}

.qa-icon {
  font-size: 1.4rem;
}

.qa-text strong {
  display: block;
  font-size: 0.95rem;
}

.qa-text small {
  font-size: 0.76rem;
  opacity: 0.9;
}

.rule-callout {
  background-color: #f8fafc;
  border-inline-start: 4px solid var(--padel-blue);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

/* Player Selector & Mini Badges */
.player-select {
  width: 100%;
  font: inherit;
  font-size: max(1rem, 1em);
  font-weight: 700;
  min-height: 48px;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--padel-blue);
  background-color: #f8fafc;
  color: var(--text-main);
}

.player-mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.mini-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background-color: #e2e8f0;
  color: #1e293b;
}

.mini-pill.new-player {
  background-color: #fef08a;
  color: #713f12;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 0.35rem;
}

.filter-pill {
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-main);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--padel-blue);
  color: #ffffff;
  border-color: var(--padel-blue);
}

/* Match Cards Grid (Mobile-First 1 col, Desktop 2 cols) */
.matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .matches-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.match-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.match-card.status-CONFIRMED {
  border-color: #16a34a;
}

.match-card.status-AT_RISK {
  border-color: #dc2626;
  background-color: #fffafa;
}

.match-card.status-OPEN {
  border-color: #0284c7;
}

.match-card.status-PLAYED {
  border-color: #64748b;
  background-color: #f8fafc;
}

.match-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.match-time-badge {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bg-court-dark);
}

.match-duration-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.status-badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.status-badge.OPEN {
  background-color: var(--info-bg);
  color: var(--info);
}

.status-badge.FULL {
  background-color: #fef9c3;
  color: #854d0e;
}

.status-badge.CONFIRMED {
  background-color: var(--padel-green-bg);
  color: var(--padel-green);
}

.status-badge.AT_RISK {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.status-badge.PLAYED {
  background-color: #e2e8f0;
  color: #334155;
}

.match-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0.15rem 0;
}

/* Key metrics strip on match card (Prezzo, Livello, Posti, Campo) */
.match-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  background: #f8fafc;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.spec-item {
  font-size: 0.82rem;
}

.spec-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.spec-value {
  font-weight: 800;
  color: var(--text-main);
}

.spec-value.price-highlight {
  color: var(--padel-green);
  font-size: 0.95rem;
}

/* Visual 4-Spot Padel Court Representation */
.court-slots-box {
  background: var(--bg-court);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.65rem;
  border: 2px solid #38bdf8;
}

.court-slots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #bae6fd;
  margin-bottom: 0.45rem;
}

.court-4-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.court-spot {
  background: rgba(255, 255, 255, 0.12);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.court-spot.filled {
  background: rgba(198, 241, 53, 0.18);
  border: 1px solid var(--padel-lime);
}

.court-spot.needs-reconfirm {
  background: rgba(251, 191, 36, 0.25);
  border: 1px solid #fbbf24;
}

.spot-player-name {
  font-size: 0.83rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.spot-player-meta {
  font-size: 0.72rem;
  color: #e2e8f0;
}

.spot-empty-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #93c5fd;
}

.match-sublists {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.match-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Buttons (Tap target >= 48px for primary mobile controls) */
button {
  font: inherit;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success {
  min-height: 48px;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.08s, background-color 0.15s;
}

.btn-primary {
  background-color: var(--padel-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--padel-blue-hover);
}

.btn-success {
  background-color: var(--padel-green);
  color: #ffffff;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-secondary-sm,
.btn-warning-sm,
.btn-ghost-sm {
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-secondary-sm {
  background: #f8fafc;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-warning-sm {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #f59e0b;
}

.btn-ghost-sm {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-icon-close {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-main);
  font-weight: 800;
  cursor: pointer;
}

/* KPI Grid in Manager View */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--padel-blue);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Exceptions & Proposals */
.exception-item {
  border-inline-start: 4px solid var(--danger);
  background: #fff5f5;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exception-item.MEDIUM {
  border-inline-start-color: #d97706;
  background: #fffbeb;
}

.exception-item.INFO {
  border-inline-start-color: #0284c7;
  background: #f0f9ff;
}

.proposal-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  background: #f8fafc;
}

.candidate-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-top: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.scarcity-alert {
  display: block;
  color: var(--warning);
  background: var(--warning-bg);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

/* Courts & Notifications */
.courts-grid,
.live-scenarios-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .courts-grid,
  .live-scenarios-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.court-item,
.scenario-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.scenario-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.scenario-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
}

.notif-item,
.avail-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.55rem 0;
  font-size: 0.84rem;
}

/* Status Table */
.table-responsive {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.status-table th,
.status-table td {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.badge-op {
  background: var(--padel-green-bg);
  color: var(--padel-green);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-sim {
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Forms & Validation (Modern Web Guidance compliant) */
.field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-block-end: 1rem;
  width: 100%;
}

.field label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.hint {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: max(1rem, 1em);
  padding: 0.65rem 0.75rem;
  min-height: 48px;
  border: 1.5px solid #64748b;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-main);
}

@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 52px;
  }
}

:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

.error-msg {
  display: none;
  color: #d93025;
  font-size: 0.84rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Defer validation error styling until user interaction (:user-invalid + fallback) */
:is(:user-invalid, .user-invalid-fallback) {
  border-color: #d93025 !important;
  background-color: #fce8e6 !important;
}

:is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

input:user-valid {
  border-color: #188038;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 580px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .form-row-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--padel-blue);
}

/* Fieldset e Radio Buttons per scelta sport (2-5 opzioni visibili a zero-click scanning) */
.sport-radio-fieldset {
  border: 1px solid #86efac;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  margin: 0.5rem 0 0.75rem;
}

.sport-radio-fieldset legend {
  font-weight: 800;
  font-size: 0.88rem;
  color: #065f46;
  padding: 0 0.4rem;
}

.sport-radio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

@media (min-width: 720px) {
  .sport-radio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.radio-card-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  min-height: 52px;
  cursor: pointer;
}

.radio-card-option:has(input[type="radio"]:checked) {
  border-color: #047857;
  background: #ecfdf5;
}

.radio-card-option input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: #047857;
  flex-shrink: 0;
}

.radio-card-option label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}

.radio-card-option label small {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Native Modal Dialogs (Modern Web Guidance compliant: no unconditional display on dialog, overscroll-behavior: contain) */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 540px;
  width: calc(100% - 1.5rem);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
  background: #ffffff;
  color: var(--text-main);
}

dialog:has(.dialog-wide) {
  max-width: 680px;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dialog-content {
  padding: 1.25rem;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.12rem;
}

.dialog-note {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  max-width: 460px;
  margin: 0 auto;
  z-index: 60;
  pointer-events: none;
}

.toast-msg {
  background: #0f172a;
  color: #ffffff;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 0.5rem;
  border-inline-start: 5px solid var(--padel-lime);
  pointer-events: auto;
}

.toast-msg.error {
  border-inline-start-color: #ef4444;
  background: #450a0a;
}

.ai-response-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.88rem;
  white-space: pre-line;
}

.mt-md { margin-top: 0.75rem; }
.mt-lg { margin-top: 1.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 0.85rem; }
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.25rem 0;
}

/* CSV Preview Table & Badges */
.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.csv-preview-table th,
.csv-preview-table td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.csv-preview-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-muted);
}

.csv-row-valid {
  background: #f0fdf4;
}

.csv-row-error {
  background: #fef2f2;
}

.badge-csv-valid {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  font-size: 0.75rem;
}

.badge-csv-error {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
  font-size: 0.75rem;
}

.badge-csv-duplicate {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Gestore Login Bar */
.manager-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.manager-auth-badge.logged-in {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Pilot Invite View */
.pilot-invite-card {
  border: 2px solid #047857;
  background: #f0fdf4;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
