:root {
  --bg:            #e8f0fe;
  --surface:       #ffffff;
  --surface2:      #f0f4ff;
  --surface3:      #dce7fd;
  --text:          #0d1b3e;
  --muted:         #5a6a8a;
  --subtle:        #99aac9;
  --accent:        #1a4fd6;
  --accent-mid:    #3b6ef0;
  --accent-light:  #dce7fd;
  --accent-hover:  #1240b8;
  --green:         #146b45;
  --green-light:   #d6f5e7;
  --amber:         #a05a08;
  --amber-light:   #fef3dc;
  --red:           #b52424;
  --red-light:     #fde8e8;
  --border:        rgba(26, 60, 140, 0.10);
  --border-strong: rgba(26, 60, 140, 0.20);
  --radius:        14px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --shadow:        0 1px 4px rgba(26,60,140,0.08), 0 4px 16px rgba(26,60,140,0.06);
  --shadow-lg:     0 2px 10px rgba(26,60,140,0.10), 0 16px 40px rgba(26,60,140,0.08);
  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-serif:    "Georgia", "Times New Roman", serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* SIDEBAR*/
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 26px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.logo-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.logo-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--subtle);
  padding: 0 12px;
  margin: 18px 0 6px;
  font-weight: 600;
}
.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.sidebar-user {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}
.user-name  { font-size: 13px; font-weight: 600; }
.user-role  { font-size: 11px; color: var(--muted); }


.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  
}
@media (max-width: 1100px) {
  .grid-2-1 { 
    grid-template-columns: 1fr; 
  }

  .right-stack { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
  }
}

/* MOBILE SIDEBAR SUPPORT */
.mobile-menu-btn{
  display:none;
  width:40px;
  height:40px;
  border:none;
  border-radius:10px;
  background:var(--surface2);
  cursor:pointer;
  font-size:20px;
  color:var(--text);
}

@media (max-width: 540px) {
  .top-row { 
    grid-template-columns: 1fr; 
  }
}

.topbar-greeting { font-size: 16px; font-weight: 600; }
.topbar-date     { font-size: 13px; color: var(--muted); margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

.notif-dot::after {
  content: '';
  position: absolute;
  top: 7px; right: 7px;
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  min-width: 210px;
  font-size: 13px;
  color: var(--muted);
  cursor: text;
  font-family: var(--font);
  transition: border-color 0.15s;
}
.search-box:hover { border-color: var(--border-strong); }

.content {
  padding: 28px 32px;
  display: grid;
  gap: 20px;
}

.top-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 16px;
  align-items: stretch;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 20px;
  align-items: start;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-pad { padding: 20px 22px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--muted);
}
.card-action {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}
.card-action:hover { text-decoration: underline; }

.stat-card {
  min-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.stat-val {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: bold;
  line-height: 1;
  color: var(--text);
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}
.trend-up   { background: var(--green-light); color: var(--green); }
.trend-warn { background: var(--amber-light); color: var(--amber); }

.hero {
  background: linear-gradient(125deg, #0d2a80 0%, #1a4fd6 55%, #3b6ef0 100%);
  border-radius: var(--radius);
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  position: relative;
  overflow: hidden;
}
.hero-orb1 {
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -60px; right: -40px;
  pointer-events: none;
}
.hero-orb2 {
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -50px; right: 100px;
  pointer-events: none;
}
.hero-text { position: relative; z-index: 1; }
.hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
  font-weight: 600;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: 26px;
  color: white;
  line-height: 1.2;
  margin-bottom: 6px;
}
.hero-sub { font-size: 13px; color: rgba(255,255,255,0.60); }

.hero-cta {
  background: white;
  color: var(--accent);
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.28); }

.courses-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.courses-scroll::-webkit-scrollbar { height: 4px; }
.courses-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.course-card {
  min-width: 195px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.course-card:hover {
  border-color: var(--accent-mid);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.course-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.course-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.course-meta { font-size: 11px; color: var(--muted); margin-bottom: 12px; }

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.progress-pct { font-size: 11px; color: var(--accent); font-weight: 600; }

.tabs {
  display: flex;
  gap: 3px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.tab {
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(26,60,140,0.10);
}

.assign-row {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.assign-row:last-child { border-bottom: none; padding-bottom: 0; }

.assign-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.assign-name   { font-size: 13px; font-weight: 600; }
.assign-course { font-size: 11px; color: var(--muted); }

.assign-due {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  margin-left: auto;
}
.due-urgent { background: var(--red-light);   color: var(--red);   }
.due-soon   { background: var(--amber-light); color: var(--amber); }
.due-ok     { background: var(--green-light); color: var(--green); }


.grade-row {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.grade-row:last-child { border-bottom: none; }
.grade-subject  { font-size: 13px; font-weight: 500; flex: 1; }
.grade-score    { font-size: 13px; font-weight: 700; min-width: 36px; text-align: right; }
.grade-bar-wrap { flex: 1; max-width: 80px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.grade-bar      { height: 100%; border-radius: 2px; }

.schedule-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.schedule-item:last-child { border-bottom: none; padding-bottom: 0; }
.sched-time { font-size: 11px; color: var(--muted); font-weight: 700; min-width: 52px; }
.sched-bar  { width: 3px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.sched-name { font-size: 13px; font-weight: 600; }
.sched-room { font-size: 11px; color: var(--muted); }


.feed-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}
.feed-item:hover { opacity: 0.75; }
.feed-item:last-child { border-bottom: none; padding-bottom: 0; }

.feed-icon-wrap {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.feed-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.feed-meta  { font-size: 11px; color: var(--muted); }

.feed-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  margin-left: auto;
  align-self: flex-start;
  flex-shrink: 0;
  white-space: nowrap;
}


.right-stack { display: flex; flex-direction: column; gap: 16px; }


.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month { font-size: 14px; font-weight: 700; }
.cal-nav   { display: flex; gap: 4px; }
.cal-nav button {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.cal-nav button:hover { background: var(--surface2); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 4px 0;
  letter-spacing: 0.06em;
}
.cal-day {
  text-align: center;
  font-size: 12px;
  padding: 5px 2px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
}
.cal-day:hover        { background: var(--surface2); color: var(--text); }
.cal-day.today        { background: var(--accent); color: white; font-weight: 700; }
.cal-day.has-event    { color: var(--text); font-weight: 600; position: relative; }
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--accent-mid);
  border-radius: 50%;
}
.cal-day.today.has-event::after { background: rgba(255,255,255,0.7); }
.cal-day.other-month  { opacity: 0.3; }

.upcoming-events {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.event-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.event-dot  { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.event-name { font-size: 12px; font-weight: 600; flex: 1; }
.event-date { font-size: 11px; color: var(--muted); }


/* ── NOTES ───────────────────────────────────────── */
.notes-area {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface2);
  resize: none;
  height: 88px;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 10px;
}
.notes-area:focus {
  outline: none;
  border-color: var(--accent-mid);
  background: var(--surface);
}
.btn-row { display: flex; gap: 8px; align-items: center; }
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.note-saved {
  font-size: 11px;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: 600;
}


.cgpa-wrap { display: flex; align-items: center; gap: 22px; }

.ring-container {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.ring-bg, .ring-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.ring-bg {
  border: 8px solid var(--surface3);
}
.ring-fill {
  border: 8px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-bottom-color: var(--accent);
  transform: rotate(-90deg);
  clip-path: inset(0 0 0 0);
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

.cgpa-num  { font-family: var(--font-serif); font-size: 40px; font-weight: bold; line-height: 1; color: var(--text); }
.cgpa-sub  { font-size: 13px; color: var(--muted); margin-top: 4px; }
.cgpa-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

@media (max-width: 1100px) {
  .grid-2-1 { grid-template-columns: 1fr; }
  .right-stack { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {

  body{
    position: relative;
    overflow-x: hidden;
  }

  .sidebar{
    display:flex;
    position:fixed;
    top:0;
    left:-240px;
    width:220px;
    height:100vh;
    z-index:9999;
    background:var(--surface);
    transition:left 0.3s ease;
    box-shadow:var(--shadow-lg);
  }

  .sidebar.show{
    left:0;
  }

  /* OVERLAY */
  .sidebar-overlay{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.35);
    opacity:0;
    visibility:hidden;
    transition:opacity 0.3s, visibility 0.3s;
    z-index:9998;
  }

  .sidebar-overlay.show{
    opacity:1;
    visibility:visible;
  }

  /* HAMBURGER */
  .mobile-menu-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    background:var(--surface);
    cursor:pointer;
    font-size:18px;
    color:var(--text);
    flex-shrink:0;
  }

  .content{
    padding:18px;
  }

  .topbar{
    padding:14px 18px;
  }

  .top-row{
    grid-template-columns:1fr 1fr;
  }

  .right-stack{
    grid-template-columns:1fr;
  }

  .search-box{
    min-width:140px;
  }
}
@media (max-width: 540px) {
  .top-row { grid-template-columns: 1fr; }
}