/* =========================================================
   Yusr UI Shell V5
   Additive shell only: modern desktop header + mobile app shell.
   Business forms / database / routes are intentionally untouched.
   ========================================================= */

/* ---------- Desktop public header: floating modern glass shell ---------- */
@media (min-width: 921px){
  .public-mode .topbar{
    padding:12px 0 0;
    background:linear-gradient(180deg,rgba(245,247,251,.96),rgba(245,247,251,.60) 74%,transparent);
    border-bottom:0;
    backdrop-filter:none;
  }
  .public-mode .nav-wrap{
    min-height:68px;
    padding:7px 9px 7px 14px;
    border:1px solid rgba(220,226,234,.92);
    border-radius:22px;
    background:rgba(255,255,255,.91);
    box-shadow:0 16px 46px rgba(11,31,58,.085),inset 0 1px 0 rgba(255,255,255,.92);
    backdrop-filter:blur(24px) saturate(160%);
  }
  .public-mode .brand{padding:2px 6px 2px 10px}
  .public-mode .brand img{width:124px;height:48px}
  .public-mode .nav{
    gap:2px;
    padding:5px;
    border:1px solid #edf0f4;
    border-radius:16px;
    background:linear-gradient(180deg,#fafbfd,#f6f8fb);
    box-shadow:inset 0 1px 0 #fff;
  }
  .public-mode .nav>a:not(.btn){
    padding:9px 11px;
    border-radius:11px;
    font-size:13px;
    color:#475166;
  }
  .public-mode .nav>a:not(.btn):hover{
    color:var(--navy);
    background:#fff;
    box-shadow:0 5px 14px rgba(23,32,51,.06);
  }
  .public-mode .nav .btn{min-height:40px;padding-inline:15px;border-radius:12px}
  .public-mode .nav .btn.ghost{background:#fff;border-color:#e2e7ee}
}

/* ---------- Shared mobile app navigation ---------- */
.v5-bottom-nav,.v5-sheet-backdrop,.v5-mobile-sheet{display:none}
/* If Mobile V3 was installed earlier, V5 supersedes its navigation without touching its routes. */
.mobile-bottom-nav,.mobile-nav-sheet,.mobile-sheet-backdrop{display:none!important}

@media (max-width: 920px){
  html,body{max-width:100%;overflow-x:hidden}
  body.public-mode,body.dashboard-mode{padding-bottom:calc(92px + env(safe-area-inset-bottom))}

  /* Public top header becomes intentionally minimal; main navigation is below. */
  .public-mode .topbar{
    position:sticky;top:0;z-index:120;
    padding:8px 10px 0;
    background:linear-gradient(180deg,rgba(248,250,252,.96),rgba(248,250,252,.78));
    border:0;backdrop-filter:blur(18px) saturate(150%);
  }
  .public-mode .nav-wrap{
    width:100%;min-height:58px;padding:5px 12px;
    border:1px solid rgba(222,227,234,.9);border-radius:18px;
    background:rgba(255,255,255,.92);box-shadow:0 9px 28px rgba(11,31,58,.07);
  }
  .public-mode .brand{margin-inline:auto}
  .public-mode .brand img{width:105px;height:44px}
  .public-mode .mobile-nav,.public-mode .nav{display:none!important}

  /* Bottom bar */
  .v5-bottom-nav{
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
    position:fixed;z-index:190;right:8px;left:8px;
    bottom:max(8px,env(safe-area-inset-bottom));height:72px;
    padding:7px 6px;border:1px solid rgba(217,224,233,.92);border-radius:23px;
    background:rgba(255,255,255,.94);backdrop-filter:blur(24px) saturate(180%);
    box-shadow:0 18px 60px rgba(10,29,53,.19),inset 0 1px 0 rgba(255,255,255,.95)
  }
  .v5-bottom-item{
    min-width:0;border:0;background:transparent;color:#8792a4;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    position:relative;border-radius:17px;font-size:9.8px;font-weight:800;line-height:1.15;
    transition:transform .18s var(--ease),background .18s var(--ease),color .18s var(--ease);
    cursor:pointer;font-family:inherit
  }
  .v5-bottom-item svg{width:21px;height:21px;flex:0 0 auto;transition:transform .18s var(--ease),color .18s var(--ease)}
  .v5-bottom-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .v5-bottom-item.active{color:var(--navy);background:linear-gradient(180deg,#eafafa,#f7fbfb)}
  .v5-bottom-item.active svg{color:var(--teal);transform:translateY(-1px)}
  .v5-bottom-item.active:before{content:"";position:absolute;top:2px;width:23px;height:3px;border-radius:99px;background:linear-gradient(90deg,var(--teal),var(--teal-2));box-shadow:0 3px 11px rgba(12,154,152,.25)}
  .v5-bottom-item:active{transform:scale(.96)}

  /* More bottom sheet */
  .v5-sheet-backdrop{
    display:block;position:fixed;inset:0;z-index:200;background:rgba(4,18,33,.42);backdrop-filter:blur(3px);
    opacity:0;visibility:hidden;transition:.24s var(--ease)
  }
  .v5-sheet-backdrop.open{opacity:1;visibility:visible}
  .v5-mobile-sheet{
    display:block;position:fixed;z-index:210;right:0;left:0;bottom:0;
    max-height:min(78vh,680px);overflow:auto;padding:8px 15px calc(22px + env(safe-area-inset-bottom));
    border-radius:28px 28px 0 0;background:#fff;box-shadow:0 -28px 74px rgba(10,29,53,.22);
    transform:translateY(106%);transition:transform .3s var(--ease)
  }
  .v5-mobile-sheet.open{transform:none}
  .v5-sheet-handle{width:43px;height:5px;border-radius:99px;background:#d7dde6;margin:2px auto 12px}
  .v5-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 2px 14px;border-bottom:1px solid #edf0f4}
  .v5-sheet-user{display:flex;align-items:center;gap:10px;min-width:0}.v5-sheet-user strong{display:block;color:var(--navy);font-size:13px}.v5-sheet-user small{display:block;color:var(--muted);font-size:10.5px}
  .v5-sheet-close{width:38px;height:38px;border:1px solid var(--line);border-radius:13px;background:#f8fafc;color:var(--navy);font-size:24px;line-height:1;cursor:pointer}
  .v5-sheet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;padding-top:14px}
  .v5-sheet-link{min-height:86px;border:1px solid var(--line);background:#fbfcfe;border-radius:18px;padding:11px 7px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;color:var(--ink-2);font-size:10.8px;font-weight:780}
  .v5-sheet-link svg{width:22px;height:22px;color:var(--teal)}.v5-sheet-link.danger{color:var(--danger);background:var(--danger-soft)}.v5-sheet-link.danger svg{color:var(--danger)}
  body.v5-sheet-open{overflow:hidden}

  /* ---------- Rebuilt mobile homepage ---------- */
  .public-mode .hero{padding:24px 0 22px;background:linear-gradient(180deg,#fff 0%,#f7fafc 72%,#f5f7fb 100%)}
  .public-mode .hero:before{width:250px;height:250px;right:-145px;top:-90px}.public-mode .hero:after{width:220px;height:220px;left:-130px;bottom:-90px}
  .public-mode .hero-grid{display:flex!important;flex-direction:column;gap:18px;align-items:stretch}
  .public-mode .hero-grid>div:first-child{text-align:center;display:flex;flex-direction:column;align-items:center}
  .public-mode .hero .eyebrow{font-size:10.5px;padding:6px 10px;margin-top:2px}
  .public-mode .hero h1{font-size:clamp(34px,10.5vw,48px)!important;line-height:1.14;letter-spacing:-1.4px;margin:13px auto 12px;max-width:360px}
  .public-mode .hero p{font-size:14.2px;line-height:1.85;margin:0 auto;max-width:355px}
  .public-mode .hero-actions{width:100%;display:grid;grid-template-columns:1.25fr .9fr;gap:9px;margin-top:18px}
  .public-mode .hero-actions .btn{width:100%;padding:11px 10px;font-size:12px;border-radius:14px}
  .public-mode .hero .meta{justify-content:center;gap:6px 10px;margin-top:14px!important;font-size:10.5px}

  .public-mode .hero-card{width:100%;padding:16px;border-radius:23px;background:rgba(255,255,255,.96);box-shadow:0 18px 48px rgba(11,31,58,.08)}
  .public-mode .hero-card .kicker{font-size:10px}.public-mode .hero-card h3{margin:4px 0 12px;font-size:18px;color:var(--navy)}
  .public-mode .hero-card .search-box{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;padding:9px;border-radius:16px}
  .public-mode .hero-card .search-box input{grid-column:1/-1}.public-mode .hero-card .search-box button{grid-column:1/-1}
  .public-mode .hero-card .search-box input,.public-mode .hero-card .search-box select,.public-mode .hero-card .search-box .btn{min-height:45px;font-size:12px}
  .public-mode .hero-card .grid-3{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;margin-top:10px!important}
  .public-mode .hero-card .stat{min-height:82px;padding:11px 7px;border-radius:15px;text-align:center;box-shadow:none;background:#fbfcfe}
  .public-mode .hero-card .stat strong{font-size:23px}.public-mode .hero-card .stat span{font-size:9px;line-height:1.3;display:block;margin-top:4px}

  .public-mode .section{padding:34px 0}.public-mode .section-head{margin-bottom:16px}.public-mode .section-head h1,.public-mode .section-head h2{font-size:25px;line-height:1.35}.public-mode .section-head p{font-size:12.5px}
  .public-mode .grid-4,.public-mode .grid-3,.public-mode .grid-2,.public-mode .entity-grid{grid-template-columns:1fr!important;gap:11px}
  .public-mode .card{border-radius:20px;padding:16px}.public-mode .card h3{font-size:16px}.public-mode .card .muted,.public-mode .card p{font-size:12.5px}
  .public-mode .featured-course{min-height:250px;padding:21px;border-radius:23px}.public-mode .featured-course h2{font-size:25px}.public-mode .featured-course p{font-size:12.5px}
  .public-mode footer{padding-bottom:88px}

  /* ---------- Dashboard mobile: app shell, not compressed desktop ---------- */
  .dashboard-mode{background:#f5f7fb}
  .dashboard-mode .sidebar{display:none!important}
  .dashboard-mode .dash-mobile-menu{display:none!important}
  .dashboard-mode .dash-topbar{height:64px;right:0;left:0;background:rgba(248,250,252,.91);border-bottom:1px solid rgba(222,227,234,.76);backdrop-filter:blur(20px) saturate(155%)}
  .dashboard-mode .dash-topbar-inner{height:64px;padding:0 13px;gap:7px}
  .dashboard-mode .dash-search{display:none!important}
  .dashboard-mode .dash-content{margin-right:0!important;padding-top:64px;min-width:0}
  .dashboard-mode .dash-content-inner{width:100%!important;padding:17px 13px 12px;min-width:0}
  .dashboard-mode .dash-top-actions{margin-inline-start:auto;gap:6px}.dashboard-mode .dash-top-action{width:41px;height:41px;border-radius:14px;background:#fff}.dashboard-mode .dash-user-chip{padding:4px;border:0;background:transparent;box-shadow:none}.dashboard-mode .dash-user-chip span{display:none!important}
  .dashboard-mode .dash-page-intro{margin:0 0 14px;gap:4px}.dashboard-mode .dash-page-intro h1{font-size:24px;line-height:1.3}.dashboard-mode .dash-page-intro p{font-size:11.5px;line-height:1.6;margin-top:3px}.dashboard-mode .dash-date{display:none}
  .dashboard-mode .dash-hero{padding:19px;border-radius:22px}.dashboard-mode .dash-hero h2{font-size:24px;line-height:1.35}.dashboard-mode .dash-hero p{font-size:12px}.dashboard-mode .dash-hero-actions{gap:8px}.dashboard-mode .dash-hero-actions .btn{font-size:11.5px;padding:9px 12px}

  .dashboard-mode .dash-metrics{display:flex!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px;padding:1px 1px 8px;scrollbar-width:none}.dashboard-mode .dash-metrics::-webkit-scrollbar{display:none}
  .dashboard-mode .metric-card{min-width:min(78vw,310px);scroll-snap-align:start;border-radius:20px;padding:16px}
  .dashboard-mode .dash-panels,.dashboard-mode .entity-grid,.dashboard-mode .grid-2,.dashboard-mode .grid-3,.dashboard-mode .grid-4,.dashboard-mode .detail-grid{grid-template-columns:1fr!important}
  .dashboard-mode .dash-panel,.dashboard-mode .entity-card,.dashboard-mode .card,.dashboard-mode .table-wrap{border-radius:20px}
  .dashboard-mode .dash-panel{padding:16px}.dashboard-mode .dash-panel-head{gap:8px;align-items:flex-start}.dashboard-mode .dash-panel-head h3{font-size:15px}.dashboard-mode .dash-panel-head p{font-size:10.8px}
  .dashboard-mode .quick-actions{display:flex!important;overflow-x:auto;gap:9px;scroll-snap-type:x proximity;scrollbar-width:none}.dashboard-mode .quick-actions::-webkit-scrollbar{display:none}.dashboard-mode .quick-action{min-width:155px;scroll-snap-align:start}
  .dashboard-mode .entity-card{padding:15px}.dashboard-mode .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.dashboard-mode table{min-width:720px}
  .dashboard-mode .form-grid{grid-template-columns:1fr!important}
  .dashboard-mode .dash-flashes{top:71px;right:12px;left:12px}
}

@media(max-width:430px){
  .v5-bottom-nav{right:6px;left:6px;height:70px;border-radius:21px}.v5-bottom-item{font-size:9.2px}.v5-bottom-item svg{width:20px;height:20px}
  .v5-sheet-grid{gap:8px}.v5-sheet-link{min-height:82px;border-radius:16px;font-size:10.3px}
  .public-mode .hero-actions{grid-template-columns:1fr 1fr}.public-mode .hero-actions .btn{font-size:11px}
  .public-mode .hero-card{padding:14px}.public-mode .hero-card .search-box{grid-template-columns:1fr 1fr}
  .dashboard-mode .metric-card{min-width:84vw}
}

@media(max-width:360px){
  .v5-bottom-item{font-size:8.5px}.v5-bottom-item svg{width:19px;height:19px}.v5-sheet-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .public-mode .hero h1{font-size:33px!important}.public-mode .hero-actions{grid-template-columns:1fr}
}
