/* =========================================================================
   Student Panel Redesign — scoped design system
   Scope: everything under .sp (added to .dashboard_main_wrapper).
   Does NOT edit frontend_style.css (pre-built vendor asset). These rules
   override the legacy flat styles by specificity (.sp … > flat .class).
   Brand comes from the live --system_primary_color CSS var (set by
   frontend-dynamic-style-color from theme_customizes DB; real value #27AAE1).
   Mirrors the approved mockup: plans/.../mockup/dashboard.html
   ========================================================================= */

.sp{
  /* Brand — solid #27aae1 (real DB primary_color from theme_customizes).
     NOTE: --system_primary_color is a gradient string, unusable as a solid color,
     so we use the known solid value. Update here if rebranded. */
  --sp-brand:#27aae1;
  --sp-brand-600:#1f96cc;
  --sp-brand-700:#0d7faf;
  --sp-brand-soft:rgba(39,170,225,.12);
  --sp-brand-soft-2:rgba(39,170,225,.20);
  /* Neutrals (light theme) */
  --sp-bg:#f5f6fa; --sp-surface:#ffffff; --sp-surface-2:#f8f9fc;
  --sp-ink:#161a24; --sp-ink-2:#3c4257; --sp-muted:#7a8295; --sp-muted-2:#9aa0b4;
  --sp-line:#e9ebf2; --sp-line-2:#eef0f6;
  --sp-ok:#16a34a; --sp-ok-soft:rgba(22,163,74,.12); --sp-warn:#d97706; --sp-warn-soft:rgba(217,119,6,.14);
  --sp-radius:16px; --sp-radius-sm:11px; --sp-radius-xs:8px;
  --sp-shadow:0 1px 2px rgba(16,24,40,.04),0 4px 14px rgba(16,24,40,.05);
  --sp-shadow-sm:0 1px 2px rgba(16,24,40,.06);
  --sp-side-w:264px;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--sp-bg);
  color:var(--sp-ink);
}

/* ---------- Layout shell ---------- */
.sp.dashboard_main_wrapper{display:flex;min-height:100vh;background:var(--sp-bg);align-items:flex-start}
.sp .main_content.dashboard_part{
  flex:1;min-width:0;background:var(--sp-bg)!important;
  width:calc(100% - var(--sp-side-w));
  margin-left:var(--sp-side-w);
  border-radius:0;
  padding:0!important;
}
/* dashboard content breathing room (topbar stays full-width above it) */
.sp-dashboard{width:100%;padding:24px 26px 48px;max-width:1340px;margin:0 auto;box-sizing:border-box}
/* sidebar becomes a light fixed column */
.sp .sidebar{
  position:fixed;top:0;left:0;bottom:0;width:var(--sp-side-w);height:100vh;
  background:var(--sp-surface);border-right:1px solid var(--sp-line);
  display:flex;flex-direction:column;overflow:hidden;
  box-shadow:none;
}
.sp .sidebar .logo{padding:18px 20px;border-bottom:1px solid var(--sp-line-2);display:flex;align-items:center;gap:10px}
.sp .sidebar .logo img{max-height:34px;width:auto}
.sp .sidebar_iner{flex:1;overflow:auto;padding:6px 12px 12px;width:100%}
.sp .sidebar_iner::-webkit-scrollbar{width:6px}
.sp .sidebar_iner::-webkit-scrollbar-thumb{background:var(--sp-line);border-radius:6px}

/* sidebar nav items */
.sp .sidebar_iner ul{list-style:none;padding:0;margin:0}
.sp .sidebar_iner li{margin:0}
.sp .sidebar_iner > ul > li > a,
.sp .sidebar_iner a.d-flex{
  display:flex!important;align-items:center;gap:11px;
  padding:9px 11px!important;border-radius:10px;margin-bottom:2px;
  color:var(--sp-ink-2)!important;font-weight:500;font-size:13.5px;
  position:relative;transition:background .12s,color .12s;
  background:transparent!important;
}
.sp .sidebar_iner a .menu_icon,
.sp .sidebar_iner a svg{color:var(--sp-muted);flex-shrink:0;width:19px;height:19px}
.sp .sidebar_iner a:hover{background:var(--sp-surface-2)!important;color:var(--sp-ink)!important;text-decoration:none}
.sp .sidebar_iner a:hover .menu_icon,
.sp .sidebar_iner a:hover svg{color:var(--sp-ink-2)}
/* active state — brand soft + left accent (covers .active and routeIs active) */
.sp .sidebar_iner a.active,
.sp .sidebar_iner a.on{
  background:var(--sp-brand-soft)!important;color:var(--sp-brand-700)!important;font-weight:600;
}
.sp .sidebar_iner a.active .menu_icon,
.sp .sidebar_iner a.active svg{color:var(--sp-brand)!important}
/* sidebar link TEXT lives in a <span> that ships white (legacy dark active bg);
   force it to inherit the <a> color (brand-700 active / ink-2 normal) */
.sp .sidebar_iner a > span{color:inherit!important}
.sp .sidebar_iner a.active::before{
  content:"";position:absolute;left:-12px;top:7px;bottom:7px;width:3px;border-radius:3px;background:var(--sp-brand);
}
/* collapse submenus keep readable */
.sp .sidebar_iner .chat-menu-ul{padding-left:6px}
.sp .sidebar_iner .chat-submenu{font-size:13px;color:var(--sp-muted);padding:7px 10px 7px 30px;border-radius:8px;display:block}
.sp .sidebar_iner .chat-submenu:hover{background:var(--sp-surface-2);color:var(--sp-ink)}

/* sidebar user block */
.sp .sidebar-user{display:flex;align-items:center;gap:11px;padding:14px 18px;margin:10px 12px;border-radius:12px;background:var(--sp-surface-2);border:1px solid var(--sp-line-2)}
.sp .sidebar-user .sidebar-profile{width:68px;height:68px;border-radius:50%;overflow:hidden;flex-shrink:0;margin:0!important}
.sp .sidebar-user .sidebar-profile img{width:100%;height:100%;object-fit:cover}
.sp .sidebar-user h4{font-size:13.5px;font-weight:600;margin:0;color:var(--sp-ink)}
.sp .sidebar-user p{font-size:11.5px;color:var(--muted);margin:0}

/* ---------- Topbar (partials/_dashboard_menu) ---------- */
.sp .header_iner{
  position:sticky;top:0;z-index:30;
  background:rgba(255,255,255,.85)!important;backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--sp-line);
  padding:11px 26px!important;display:flex;align-items:center;gap:14px;
}
.sp .header_iner .sidebar_icon{color:var(--sp-ink-2)}
.sp .header_iner .category_search{flex:1;max-width:440px}
.sp .header_iner .theme_search_field{
  display:flex;align-items:center;gap:9px;background:var(--sp-surface-2);
  border:1px solid var(--sp-line);border-radius:10px;padding:0 14px;
}
.sp .header_iner .theme_search_field .form-control,
.sp .header_iner .theme_search_field input{border:0;background:transparent;outline:0;box-shadow:none;font:inherit;color:var(--sp-ink-2)!important;-webkit-text-fill-color:var(--sp-ink-2)!important;caret-color:var(--sp-ink-2)}
/* placeholder + typed text must be dark on the light search field (legacy
   dark-header CSS forces white -> invisible). !important beats that. */
.sp .header_iner .theme_search_field input::placeholder,
.sp .header_iner .theme_search_field .form-control::placeholder{color:var(--sp-muted)!important;opacity:1}
.sp .header_iner .theme_search_field .btn,
.sp .header_iner .theme_search_field .btn i,
.sp .header_iner .theme_search_field button{background:transparent;border:0;color:var(--sp-muted)!important;-webkit-text-fill-color:var(--sp-muted)!important;padding:0;box-shadow:none}
.sp .header_iner .notification_wrapper ul{list-style:none;display:flex;align-items:center;gap:10px;margin:0;padding:0;background:transparent!important}
.sp .header_iner .notification_wrapper > ul > li > a{
  width:38px;height:38px;flex:0 0 38px;border-radius:10px;border:1px solid var(--sp-line);background:var(--sp-surface);
  display:grid;place-items:center;color:var(--sp-ink-2);position:relative;transition:border-color .12s,color .12s;
}
.sp .header_iner .notification_wrapper > ul > li > a:hover{border-color:var(--sp-brand-soft-2);color:var(--sp-brand);text-decoration:none}
/* neutralize legacy inner <div class=notify_icon> so it doesn't double-box inside the <a> */
.sp .header_iner .notification_wrapper > ul > li > a .notify_icon{
  width:auto;height:auto;border:0;background:transparent;border-radius:0;display:grid;place-items:center;
}
.sp .header_iner .notification_wrapper > ul > li > a img{width:19px;height:19px;filter:invert(1) opacity(.6);transition:filter .12s}
.sp .header_iner .notification_wrapper > ul > li > a:hover img{filter:invert(1) opacity(.85)}
/* NOTE: bell/heart/cart SVGs ship with fill="white" (legacy dark header); on the
   light button they'd be white-on-white, so we invert→dark gray to match the mockup. */
.sp .header_iner .notify_count{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 4px;display:grid;place-items:center;font-size:10px;line-height:1;background:var(--sp-brand)!important;color:#fff!important;border:2px solid var(--sp-surface)}
.sp .header_iner .point_btn{background:var(--sp-brand-soft)!important;color:var(--sp-brand-700)!important;border:1px solid var(--sp-brand-soft-2);font-weight:700;font-size:13px;box-shadow:none}
.sp .header_iner .profile_info{margin-left:4px}
.sp .header_iner .profile_info_icon{color:var(--sp-brand-700)}

/* ---------- Page head (dashboard_title) ---------- */
.sp .dashboard_title{margin:0 0 18px;padding:0;background:transparent}
.sp .dashboard_title h3{font-size:24px;font-weight:750;letter-spacing:-.3px;color:var(--sp-ink);margin:0}
.sp .dashboard_title h3 span{color:var(--sp-brand-700)}

/* ---------- Cards ---------- */
.sp .dashboard_card{
  background:var(--sp-surface);border:1px solid var(--sp-line);border-radius:var(--sp-radius);
  box-shadow:var(--sp-shadow-sm);padding:18px;
}
/* KPI tiles */
.sp .dashboard_card.text-center{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.sp .dashboard_card.text-center h4{font-size:24px;font-weight:780;color:var(--sp-ink);margin:0;letter-spacing:-.5px}
.sp .dashboard_card.text-center p,
.sp .dashboard_card.text-center small{font-size:13px;color:var(--sp-muted);font-weight:500;margin:0}
.sp .dashboard_card.text-center img{width:30px;height:30px;opacity:.8}
/* section cards (noticeboard, badges) */
.sp .dashboard_card h4{font-size:16px;font-weight:700;color:var(--sp-ink)}
/* continue-learning banner — de-bloat: cap height, clean borders */
.sp .dashboard_card.dashboard_banner{
  display:flex;flex-direction:row;align-items:stretch;gap:0;padding:0;overflow:hidden;
}
.sp .dashboard_card.dashboard_banner .banner_info{padding:14px 16px;flex:1;display:flex;flex-direction:column;justify-content:center;gap:6px}

/* ---------- Buttons ---------- */
.sp .theme_btn,
.sp .point_btn{
  border-radius:10px;font-weight:600;font-size:13.5px;border:1px solid transparent;
}
.sp .theme_btn.small_btn{background:var(--sp-brand);color:#fff;box-shadow:0 6px 16px var(--sp-brand-soft-2)}
.sp .theme_btn.small_btn:hover{background:var(--sp-brand-600);color:#fff}

/* ---------- Currency fix: force VND symbol consistency on KPI row ---------- */
/* (DashboardDemoSeeder configures currency_code=VND; some cards render wrong symbol) */
.sp .dashboard_card.text-center h4{font-variant-numeric:tabular-nums}

/* ---------- Responsive ---------- */
@media (max-width:991px){
  .sp.dashboard_main_wrapper{display:block}
  .sp .sidebar{transform:translateX(-100%);transition:transform .25s;z-index:60;box-shadow:0 0 40px rgba(0,0,0,.2)}
  .sp .sidebar.sidebar-mobile-open{transform:translateX(0)}
  .sp .main_content.dashboard_part{width:100%;margin-left:0}
}

/* =========================================================================
   Dashboard home content (my-dashboard-page-section) — matches mockup
   ========================================================================= */
/* dashboard content padding is set on .sp-dashboard in the layout shell above */

/* page head */
.sp-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.sp-page-head h1{font-size:25px;margin:0 0 4px;font-weight:800!important;letter-spacing:-.3px;color:var(--sp-ink)}
.sp-page-head h1 span{color:var(--sp-brand-700)}
.sp-page-head p{margin:0;color:var(--sp-muted);font-size:13.5px}

/* buttons */
.sp-btn{display:inline-flex;align-items:center;gap:8px;border:0;cursor:pointer;font:inherit;font-weight:600;border-radius:10px;padding:10px 16px;font-size:13.5px;text-decoration:none;transition:background .12s}
.sp-btn--pri{background:var(--sp-brand);color:#fff;box-shadow:0 6px 16px var(--sp-brand-soft-2)}
.sp-btn--pri:hover{background:var(--sp-brand-600);color:#fff}
.sp-btn--sm{font-size:12.5px;padding:7px 13px;border-radius:8px}

/* KPI tiles */
.sp-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px}
.sp-kpi{background:var(--sp-surface);border:1px solid var(--sp-line);border-radius:var(--sp-radius);padding:16px 16px 14px;box-shadow:var(--sp-shadow-sm);display:flex;flex-direction:column;gap:7px}
.sp-chip{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;margin-bottom:2px}
.sp-chip svg{width:20px;height:20px}
.sp-chip--brand{background:var(--sp-brand-soft);color:var(--sp-brand)}
.sp-chip--ok{background:var(--sp-ok-soft);color:var(--sp-ok)}
.sp-chip--warn{background:var(--sp-warn-soft);color:var(--sp-warn)}
.sp-chip--violet{background:rgba(139,92,246,.12);color:#7c3aed}
.sp-kpi__val{font-size:22px;font-weight:780;letter-spacing:-.4px;line-height:1;color:var(--sp-ink);font-variant-numeric:tabular-nums}
.sp-kpi__lab{font-size:13px;color:var(--sp-ink-2);font-weight:600}

/* main + rail grid */
.sp-grid{display:grid;grid-template-columns:1fr 340px;gap:20px;align-items:start}
.sp-section{background:var(--sp-surface);border:1px solid var(--sp-line);border-radius:var(--sp-radius);box-shadow:var(--sp-shadow-sm);padding:18px 20px;margin-bottom:20px}
.sp-section--full{margin-top:4px}
.sp-section__h{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.sp-section__h h2{font-size:17px;margin:0;font-weight:700;color:var(--sp-ink)}
.sp-section__h a{font-size:13px;color:var(--sp-brand);font-weight:600}

/* course cards */
.sp-course-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.sp-course{border:1px solid var(--sp-line);border-radius:13px;overflow:hidden;background:var(--sp-surface-2);transition:box-shadow .14s,border-color .14s,transform .14s}
.sp-course:hover{box-shadow:var(--sp-shadow);border-color:var(--sp-brand-soft-2);transform:translateY(-1px)}
.sp-course__thumb{height:104px;background-size:cover;background-position:center;background-color:var(--sp-brand-soft);display:flex;align-items:flex-start;padding:8px;border-bottom:1px solid var(--sp-line-2)}
.sp-course__tag{background:rgba(255,255,255,.94);color:var(--sp-ink);font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:20px}
.sp-course__thumb--empty{background:linear-gradient(135deg,var(--sp-brand-soft),rgba(124,58,237,.10));align-items:center;justify-content:center}
.sp-course__ph{display:grid;place-items:center;color:var(--sp-brand);opacity:.5}
.sp-course__ph svg{width:34px;height:34px}
.sp-course__body{padding:13px 14px 14px}
.sp-course__title{margin:0 0 6px;font-size:14.5px;font-weight:700;line-height:1.3;color:var(--sp-ink);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:38px}
.sp-course__ins{display:flex;align-items:center;gap:7px;margin-bottom:11px;font-size:12.5px;color:var(--sp-ink-2)}
.sp-course__ins img{width:22px;height:22px;border-radius:50%;object-fit:cover}
.sp-prog{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.sp-bar{flex:1;height:9px;background:var(--sp-line);border-radius:6px;overflow:hidden}
.sp-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--sp-brand),#8b5cf6);border-radius:6px}
.sp-prog b{font-size:12px;font-weight:700;color:var(--sp-ink-2);min-width:34px;text-align:right}

/* rail */
.sp-rail{display:flex;flex-direction:column;gap:0}
.sp-rail .sp-section{margin-bottom:20px}

/* notices */
.sp-notice-list{display:flex;flex-direction:column}
.sp-notice{display:flex;gap:11px;padding:11px 0;border-bottom:1px solid var(--sp-line-2);text-decoration:none}
.sp-notice:last-child{border:0;padding-bottom:0}
.sp-notice__dot{width:8px;height:8px;border-radius:50%;margin-top:6px;flex-shrink:0}
.sp-notice__body{display:flex;flex-direction:column;gap:2px}
.sp-notice__body strong{font-size:13px;font-weight:600;color:var(--sp-ink);line-height:1.35}
.sp-notice__body small{font-size:11.5px;color:var(--muted)}

/* badges */
.sp-badge-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.sp-badge-item{border:1px solid var(--sp-line);border-radius:11px;padding:12px;text-align:center;background:var(--sp-surface-2);display:flex;flex-direction:column;align-items:center;gap:3px}
.sp-badge-item img{width:44px;height:44px;object-fit:contain;margin-bottom:4px}
.sp-badge-item strong{font-size:12.5px;font-weight:650;color:var(--sp-ink)}
.sp-badge-item span{font-size:11px;color:var(--sp-muted)}
.sp-badge-item em{font-size:10.5px;color:var(--sp-muted-2);font-style:normal;line-height:1.3}

/* empty state */
.sp-empty{text-align:center;padding:30px 16px;display:flex;flex-direction:column;align-items:center;gap:8px}
.sp-empty__icon{width:54px;height:54px;border-radius:50%;background:var(--sp-surface-2);display:grid;place-items:center;color:var(--sp-muted);margin-bottom:4px}
.sp-empty__icon svg{width:26px;height:26px}
.sp-empty h4{margin:0;font-size:15px;color:var(--sp-ink)}
.sp-empty p{margin:0 0 6px;font-size:13px;color:var(--sp-muted)}

/* dashboard responsive */
@media (max-width:1100px){
  .sp-grid{grid-template-columns:1fr}
  .sp-kpis{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:560px){
  .sp-kpis{grid-template-columns:repeat(2,1fr);gap:12px}
  .sp-course-grid{grid-template-columns:1fr}
  .sp-dashboard{padding:18px 16px 40px}
}

/* =========================================================================
   Sidebar rewrite — mockup brand header + grouped nav
   ========================================================================= */
.sp .sp-brand{display:flex;align-items:center;gap:10px;padding:16px 18px;border-bottom:1px solid var(--sp-line-2)}
.sp .sp-brand__mark{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;overflow:hidden;flex-shrink:0;box-shadow:0 4px 10px var(--sp-brand-soft-2)}
.sp .sp-brand__mark img{max-width:100%;max-height:100%;object-fit:contain;filter:none}
.sp .sp-brand__text b{display:block;font-size:15px;font-weight:700;color:var(--sp-ink);line-height:1.1;letter-spacing:.2px}
.sp .sp-brand__text span{display:block;font-size:11.5px;color:var(--sp-muted);font-weight:500}
.sp .sidebar .sidebar_close_icon{margin-left:auto;color:var(--sp-muted);font-size:18px}

/* user block already styled above (.sp .sidebar-user) — ensure avatar + role clean */
.sp .sidebar-user{display:flex;flex-direction:column;align-items:center;text-align:center}

/* nav list reset */
.sp .sp-nav{list-style:none;padding:0;margin:0}
/* group label */
.sp .sp-nav-label{font-size:11px;text-transform:uppercase;letter-spacing:.7px;color:var(--sp-muted-2);font-weight:700;padding:16px 11px 6px}
.sp .sp-nav-label:first-child{padding-top:6px}
/* chevron on collapsible items */
.sp .sp-chev{font-size:11px;color:var(--sp-muted)}

/* logout footer */
.sp .sp-side-foot{padding:10px 14px;border-top:1px solid var(--sp-line-2);margin-top:auto}
.sp .sp-side-foot a{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:10px;color:var(--sp-muted);font-size:13.5px;font-weight:500}
.sp .sp-side-foot a:hover{background:var(--sp-surface-2);color:#dc2626}

/* ensure the fixed sidebar is a flex column so footer pins to bottom */
.sp .sidebar{display:flex;flex-direction:column}
.sp .sidebar .sidebar_iner{flex:1;overflow:auto}

/* fix topbar notify_icon / cart to match mockup pill buttons */
.sp .header_iner .notify_icon,
.sp .header_iner .notification_open > a{cursor:pointer}

/* =========================================================================
   Footer — a logged-in dashboard is a panel, not a marketing page.
   The public footer (partials._footer) is a sibling AFTER .dashboard_main_wrapper
   and spans full width — it would sit under the fixed 264px sidebar and dump a
   huge marketing block (About / Subscribe / payment logos) into the panel.
   Hide the <footer> marketing block regardless of footer style — style 1
   (<footer class="d-none…">) and style 2 (<footer class="footer footer2 …">)
   both render a <footer> tag, so match the tag, not a style-specific class.
   The cart drawer + modals + cookie live in other (non-footer) elements and
   stay functional.
   ========================================================================= */
.dashboard_main_wrapper.sp ~ .aoraeditor-footer footer{display:none!important}


