/* =====================================================
   ARGO — Design tokens
   ===================================================== */
:root {
  /* Colori — Mediterraneo notturno + carta avorio */
  --color-ink:              #1A1A1A;
  --color-egeo:             #0F2940;
  --color-egeo-soft:        #1E3A5F;
  --color-egeo-muted:       rgba(15, 41, 64, 0.55);
  --color-terracotta:       #C66A3A;
  --color-terracotta-soft:  #E08E5C;
  --color-oro:              #D8B26A;
  --color-oro-soft:         #E8CA95;
  --color-avorio:           #F7F2E8;
  --color-avorio-warm:      #EFE6D2;
  --color-avorio-deep:      #E6DCCA;
  --color-success:          #6B8E4E;
  --color-danger:           #A6391E;
  --color-warning:          #D8B26A;

  /* Token surface e testo — introdotti con il refactor Ondata 1 */
  --surface-info-soft:     rgba(15, 41, 64, 0.04);
  --surface-info-strong:   rgba(15, 41, 64, 0.10);
  --surface-warning-soft:  rgba(216, 178, 106, 0.14);
  --surface-warning:       rgba(216, 178, 106, 0.28);
  --surface-success-soft:  rgba(107, 142, 78, 0.10);
  --surface-success:       rgba(107, 142, 78, 0.20);
  --surface-danger-soft:   rgba(166, 57, 30, 0.08);
  --text-muted:            rgba(15, 41, 64, 0.55);
  --text-strong:           var(--color-egeo);

  /* Semantici */
  --bg-app:     var(--color-avorio);
  --bg-sidebar: var(--color-egeo);
  --bg-card:    #FFFFFF;
  --bg-input:   #FFFFFF;

  --border-subtle:  rgba(15, 41, 64, 0.09);
  --border-default: rgba(15, 41, 64, 0.14);
  --border-strong:  rgba(15, 41, 64, 0.25);

  /* Tipografia — Optima come font sistemico */
  --font-display: "Optima", "Optima Nova LT", "Candara", "URW Classico", Georgia, sans-serif;
  --font-ui:      "Optima", "Optima Nova LT", "Candara", "URW Classico", Georgia, sans-serif;

  /* Spazi */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px;
  --space-4: 16px; --space-6: 24px;  --space-8: 32px;
  --space-12: 48px; --space-16: 64px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-pill: 999px;

  /* Ombre calde */
  --shadow-sm: 0 1px 2px rgba(15, 41, 64, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 41, 64, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 41, 64, 0.12);
}

/* =====================================================
   RESET
   ===================================================== */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--color-ink);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font-ui); }
a { color: inherit; text-decoration: none; }

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
.h1, h1 {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1.15;
  color: var(--color-egeo); margin: 0;
}
.h2, h2 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.2;
  color: var(--color-egeo); margin: 0;
}
.h3, h3 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-egeo); margin: 0;
}
.muted { color: var(--color-egeo-muted); font-size: 14px; }
.mini  { font-size: 12px; color: var(--color-egeo-muted); }

/* Layout helpers */
.row     { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.col     { display: flex; flex-direction: column; }
.stack-8  > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { opacity: 0.88; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--color-terracotta);
  color: var(--color-avorio);
}
.btn-primary:hover:not(:disabled) { background: var(--color-terracotta-soft); }

.btn-secondary {
  background: transparent;
  color: var(--color-egeo);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(15, 41, 64, 0.05);
  border-color: var(--color-egeo);
}

.btn-ghost {
  color: var(--color-egeo-muted);
  padding: 8px 12px;
}
.btn-ghost:hover { background: rgba(15, 41, 64, 0.06); color: var(--color-egeo); }

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid rgba(166, 57, 30, 0.25);
}
.btn-danger:hover { background: rgba(166, 57, 30, 0.06); border-color: var(--color-danger); }

.btn-danger-solid { background: var(--color-danger); color: white; }
.btn-danger-solid:hover { background: #8A2E17; }

.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-xs  { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }

/* On dark/egeo background — invert secondary */
.btn-secondary-light {
  background: transparent;
  color: var(--color-avorio);
  border: 1px solid rgba(247, 242, 232, 0.35);
}
.btn-secondary-light:hover { background: rgba(247, 242, 232, 0.08); }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
}
.badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.badge-active   { background: rgba(107,142,78,0.10);  color: var(--color-success);   border-color: rgba(107,142,78,0.25); }
.badge-pending  { background: rgba(216,178,106,0.14); color: #8A6B2A;                border-color: rgba(216,178,106,0.4); }
.badge-expired  { background: rgba(15,41,64,0.06);    color: var(--color-egeo-muted); border-color: var(--border-subtle); }
.badge-rejected { background: rgba(166,57,30,0.08);   color: var(--color-danger);    border-color: rgba(166,57,30,0.2); }
.badge-plain    { background: rgba(15,41,64,0.06); color: var(--color-egeo-muted); border-color: var(--border-subtle); }
.badge-plain::before { display: none; }

/* Plan badges */
.badge-starter  { background: transparent; color: var(--color-egeo); border: 1px solid var(--color-egeo); }
.badge-pro      { background: transparent; color: var(--color-terracotta); border: 1px solid var(--color-terracotta); }
.badge-business { background: var(--color-egeo); color: var(--color-oro); border: 1px solid var(--color-oro); }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 26px; }

/* =====================================================
   INPUTS
   ===================================================== */
.field-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-egeo-muted);
  margin-bottom: 6px;
}
.input, .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 14px; color: var(--color-egeo);
  background: var(--bg-input);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: rgba(15,41,64,0.35); }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-egeo);
  box-shadow: 0 0 0 3px rgba(15, 41, 64, 0.10);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
select.input { cursor: pointer; }

/* =====================================================
   TABLES
   ===================================================== */
.table-wrap { overflow: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: var(--font-ui);
}
.table th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--color-egeo-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 22px;
  background: var(--color-avorio);
  border-bottom: 1px solid var(--border-default);
}
.table td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--color-egeo);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(15,41,64,0.025); }

/* =====================================================
   APP LAYOUT
   ===================================================== */
.app { display: flex; min-height: 100vh; }

/* Sidebar — egeo scuro */
.sidebar {
  width: 252px;
  background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
  flex-shrink: 0;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg-app);
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex; align-items: center;
  padding: 0 40px;
  gap: 16px;
  position: sticky; top: 0; z-index: 5;
}

.page {
  padding: 36px 44px 64px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* =====================================================
   NAVIGATION (sidebar dark)
   ===================================================== */
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(247,242,232,0.6);
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover  { background: rgba(247,242,232,0.08); color: var(--color-avorio); }
.nav-item.active {
  background: rgba(216,178,106,0.12);
  color: var(--color-oro);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: rgba(247,242,232,0.08);
  margin: 12px 4px;
}

/* =====================================================
   TABS
   ===================================================== */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 28px;
}
.tab {
  padding: 11px 18px;
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 500;
  color: var(--color-egeo-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--color-egeo); }
.tab.active {
  color: var(--color-terracotta);
  border-bottom-color: var(--color-terracotta);
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.stat-label {
  font-family: var(--font-ui);
  font-size: 12px; color: var(--color-egeo-muted);
  font-weight: 500; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 7px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 600;
  color: var(--color-egeo);
  margin-top: 8px; letter-spacing: -0.03em; line-height: 1;
}
.stat-delta { font-size: 12px; color: var(--color-egeo-muted); margin-top: 6px; }
.stat-delta.up { color: var(--color-success); }

/* =====================================================
   TOAST
   ===================================================== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--color-egeo);
  color: var(--color-avorio);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-ui);
  font-size: 14px; z-index: 100;
  animation: toastIn 0.25s ease;
  display: flex; align-items: center; gap: 10px;
}
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 41, 64, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 460px; width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Left panel — egeo scuro con archi */
.login-hero {
  background: var(--color-egeo);
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
  overflow: hidden;
}
.login-hero-arches {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.07;
}
.login-hero-content {
  position: relative; z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-tagline {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500;
  color: rgba(247,242,232,0.6);
  letter-spacing: 0.04em;
  margin-top: 18px;
  line-height: 1.7;
}
.login-tagline span {
  display: block;
}

/* Right panel — form su avorio */
.login-form-panel {
  background: var(--color-avorio);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 36px;
  width: 100%;
  max-width: 400px;
}

/* Mode switcher */
.login-switch {
  display: flex;
  background: var(--color-avorio-warm);
  border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 28px;
  position: relative;
}
.login-switch button {
  flex: 1; padding: 8px;
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 500;
  color: var(--color-egeo-muted);
  border-radius: 5px;
  transition: color 0.2s;
  position: relative; z-index: 1;
}
.login-switch button.active { color: var(--color-egeo); }
.login-switch-indicator {
  position: absolute; top: 3px; bottom: 3px;
  width: calc(50% - 3px);
  background: white;
  border-radius: 5px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =====================================================
   DROPZONE
   ===================================================== */
.dropzone {
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  background: rgba(15,41,64,0.02);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--color-terracotta);
  background: rgba(198, 106, 58, 0.04);
}

/* =====================================================
   PROPERTY GRID + CARDS
   ===================================================== */
.prop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(284px, 1fr));
  gap: 16px;
}
.prop-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.prop-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}
.prop-thumb {
  height: 144px;
  background: var(--color-avorio-warm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(15,41,64,0.25);
  font-family: var(--font-ui);
  font-size: 11px; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
}
/* Arch decoration on prop thumb */
.prop-thumb::after {
  content: '';
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 40px;
  border: 1.5px solid rgba(15,41,64,0.12);
  border-bottom: none;
  border-radius: 80px 80px 0 0;
}

/* =====================================================
   ARCH DECORATIVE ELEMENTS
   ===================================================== */
/* Inline arch SVG divider */
.arch-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 24px 0;
  color: var(--border-default);
}

/* Info banner with arch motif */
.info-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: rgba(15,41,64,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-egeo);
}
.info-banner-warm {
  background: rgba(198,106,58,0.05);
  border-color: rgba(198,106,58,0.2);
  border-left-color: var(--color-terracotta);
}

/* =====================================================
   QR
   ===================================================== */
.qr-preview {
  width: 160px; height: 160px;
  background: white;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px;
}

/* =====================================================
   SUBSCRIPTION PLAN CARDS
   ===================================================== */
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}
.plan-card.plan-current {
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(198,106,58,0.10);
}
.plan-card.plan-business {
  background: var(--color-egeo);
}

/* =====================================================
   LEGACY COMPAT — supporto classi e variabili dell'app esistente
   Permette ai JSX scritti contro il vecchio styles.css di funzionare
   senza modifiche. Rimuovere quando i JSX sono migrati.
   ===================================================== */

/* DEPRECATED: legacy palette alias — to remove once dashboard.jsx, other-pages.jsx, checkin.jsx, schedina.jsx are migrated */
/* --- Variabili legacy mappate sui nuovi token Argo --- */
:root {
  /* old green palette → terracotta/oro */
  --green-50:  rgba(198, 106, 58, 0.06);
  --green-100: rgba(198, 106, 58, 0.14);
  --green-200: rgba(198, 106, 58, 0.22);
  --green-500: var(--color-terracotta);
  --green-600: var(--color-terracotta);
  --green-700: var(--color-terracotta-soft);

  /* old grays → egeo / avorio scale */
  --gray-25:  var(--color-avorio);
  --gray-50:  var(--color-avorio);
  --gray-100: var(--color-avorio-warm);
  --gray-200: var(--border-subtle);
  --gray-300: var(--border-default);
  --gray-400: rgba(15, 41, 64, 0.4);
  --gray-500: var(--color-egeo-muted);
  --gray-600: rgba(15, 41, 64, 0.7);
  --gray-700: rgba(15, 41, 64, 0.85);
  --gray-800: var(--color-egeo);
  --gray-900: var(--color-egeo);

  /* old amber → oro */
  --amber-50:  rgba(216, 178, 106, 0.10);
  --amber-100: rgba(216, 178, 106, 0.18);
  --amber-700: #8A6B2A;

  /* old red → danger */
  --red-50:  rgba(166, 57, 30, 0.06);
  --red-100: rgba(166, 57, 30, 0.14);
  --red-600: var(--color-danger);
  --red-700: var(--color-danger);

  /* old blue → egeo */
  --blue-50:  rgba(15, 41, 64, 0.06);
  --blue-100: rgba(15, 41, 64, 0.12);
  --blue-700: var(--color-egeo-soft);
}

/* --- Login backdrop legacy → trasformato in 2-colonne con hero blu --- */
.login-bg {
  display: grid;
  grid-template-columns: 5fr 6fr;
  min-height: 100vh;
  padding: 0;
  background: var(--color-avorio);
  align-content: center;
  justify-items: center;
  row-gap: 16px;
  position: relative;
  overflow: hidden;
}

/* Pannello hero blu egeo con logo Argo (assoluto, copre la prima colonna) */
.login-bg::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: calc(100% * 5 / 11);
  background-color: var(--color-egeo);
  background-image: url('assets/argo-logo.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: clamp(200px, 55%, 380px) auto;
  z-index: 0;
}

/* Tagline opzionale sotto il logo nel pannello hero */
.login-bg::after {
  content: "Custodisce.   Accoglie.   Risponde.";
  position: absolute;
  top: calc(50% + 130px); left: 0;
  width: calc(100% * 5 / 11);
  text-align: center;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.18em;
  color: rgba(216, 178, 106, 0.55);
  z-index: 1;
  pointer-events: none;
}

/* Tutti i figli vanno nella colonna destra */
.login-bg > * {
  grid-column: 2;
  position: relative;
  z-index: 2;
}

/* Nasconde il vecchio <div><Logo /></div> sopra la card (logo "T" verde non più necessario) */
.login-bg > div:first-child:not(.login-card) {
  display: none;
}

/* Responsive: su mobile collassa a singola colonna senza hero */
@media (max-width: 768px) {
  .login-bg {
    grid-template-columns: 1fr;
    padding: 32px 20px 24px;
    row-gap: 20px;
  }
  .login-bg::before,
  .login-bg::after { display: none; }
  .login-bg > * { grid-column: 1; }
  /* Mostra il logo testuale sopra il form card su mobile */
  .login-bg > div:first-child:not(.login-card) {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
  }
  /* Logo più grande su mobile login */
  .login-bg > div:first-child:not(.login-card) .logo {
    font-size: 22px;
  }
  .login-bg > div:first-child:not(.login-card) .logo-mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 10px;
  }
}

/* --- Login card legacy (white card centered) --- */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 36px;
  width: 100%;
  max-width: 420px;
}

/* --- Logo lockup (mark + wordmark "Argo") --- */
/* Quando components.jsx renderizza <div className="logo">
   con un mark colorato e il testo "Argo" — il testo deve essere visibile
   sia su bianco (login) che su egeo (sidebar). */
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 18px;
  color: var(--color-egeo);
  letter-spacing: -0.01em;
}
.sidebar .logo {
  color: var(--color-oro);  /* visibile su egeo */
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--color-terracotta);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-avorio); font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(198, 106, 58, 0.30);
  font-family: var(--font-display);
}
.sidebar .logo-mark {
  background: var(--color-oro);
  color: var(--color-egeo);
  box-shadow: 0 2px 6px rgba(216, 178, 106, 0.25);
}

/* =====================================================
   RESPONSIVE — Argo host frontend
   Breakpoint: --bp-sm:480px --bp-md:768px --bp-lg:1024px
   Desktop = default. Media query solo per overrides.
   ===================================================== */

/* ---- Hover solo su dispositivi che lo supportano ---- */
@media (hover: hover) {
  .btn-primary:hover:not(:disabled)   { background: var(--color-terracotta-soft); }
  .btn-secondary:hover:not(:disabled) { background: rgba(15,41,64,0.05); border-color: var(--color-egeo); }
  .btn-ghost:hover    { background: rgba(15,41,64,0.06); color: var(--color-egeo); }
  .btn-danger:hover   { background: rgba(166,57,30,0.06); border-color: var(--color-danger); }
  .btn-danger-solid:hover  { background: #8A2E17; }
  .btn-secondary-light:hover { background: rgba(247,242,232,0.08); }
  .nav-item:hover  { background: rgba(247,242,232,0.08); color: var(--color-avorio); }
  .prop-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-default); }
  .dropzone:hover, .dropzone.drag { border-color: var(--color-terracotta); background: rgba(198,106,58,0.04); }
  .tab:hover { color: var(--color-egeo); }
  .table tbody tr:hover { background: rgba(15,41,64,0.025); }
}

/* ---- Touch target minimi (si applicano sempre) ---- */
.btn          { min-height: 44px; }
.btn-sm       { min-height: 38px; }
.btn-xs       { min-height: 32px; }
.nav-item     { min-height: 44px; padding: 12px 14px; }

/* ---- Tabelle: scroll orizzontale, min-width sicuro ---- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table { min-width: 640px; }

/* ---- Griglia dashboard ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 16px;
}

/* ---- Header saluto dashboard ---- */
.greeting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.greeting-row > div:last-child { flex-shrink: 0; }
.greeting-subtitle { margin: 6px 0 0; }

/* ---- Tre card sintetiche: Piano · Strutture · Messaggi ---- */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  position: relative;
}
.dashboard-card-plan {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(107, 142, 78, 0.07) 100%);
}
.dashboard-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dashboard-card-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--color-egeo);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.dashboard-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.dashboard-card-action {
  align-self: flex-start;
  margin-top: 4px;
}
.dashboard-meta-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-terracotta);
  background: var(--surface-warning);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

/* =====================================================
   DASHBOARD — MOTION
   "Calmare, non eccitare": una sola entrata sobria + un
   segnale vigile (mai allarme) sulle richieste in sospeso.
   Tutto subordinato a prefers-reduced-motion.
   ===================================================== */

/* La mano del saluto riposa inclinata anche senza animazione */
.wave-hand { display: inline-block; transform: rotate(10deg); transform-origin: 70% 80%; }

@media (prefers-reduced-motion: no-preference) {
  /* 1. Entrata: i blocchi si posano con un breve stagger, una passata sola */
  .dashboard-animate > * {
    animation: dashSettle 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .dashboard-animate > *:nth-child(1) { animation-delay: 0.02s; }
  .dashboard-animate > *:nth-child(2) { animation-delay: 0.09s; }
  .dashboard-animate > *:nth-child(3) { animation-delay: 0.16s; }
  .dashboard-animate > *:nth-child(4) { animation-delay: 0.23s; }

  /* 2. Saluto: un cenno della mano, una volta sola, poi riposa a 10° */
  .wave-hand { animation: waveHand 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s 1 both; }

  /* 3. Richieste in sospeso: respiro lento e dorato sul pallino di stato.
        Vigile, non urgente — niente rosso, niente lampeggio. */
  .dashboard-animate .badge-pending::before {
    animation: pendingBreath 2.6s ease-in-out infinite;
  }

  /* 4. Copertina struttura: lieve zoom al passaggio (tattilità) */
  .prop-card .prop-thumb img { transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .prop-card:hover .prop-thumb img { transform: scale(1.04); }
}

@keyframes dashSettle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes waveHand {
  0%   { transform: rotate(0deg); }
  18%  { transform: rotate(13deg); }
  34%  { transform: rotate(-7deg); }
  50%  { transform: rotate(10deg); }
  66%  { transform: rotate(-4deg); }
  82%  { transform: rotate(8deg); }
  100% { transform: rotate(10deg); }
}
@keyframes pendingBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 178, 106, 0.5); }
  50%      { box-shadow: 0 0 0 4px rgba(216, 178, 106, 0); }
}

/* ---- Griglia piani abbonamento ---- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ---- Layout pagina abbonamenti (piani + pannello checkout) ---- */
.subscription-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.subscription-layout > .subscription-plans { flex: 1 1 auto; min-width: 0; }
.subscription-layout > .subscription-checkout { flex: 1 1 0; min-width: 0; }

/* ---- Griglia campi info struttura (property-detail) ---- */
.info-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---- Azioni wizard ---- */
.wizard-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- Wizard layout ---- */
.wizard-sidebar {
  width: 260px;
  background: var(--gray-900);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 36px 28px;
}

.wizard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
  overflow: hidden;
  min-width: 0;
}

.wizard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.wizard-topbar-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-egeo);
  margin: 0;
}

.wizard-body {
  flex: 1;
  overflow: auto;
  padding: 36px;
}

/* Mobile stepper — nascosto su desktop */
.wizard-stepper-mobile {
  display: none;
}

/* Chips step */
.wizard-step-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.wizard-step-chip-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.wizard-step-chip.active .wizard-step-chip-circle {
  background: var(--color-egeo);
  color: var(--color-avorio);
}
.wizard-step-chip.done .wizard-step-chip-circle {
  background: var(--color-terracotta);
  color: white;
}
.wizard-step-chip.todo .wizard-step-chip-circle {
  background: var(--border-default);
  color: var(--color-egeo-muted);
}
.wizard-step-chip-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-egeo-muted);
}
.wizard-step-chip.active .wizard-step-chip-label {
  color: var(--color-egeo);
  font-weight: 600;
}
.wizard-step-chip.done .wizard-step-chip-label {
  color: var(--color-terracotta);
}
.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-default);
  border-radius: 1px;
  min-width: 16px;
}
.wizard-step-line.done {
  background: var(--color-terracotta);
}

/* Hamburger nascosto su desktop (default) */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--color-egeo-muted);
  cursor: pointer;
  background: none;
  border: none;
  margin-right: 4px;
}

/* =====================================================
   ≤ 1024px — Tablet e schermi intermedi
   ===================================================== */
@media (max-width: 1024px) {

  /* App diventa colonna; sidebar diventa drawer fixed */
  .app { flex-direction: column; }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100dvh;
    width: 252px;
    z-index: 50;
    transition: left 0.25s ease;
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }

  /* Scrim overlay quando il drawer è aperto */
  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,41,64,0.45);
    z-index: 49;
    cursor: pointer;
  }
  .scrim.visible { display: block; }

  /* body blocca scroll quando nav aperto */
  body.nav-open { overflow: hidden; }

  /* Main si espande a tutto lo schermo */
  .main { min-height: 100dvh; }

  /* Topbar: mostra hamburger, padding ridotto */
  .topbar {
    height: 56px;
    padding: 0 16px;
  }

  /* Hamburger visibile su mobile/tablet */
  .hamburger { display: flex; }
  .hamburger:active { background: rgba(15,41,64,0.06); }

  /* Dashboard: 2-colonne → 1 colonna */
  .dashboard-grid { grid-template-columns: 1fr; }

  /* Tre card → 1 colonna su mobile, 2 su tablet medio */
  .dashboard-cards { grid-template-columns: 1fr; }

  /* Saluto: stack verticale su mobile */
  .greeting-row { flex-direction: column; align-items: flex-start; }

  /* Piani: 3 → 2 colonne */
  .plans-grid { grid-template-columns: repeat(2, 1fr); }

  /* Page padding */
  .page { padding: 24px 20px 56px; }
}

/* =====================================================
   ≤ 768px — Mobile
   ===================================================== */
@media (max-width: 768px) {

  /* Stat grid: auto-fill flessibile */
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  /* Prop grid: card più piccole */
  .prop-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  /* Piani: 1 colonna */
  .plans-grid { grid-template-columns: 1fr; }

  /* Abbonamenti: stack piani + pannello checkout a tutta larghezza */
  .subscription-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .subscription-layout > .subscription-plans,
  .subscription-layout > .subscription-checkout {
    width: 100%;
    flex: 0 0 auto;
  }

  /* Page padding più stretto */
  .page { padding: 16px 14px 56px; }

  /* Topbar */
  .topbar { height: 56px; padding: 0 14px; }

  /* Input: font-size 16px previene zoom iOS */
  .input, .textarea, select.input {
    min-height: 44px;
    font-size: 16px;
  }

  /* Info fields: 2 col → 1 col */
  .info-fields-grid { grid-template-columns: 1fr; }

  /* Tabs: scroll orizzontale senza wrap */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0;
  }
  .tab { white-space: nowrap; flex-shrink: 0; }

  /* Modali → bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90dvh;
  }

  /* .between: evita overflow su mobile */
  .between { flex-wrap: wrap; gap: 10px; }

  /* ---- Wizard mobile ---- */
  .wizard-sidebar { display: none; }

  .wizard-stepper-mobile {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--border-subtle);
    gap: 8px;
    flex-shrink: 0;
  }

  .wizard-topbar { padding: 14px 16px; }
  .wizard-topbar-title { font-size: 17px; }

  .wizard-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .wizard-body { padding: 20px 16px; }

  /* Wizard bottoni: column-reverse su mobile */
  .wizard-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .wizard-actions .btn { width: 100%; justify-content: center; }
}

/* =====================================================
   ≤ 640px — Mobile piccolo
   ===================================================== */
@media (max-width: 640px) {

  /* Galleria foto */
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
  }

  /* Toast: full-width */
  .toast {
    right: 12px;
    left: 12px;
    bottom: 16px;
  }
}

/* =====================================================
   ≤ 480px — Mobile stretto (wizard, checkin, schedina)
   ===================================================== */
@media (max-width: 480px) {

  /* Stat grid: 1 colonna */
  .stat-grid { grid-template-columns: 1fr; }

  /* Prop grid: 1 colonna */
  .prop-grid { grid-template-columns: 1fr; }

  /* Wizard: bottoni in colonna (già gestito a 768px, ribadito qui per min sicurezza) */
  .wizard-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .wizard-actions .btn { width: 100%; justify-content: center; }

  /* Piani: assicura 1 colonna */
  .plans-grid { grid-template-columns: 1fr; }

  /* Page padding minimo */
  .page { padding: 14px 12px 64px; }

  /* Card padding ridotto */
  .card-pad { padding: 16px; }
}

/* =====================================================
   Classi utility responsive
   ===================================================== */
/* Bottone submit sticky in fondo — usato in checkin.jsx e schedina.jsx */
.sticky-submit {
  position: sticky;
  bottom: 0;
  padding: 12px 0 16px;
  background: linear-gradient(to top, var(--bg-app) 80%, transparent);
  z-index: 10;
}

/* City autocomplete dropdown: fixed su mobile piccolo */
@media (max-width: 640px) {
  .city-dropdown-fixed {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto;
    width: auto !important;
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
  }
}

/* =====================================================
   SCROLL LOCK — usato da Drawer quando aperto
   ===================================================== */
body.scroll-lock { overflow: hidden; }

/* =====================================================
   CARD STACK — card siblings con gap uniforme
   ===================================================== */
.card-stack > .card + .card { margin-top: 24px; }

/* Card con padding standard da info-tab */
.card-info {
  padding: 28px;
  background: var(--color-avorio);
  border-color: var(--border-default);
}
.card-info .card-head { margin-bottom: 20px; }
.card-info .card-head h2 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500; color: var(--color-egeo);
  margin: 0 0 4px; letter-spacing: -0.005em;
}
.card-info .card-head .card-sub { font-size: 13px; color: var(--text-muted); margin: 0; }

/* Grid campo info a 2 colonne */
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field-grid-2 .full { grid-column: 1 / -1; }

/* =====================================================
   TOGGLE — interruttore on/off
   ===================================================== */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  /* Padding invisibile per touch target 44x44 su mobile */
  padding: 8px;
  margin: -8px;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
}
.toggle-track {
  position: relative;
  width: 48px; height: 26px;
  border-radius: var(--radius-pill);
  background: var(--border-default);
  flex-shrink: 0;
}
.toggle-track.on { background: var(--color-terracotta); }
.toggle-track-sm { width: 40px; height: 22px; }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle-track.on .toggle-thumb { left: 25px; }
.toggle-track-sm.on .toggle-thumb { left: 19px; }
.toggle-track-sm .toggle-thumb { width: 16px; height: 16px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 4px 0;
}
.toggle-row .label-block .toggle-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500; color: var(--color-egeo);
  margin: 0 0 4px;
}
.toggle-row .label-block .toggle-sub { font-size: 13px; color: var(--text-muted); margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .toggle-track { transition: background 0.2s; }
  .toggle-thumb { transition: left 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
}

/* =====================================================
   PT BANNER — 3 stati PayTourist
   ===================================================== */
.pt-banner {
  margin-top: 20px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px; line-height: 1.55;
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid;
}
.pt-banner-icon {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.pt-banner-info {
  background: var(--surface-info-soft);
  border-color: var(--border-subtle);
  color: var(--color-egeo);
}
.pt-banner-info .pt-banner-icon { color: var(--color-egeo); }
.pt-banner-warning {
  background: var(--surface-warning-soft);
  border-color: var(--surface-warning);
  color: var(--color-egeo);
}
.pt-banner-warning .pt-banner-icon { color: #8A6B2A; }
.pt-banner-uncovered {
  background: var(--color-avorio-warm);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.pt-banner-uncovered .pt-banner-icon { color: var(--text-muted); }
.pt-banner strong { color: var(--color-egeo); }
.pt-banner-link {
  color: var(--color-terracotta); text-decoration: underline; font-weight: 500;
  cursor: pointer; background: none; border: none; padding: 0; font-family: inherit; font-size: inherit;
}

/* =====================================================
   PT PICKER — configurazione struttura PayTourist
   ===================================================== */
.pt-picker {
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-avorio);
}
.pt-picker-head {
  padding: 14px 18px;
  background: white;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pt-picker-head .pt-picker-city {
  font-family: var(--font-display); font-weight: 500;
  color: var(--color-egeo); font-size: 15px;
}
.pt-picker-head .pt-picker-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.pt-picker-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.pt-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =====================================================
   BADGE — varianti aggiunte per sessions
   ===================================================== */
/* .badge-active, .badge-pending, .badge-plain già definite sopra — ok */

/* =====================================================
   AVATAR — iniziali nome ospite
   ===================================================== */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-avorio-warm); color: var(--color-egeo);
  font-family: var(--font-display); font-weight: 600;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* =====================================================
   SESSION ROWS — lista sessioni ospiti
   ===================================================== */
.sessions-card { padding: 0; overflow: hidden; }

.sessions-toolbar {
  display: flex; gap: 8px; padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--color-avorio);
  flex-wrap: wrap;
}

.session-tab {
  padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  font-size: 13px; color: var(--text-muted);
  background: white; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.session-tab.active {
  background: var(--color-egeo); color: var(--color-avorio); border-color: var(--color-egeo);
}
.session-tab .st-count {
  background: rgba(255,255,255,0.18); padding: 1px 7px; border-radius: var(--radius-pill); font-size: 11px;
}
.session-tab:not(.active) .st-count {
  background: var(--surface-info-soft); color: var(--text-muted);
}

.session-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr auto 32px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
}
.session-row:last-child { border-bottom: none; }
.session-row.selected { background: var(--surface-info-strong); }

.session-guest { display: flex; align-items: center; gap: 12px; min-width: 0; }
.session-guest .sg-name { font-weight: 500; color: var(--color-egeo); font-size: 14px; }
.session-guest .sg-contact { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.session-period .sp-row { font-size: 13px; color: var(--color-egeo); }
.session-period .sp-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 4px; }

.session-status { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.session-chevron {
  color: var(--text-muted); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}

@media (hover: hover) {
  .session-row:hover { background: var(--surface-info-soft); }
  .session-row.selected:hover { background: var(--surface-info-strong); }
  .session-tab:not(.active):hover { border-color: var(--border-default); color: var(--color-egeo); }
}

@media (max-width: 768px) {
  .session-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .session-period, .session-status { display: none; }
  .session-status.mobile-show { display: flex; }
}

/* =====================================================
   DRAWER — pannello laterale sessione ospite
   ===================================================== */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(15, 41, 64, 0.35);
  opacity: 0; pointer-events: none;
  z-index: 200;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 92vw;
  background: var(--color-avorio);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  z-index: 201;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

@media (prefers-reduced-motion: no-preference) {
  .drawer-scrim { transition: opacity 0.22s; }
  .drawer { transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
}

.drawer-head {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  background: white;
  flex-shrink: 0;
}
.drawer-head .dh-name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500; color: var(--color-egeo);
  margin: 0 0 4px;
}
.drawer-head .dh-contact {
  font-size: 13px; color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", monospace;
}
.drawer-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border-subtle);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.drawer-close:hover { background: var(--surface-info-soft); color: var(--color-egeo); }

.drawer-body {
  flex: 1; overflow-y: auto;
  padding: 24px 28px;
}

.drawer-section { margin-bottom: 28px; }
.drawer-section h3 {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600; color: var(--color-terracotta);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin: 0 0 12px;
}

.meta-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 13px;
  border-bottom: 1px dashed var(--border-subtle);
}
.meta-row:last-child { border-bottom: none; }
.meta-row .mr-key { color: var(--text-muted); }
.meta-row .mr-val { color: var(--color-egeo); font-weight: 500; }

.status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: white;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.status-row .sr-label {
  font-size: 13px; color: var(--color-egeo);
  display: flex; align-items: center; gap: 8px;
}
.status-row .sr-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-success); flex-shrink: 0;
}
.status-row .sr-dot.warn { background: var(--color-oro); }
.status-row .sr-dot.fail { background: var(--color-danger); }
.status-row .sr-dot.plain { background: var(--border-default); }

.checkin-link-box {
  display: flex; align-items: center; gap: 10;
  padding: 10px 14px;
  margin-top: -4px; margin-bottom: 10px;
  background: var(--surface-info-soft);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  gap: 10px;
}
.checkin-link-url {
  flex: 1; min-width: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--color-egeo);
  word-break: break-all;
  line-height: 1.5;
}
.checkin-link-copy {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-egeo-muted);
  white-space: nowrap;
  min-width: 54px;
}

.drawer-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--border-subtle);
  background: white;
  display: flex; gap: 8px; justify-content: flex-end;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .drawer { width: 100%; max-width: 100%; }
  .drawer-head { padding: 20px 20px 16px; }
  .drawer-body { padding: 20px; }
  .drawer-footer { padding: 14px 20px; }
}

/* =====================================================
   INFO-TAB — azioni footer
   ===================================================== */
.info-tab-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px;
}

/* =====================================================
   ADEMPIMENTI SECTION — card extra check-in e PT
   ===================================================== */
.adempimenti-section { margin-top: 8px; }

/* Checkin form — date input non overflow su mobile (iOS ha larghezza intrinseca che ignora width:100%) */
input[type="date"].input,
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* =====================================================
   TABLE-AS-CARDS — tabella → card su mobile (data-label)
   Usata dalle tabelle del dashboard
   ===================================================== */
@media (max-width: 640px) {
  .table-as-cards { min-width: 0; }
  .table-as-cards thead { display: none; }
  .table-as-cards tr {
    display: block;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin: 12px;
    background: var(--bg-card);
  }
  .table-as-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-align: right;
  }
  .table-as-cards td:last-child { border-bottom: 0; }
  .table-as-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-egeo-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    text-align: left;
  }
}

/* Impostazioni — griglia 2 colonne sotto il pannello Piano
   Su desktop le card Profilo/Password/Notifiche (e future) si
   affiancano a 2 a 2 coprendo la stessa larghezza del pannello
   Piano sopra; su mobile impilano a colonna singola. */
.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 768px) {
  .settings-cards-grid {
    grid-template-columns: 1fr;
  }
}
