* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1c1c1e;
  color: #f2f2f7;
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 220px;
  height: 100vh;
  position: fixed;
  background: rgba(44, 44, 46, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 auto 10px;
}

.profile { text-align: center; }
.profile h2 { font-size: 13px; font-weight: 600; }
.profile p  { font-size: 11px; color: #aeaeb2; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 5px; }

.nav-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #aeaeb2;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}
.nav-btn:hover  { background: rgba(255, 255, 255, 0.08); color: #f2f2f7; }
.nav-btn.active { background: #0a84ff; color: white; }

.sub-menu {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding-left: 12px;
}
.sub-menu.open { display: flex; }

.sub-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #aeaeb2;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}
.sub-btn:hover  { background: rgba(255, 255, 255, 0.06); color: #f2f2f7; }
.sub-btn.active { background: rgba(10, 132, 255, 0.2); color: #0a84ff; }

/* MAIN CONTENT */
.main {
  margin-left: 220px;
  padding: 28px;
  width: 100%;
}

.page        { display: none; }
.page.active { display: block; }

.page-title { font-size: 28px; font-weight: 700; margin-bottom: 18px; }

/*  CARD*/
.card {
  background: rgba(44, 44, 46, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px;
}

/* DASHBOARD */
.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
.hero-card h1          { font-size: 36px; font-weight: 800; margin: 8px 0; }
.hero-card > div > p   { color: #aeaeb2; font-size: 13px; line-height: 1.5; }
.hero-buttons          { display: flex; gap: 8px; margin-top: 16px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.stat-box h2 { font-size: 22px; font-weight: 800; }
.stat-box p  { font-size: 11px; color: #aeaeb2; margin-top: 3px; }

/* ACTIVITY GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.act-card { display: flex; flex-direction: column; gap: 8px; }
.act-num  { font-size: 10px; color: #636366; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.act-card h3 { font-size: 15px; font-weight: 600; }
.act-card p  { font-size: 12px; color: #aeaeb2; }

/* BUTTONS */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: #0a84ff;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  width: 100%;
}
.btn:hover { background: #3395ff; }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* INPUTS */
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #f2f2f7;
  font-size: 13px;
  outline: none;
}
input:focus { border-color: #0a84ff; }

/* LIST */
ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }

ul li {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

li.done { text-decoration: line-through; color: #636366; }

/* CHARACTER COUNTER */
.char-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 12px;
  color: #aeaeb2;
}
.char-row span { font-size: 18px; font-weight: 700; color: #0a84ff; }

/* IMAGE BOX */
#imgBox {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* REMOVE TEXT */
.remove-text {
  padding: 8px 12px;
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: #ff6961;
}

/* GRADE CALCULATOR */
.grade-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grade-card { display: flex; flex-direction: column; gap: 12px; }
.grade-card h3 { font-size: 16px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; }
.field label span { font-weight: 400; color: #aeaeb2; }

.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.result-row p:first-child { font-size: 12px; color: #aeaeb2; }
.result-row p:last-child  { font-size: 20px; font-weight: 800; color: #0a84ff; }
.result-row p.letter      { font-size: 28px; color: #30d158; }

.err-box {
  padding: 10px 12px;
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: 10px;
  font-size: 12px;
  color: #ff6961;
  display: none;
}

/* ABOUT */
.about-card { display: flex; gap: 20px; align-items: flex-start; }

.about-av {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.about-card > div > p { font-size: 13px; color: #aeaeb2; line-height: 1.6; margin-top: 8px; }

/* CONTACT */
.contact-item {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 10px;
}
.contact-item p:first-child { font-size: 10px; color: #636366; text-transform: uppercase; letter-spacing: 0.05em; }
.contact-item p:last-child  { font-size: 14px; font-weight: 600; }

/* TOAST BUBBLE */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: rgba(30, 30, 40, 0.97);
  color: #f2f2f7;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  max-width: 360px;
  text-align: center;
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: pre-line;
  line-height: 1.5;
}
#toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error   { border-color: rgba(255, 69, 58, 0.4); color: #ff6961; }
#toast.success { border-color: rgba(48, 209, 88, 0.3); color: #30d158; }

/*LIGHT MODE */
body.light-mode { background: #f2f2f7; color: #1c1c1e; }

body.light-mode .sidebar {
  background: rgba(242, 242, 247, 0.95);
  border-right-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .card      { background: rgba(255, 255, 255, 0.85); border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .stat-box  { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); }
body.light-mode .nav-btn   { color: #3a3a3c; }
body.light-mode .nav-btn.active { color: white; }
body.light-mode .sub-btn   { color: #3a3a3c; }

body.light-mode input[type="text"],
body.light-mode input[type="number"] {
  background: rgba(0, 0, 0, 0.05);
  color: #1c1c1e;
  border-color: rgba(0, 0, 0, 0.1);
}
body.light-mode input::placeholder { color: #8e8e93; }
body.light-mode ul li       { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.07); color: #1c1c1e; }
body.light-mode .char-row   { background: rgba(0, 0, 0, 0.04); }
body.light-mode .contact-item { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.07); }
body.light-mode .result-row { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.07); }
body.light-mode #toast      { background: rgba(255, 255, 255, 0.97); color: #1c1c1e; border-color: rgba(0, 0, 0, 0.15); }

/* RESPONSIVE */
@media (max-width: 768px) {
  body       { flex-direction: column; }
  .sidebar   { position: relative; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; padding: 16px; }
  .main      { margin-left: 0; padding: 20px; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card h1 { font-size: 28px; }
  .grade-wrap   { grid-template-columns: 1fr; }
}