:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 0;
  margin-bottom: 24px;
}
.topbar .container {
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar a.logout {
  color: var(--gray-600);
  text-decoration: none;
  font-size: .9rem;
  border: 1px solid var(--gray-200);
  padding: 6px 12px;
  border-radius: 8px;
}
.topbar a.logout:hover { background: var(--gray-100); }

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

h2 { margin-top: 0; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

input[type=text], input[type=password], input[type=tel], input[type=time], input[type=date], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: var(--gray-600); }
.btn.danger { background: var(--red); }
.btn:disabled { background: var(--gray-400); cursor: not-allowed; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.msg.error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.msg.success { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }

/* Calendar */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-header button {
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem;
}
.cal-header .label { font-weight: 600; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-size: .75rem;
  color: var(--gray-400);
  font-weight: 600;
  padding-bottom: 4px;
}
.cal-day {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .9rem;
  cursor: default;
  color: var(--gray-800);
  position: relative;
}
.cal-day.empty { visibility: hidden; }
.cal-day.past { color: var(--gray-400); }
.cal-day.has-slots {
  cursor: pointer;
  border-color: var(--primary);
  background: #eff6ff;
  font-weight: 600;
}
.cal-day.has-slots:hover { background: #dbeafe; }
.cal-day.selected { background: var(--primary); color: #fff; }
.cal-day .dot {
  position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--primary);
}
.cal-day.selected .dot { background: #fff; }

.slot-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.slot-btn {
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
}
.slot-btn:hover { border-color: var(--primary); background: #eff6ff; }
.slot-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot-btn.booked { color: var(--gray-400); background: var(--gray-100); cursor: not-allowed; text-decoration: line-through; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--gray-200); font-size: .9rem; }
th { color: var(--gray-600); font-size: .8rem; text-transform: uppercase; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; }
.badge.available { background: #f0fdf4; color: var(--green); }
.badge.booked { background: #fef2f2; color: var(--red); }

.small { font-size: .82rem; color: var(--gray-600); }
