/* ============================================================
   District School Grading System — Main Stylesheet
   ============================================================ */

:root {
  --primary: #1a6fc4;
  --primary-dark: #155fa0;
  --success: #198754;
  --warning: #d97706;
  --danger: #dc3545;
  --sidebar-width: 0px;
  --body-bg: #f0f4f8;
}

body {
  background-color: var(--body-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.footer { margin-top: auto; }

/* ---- Navbar ---- */
.navbar { min-height: 60px; }
.navbar-brand { font-size: 1.1rem; letter-spacing: .3px; }

/* ---- Cards ---- */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.stat-card .stat-icon {
  width: 54px; height: 54px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

/* ---- Tables ---- */
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: #6c757d; font-weight: 600; }
.table-hover tbody tr:hover { background-color: #f0f6ff; }

/* ---- Grade Badges ---- */
.badge-advanced    { background: #d1fae5; color: #065f46; }
.badge-proficient  { background: #dbeafe; color: #1e40af; }
.badge-basic       { background: #fef3c7; color: #92400e; }
.badge-below-basic { background: #fee2e2; color: #991b1b; }

.grade-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}

/* ---- Mark Entry Table ---- */
.marks-table input[type="number"] {
  width: 72px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  padding: 4px 6px;
  font-size: .9rem;
}
.marks-table input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,111,196,.15);
}
.marks-table .computed {
  font-weight: 600;
  color: var(--primary);
}

/* ---- Report Card ---- */
.report-card {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.12);
  overflow: hidden;
}
.report-header {
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: #fff;
  padding: 2rem;
}
.report-school-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.report-meta { font-size: .88rem; opacity: .9; }
.report-student-name { font-size: 1.2rem; font-weight: 600; margin-top: .5rem; }
.report-body { padding: 1.5rem 2rem; }
.score-bar {
  height: 6px;
  border-radius: 3px;
  background: #e9ecef;
  overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }

/* ---- SMS Preview ---- */
.sms-preview {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-family: monospace;
  font-size: .85rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}
.sms-char-count { font-size: .78rem; color: #6c757d; }
.sms-parts-count { font-weight: 600; color: var(--primary); }

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed #adb5bd;
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: #eff6ff;
}
.upload-zone i { font-size: 3rem; color: #adb5bd; }
.upload-zone:hover i { color: var(--primary); }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a6fc4 0%, #0f3460 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { font-size: 2.5rem; color: var(--primary); }

/* ---- Print ---- */
@media print {
  .navbar, .footer, .no-print, .btn, .alert { display: none !important; }
  .report-card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  body { background: #fff; }
  .container-fluid { padding: 0; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stat-card .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }
  .report-body { padding: 1rem; }
  .marks-table input[type="number"] { width: 60px; }
}

/* ---- Helpers ---- */
.cursor-pointer { cursor: pointer; }
.fs-xs { font-size: .78rem; }
.fs-sm { font-size: .85rem; }
.text-muted-sm { color: #9ca3af; font-size: .8rem; }
.rounded-pill-sm { border-radius: 20px; }

/* ---- Progress Steps ---- */
.import-steps .step {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  color: #6c757d;
}
.import-steps .step.active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.import-steps .step.done   { color: var(--success); }
.import-steps .step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
}
.import-steps .step.active .step-num { background: var(--primary); color: #fff; }
.import-steps .step.done .step-num   { background: var(--success); color: #fff; }
