/* Greenfield Academy — School Management System demo */

* { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #2a2a36; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a46; }

/* ── Login role pills ── */
.role-pill {
  padding: 0.55rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.15s;
}
.role-pill:hover { color: #fff; background: rgba(255,255,255,0.06); }
.role-pill.is-active {
  background: linear-gradient(135deg, rgba(74,222,128,0.18), rgba(96,165,250,0.18));
  border-color: rgba(96,165,250,0.4);
  color: #fff;
}

/* ── Sidebar nav links ── */
.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  text-align: left;
  color: #9ca3af;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-link.is-active {
  background: linear-gradient(90deg, rgba(96,165,250,0.15), rgba(167,139,250,0.06));
  color: #fff;
}
.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: -0.75rem; top: 25%; bottom: 25%;
  width: 3px; border-radius: 999px;
  background: linear-gradient(180deg, #4ade80, #60a5fa);
}
.nav-link.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Quick action buttons ── */
.qa {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.625rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  text-align: left;
  transition: all 0.15s;
}
.qa:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.08); }

/* ── Panel ── */
.panel {
  background: #15151c;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
}

/* ── KPI cards ── */
.kpi {
  background: #15151c;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi:hover { border-color: rgba(255,255,255,0.1); transform: translateY(-2px); }
.kpi__label {
  font-size: 0.72rem; color: #6b7280;
  margin-bottom: 0.5rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.kpi__value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem; font-weight: 700;
  color: #fff; line-height: 1.1;
}
.kpi__delta { font-size: 0.7rem; margin-top: 0.5rem; }

/* ── Avatar ── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.7rem; color: #0a0a0f;
  flex-shrink: 0;
}

/* ── Status pill ── */
.pill {
  display: inline-flex; align-items: center;
  font-size: 0.65rem; padding: 0.15rem 0.55rem;
  border-radius: 999px; font-weight: 600;
}
.pill--paid    { background: rgba(74,222,128,0.15); color: #4ade80; }
.pill--partial { background: rgba(167,139,250,0.15); color: #a78bfa; }
.pill--unpaid  { background: rgba(248,113,113,0.15); color: #f87171; }

/* ── Toast ── */
#toast.show { opacity: 1; transform: translateY(0); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 40;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal-card {
  width: 100%; max-width: 28rem;
  background: #15151c;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  animation: modalIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.modal-x {
  color: #6b7280; background: none; border: none;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.modal-x:hover { color: #fff; }
.modal-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal-input:focus {
  border-color: rgba(96,165,250,0.5);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
}

.btn-primary {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #4ade80, #60a5fa);
  color: #0a0a0f;
  font-weight: 700;
  font-size: 0.875rem;
  transition: filter 0.15s;
  border: none; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 0.875rem;
  transition: background 0.15s;
  border: none; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* ── Spinner ── */
.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #4ade80;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Success pop ── */
.success-pop { animation: pop 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Subject bar ── */
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  align-items: center; gap: 0.75rem;
  font-size: 0.8rem;
}
.bar-row__label { color: #d1d5db; }
.bar-row__track { height: 8px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.bar-row__fill {
  height: 100%; border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}
.bar-row__value { color: #fff; font-weight: 600; text-align: right; }

/* ── Attendance row ── */
.att-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  background: #15151c;
  border: 1px solid rgba(255,255,255,0.04);
  transition: border-color 0.15s;
}
.att-row:hover { border-color: rgba(255,255,255,0.08); }
.att-toggle {
  display: inline-flex; gap: 0.25rem;
}
.att-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.04);
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}
.att-btn:hover { color: #fff; }
.att-btn.is-present { background: rgba(74,222,128,0.18); color: #4ade80; border-color: rgba(74,222,128,0.3); }
.att-btn.is-late    { background: rgba(167,139,250,0.18); color: #a78bfa; border-color: rgba(167,139,250,0.3); }
.att-btn.is-absent  { background: rgba(248,113,113,0.18); color: #f87171; border-color: rgba(248,113,113,0.3); }

/* ── Report step ── */
.report-step {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.4;
  transition: opacity 0.3s;
}
.report-step.is-active { opacity: 1; }
.report-step.is-done   { opacity: 0.85; }
.report-step__icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  color: #6b7280;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.report-step.is-active .report-step__icon { background: rgba(96,165,250,0.2); color: #60a5fa; }
.report-step.is-done .report-step__icon { background: rgba(74,222,128,0.2); color: #4ade80; }

/* ── Chart line drawing animation ── */
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-line { stroke-dasharray: 1500; stroke-dashoffset: 1500; animation: draw 2s 0.2s ease forwards; }
.chart-area { opacity: 0; animation: fade 1.4s 0.6s ease forwards; }
@keyframes fade { to { opacity: 1; } }
.chart-dot { opacity: 0; animation: fade 0.5s ease forwards; }

/* ── Locked nav hint ── */
.locked-msg {
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.15);
  color: #a78bfa;
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 1023px) {
  .panel, .kpi { border-radius: 14px; }
}
