:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #e7eaf2;
  --blue: #3977ff;
  --violet: #8b5cf6;
  --mint: #11b981;
  --orange: #fb923c;
  --danger: #ef4444;
  --shadow: 0 18px 50px rgba(17, 24, 39, .09);
  --soft: 0 10px 28px rgba(17, 24, 39, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(57, 119, 255, .13), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(17, 185, 129, .11), transparent 25rem),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fbfcff;
  color: var(--ink);
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(255,255,255,.76);
  border-right: 1px solid rgba(231,234,242,.8);
  backdrop-filter: blur(22px);
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-row strong { display: block; font-size: 17px; }
.brand-row span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--blue), var(--violet) 55%, var(--mint));
  box-shadow: 0 14px 26px rgba(57, 119, 255, .24);
}
.sidebar nav { display: grid; gap: 6px; overflow: auto; padding-right: 4px; }
.sidebar nav a, .logout {
  padding: 13px 14px;
  border-radius: 15px;
  color: #495266;
  font-weight: 750;
  font-size: 14px;
}
.sidebar nav a.active, .sidebar nav a:hover {
  background: #eef4ff;
  color: #1f5de8;
}
.logout { margin-top: auto; background: #fff5f5; color: #c02626; }

.main { padding: 28px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-weight: 850;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--soft);
  font-weight: 800;
}
.user-pill b {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.9)),
    linear-gradient(135deg, rgba(57,119,255,.16), rgba(17,185,129,.10));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.86);
}
.hero-panel h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.02;
  max-width: 760px;
}
.hero-panel p { margin: 14px 0 0; color: #475467; font-size: 17px; }
.hero-stat {
  min-width: 180px;
  padding: 22px;
  border-radius: 26px;
  background: #101828;
  color: #fff;
}
.hero-stat span { display: block; color: #c8d3e5; font-size: 13px; font-weight: 700; }
.hero-stat strong { display: block; margin-top: 8px; font-size: 44px; line-height: 1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.stat-grid article, .panel {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(231,234,242,.92);
  border-radius: 26px;
  box-shadow: var(--soft);
}
.stat-grid article { padding: 20px; }
.stat-grid span, .muted { color: var(--muted); }
.stat-grid strong { display: block; margin-top: 10px; font-size: 34px; letter-spacing: 0; }

.panel { padding: 22px; min-width: 0; }
.panel h3 { margin: 0 0 18px; font-size: 21px; letter-spacing: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-list { grid-template-columns: minmax(280px, 390px) 1fr; align-items: start; }
.wide { min-width: 0; }

.primary-btn, .ghost-btn, .status {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 850;
  cursor: pointer;
}
.primary-btn {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #6d5dfc);
  box-shadow: 0 12px 24px rgba(57,119,255,.25);
}
.ghost-btn { background: #f2f5fb; color: #344054; }
.alert {
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 18px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 750;
}
.alert.danger { background: #fff1f2; color: #be123c; }

.student-list, .soft-list, .result-list, .task-list, .announcement-list { display: grid; gap: 12px; }
.student-card, .result-list article, .task-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: #fbfcff;
  border: 1px solid var(--line);
}
.student-card strong, .result-list strong, .task-list strong { display: block; font-size: 16px; }
.student-card span, .result-list span, .task-list span, .student-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}
.soft-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.soft-list div:last-child { border-bottom: 0; }

.chart-bars {
  height: 260px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding-top: 20px;
}
.chart-bars div {
  flex: 1;
  min-width: 28px;
  height: 100%;
  display: grid;
  align-items: end;
  gap: 8px;
}
.chart-bars span {
  display: block;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, #7c3aed, #3977ff 55%, #11b981);
}
.chart-bars small { text-align: center; color: var(--muted); font-weight: 800; }

.timeline { display: grid; gap: 14px; }
.timeline article {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: #fbfcff;
  border: 1px solid var(--line);
}
.timeline time { color: var(--blue); font-weight: 900; }
.timeline strong, .timeline span, .timeline small { display: block; }
.timeline span, .timeline small { margin-top: 6px; color: var(--muted); }

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}
.check {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
}
.check input { width: auto; min-height: auto; }
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.attendance-grid article {
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fbfcff;
}
.attendance-grid strong { display: block; margin-bottom: 10px; }

.net-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.topic-cloud {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.topic-cloud article {
  padding: 17px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #f9fbff;
}
.topic-cloud article.high { background: #fff7ed; border-color: #fed7aa; }
.topic-cloud article.medium { background: #f5f3ff; border-color: #ddd6fe; }
.topic-cloud span, .topic-cloud small { display: block; color: var(--muted); font-size: 13px; font-weight: 750; }
.topic-cloud strong { display: block; margin: 8px 0; }
.status.assigned { background: #fff7ed; color: #c2410c; }
.status.completed { background: #eef4ff; color: #1f5de8; }
.status.checked { background: #ecfdf5; color: #047857; }

.announcement-list article {
  padding: 18px;
  border-radius: 24px;
  background: #fbfcff;
  border: 1px solid var(--line);
}
.announcement-list span { color: var(--violet); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.announcement-list strong { display: block; margin-top: 6px; font-size: 18px; }
.announcement-list p { margin: 8px 0 0; color: var(--muted); }

.login-body, .install-body {
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 32px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.9);
}
.login-card h1 { margin: 28px 0 10px; font-size: 42px; line-height: 1.04; }
.login-card p { color: var(--muted); font-size: 16px; }
.login-card form, .install-card { display: grid; gap: 14px; }
.login-card small { display: block; margin-top: 16px; color: var(--muted); }

.install-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 24px;
  align-items: center;
}
.install-hero {
  padding: 24px;
}
.install-hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: .98;
}
.install-hero p { color: #475467; font-size: 18px; }
.install-preview {
  margin-top: 24px;
  padding: 22px;
  border-radius: 28px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}
.install-preview span, .install-preview small { display: block; color: #cbd5e1; }
.install-preview strong { display: block; margin: 10px 0; font-size: 30px; }
.install-card {
  padding: 24px;
  border-radius: 32px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.install-card h2 { margin: 8px 0 0; }

.mobile-nav { display: none; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 14px 86px; }
  .topbar { align-items: start; }
  .user-pill span { display: none; }
  .hero-panel { grid-template-columns: 1fr; border-radius: 28px; }
  .hero-stat { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-list, .install-shell { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 7px;
    border-radius: 24px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(231,234,242,.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a {
    min-height: 46px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }
  .mobile-nav a.active { background: #eef4ff; color: var(--blue); }
}

@media (max-width: 620px) {
  body { background: #f7f8fc; }
  .topbar h1 { font-size: 30px; }
  .hero-panel { padding: 22px; }
  .hero-panel h2 { font-size: 34px; }
  .stat-grid, .grid.two, .net-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; border-radius: 24px; }
  .student-card, .result-list article, .task-list article { align-items: flex-start; flex-direction: column; }
  .timeline article { grid-template-columns: 1fr; }
  .login-card, .install-card { border-radius: 28px; padding: 22px; }
  .login-card h1 { font-size: 34px; }
}
