* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  color: #1a1a2e;
  min-height: 100vh;
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* LOGIN */
.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}
.beach-icon { font-size: 64px; }
.login-box h1 { font-size: 22px; text-align: center; color: #1565C0; }
.subtitle { color: #666; font-size: 14px; }
.login-box select, .login-box input {
  width: 100%; padding: 12px 14px; border: 2px solid #ddd;
  border-radius: 10px; font-size: 16px; background: white;
}
.login-box select:focus, .login-box input:focus { border-color: #1565C0; outline: none; }

/* HEADER */
header {
  background: linear-gradient(135deg, #1565C0, #0D47A1);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
header h1 { font-size: 18px; }
.family-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.btn-logout {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* TAB BAR */
.tab-bar {
  display: flex;
  background: white;
  border-bottom: 2px solid #e0e0e0;
  position: sticky;
  top: 53px;
  z-index: 99;
}
.tab {
  flex: 1;
  padding: 12px 4px;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.tab.active { color: #1565C0; border-bottom-color: #1565C0; font-weight: 600; }

/* TAB CONTENT */
.tab-content { padding: 16px; padding-bottom: 80px; }

/* CARD */
.card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card h3 { margin-bottom: 12px; color: #1565C0; font-size: 15px; }

/* BUTTONS */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: #1565C0;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.btn-primary:active { background: #0D47A1; }
.btn-danger {
  padding: 4px 10px;
  background: #ef5350;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

/* CALENDAR */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.calendar-header button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 36px; height: 36px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
}
#month-label { font-size: 17px; font-weight: 700; color: #1565C0; }

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: white;
  border-radius: 10px;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }

.calendar-grid {
  margin-bottom: 16px;
}
.month-block {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}
.month-title {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #1565C0;
  padding: 10px;
  background: #f0f4ff;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #e8eef7;
}
.cal-weekday {
  text-align: center;
  padding: 8px 2px;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-day {
  min-height: 44px;
  padding: 4px;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  font-size: 13px;
}
.cal-day.empty { background: #fafafa; }
.cal-day.today .day-num { background: #1565C0; color: white; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.day-num { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.day-booking {
  border-radius: 3px;
  padding: 5px 3px;
  font-size: 10px;
  color: white;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BOOKING FORM */
.booking-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-top: 10px;
  margin-bottom: 4px;
}
.booking-form input[type="date"],
.booking-form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
}
.booking-form input:focus { border-color: #1565C0; outline: none; }

/* MY BOOKINGS */
.booking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.booking-item:last-child { border-bottom: none; }
.booking-dates { font-size: 14px; font-weight: 600; }
.booking-note { font-size: 12px; color: #666; margin-top: 2px; }

/* MESSAGES */
.message-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.message-item:last-child { border-bottom: none; }
.message-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.message-family { font-size: 12px; font-weight: 700; }
.message-time { font-size: 11px; color: #999; }
.message-content { font-size: 14px; line-height: 1.5; }
.message-input {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: white;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.message-input textarea {
  flex: 1;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}
.message-input textarea:focus { border-color: #1565C0; outline: none; }
.message-input .btn-primary { width: auto; padding: 10px 16px; margin: 0; }

/* DOCUMENTS */
.upload-area input[type="file"] { width: 100%; margin: 8px 0; }
.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.doc-item:last-child { border-bottom: none; }
.doc-name { font-size: 14px; }
.doc-name a { color: #1565C0; text-decoration: none; }
.doc-meta { font-size: 11px; color: #999; margin-top: 2px; }

/* ERRORS */
.error-msg { color: #e53935; font-size: 13px; min-height: 18px; text-align: center; }
