:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --background: #f6f8fc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e5e7eb;
  --sidebar: #0f172a;
  --sidebar-text: #e2e8f0;
}

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

body {
  font-family: "Poppins", sans-serif;
  background: var(--background);
  color: var(--text);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 220px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 16px;
}

.sidebar .brand {
  font-size: 20px;
  font-weight: 700;
}

.sidebar ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.sidebar label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
}

.sidebar label:hover {
  background: rgba(255, 255, 255, 0.1);
}

#tab-dashboard:checked ~ .sidebar label[for="tab-dashboard"],
#tab-subjects:checked ~ .sidebar label[for="tab-subjects"],
#tab-attendance:checked ~ .sidebar label[for="tab-attendance"],
#tab-profile:checked ~ .sidebar label[for="tab-profile"],
#tab-settings:checked ~ .sidebar label[for="tab-settings"] {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.layout {
  margin-left: 220px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.student-name {
  font-size: 18px;
  font-weight: 700;
}

.student-sub {
  font-size: 13px;
  color: var(--muted);
}

.notification {
  font-size: 20px;
  color: var(--primary-dark);
  cursor: pointer;
}

.main {
  padding: 24px;
}

.view {
  display: none;
  animation: fade 0.3s ease;
}

#tab-dashboard:checked ~ .layout .dashboard,
#tab-subjects:checked ~ .layout .subjects,
#tab-attendance:checked ~ .layout .attendance,
#tab-profile:checked ~ .layout .profile,
#tab-settings:checked ~ .layout .settings {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0.3;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.card h3 {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.card p,
.stat {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.deadlines h2,
.subjects h2,
.attendance h2,
.profile h2,
.settings h2 {
  font-size: 18px;
  margin: 24px 0 12px;
}

.deadlines ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.badge {
  display: inline-block;
  min-width: 60px;
  text-align: center;
  background: var(--primary);
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  margin-right: 10px;
  font-size: 12px;
  font-weight: 600;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}

.table th,
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f1f5f9;
  font-weight: 600;
}

.bar {
  width: 220px;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
}

.profile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  max-width: 480px;
  margin: auto;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  margin-bottom: 12px;
}

.profile-info {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 14px;
  margin-top: 10px;
}

.profile-info a {
  color: var(--primary);
}

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

.setting-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.site-footer {
  margin-left: 220px;
  border-top: 1px solid var(--line);
  background: #fff;
  text-align: center;
  padding: 14px;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
  }
  .layout {
    margin-left: 0;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .site-footer {
    margin-left: 0;
  }
}
