/* ============================================================
   Terrific Tutoring Centre — Staff Portal Stylesheet
   Reuses colour/font variables defined in css/styles.css
   ============================================================ */

body { background: var(--off-white); }

.hidden { display: none !important; }

/* ── Header ── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.95rem;
}
.portal-brand img {
  width: 34px; height: 34px;
  object-fit: cover; border-radius: 50%;
}
.portal-brand strong {
  display: block;
  color: var(--accent-dark);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.portal-signout {
  background: var(--primary-light);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}
.portal-signout:hover { background: var(--primary-mid); }

/* ── Main / state screens ── */
.portal-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.portal-state {
  text-align: center;
  padding: 4rem 1rem;
}
.portal-state h2 {
  font-family: 'Playfair Display', serif;
  color: var(--accent-dark);
  margin-bottom: 0.75rem;
}
.portal-state p { color: var(--text-mid); margin-bottom: 1.5rem; }

.portal-btn {
  background: var(--accent-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.portal-btn:hover { background: var(--accent-mid); transform: translateY(-1px); }
.portal-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Tabs ── */
.portal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--primary-light);
}
.portal-tab {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.portal-tab.active,
.portal-tab:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}

/* ── Panels ── */
.portal-panel h2 {
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}
.portal-panel h3 { margin: 2rem 0 0.75rem; color: var(--text-dark); }
.portal-hint { color: var(--text-mid); font-size: 0.88rem; margin-bottom: 1rem; }

.portal-form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) { .portal-form-row { grid-template-columns: 1fr; } }

.portal-field { margin-bottom: 1rem; }
.portal-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 0.35rem;
}
.portal-field select,
.portal-field input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--primary-light);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--text-dark);
}
.portal-field select:focus,
.portal-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.portal-msg { margin-top: 0.75rem; font-size: 0.85rem; font-weight: 600; min-height: 1.2em; }

/* ── Tables ── */
.portal-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.portal-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.portal-table th,
.portal-table td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--primary-light);
}
.portal-table th {
  background: var(--primary-light);
  color: var(--text-dark);
  font-weight: 700;
}
.portal-table select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--primary-mid);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
}
.portal-table tbody tr[data-clickable] { cursor: pointer; }
.portal-table tbody tr[data-clickable]:hover { background: var(--primary-light); }

/* ── Small action buttons (edit/delete in table rows) ── */
.portal-btn-sm {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.4rem;
  background: var(--primary-light);
  color: var(--text-dark);
  transition: background var(--transition);
}
.portal-btn-sm:last-child { margin-right: 0; }
.portal-btn-sm:hover { background: var(--primary-mid); }
.portal-btn-danger { background: #f6d9d4; color: #8a2c1d; }
.portal-btn-danger:hover { background: #eebbb0; }

/* ── Loading state ── */
.portal-loading { color: var(--text-light); font-size: 0.85rem; padding: 0.75rem 0.25rem; }

/* ── Attendance stats ── */
.portal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-mid);
}
.portal-stats span strong { color: var(--text-dark); }

/* ── Learner detail modal content (shell reused from css/styles.css .pf-modal*) ── */
.learner-detail-section { margin-bottom: 1.25rem; }
.learner-detail-section:last-child { margin-bottom: 0; }
.learner-detail-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
  margin: 0 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--primary-light);
}
.learner-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
}
@media (max-width: 480px) { .learner-detail-grid { grid-template-columns: 1fr; } }
.learner-detail-grid dt { font-size: 0.72rem; color: var(--text-light); margin: 0; }
.learner-detail-grid dd { font-size: 0.88rem; color: var(--text-dark); margin: 0 0 0.5rem; }
