/* Compact Cybro-inspired positioning using Yovaan's own navy and marigold identity. */
.user-welcome{max-width:230px;overflow:hidden;color:#123b82;font-size:.76rem;font-weight:600;white-space:nowrap;text-overflow:ellipsis}.user-welcome strong{color:#c58c0e;font-weight:800}
.contactbar{background:#123b82;border:0;color:#fff}.contactbar__inner{width:100%;min-height:34px;padding:0 28px;display:flex;align-items:center;justify-content:space-between;gap:24px}.contactbar__details{display:flex;align-items:center;gap:24px}.contactbar__details a,.contactbar__location{display:inline-flex;align-items:center;gap:7px;color:#fff;font-size:.69rem;font-weight:600;white-space:nowrap}.contactbar__details>a+*,.contactbar__location{position:relative}.contactbar__details>a+*::before,.contactbar__location::before{content:"";position:absolute;left:-13px;top:50%;width:3px;height:3px;border-radius:50%;background:#dda928;transform:translateY(-50%)}.contactbar__social{display:flex;align-items:center;gap:7px}.social-link{width:20px;height:20px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;font-size:.64rem;line-height:1;cursor:default}.social-link b{font:700 .64rem/1 'Plus Jakarta Sans',sans-serif}.header .nav-wrap{width:100%;max-width:none;height:70px;padding:0 28px;gap:18px}.nav-cluster{min-width:0;display:flex;align-items:center;gap:30px}.brand--official{width:58px;height:64px;flex:0 0 58px;display:flex;align-items:center;justify-content:center;overflow:hidden}.brand-logo-exact{display:block;width:auto;height:58px;max-width:100%;object-fit:contain}.header .nav{margin-left:0;gap:clamp(18px,1.8vw,32px);align-self:stretch}.header .nav a{height:100%;display:flex;align-items:center;position:relative;font-size:.82rem;font-weight:650;letter-spacing:-.01em;color:#172033}.header .nav a::after{height:3px;bottom:0;background:#dda928;right:100%;transition:right .25s ease}.header .nav a:hover,.header .nav a.active{color:#c58c0e}.header .nav a:hover::after,.header .nav a.active::after{right:0}.header .nav-actions{margin-left:auto;display:flex;align-items:center;gap:10px;flex:0 0 auto}.account-button{min-height:42px;padding:9px 22px;border-radius:999px;font-size:.76rem;font-weight:750}.account-button--outline{border:1.5px solid #9caabd;background:#fff;color:#172033}.account-button--outline:hover{border-color:#123b82;color:#123b82}.account-button--filled{border-color:#dda928;background:#dda928;color:#061c43;box-shadow:0 8px 18px rgba(221,169,40,.2)}.account-button--filled:hover{background:#e5b43e}.user-chip{max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:1100px){.contactbar__location{display:none}.header .nav{gap:16px}.header .nav a{font-size:.76rem}.account-button{padding-inline:16px}}@media(max-width:1000px){.header .nav-wrap{height:66px;padding:0 18px}.nav-cluster{width:100%;justify-content:space-between}.brand--official{width:54px;height:60px;flex-basis:54px}.brand-logo-exact{height:54px}.nav-toggle{margin-left:auto}.header .nav--open{top:66px;height:auto;align-items:flex-start}.header .nav--open a{height:auto;width:100%;padding:12px 0}.header .nav-actions{display:none}}@media(max-width:650px){.contactbar__inner{min-height:32px;padding:0 14px}.contactbar__details{gap:0}.contactbar__location{display:none}.contactbar__details a+*::before{display:none}.contactbar__details a{font-size:.64rem}.contactbar__social{gap:5px}.social-link{width:18px;height:18px}.header .nav-wrap{padding:0 14px}}
.header-icon-link{position:relative;display:grid;place-items:center;width:34px;height:34px;color:#173f78}.header-icon-link svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.header-icon-link span{font-size:.72rem;font-weight:500;color:#173f78;white-space:nowrap}.header-icon-link:hover{color:#c58c0e}.header-text-link{display:flex;align-items:center;font-size:.82rem;font-weight:650;color:#173f78;text-decoration:none;transition:color .25s ease;white-space:nowrap;padding:0 4px}.header-text-link:hover{color:#c58c0e}.header-count{position:absolute;right:-5px;top:-6px;display:grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#e2aa21;color:#061c43;font-size:.62rem}.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important}
.brand-logo-exact{background:transparent;mix-blend-mode:multiply}

/* Mobile-only usability corrections. Keep one useful contact method visible. */
@media(max-width:650px){.contactbar__details a:nth-child(2){margin-right:0}.contactbar__details a:nth-child(2) span{display:inline;font-size:.58rem;letter-spacing:0;text-transform:none}.contactbar__social{margin-left:auto}}

/* ── Mobile Top Bar & Toggle Auth Styling ── */
.mobile-top-bar {
  display: none !important;
}

.mobile-nav-auth {
  display: none !important;
}

@media (max-width: 1000px) {
  .header {
    background: rgba(255, 255, 255, 0.98);
  }

  .header .nav-wrap {
    height: auto !important;
    padding: 10px 18px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .nav-cluster {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  .nav-toggle {
    margin-left: auto !important;
    cursor: pointer !important;
    padding: 6px !important;
    display: grid !important;
    gap: 5px !important;
    z-index: 10 !important;
  }

  .header .nav-actions {
    display: none !important;
  }

  /* 1. Mobile top-of-page buttons row (visible under brand logo & hamburger) */
  .mobile-top-bar {
    display: block !important;
    width: 100% !important;
  }

  .mobile-top-bar__auth {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .mobile-top-bar__auth .mobile-top-btn {
    flex: 1 1 0 !important;
    min-height: 40px !important;
    padding: 9px 16px !important;
    font-size: 0.82rem !important;
    font-weight: 750 !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .mobile-top-bar__auth--user {
    justify-content: space-between !important;
  }

  /* 2. Hamburger Dropdown Navigation */
  .header .nav {
    display: none;
  }

  .header .nav--open {
    display: flex !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    flex-direction: column !important;
    padding: 18px 24px 28px !important;
    box-shadow: 0 16px 36px rgba(6, 28, 67, 0.16) !important;
    border-top: 1px solid #e2e8f0 !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
  }

  .header .nav--open a:not(.btn) {
    height: auto !important;
    width: 100% !important;
    padding: 12px 6px !important;
    font-size: 0.95rem !important;
    font-weight: 650 !important;
    color: #172033 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
  }

  .header .nav--open a:not(.btn):hover,
  .header .nav--open a:not(.btn).active {
    color: #c58c0e !important;
  }

  .header .nav--open a:not(.btn)::after {
    display: none !important;
  }

  /* Inside toggle menu: student login and create account */
  .mobile-nav-auth {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    padding-top: 16px !important;
    margin-top: 8px !important;
    border-top: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
  }

  .mobile-nav-auth .mobile-nav-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 18px !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
    font-weight: 750 !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .mobile-nav-auth a::after {
    display: none !important;
  }

  .mobile-nav-user-greeting {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #123b82 !important;
    padding-bottom: 6px !important;
  }

  .mobile-nav-user-greeting strong {
    color: #c58c0e !important;
    font-weight: 800 !important;
  }

  .mobile-nav-user-link {
    width: 100% !important;
    padding: 10px 4px !important;
    font-size: 0.9rem !important;
    font-weight: 650 !important;
    color: #173f78 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
  }
}

@media (max-width: 480px) {
  .header .nav-wrap {
    padding: 8px 12px 10px !important;
    gap: 6px !important;
  }

  .mobile-top-bar__auth .mobile-top-btn {
    font-size: 0.78rem !important;
    padding: 8px 10px !important;
    min-height: 38px !important;
  }

  .brand--official-custom img {
    height: 38px !important;
  }

  .brand--official-custom span {
    font-size: 1.05rem !important;
  }
}

@media (max-width: 360px) {
  .brand--official-custom span {
    font-size: 0.92rem !important;
  }

  .mobile-top-bar__auth .mobile-top-btn {
    font-size: 0.72rem !important;
    padding: 7px 8px !important;
  }
}

/* ── Mobile Auth Hero & Shell Tuning (Login & Create Account Pages) ── */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
    background: #edf3fa !important;
    background-image: none !important;
  }

  .auth-shell::before {
    display: none !important;
  }

  .auth-intro {
    padding: 24px 20px 22px !important;
    background: linear-gradient(135deg, #061c43 0%, #0c2b5c 100%) !important;
    text-align: left !important;
  }

  .auth-intro:after {
    display: none !important;
  }

  .auth-intro .eyebrow {
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    color: #c5a059 !important;
    margin-bottom: 4px !important;
    display: inline-block !important;
  }

  .auth-intro h1 {
    font-size: clamp(1.35rem, 5.2vw, 1.7rem) !important;
    line-height: 1.25 !important;
    margin: 4px 0 8px 0 !important;
    letter-spacing: -0.02em !important;
    max-width: 100% !important;
  }

  .auth-intro p {
    font-size: 0.84rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    color: #cbd5e1 !important;
    max-width: 100% !important;
  }

  .auth-card {
    margin: 20px auto 36px !important;
    width: min(440px, calc(100% - 32px)) !important;
    padding: 24px 20px !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(6, 28, 67, 0.08) !important;
  }
}

@media (max-width: 480px) {
  .auth-intro {
    padding: 20px 16px 18px !important;
  }

  .auth-intro h1 {
    font-size: 1.35rem !important;
    line-height: 1.22 !important;
  }

  .auth-intro p {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
  }

  .auth-card {
    margin: 16px auto 28px !important;
    width: calc(100% - 24px) !important;
    padding: 20px 16px !important;
  }
}


/* ── Universal Viewport & Cross-Page Responsive Protection ── */
html {
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible !important;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

@supports not (overflow: clip) {
  body {
    overflow: visible !important;
  }
}

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

img,
svg,
video,
canvas {
  max-width: 100%;
}

/* Ensure smooth horizontal scroll on touch devices without stretching page */
.dashboard-table-scroll,
.table-responsive,
.dashboard-main-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  box-sizing: border-box;
}

/* Generic container safeguard on ultra-narrow screens */
@media (max-width: 480px) {
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  
  /* Prevent any hero or section titles from overflowing */
  h1, h2, h3, h4, h5, h6 {
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

/* Universal Form Control Protection on Mobile */
select,
input,
textarea,
button {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

select {
  text-overflow: ellipsis !important;
}

/* Ensure CSS Grid items never expand parent containers on mobile */
.dashboard-activity-grid,
.dashboard-metrics-grid,
#examReorderGrid,
.exam-workspace-top-grid,
#subjectReorderGrid {
  max-width: 100% !important;
  min-width: 0 !important;
}

.dashboard-activity-grid > *,
.dashboard-metrics-grid > *,
#examReorderGrid > *,
.exam-workspace-top-grid > *,
#subjectReorderGrid > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.dt-card,
.dashboard-panel {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .dashboard-filter-form,
  .orders-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .dashboard-filter-form > *,
  .orders-filter-bar > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .dashboard-filter-form input,
  .dashboard-filter-form select,
  .dashboard-filter-form button,
  .dashboard-filter-form a,
  .orders-filter-bar input,
  .orders-filter-bar select,
  .orders-filter-bar button,
  .orders-filter-bar a {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
