/* ─── TenisLog CSS ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cyan-50:  #F0F8FC;
  --cyan-100: #E0F3FC;
  --cyan-200: #B9E1F5;
  --cyan-300: #7DC6E8;
  --cyan-500: #3FAEC8;
  --cyan-600: #0284C7;
  --cyan-700: #0369A1;
  --green:    #16A34A;
  --red:      #DC2626;
  --text:     #1E293B;
  --text-sub: #64748B;
  --border:   #E0EDF5;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(2,132,199,.10);
  --nav-h:    58px;
  --mobile-nav-h: 60px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cyan-50);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 8px;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1.5px solid var(--border);
  padding: 0 24px;
  box-shadow: 0 1px 8px rgba(2,132,199,.06);
}

.navbar-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-icon   { font-size: 22px; }
.brand-name   { font-size: 18px; font-weight: 800; color: var(--cyan-600); letter-spacing: -.3px; }

.navbar-links { display: flex; align-items: center; gap: 4px; margin-left: 28px; flex: 1; }

.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  color: var(--text-sub);
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--cyan-100); color: var(--cyan-600); }
.nav-link.active { background: var(--cyan-100); color: var(--cyan-600); }

.navbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.coach-badge {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
}
.coach-name-nav { font-size: 13px; font-weight: 600; color: var(--text-sub); }

.btn-logout {
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  padding: 5px 12px; border-radius: 7px;
  border: 1.5px solid var(--border);
  transition: border-color .15s, color .15s;
}
.btn-logout:hover { border-color: var(--cyan-300); color: var(--cyan-600); }

/* Mobile nav (hidden on desktop) */
.mobile-nav { display: none; }

/* ─── Page layout ─────────────────────────────────────────────────────── */
.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-header-left {}
.page-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 800; color: var(--text); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--cyan-300); background: var(--cyan-50); }
.btn-primary { background: var(--cyan-600); color: #fff; border-color: var(--cyan-600); }
.btn-primary:hover { background: var(--cyan-700); border-color: var(--cyan-700); }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #15803D; border-color: #15803D; }
.btn-danger  { background: #fff; color: var(--red); border-color: #FECACA; }
.btn-danger:hover  { background: #FEF2F2; border-color: var(--red); }
.btn-sm   { padding: 5px 12px; font-size: 13px; }
.btn-icon { padding: 7px; min-width: 34px; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 3px rgba(63,174,200,.15);
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-row .form-group.flex-1 { flex: 1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.form-hint { font-weight: 400; font-size: 11px; color: var(--text-sub); }

/* ─── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: #FEF2F2; color: var(--red); border: 1px solid #FECACA; }

/* ─── Login page ─────────────────────────────────────────────────────── */
body.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--cyan-50);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(2,132,199,.12);
  padding: 36px 32px 32px;
  width: 100%; max-width: 400px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.brand-icon-large { font-size: 48px; display: block; margin-bottom: 8px; }
.login-title { font-size: 26px; font-weight: 800; color: var(--cyan-600); }
.login-sub   { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.login-form .form-group { margin-bottom: 16px; }

/* ─── Calendar ───────────────────────────────────────────────────────── */
.calendar-wrap { overflow-x: auto; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  min-width: 560px;
}

.cal-header-cell {
  text-align: center;
  font-size: 12px; font-weight: 700;
  color: var(--cyan-600);
  padding: 6px 0;
  letter-spacing: .3px;
}

.cal-cell {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  min-height: 90px;
  padding: 6px 5px 4px;
  display: flex; flex-direction: column; gap: 3px;
  position: relative;
  transition: border-color .15s;
}
.cal-cell:hover { border-color: var(--cyan-300); }
.cal-cell:hover .cal-add-btn { opacity: 1; }
.cal-cell-empty { background: transparent; border-color: transparent; }
.cal-cell-today { border-color: var(--cyan-500); background: var(--cyan-50); }

.cal-day-num {
  font-size: 12px; font-weight: 700; color: var(--text-sub);
  text-align: right; margin-bottom: 2px;
}
.today-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cyan-600); color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; margin-left: auto;
}

.cal-pill {
  background: var(--cyan-100);
  border-left: 3px solid var(--cyan-600);
  border-radius: 5px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 11px;
  transition: background .12s;
}
.cal-pill:hover { background: var(--cyan-200); }
.pill-time  { display: block; font-weight: 700; color: var(--cyan-700); }
.pill-names { display: block; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cal-add-btn {
  position: absolute; bottom: 4px; right: 5px;
  font-size: 16px; color: var(--cyan-500);
  cursor: pointer; opacity: 0;
  transition: opacity .15s, color .12s;
  line-height: 1;
}
.cal-add-btn:hover { color: var(--cyan-600); }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,40,80,.25);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(2,132,199,.16);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--text-sub); padding: 2px 6px; border-radius: 6px;
}
.modal-close:hover { background: var(--cyan-100); color: var(--cyan-600); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}
.modal-footer .btn-danger { margin-right: auto; }

/* Checkbox list */
.checkbox-list { display: flex; flex-direction: column; gap: 6px; }
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  font-size: 14px;
}
.checkbox-item:has(input:checked) {
  border-color: var(--cyan-500);
  background: var(--cyan-50);
}
.checkbox-item input { accent-color: var(--cyan-600); width: 16px; height: 16px; cursor: pointer; }

/* ─── Attendance ─────────────────────────────────────────────────────── */
.attendance-list { display: flex; flex-direction: column; gap: 14px; }

.attendance-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.attendance-card-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: var(--cyan-50);
  border-bottom: 1px solid var(--border);
}
.att-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 42px;
}
.att-day   { font-size: 24px; font-weight: 800; color: var(--cyan-600); line-height: 1; }
.att-month { font-size: 11px; font-weight: 600; color: var(--text-sub); text-transform: uppercase; }
.att-info {}
.att-time  { font-size: 15px; font-weight: 700; color: var(--text); }
.att-duration { font-size: 12px; color: var(--text-sub); margin-left: 4px; }
.att-court { font-size: 12px; color: var(--text-sub); }
.att-no-students { padding: 12px 18px; font-size: 13px; color: var(--text-sub); font-style: italic; }

.att-students { padding: 10px 18px; display: flex; flex-direction: column; gap: 6px; }
.att-student-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--cyan-50);
}
.att-student-name { font-size: 14px; font-weight: 600; }

.att-toggle {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  background: none;
}
.att-toggle.present { border-color: var(--green); color: var(--green); }
.att-toggle.present:hover { background: #DCFCE7; }
.att-toggle.absent  { border-color: #FECACA;     color: var(--red);   }
.att-toggle.absent:hover  { background: #FEF2F2; }

/* ─── Stats ──────────────────────────────────────────────────────────── */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card-accent { border-color: var(--cyan-300); background: var(--cyan-50); }
.stat-card-label  { font-size: 12px; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.stat-card-value  { font-size: 26px; font-weight: 800; color: var(--cyan-600); }

.table-wrap { overflow-x: auto; }
.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.stats-table th {
  background: var(--cyan-100);
  color: var(--cyan-700);
  font-weight: 700;
  font-size: 12px;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--cyan-200);
}
.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tbody tr:hover td { background: var(--cyan-50); }
.stats-total-row td { background: var(--cyan-50); border-top: 2px solid var(--cyan-200); }

.text-right  { text-align: right; }
.text-center { text-align: center; }
.font-bold   { font-weight: 700; }

.student-name-cell  { font-weight: 600; }
.student-email-cell { font-size: 11px; color: var(--text-sub); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; border-radius: 6px;
  font-size: 12px; font-weight: 700; padding: 0 6px;
}
.badge-present { background: #DCFCE7; color: #15803D; }
.badge-absent  { background: #FEF2F2; color: var(--red); }

/* ─── Admin tabs ─────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 10px 18px;
  font-size: 14px; font-weight: 700;
  color: var(--text-sub);
  border-radius: 8px 8px 0 0;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.tab:hover  { background: var(--cyan-100); color: var(--cyan-600); }
.tab.active { color: var(--cyan-600); border-bottom: 2px solid var(--cyan-600); margin-bottom: -2px; }

.tab-content { max-width: 700px; }
.tab-content h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }

.tab-content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.tab-content-header h3 { margin-bottom: 0; }

.inline-form {
  background: var(--cyan-50);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}

.entity-list { display: flex; flex-direction: column; gap: 6px; }
.entity-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  gap: 10px;
}
.entity-name    { font-size: 14px; font-weight: 600; }
.entity-sub     { font-size: 12px; color: var(--text-sub); }
.entity-actions { display: flex; gap: 6px; flex-shrink: 0; }
.entity-right   { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.entity-rate    { font-size: 13px; font-weight: 600; color: var(--cyan-600); }

.entity-coach-row { display: flex; align-items: center; gap: 10px; }
.coach-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-sub);
}
.empty-state svg { display: block; margin: 0 auto 14px; opacity: .7; }
.empty-state p { font-size: 15px; line-height: 1.6; }
.empty-state-sm { color: var(--text-sub); font-size: 14px; font-style: italic; padding: 12px 0; }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-links, .coach-name-nav { display: none; }
  .page-content { padding: 16px 12px var(--mobile-nav-h); }
  .page-title   { font-size: 18px; }

  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: #fff;
    border-top: 1.5px solid var(--border);
    box-shadow: 0 -2px 12px rgba(2,132,199,.08);
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px;
    font-size: 10px; font-weight: 600;
    color: var(--text-sub);
    transition: color .15s;
  }
  .mobile-nav-item.active { color: var(--cyan-600); }
  .mobile-nav-item svg { flex-shrink: 0; }

  .stats-table { font-size: 12px; }
  .stats-table th, .stats-table td { padding: 8px 8px; }

  .form-row { flex-direction: column; }
  .modal { max-height: 95vh; }
}

@media (max-width: 480px) {
  .attendance-card-header { gap: 10px; padding: 10px 12px; }
  .att-day { font-size: 20px; }
  .stat-card { padding: 14px 16px; }
  .stat-card-value { font-size: 22px; }
}
