:root {
  --brand-primary: #0f172a;
  --brand-accent: #2EBCB8;
  --brand-surface: #111827;
  --brand-surface-soft: #172033;
  --brand-border: rgba(148, 163, 184, 0.22);
  --brand-text: #e5eef7;
  --brand-muted: #8fa0b8;
  --brand-success: #22c55e;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --shadow-soft: 0 20px 60px rgba(2, 6, 23, 0.32);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(46, 188, 184, 0.16), transparent 28%),
    linear-gradient(180deg, #09111f 0%, #0f172a 60%, #08111d 100%);
  color: var(--brand-text);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.layout {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(8, 17, 29, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 140px;
  height: 46px;
  object-fit: cover;
  object-position: left center;
  border-radius: 8px;
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  color: var(--brand-accent);
}

.brand-copy span {
  display: block;
  font-size: 0.9rem;
  color: var(--brand-muted);
}

.page {
  padding: 32px 0 72px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-card,
.card,
.panel,
.auth-card {
  background: linear-gradient(180deg, rgba(18, 27, 44, 0.95), rgba(11, 18, 31, 0.96));
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero-card {
  padding: 30px;
}

.hero-card h1,
.hero-card h2,
.section-title,
h3 {
  margin: 0 0 10px;
  line-height: 1.1;
  color: var(--brand-accent);
}

.hero-card h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.hero-card p,
.lead,
.muted {
  color: var(--brand-muted);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(46, 188, 184, 0.28);
  background: rgba(46, 188, 184, 0.1);
  color: #8ee0de;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.compact-panel {
  width: min(760px, 100%);
  margin-inline: auto;
}

.card,
.panel {
  padding: 22px;
}

.stats-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95), rgba(8, 14, 26, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.stats-card .eyebrow {
  color: var(--brand-muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-card strong {
  display: block;
  font-size: 2rem;
}

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

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

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

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

.field label {
  font-size: 0.92rem;
  color: #d5dfeb;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(8, 15, 28, 0.88);
  color: var(--brand-text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

input[readonly],
textarea[readonly] {
  background: rgba(12, 24, 39, 0.92);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(46, 188, 184, 0.72);
  box-shadow: 0 0 0 3px rgba(46, 188, 184, 0.18);
}

.actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.booking-submit-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.booking-submit-actions .btn {
  width: 100%;
  justify-content: center;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
  text-decoration: none;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-accent), #5fd7d2);
  color: #06282a;
  font-weight: 700;
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #86efac);
  color: #06140a;
  font-weight: 700;
}

.btn-negative {
  background: linear-gradient(135deg, #ef4444, #fca5a5);
  color: #170606;
  font-weight: 700;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary.is-active {
  background: linear-gradient(135deg, rgba(46, 188, 184, 0.22), rgba(95, 215, 210, 0.16));
  border-color: rgba(46, 188, 184, 0.46);
  color: #dffaf9;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #d8e3f0;
  font-size: 0.86rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-button {
  background: rgba(255, 255, 255, 0.06);
  color: #d8e3f0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 10px 14px;
  border-radius: 999px;
}

.chip-button.is-active {
  background: linear-gradient(135deg, rgba(46, 188, 184, 0.24), rgba(95, 215, 210, 0.18));
  border-color: rgba(46, 188, 184, 0.52);
  color: #dffaf9;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.call-action-row {
  width: 100%;
}

.call-action-button {
  width: 100%;
  min-height: 52px;
  text-align: center;
  white-space: normal;
}

.agent-outcome-select {
  font-weight: 700;
  color: #111111;
  border-color: rgba(0, 0, 0, 0.14);
}

.agent-outcome-select.outcome-concluded {
  background: linear-gradient(135deg, #22c55e, #86efac);
  color: #111111;
}

.agent-outcome-select.outcome-pending {
  background: linear-gradient(135deg, #f59e0b, #fde68a);
  color: #111111;
}

.agent-outcome-select.outcome-not-interested {
  background: linear-gradient(135deg, #ef4444, #fca5a5);
  color: #111111;
}

.agent-outcome-select option {
  color: #111111;
}

.esito-help-text {
  color: rgba(229, 238, 247, 0.72);
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status.requested {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.status.confirmed {
  background: rgba(46, 188, 184, 0.18);
  color: #8ee0de;
}

.status.in_progress {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.status.completed {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.status.cancelled {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

th {
  color: #cfd8e3;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr.is-selected td {
  background: rgba(46, 188, 184, 0.08);
}

.table-note {
  min-width: 220px;
  min-height: 90px;
}

.readonly-note-block {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(8, 22, 33, 0.78);
  border: 1px solid rgba(46, 188, 184, 0.24);
}

.readonly-note-content {
  color: #dce7f4;
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
}

.auth-card {
  width: min(480px, 100%);
  padding: 28px;
}

.portal-access-card {
  width: 100%;
}

.auth-card h1 {
  margin: 0 0 10px;
}

.portal-choice-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-choice {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--brand-text);
  text-align: left;
}

.portal-choice strong {
  font-size: 1rem;
}

.portal-choice span {
  color: var(--brand-muted);
  font-size: 0.86rem;
}

.portal-choice.is-active {
  background: linear-gradient(135deg, rgba(46, 188, 184, 0.2), rgba(95, 215, 210, 0.14));
  border-color: rgba(46, 188, 184, 0.5);
}

.portal-selected-link {
  color: var(--brand-muted);
  font-size: 0.92rem;
}

.notice {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #d7e3ef;
  padding: 13px 14px;
}

.notice.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.09);
}

.notice.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.notice.warning {
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.1);
}

.toast-stack {
  position: fixed;
  top: 92px;
  right: 24px;
  z-index: 60;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(10, 17, 29, 0.96);
  box-shadow: var(--shadow-soft);
  color: var(--brand-text);
  padding: 14px 16px;
  transform: translateY(-10px);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast-item.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-item.success {
  border-color: rgba(34, 197, 94, 0.34);
  background: linear-gradient(180deg, rgba(20, 52, 37, 0.96), rgba(9, 21, 17, 0.98));
}

.toast-item.error {
  border-color: rgba(239, 68, 68, 0.34);
  background: linear-gradient(180deg, rgba(65, 21, 24, 0.96), rgba(24, 10, 12, 0.98));
}

.hero-list,
.stack {
  display: grid;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  color: var(--brand-text);
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-accent);
}

.hero-list li,
.unstyled-list li {
  list-style: none;
}

.unstyled-list {
  padding: 0;
  margin: 0;
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-spacer {
  margin-top: 24px;
}

.admin-section-spotlight {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.admin-section-spotlight > [data-admin-section] {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

.small {
  font-size: 0.82rem;
  color: var(--brand-muted);
}

.booking-banner {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(46, 188, 184, 0.18);
  background: linear-gradient(135deg, rgba(46, 188, 184, 0.16), rgba(15, 23, 42, 0.5));
}

.map-shell {
  display: grid;
  gap: 16px;
}

.map-canvas {
  width: 100%;
  min-height: 460px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 23, 37, 0.95), rgba(8, 14, 24, 0.95));
}

.map-canvas.is-expanded {
  min-height: 680px;
}

.map-help {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--brand-muted);
}

.detail-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(9, 18, 31, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-accent {
  color: #8ee0de;
  text-decoration: none;
}

.link-accent:hover {
  text-decoration: underline;
}

.mini-note {
  color: var(--brand-muted);
  font-size: 0.88rem;
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result-card {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(9, 18, 31, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--brand-text);
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.search-result-card strong {
  color: #f5fbff;
}

.search-result-card .small {
  color: #d8e3f0;
}

.search-result-card:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 188, 184, 0.42);
}

.search-result-card.is-active {
  border-color: rgba(46, 188, 184, 0.58);
  background: linear-gradient(180deg, rgba(17, 31, 46, 0.96), rgba(8, 18, 31, 0.98));
}

.route-planner-actions {
  align-items: flex-end;
  padding-top: 28px;
}

.route-plan-card {
  border-color: rgba(46, 188, 184, 0.2);
}

.route-plan-card strong {
  color: #f5fbff;
}

.route-plan-card--muted {
  opacity: 0.82;
  border-style: dashed;
}

.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-range-caption {
  color: var(--brand-muted);
}

.outcome-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.outcome-pill.interested {
  background: rgba(34, 197, 94, 0.18);
  color: #9ff7bb;
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.outcome-pill.not_interested {
  background: rgba(239, 68, 68, 0.16);
  color: #ffb3b3;
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.agent-outcome-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #111111;
}

.agent-outcome-indicator__icon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.9);
  flex: 0 0 auto;
}

.agent-outcome-indicator.concluded {
  background: linear-gradient(135deg, #22c55e, #86efac);
}

.agent-outcome-indicator.pending {
  background: linear-gradient(135deg, #f59e0b, #fde68a);
}

.agent-outcome-indicator.not_interested {
  background: linear-gradient(135deg, #ef4444, #fca5a5);
}

.tight-table td {
  padding: 12px 10px;
}

@media (max-width: 960px) {
  .hero,
  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    min-width: 140px;
  }

  .topbar-inner,
  .split {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand img {
    width: 116px;
    height: 40px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .portal-choice-group {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    top: 84px;
    width: auto;
  }
}
