/* ═══════════════════════════════════════════
   Career Spotlight Day v2 — Stylesheet
   St James' Catholic High School
═══════════════════════════════════════════ */

:root {
  --navy:       #0b5f7a;
  --navy-dark:  #08435a;
  --blue:       #2563eb;
  --sky:        #eaf3ff;
  --green:      #166534;
  --lightgreen: #dcfce7;
  --red:        #991b1b;
  --lightred:   #fee2e2;
  --amber:      #92400e;
  --lightamber: #fef3c7;
  --grey:       #f1f5f9;
  --border:     #cbd5e1;
  --text:       #1f2937;
  --muted:      #64748b;
  --white:      #ffffff;
}

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

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #dbeafe, #eef2ff);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Topbar ── */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { font-size: 18px; font-weight: 700; }
.school-name { font-size: 13px; opacity: 0.75; }

/* ── Page wrap ── */
.page-wrap {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

/* ── Container (student pages) ── */
.container {
  background: var(--white);
  border-radius: 14px;
  padding: 28px 32px;
  border: 1px solid rgba(37,99,235,0.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

/* ── Flash messages ── */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}
.flash-success { background: var(--lightgreen); color: var(--green); }
.flash-error   { background: var(--lightred);   color: var(--red); }
.flash-info    { background: var(--sky);         color: var(--navy); }

/* ── Info / error boxes ── */
.info-box {
  background: var(--sky);
  border-left: 4px solid var(--navy);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.info-box.warning { background: var(--lightamber); border-color: var(--amber); }
.info-box.success-box { background: var(--lightgreen); border-color: var(--green); }
.info-box.warning-box { background: var(--lightamber); border-color: var(--amber); }
.error-box {
  background: var(--lightred);
  border-left: 4px solid var(--red);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  color: var(--red);
  font-weight: 600;
}
.verified-box {
  background: #eef6ff;
  color: #1e3a8a;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--blue);
  margin-bottom: 16px;
}
.verified-box p { margin: 2px 0; font-size: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(0.9); }
.btn-primary   { background: var(--blue); }
.btn-secondary { background: #475569; }
.btn-danger    { background: #dc2626; }
.btn-sm  { padding: 7px 12px; font-size: 13px; }
.btn-xs  { padding: 4px 8px;  font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
input[type=text],
input[type=password],
select,
.input-sm,
.input-xs {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  max-width: 400px;
}
.input-sm { max-width: 180px; }
.input-xs { max-width: 140px; padding: 4px 8px; font-size: 12px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ── Dashboard header ── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--white);
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.dash-header h1 { font-size: 26px; color: var(--navy); margin-bottom: 4px; }
.dash-header p  { color: var(--muted); font-size: 14px; }
.dash-header-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reg-status { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.stat-card.stat-green { border-color: #86efac; background: #f0fdf4; }
.stat-card.stat-red   { border-color: #fca5a5; background: #fef2f2; }
.stat-num   { font-size: 32px; font-weight: 800; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--white);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* ── Section card ── */
.section-card {
  background: var(--white);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.section-card h2 { color: var(--navy); font-size: 18px; margin-bottom: 12px; }
.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  background: var(--navy);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}
td { padding: 10px 12px; border-top: 1px solid #e2e8f0; }
tr:nth-child(even) { background: #f8fafc; }
.table-scroll { max-height: 60vh; overflow: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}
.badge-green  { background: var(--lightgreen); color: var(--green); }
.badge-red    { background: var(--lightred);   color: var(--red); }
.badge-amber  { background: var(--lightamber); color: var(--amber); }
.count-badge  { padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; }

/* ── Year / form grid ── */
.year-block { margin-bottom: 16px; }
.year-block h3 { color: var(--navy); margin-bottom: 8px; font-size: 15px; }
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.form-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
}
.form-btn:hover    { background: var(--sky); }
.form-btn-active   { background: #dbeafe; border-color: var(--blue); color: var(--blue); }

/* ── Two col panels ── */
.two-col-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .two-col-panels { grid-template-columns: 1fr; }
}
.panel {
  border-radius: 14px;
  padding: 16px;
  border: 2px solid;
}
.panel-red   { background: #fef2f2; border-color: #ef4444; }
.panel-green { background: #f0fdf4; border-color: #22c55e; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.panel-red   h3 { color: var(--red); }
.panel-green h3 { color: var(--green); }
.empty-msg { color: var(--muted); font-style: italic; padding: 12px 0; }

/* ── Allocations grid ── */
.alloc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.alloc-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}
.alloc-card.alloc-full { border-color: #ef4444; background: #fef2f2; }
.alloc-card.alloc-near { border-color: #f59e0b; background: #fffbeb; }
.alloc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.alloc-card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.room-badge {
  background: var(--navy);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.alloc-student-list { margin-top: 8px; }
.alloc-student-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid #e2e8f0;
  gap: 8px;
  flex-wrap: wrap;
}
.student-name { font-size: 13px; }
.moved-badge { background: #dbeafe; color: var(--blue); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.pref-badge  { background: var(--lightgreen); color: var(--green); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.auto-badge  { background: var(--lightamber); color: var(--amber); padding: 1px 6px; border-radius: 4px; font-size: 11px; }

/* ── Demand bar ── */
.demand-bar-wrap { display: flex; align-items: center; gap: 8px; }
.demand-bar {
  height: 8px;
  background: var(--blue);
  border-radius: 4px;
  min-width: 4px;
  max-width: 200px;
}

/* ── Student preference form ── */
.rank-badge {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.pref-select { width: 100%; max-width: 500px; }

/* ── Timetable preview ── */
.timetable-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
}
.timetable-preview th {
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
}
.timetable-preview td { padding: 10px 12px; border-top: 1px solid #e2e8f0; }
.period-time { font-size: 12px; color: var(--muted); margin-left: 6px; }
.assembly-cell   { color: #1d4ed8; font-weight: 600; }
.career-cell     { color: var(--green); }
.reflection-cell { color: var(--amber); }

/* ── Success banner ── */
.success-banner {
  background: var(--lightgreen);
  border-left: 5px solid var(--green);
  padding: 18px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.success-banner h2 { color: var(--green); margin-bottom: 4px; }

/* ── Pref / info tables ── */
.pref-table, .info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
}
.pref-table th, .info-table th {
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
}
.pref-table td, .info-table td { padding: 9px 12px; border-top: 1px solid #e2e8f0; }
.rank-cell { font-weight: 700; color: var(--navy); }

/* ── Session tags ── */
.session-tag {
  display: inline-block;
  background: var(--sky);
  color: var(--navy);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
}

/* ── Row inactive ── */
.row-inactive td { opacity: 0.45; }

/* ── Tutor timetable cells ── */
.tt-cell { font-size: 12px; vertical-align: top; }
.tt-name { display: block; font-weight: 600; }
.tt-loc  { display: block; color: var(--muted); }
.tt-empty { color: var(--muted); }
.tt-career     { background: #f0fdf4; }
.tt-assembly   { background: #eff6ff; }
.tt-reflection { background: #fffbeb; }

/* ── Login ── */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}
.login-card h2 { color: var(--navy); margin-bottom: 4px; }
.login-card p  { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.login-hint    { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.login-hint a  { color: var(--blue); }

/* ── Headings ── */
h1 { font-size: 28px; color: var(--navy); margin-bottom: 12px; }
h2 { font-size: 20px; color: var(--navy); margin-bottom: 10px; }
h3 { font-size: 16px; color: var(--navy); margin-bottom: 8px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .page-wrap { padding: 0 10px; }
  .container { padding: 18px 14px; }
  .dash-header { flex-direction: column; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; }
  .alloc-grid { grid-template-columns: 1fr; }
}
