:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --free: #16a34a;
  --busy: #dc2626;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header.site-header {
  background: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.site-header a { color: white; text-decoration: none; font-weight: 600; }
header.site-header nav a { margin-left: 1rem; font-weight: 400; opacity: 0.9; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.room-card h3 { margin: 0 0 0.25rem; }
.room-card .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #f1f5f9;
}
.status-pill.free { color: var(--free); }
.status-pill.busy { color: var(--busy); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

a.button, button.button {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
a.button:hover, button.button:hover { background: var(--primary-dark); }
button.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.button.danger { background: var(--danger); }

form .field { margin-bottom: 1rem; }
form label { display: block; margin-bottom: 0.3rem; font-weight: 500; font-size: 0.9rem; }
form input, form textarea, form select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.row { display: flex; gap: 1rem; }
.row .field { flex: 1; }

.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.success-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

#calendar { margin-top: 1rem; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; }

table.bookings-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.bookings-table th, table.bookings-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.room-list-admin { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.room-list-admin a.tab {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}
.room-list-admin a.tab.active { background: var(--primary); color: white; }

.muted { color: var(--muted); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
