@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

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

:root {
  --pink: #FF4D8D;
  --pink2: #FF8CB8;
  --pink-bg: #FFF0F6;
  --teal: #0D9D87;
  --teal2: #14C9A8;
  --teal-bg: #E6FAF6;
  --amber: #F5A623;
  --amber-bg: #FFF6E0;
  --purple: #7C5CBF;
  --purple-bg: #F3EEFF;
  --night: #1A1E3A;
  --nightmed: #252B55;
  --nightlit: #323972;
  --sky: #63C3F5;
  --sun: #FFD84D;
  --card: #FFFFFF;
  --border: #E8EDF4;
  --bg: #F0F4FF;
  --txt: #1A1E3A;
  --txt2: #6B7A99;
  --shadow: 0 2px 16px rgba(26,30,58,0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- LAYOUT ---- */
.app-wrap { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  background: var(--night);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sb-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--nightlit);
}
.logo-text {
  font-family: 'Fredoka One', cursive;
  font-size: 22px;
  color: white;
}
.logo-text span { color: var(--pink); }
.logo-sub {
  font-size: 11px;
  font-weight: 800;
  color: #8899CC;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}
.nav { padding: 10px 12px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #8899CC;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: var(--pink); color: white; }
.nav-icon { font-size: 18px; width: 22px; text-align: center; }

/* ---- TOPBAR ---- */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 22px; font-weight: 900; }
.topbar p { font-size: 12px; color: var(--txt2); font-weight: 600; margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---- CARDS ---- */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
}
.card-body { padding: 20px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: scale(0.97); }
.btn-pink { background: var(--pink); color: white; }
.btn-teal { background: var(--teal); color: white; }
.btn-amber { background: var(--amber); color: white; }
.btn-outline { background: white; border: 1.5px solid var(--pink); color: var(--pink); }
.btn-dark { background: var(--night); color: white; }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
}
.badge-teal { background: var(--teal-bg); color: #085041; border: 1px solid #9FE1CB; }
.badge-amber { background: var(--amber-bg); color: #633806; border: 1px solid #FAC775; }
.badge-green { background: #EAF3DE; color: #27500A; border: 1px solid #C0DD97; }
.badge-pink { background: var(--pink-bg); color: #72243E; border: 1px solid #F4C0D1; }
.badge-easy { background: #D1FAE5; color: #065F46; }
.badge-medium { background: var(--amber-bg); color: #92400E; }
.badge-hard { background: #FEE2E2; color: #991B1B; }

/* ---- STATUS ---- */
.status-online { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: #ECFDF5; border: 1px solid #D1FAE5; border-radius: 20px; font-size: 12px; font-weight: 700; color: #059669; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #10B981; animation: statusPulse 2s infinite; }
@keyframes statusPulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ---- FORMS ---- */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 800; }
.form-label .req { color: var(--pink); }
.form-control {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,77,141,0.12); }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ---- ALERTS ---- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; font-weight: 700; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--teal); color: white; padding: 11px 16px; text-align: left; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--txt2); font-weight: 600; }
.page-btns { display: flex; gap: 4px; }
.page-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: white; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.page-btn.active { background: var(--pink); color: white; border-color: var(--pink); }
.page-btn:hover:not(.active) { background: var(--bg); }

/* ---- MODAL ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(10,12,40,0.65); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-box {
  background: white;
  border-radius: 22px;
  padding: 28px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
  box-shadow: 0 20px 60px rgba(10,12,40,0.3);
}
@keyframes modalIn { 0%{transform:translateY(-20px);opacity:0} 100%{transform:translateY(0);opacity:1} }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: none; cursor: pointer; font-size: 18px; color: var(--txt2); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.modal-close:hover { background: #FEE2E2; color: #DC2626; border-color: #DC2626; }

/* ---- NOTIFICATIONS ---- */
.notif-btn { position: relative; background: none; border: 1px solid var(--border); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.notif-count { position: absolute; top: -4px; right: -4px; background: var(--pink); color: white; font-size: 9px; font-weight: 900; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px; cursor: pointer; font-weight: 800; font-size: 13px; }
.user-ava { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--amber)); display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; font-weight: 900; }

/* ---- SPINNER ---- */
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- UTILITIES ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.col-span-2 { grid-column: 1 / -1; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-20 { padding: 20px; }
.content-area { padding: 20px 24px; }
.text-muted { color: var(--txt2); }
.font-900 { font-weight: 900; }
.fredoka { font-family: 'Fredoka One', cursive; }

/* ---- STAT CARD ---- */
.stat-card { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-num { font-size: 28px; font-weight: 900; line-height: 1; }
.stat-label { font-size: 11px; color: var(--txt2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-sub { font-size: 11px; margin-top: 2px; }

/* ---- SIDEBAR FOOTER ---- */
.sb-footer { padding: 12px; margin-top: auto; }
.sb-footer-box { background: var(--nightmed); border-radius: 14px; padding: 14px; text-align: center; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .app-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
