/* Student panel (My Learning). Same shell language as the admin panel. */
.stu-body {
  --side-w: 260px; --top-h: 64px;
  --s-red: #b51d21; --s-red-soft: #fdeeee; --s-navy: #13235f; --s-ink: #111827; --s-muted: #6b7280; --s-line: #e7e9ee; --s-bg: #f5f6f8;
  --font: "Bornomala", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--s-bg); font-size: 15px;
}
.stu-body h1, .stu-body h2, .stu-body h3 { letter-spacing: 0; }
.stu { min-height: 100vh; }

/* Sidebar */
.stu-side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: #fff; border-right: 1px solid var(--s-line); display: flex; flex-direction: column; z-index: 70; }
.stu-brand { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 18px; border-bottom: 1px solid var(--s-line); flex-shrink: 0; }
.stu-brand > a { display: flex; align-items: center; gap: .6rem; color: var(--s-ink); }
.stu-brand .brand-logo { height: 36px; width: auto; }
.stu-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; box-shadow: none; }
.stu-brand .txt { display: flex; flex-direction: column; line-height: 1.15; }
.stu-brand .txt strong { font-size: 1rem; }
.stu-brand .txt small { font-size: .72rem; color: var(--s-muted); }
.stu-me { display: flex; gap: .7rem; align-items: center; margin: 14px 14px 4px; padding: 12px; border-radius: 10px; background: #f7f8fa; border: 1px solid var(--s-line); }
.stu-me .av { width: 42px; height: 42px; border-radius: 50%; background: var(--s-navy); color: #fff; display: grid; place-items: center; font-weight: 700; overflow: hidden; flex-shrink: 0; font-size: .85rem; }
.stu-me .av img { width: 100%; height: 100%; object-fit: cover; }
.stu-me strong { display: block; font-size: .9rem; color: var(--s-ink); line-height: 1.25; }
.stu-me small { display: block; font-size: .76rem; color: var(--s-muted); word-break: break-all; }
.stu-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.stu-sec { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; padding: 14px 10px 6px; }
.stu-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 8px; color: #374151; font-weight: 500; font-size: .88rem; position: relative; margin-bottom: 1px; }
.stu-link .icon { color: #6b7280; width: 18px; height: 18px; }
.stu-link span { flex: 1; }
.stu-link:hover { background: #f3f4f6; color: var(--s-ink); }
.stu-link.active { background: var(--s-red-soft); color: var(--s-red); font-weight: 600; }
.stu-link.active .icon { color: var(--s-red); }
.stu-link.active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--s-red); }
.stu-badge { background: var(--s-red); color: #fff; font-size: .7rem; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: inline-grid; place-items: center; }
.stu-logout { margin: 0 12px 14px; flex-shrink: 0; }
.stu-logout button { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .65rem .8rem; border-radius: 8px; border: 1px solid var(--s-line); background: #fff; color: #b42318; font-weight: 600; font-size: .86rem; cursor: pointer; font-family: inherit; }
.stu-logout button:hover { background: #fdf0ee; }
.stu-backdrop, .stu .stu-close, .stu .stu-burger { display: none; }

/* Main column */
.stu-main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.stu-top { position: sticky; top: 0; z-index: 60; height: var(--top-h); background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--s-line); display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.stu-search { position: relative; flex: 1; max-width: 380px; }
.stu-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; width: 17px; height: 17px; }
.stu-search input { width: 100%; height: 40px; border: 1px solid var(--s-line); background: #f9fafb; border-radius: 8px; padding: 0 12px 0 38px; font: inherit; font-size: .88rem; outline: none; }
.stu-search input:focus { background: #fff; border-color: #c7cbe0; box-shadow: 0 0 0 3px rgba(19, 35, 95, .08); }
.stu-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.stu-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--s-line); background: #fff; color: #374151; display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.stu-icon-btn:hover { background: #f3f4f6; color: var(--s-ink); }
.stu-icon-btn .dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--s-red); color: #fff; font-size: .66rem; display: grid; place-items: center; border: 2px solid #fff; }
.stu-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--s-navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; overflow: hidden; }
.stu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stu-content { flex: 1; padding: 24px; min-width: 0; max-width: 1240px; width: 100%; }
.stu-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; padding: 16px 24px; border-top: 1px solid var(--s-line); background: #fff; color: var(--s-muted); font-size: .8rem; }
.stu-foot a { color: var(--s-red); font-weight: 600; }
.stu-tabbar { display: none; }

/* Inner components restyled to match the admin cards */
.stu-body .dash-head { margin-bottom: 1.2rem; }
.stu-body .dash-head .kicker { color: var(--s-muted); font-size: .75rem; letter-spacing: .04em; text-transform: none; font-weight: 500; margin-bottom: .1rem; }
.stu-body .dash-head h1 { font-size: 1.5rem; font-weight: 700; color: var(--s-ink); }
/* A description written straight under the h1 belongs below it, not pushed to the right edge. */
.stu-body .dash-head > h1 + p { flex-basis: 100%; margin: -.6rem 0 0; }
.stu-body .panel { border-radius: 12px; border-color: var(--s-line); padding: 1.2rem; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); margin-bottom: 1.2rem; }
.stu-body .panel-head { padding-bottom: .8rem; border-bottom: 1px solid #eef0f3; }
.stu-body .panel-head h2 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.stu-body .panel-head h2 .icon { color: var(--s-red); }
.stu-body .kpis { gap: 12px; margin-bottom: 1.2rem; }
.stu-body .kpi { border-radius: 12px; border-color: var(--s-line); padding: 1rem; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.stu-body .kpi .k-icon { width: 44px; height: 44px; border-radius: 10px; background: #eef1f9; color: var(--s-navy); }
.stu-body .kpi:nth-child(2) .k-icon { background: #fff1e7; color: #ea580c; }
.stu-body .kpi:nth-child(3) .k-icon { background: var(--s-red-soft); color: var(--s-red); }
.stu-body .kpi:nth-child(4) .k-icon { background: #e8f5f3; color: #0f766e; }
.stu-body .kpi strong { font-size: 1.45rem; font-weight: 700; }
.stu-body .my-course { border-radius: 10px; border-color: var(--s-line); }
.stu-body .my-course .course-media { border-radius: 8px; aspect-ratio: 16 / 10; }
.stu-body .progress { background: #eef0f3; }
.stu-body .progress span { background: var(--s-red); }
.stu-body .schedule-item .when { border-radius: 8px; background: var(--s-navy); }
.stu-body .btn { border-radius: 8px; }
.stu-body .btn-primary { background: var(--s-navy); box-shadow: none; }
.stu-body .btn-primary:hover { background: #0c1845; }
.stu-body .btn-accent { background: var(--s-red); box-shadow: none; }
.stu-body .btn-accent:hover { background: #9e1b1c; }
.stu-body .btn-ghost { background: #f3f4f6; color: var(--s-ink); }
.stu-body .btn-ghost:hover { background: var(--s-red-soft); color: var(--s-red); }
.stu-body .form-card { border-radius: 12px; border-color: var(--s-line); box-shadow: none; }
.stu-body .input, .stu-body .select, .stu-body .textarea { border-radius: 8px; }
.stu-body .flash { margin: 0 0 1rem; border-radius: 10px; }
.stu-body table { width: 100%; }
.stu-body .table-wrap, .stu-body .table-scroll { overflow-x: auto; }

/* Responsive */
@media (max-width: 1100px) {
  .stu-body .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .stu-side { transform: translateX(-100%); transition: transform .25s ease; width: min(86vw, 300px); box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  body.side-open .stu-side { transform: none; }
  body.side-open .stu-backdrop { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 65; }
  body.side-open { overflow: hidden; }
  .stu .stu-close, .stu .stu-burger { display: inline-grid; }
  .stu-main { margin-left: 0; }
  .stu-top { padding: 0 14px; }
  .stu-content { padding: 18px 14px 92px; }
  .stu-foot { padding: 14px 14px 84px; }
  .stu-tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--s-line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, .35); }
  .stu-tabbar a, .stu-tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: #6b7280; font-size: .68rem; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .stu-tabbar .icon { width: 22px; height: 22px; }
  .stu-tabbar a.active { color: var(--s-red); }
}
@media (max-width: 760px) {
  .stu-hide-sm { display: none !important; }
  .stu-body .dash-head h1 { font-size: 1.25rem; }
  .stu-body .kpi { padding: .8rem; gap: .6rem; }
  .stu-body .kpi .k-icon { width: 38px; height: 38px; }
  .stu-body .kpi strong { font-size: 1.2rem; }
  .stu-body .my-course { grid-template-columns: 1fr; }
  .stu-body .panel { padding: 1rem; }
  .stu-body .grid-2 { grid-template-columns: 1fr; }
}
@media print {
  .stu-side, .stu-top, .stu-foot, .stu-tabbar { display: none !important; }
  .stu-main { margin: 0; }
}

.stu-brand .brand-logo-full { display: block; height: 36px; width: auto; }
.stu-brand .brand-logo-full { height: 42px; margin-left: -4px; }
/* Head actions drop under the title on narrow phones */
.panel-head { flex-wrap: wrap; gap: 8px; }
