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

:root {
  --navy: #071b45;
  --navy-2: #092557;
  --blue: #2d73f5;
  --text: #111827;
  --muted: #6b7280;
  --border: #e7eaf0;
  --bg: #f8f9fb;
  --white: #ffffff;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, #071a42 0%, #08285d 100%);
  color: #fff;
  padding: 25px 15px 18px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 27px;
}

.brand-icon {
  color: #2d78ff;
  font-size: 34px;
}

.brand h2 {
  font-size: 27px;
  letter-spacing: -1px;
}

.brand span {
  display: block;
  color: #e2e8f0;
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  height: 43px;
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 0 12px;
  border-radius: 7px;
  color: #f1f5f9;
  text-decoration: none;
  font-size: 16px;
  transition: .2s ease;
}

.nav-item i {
  width: 22px;
  text-align: center;
  color: #d9e2f1;
}

.nav-item:hover {
  background: rgba(255,255,255,.09);
}

.nav-item.active {
  background: #2c73f4;
  box-shadow: 0 7px 20px rgba(45,115,245,.22);
}

.nav-item.active i {
  color: #fff;
}

.admin-profile {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 20px 10px 5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar,
.small-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 25px;
  flex: 0 0 auto;
}

.profile-text {
  min-width: 0;
  flex: 1;
}

.profile-text strong {
  display: block;
  font-size: 14px;
}

.profile-text span {
  color: #cbd5e1;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

.admin-profile > i {
  font-size: 12px;
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
}

.topbar {
  height: 101px;
  background: #fff;
  border-bottom: 1px solid #e8ebef;
  display: flex;
  align-items: center;
  padding: 0 28px 0 32px;
  gap: 18px;
}

.menu-btn {
  border: 0;
  background: transparent;
  font-size: 23px;
  cursor: pointer;
  color: #263238;
}

.welcome {
  flex: 1;
}

.welcome h1 {
  font-size: 23px;
  letter-spacing: -.5px;
}

.welcome h1 span {
  font-size: 20px;
}

.welcome p {
  color: #8a9099;
  font-size: 14px;
  margin-top: 8px;
}

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

.search-box {
  width: 295px;
  height: 44px;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #fff;
}

.search-box input {
  border: 0;
  outline: 0;
  flex: 1;
  font-size: 14px;
}

.search-box i {
  color: #4b5563;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #374151;
  cursor: pointer;
  position: relative;
}

.notification span {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
}

.small-avatar {
  width: 40px;
  height: 40px;
  font-size: 22px;
  border: 1px solid #edf0f3;
}

.user-menu i {
  font-size: 11px;
  margin-left: 3px;
}

.dashboard {
  padding: 22px 24px 12px;
}

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

.stat-card,
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 2px 7px rgba(15,23,42,.025);
}

.stat-card {
  min-height: 120px;
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-icon {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 32px;
  flex: 0 0 auto;
}

.stat-icon.blue { background: linear-gradient(145deg, #3679f7, #2467eb); }
.stat-icon.green { background: linear-gradient(145deg, #19bd6a, #08a957); }
.stat-icon.purple { background: linear-gradient(145deg, #7e48ec, #6a32db); }
.stat-icon.orange { background: linear-gradient(145deg, #ffb31e, #ff9f0d); }

.stat-card p {
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-card h2 {
  font-size: 24px;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}

.stat-card small {
  font-size: 13px;
}

.positive { color: #09a75b; }
.positive span, .neutral { color: #7a818b; }
.neutral { font-size: 13px; }

.middle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(350px, 1fr);
  gap: 18px;
  margin-top: 21px;
}

.card {
  padding: 20px;
}

.enrollment-card,
.notices-card {
  min-height: 365px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card h3 {
  font-size: 17px;
  letter-spacing: -.2px;
}

.card-header select,
select {
  height: 35px;
  border: 1px solid #e0e5eb;
  background: #fff;
  border-radius: 6px;
  padding: 0 11px;
  color: #172033;
  outline: none;
}

.card-header a {
  color: #1769ef;
  text-decoration: none;
  font-size: 14px;
}

.large-chart {
  height: 292px;
  margin-top: 12px;
}

.notice-list {
  margin-top: 18px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 74px;
  border-bottom: 1px solid #edf0f3;
}

.notice:last-child {
  border-bottom: 0;
}

.notice-icon {
  width: 49px;
  height: 49px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: 0 0 auto;
}

.purple-light { color: #7544dc; background: #f0e9ff; }
.green-light { color: #0eaf65; background: #e4f8ee; }
.orange-light { color: #f29a0b; background: #fff2d9; }
.blue-light { color: #2e75ee; background: #e8f0ff; }

.notice-body {
  min-width: 0;
  flex: 1;
}

.notice-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.notice-body p {
  color: #7c8490;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notice > span {
  color: #7d8490;
  font-size: 12px;
  white-space: nowrap;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1.05fr;
  gap: 18px;
  margin-top: 21px;
}

.summary-card,
.departments-card {
  min-height: 286px;
}

.summary-card > h3,
.departments-card > h3 {
  margin-bottom: 24px;
}

.donut-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 35px;
  height: 200px;
}

.donut {
  width: 155px;
  height: 155px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.donut::before {
  content: "";
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.attendance-donut {
  background: conic-gradient(#15b86a 0 85%, #ff9d00 85% 95%, #ff3f3f 95% 100%);
}

.fee-donut {
  background: conic-gradient(#2e75ee 0 72%, #dfe9fa 72% 100%);
}

.donut-center {
  z-index: 2;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 28px;
}

.donut-center span {
  display: block;
  font-size: 13px;
  color: #1e293b;
  margin-top: 4px;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 14px;
  min-width: 125px;
}

.legend > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.legend b {
  margin-left: auto;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.present { background: #15b86a; }
.absent { background: #ff9d00; }
.leave { background: #ff3f3f; }

.fee-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  height: 205px;
}

.fee-details {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.fee-details p {
  font-size: 13px;
  color: #6b7280;
}

.fee-details strong {
  display: block;
  color: #111827;
  font-size: 17px;
  margin-top: 5px;
}

.green-text { color: #0bb866 !important; }
.red-text { color: #ff3b30 !important; }

.department-list {
  display: flex;
  flex-direction: column;
  gap: 21px;
  margin-top: 27px;
}

.department-row {
  display: grid;
  grid-template-columns: 125px 1fr 38px;
  gap: 9px;
  align-items: center;
  font-size: 12px;
}

.department-row > div {
  height: 9px;
  border-radius: 20px;
  background: #edf1f7;
  overflow: hidden;
}

.department-row i {
  display: block;
  height: 100%;
  border-radius: 20px;
  background: #3679f6;
}

.department-row b {
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

footer {
  padding: 26px 29px 20px;
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  font-size: 12px;
}

footer b {
  color: #ef4444;
}

.overlay {
  display: none;
}

@media (max-width: 1200px) {
  .sidebar { width: 235px; }
  .main-content { margin-left: 235px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr 1fr; }
  .departments-card { grid-column: 1 / -1; }
  .search-box { width: 220px; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: .25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 999;
  }

  .overlay.show {
    display: block;
  }

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

  .top-actions .search-box {
    display: none;
  }

  .topbar {
    padding: 0 18px;
  }
}

@media (max-width: 650px) {
  .dashboard {
    padding: 15px 12px;
  }

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

  .departments-card {
    grid-column: auto;
  }

  .welcome p {
    display: none;
  }

  .welcome h1 {
    font-size: 18px;
  }

  .user-menu strong,
  .user-menu > i {
    display: none;
  }

  .top-actions {
    gap: 12px;
  }

  .stat-card {
    min-height: 105px;
  }

  .large-chart {
    height: 245px;
  }

  .donut-layout,
  .fee-layout {
    gap: 18px;
  }

  .donut {
    width: 135px;
    height: 135px;
  }

  .donut::before {
    width: 87px;
    height: 87px;
  }

  .department-row {
    grid-template-columns: 115px 1fr 35px;
  }

  footer {
    flex-direction: column;
    gap: 8px;
    padding: 20px 15px;
  }
}

@media (max-width: 430px) {
  .card {
    padding: 15px;
  }

  .donut-layout,
  .fee-layout {
    flex-direction: column;
    height: auto;
    padding: 10px 0 15px;
  }

  .legend {
    width: 100%;
  }

  .fee-details {
    width: 100%;
  }

  .notice {
    gap: 9px;
  }

  .notice > span {
    display: none;
  }
}