:root{
  --bg:#f5f9fb;
  --sidebar:#0f1724;
  --muted:#9aa6af;
  --accent:#06b6d4;
  --accent2:#2dd4bf;
  --card-bg:#ffffff;
  --card-shadow: 0 6px 18px rgba(15,23,36,0.06);
  --pill:#eef9f8;
  --radius:10px;
  --glass: rgba(255,255,255,0.6);
  --text:#0b2030;
  font-size:16px;
}
.nav-item.active-side{
  margin-top: 10px;
}

*{box-sizing:border-box;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,'Helvetica Neue',Arial;}
html,body,#root{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#f7fbfc,#f5f9fb);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.sidebar.hidden {
  display: none;
}

/* Layout */
.app{display:flex;min-height:100vh}
.sidebar{
  width:240px;
  background:var(--sidebar);
  color: #cbd5e1;
  padding:22px 16px;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.logo{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.logo svg{border-radius:6px}
.brand{font-weight:700;letter-spacing:0.2px;color:#e6eef0;text-transform:none}

.nav{flex:1;overflow:auto;padding-right:6px}
.nav-section{font-size:12px;color:#7f8a94;margin:18px 0 8px 6px;text-transform:uppercase}
.nav-item{
  display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;color:inherit;text-decoration:none;margin:6px 0;
}
.nav-item:hover{background:rgba(255,255,255,0.02)}
.nav-item .pill{margin-left:auto;font-size:11px;padding:4px 6px;border-radius:6px}
.pill.green{background:#052e2a;color:#7ff7e8}
.pill.orange{background:#3a1d0d;color:#ffd7b0}
.active-side{background:linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));border-left:3px solid var(--accent2);padding-left:8px}

.sidebar-footer{font-size:12px;color:#7a8a95;padding-top:8px;opacity:0.8}

/* Main */
.main{flex:1;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:18px 28px;background:transparent}
.searchbar input{
  width:520px;max-width:60vw;padding:12px 16px;border-radius:8px;border:1px solid #e6eef3;background:#fff;box-shadow:0 2px 8px rgba(11,32,48,0.04)
}
.top-actions{display:flex;gap:12px;align-items:center}
.btn{padding:8px 14px;border-radius:8px;border:0;background:var(--accent);color:white;font-weight:600}
.btn.outline{background:transparent;border:1px solid #e6eef3;color:var(--text);padding:8px 12px}

/* page header */
.page-header{padding:22px 36px 6px}
.page-header h1{margin:0;font-size:28px;font-weight:700}
.meta{display:flex;gap:12px;margin-top:10px;color:var(--muted);font-size:13px}
.meta .meta-item{background:#eef7f6;padding:6px 10px;border-radius:20px;color:#2b756e}

/* content area */
.content{display:flex;gap:24px;padding:18px 36px 36px}
.left-column{width:260px}
.all-subjects{margin:0 0 14px 0;font-size:18px}
.subjects{background:transparent;border-radius:10px;padding:6px}
.subject-list{list-style:none;padding:0;margin:0;border-radius:8px;background:transparent;box-shadow:none}
.subject-item{
  padding:14px 12px;border-radius:8px;margin-bottom:8px;background:transparent;color:#394b56;cursor:pointer;
  border:1px solid rgba(11,32,48,0.04);
}
.subject-item:hover{background:#f2fbfa}
.subject-item.active{background:linear-gradient(90deg,#06b6d4 0%, #2dd4bf 100%);color:white;box-shadow:0 10px 30px rgba(6,182,212,0.08);}

/* right column */
.right-column{flex:1}
.chapters-header{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.chapters-header input{
  width:100%;padding:12px 14px;border-radius:8px;border:1px solid #e8eef1;background:#fff;
  box-shadow:0 2px 10px rgba(11,32,48,0.03)
}
.course-chip{white-space:nowrap;background:#fff;padding:8px 12px;border-radius:8px;border:1px solid #edf4f6;color:#4a6b74;font-weight:600}

/* cards grid */
.cards-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:18px;
}
.card{
  background:var(--card-bg);
  border-radius:12px;padding:18px;position:relative;box-shadow:var(--card-shadow);
  transition:transform .18s ease, box-shadow .18s ease;
  display:flex;flex-direction:column;justify-content:space-between;min-height:96px;
}
.card:hover{transform:translateY(-6px);box-shadow:0 18px 40px rgba(11,32,48,0.08)}
.card h4{margin:0 0 6px 0;font-size:16px}
.card .count{margin:0;color:var(--muted);font-size:13px}
.card-arrow{
  position:absolute;right:14px;top:50%;transform:translateY(-50%);background:rgba(6,182,212,0.08);width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--accent);
  font-weight:700;transition:transform .2s ease;
}
.card:hover .card-arrow{transform:translateY(-50%) translateX(6px);}

/* placeholder/loading visuals */
.placeholder{
  opacity:0.6;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:56px;
  border:1px dashed rgba(11,32,48,0.04);
}

/* small screens */
@media (max-width:980px){
  .sidebar{display:none}
  .searchbar input{max-width:400px}
  .left-column{width:220px}
}
@media (max-width:640px){
  .content{flex-direction:column;padding:12px}
  .chapters-header{flex-direction:column;align-items:stretch}
  .cards-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
  .searchbar input{width:100%}
}
