* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, system-ui, sans-serif;
  margin: 0;
  background: #faf7f2;
  color: #2b2320;
  overflow-x: hidden;
}
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; margin-top: 1.5rem; }

.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #b25b2c;
  flex-wrap: wrap;
}
.topnav a, .topnav button {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
}
.inline { display: inline; }

.nav-dates { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-dates a { color: #b25b2c; text-decoration: none; padding: 0.3rem 0; display: inline-block; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #e5ddd3;
}
tr.status-confirmed { background: #eaf5ea; }
tr.status-refused { background: #f7e8e6; opacity: 0.7; }

button.ok, button.no {
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  min-height: 44px;
}
button.ok { background: #d9f0d9; }
button.no { background: #f5d9d6; }

/* Sotto i 640px: la tabella prenotazioni diventa una lista di schede,
   niente scroll orizzontale su telefono */
@media (max-width: 640px) {
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td {
    display: block;
    width: 100%;
  }
  table.responsive tr {
    margin-bottom: 0.75rem;
    border: 1px solid #e5ddd3;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
  }
  table.responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #f0ebe3;
    padding: 0.5rem 0;
    text-align: right;
  }
  table.responsive td:last-child { border-bottom: none; }
  table.responsive td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
    color: #6b5d4f;
  }
  table.responsive td[data-label=""]::before { content: none; }
  table.responsive td[data-label=""] {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  table.responsive td[data-label=""] form { width: 100%; }
  table.responsive td[data-label=""] button { width: 100%; }
}

.login {
  max-width: 320px;
  margin: 4rem auto;
  text-align: center;
}
.login input {
  width: 100%;
  padding: 0.6rem;
  margin: 0.5rem 0;
  font-size: 1rem;
}
.login button {
  width: 100%;
  padding: 0.6rem;
  background: #b25b2c;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.error { color: #b23c2c; }

.stats { list-style: none; padding: 0; font-size: 1.05rem; }
.stats li { padding: 0.4rem 0; border-bottom: 1px solid #e5ddd3; }
