/* ==========================================================================
   The Learning Ledge — Student Dashboard
   Same design tokens as style.css / auth.css so the dashboard doesn't
   feel like a different product once a student logs in.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
  --ink: #0f1b3a;
  --blue: #2563eb;
  --blue-dim: #1d4fc4;
  --blue-tint: #eef3ff;
  --green: #10b981;
  --green-dim: #0ea271;
  --green-tint: #e9fbf4;
  --slate: #374151;
  --muted: #6b7280;
  --paper: #f6f9ff;
  --white: #ffffff;
  --line: #e7ecf5;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button {
  font: inherit;
}

/* ---- Layout ---- */

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 235px 1fr;
}

/* ---- Sidebar ---- */

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 28px;
  text-decoration: none;
  color: var(--ink);
  font: 700 1.05rem 'Poppins', sans-serif;
}

.brand img {
  width: 34px;
}

.brand span span {
  color: var(--green);
}

.nav {
  display: grid;
  gap: 7px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.nav a:hover,
.nav a.active {
  background: var(--blue-tint);
  color: var(--blue);
}

.nav i {
  width: 18px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
}

.logout {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 11px;
  border-radius: 9px;
  color: var(--slate);
  cursor: pointer;
  transition: 0.2s ease;
}

.logout:hover {
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ---- Main column ---- */

.main {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 46px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 26px;
}

.welcome h1 {
  font: 700 clamp(1.45rem, 2.5vw, 2rem) 'Poppins', sans-serif;
  color: var(--ink);
}

.welcome p {
  color: var(--muted);
  margin-top: 3px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--white);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--blue);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* ---- Progress card ---- */

.progress-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 5px 18px rgba(15, 27, 58, 0.04);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.progress-head h2,
.section-title {
  font: 600 1.35rem 'Poppins', sans-serif;
  color: var(--ink);
}

.progress-sub {
  font-size: 0.88rem;
  margin-bottom: 9px;
  color: var(--muted);
}

.percent {
  font-weight: 700;
  color: var(--green-dim);
}

.bar {
  height: 13px;
  background: var(--blue-tint);
  border-radius: 20px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 20%;
  background: var(--green);
  border-radius: 20px;
}

/* ---- Stat cards ---- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
}

.stat strong {
  font: 700 1.5rem 'Poppins', sans-serif;
  color: var(--ink);
}

.stat p {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 3px;
}

/* ---- Quick access ---- */

.quick {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.quick h2 {
  font: 600 1.35rem 'Poppins', sans-serif;
  color: var(--ink);
  margin-bottom: 15px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-card {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.quick-card .circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue);
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  font-size: 1.1rem;
  transition: 0.2s ease;
}

.quick-card:hover .circle {
  background: var(--blue);
  color: var(--white);
}

.quick-card span {
  font-size: 0.8rem;
  line-height: 1.2;
  display: block;
  color: var(--slate);
}

/* ---- Activity & subjects ---- */

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
}

.see {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 600;
}

.activity {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.activity h3 {
  color: var(--ink);
  font: 600 1rem 'Poppins', sans-serif;
}

.activity p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 75%, var(--blue-tint) 0);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ring::after {
  content: '75%';
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--white);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.8rem;
}

.subjects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.subject {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
}

.subject h3 {
  font: 600 0.98rem 'Poppins', sans-serif;
  color: var(--ink);
}

.subject p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.subject button {
  margin-top: 12px;
  border: 0;
  background: var(--blue-tint);
  color: var(--blue);
  padding: 7px 11px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Toast ---- */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--ink);
  color: var(--white);
  padding: 12px 15px;
  border-radius: 10px;
  display: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .app {
    grid-template-columns: 76px 1fr;
  }

  .sidebar {
    padding: 18px 10px;
  }

  .brand {
    justify-content: center;
  }

  .brand span,
  .nav a span,
  .logout {
    display: none;
  }

  .nav a {
    justify-content: center;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .subjects {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 64px;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 6px 8px;
  }

  .brand,
  .sidebar-bottom {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
  }

  .nav a {
    padding: 8px 4px;
    font-size: 1rem;
  }

  .nav a span {
    display: block;
    font-size: 0.62rem;
  }

  .main {
    padding: 18px 14px 82px;
  }

  .topbar {
    margin-bottom: 18px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 18px;
  }

  .subjects {
    grid-template-columns: 1fr;
  }

  .welcome p {
    font-size: 0.8rem;
  }

  .top-actions .icon-btn {
    display: none;
  }
}
