@media (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 680px) and (max-height: 800px) {

    #appHeader3 {
        height: 78px;
        min-height: 78px;
    }

    #appHeader3 #navContent3 {
        height: 78px;
        min-height: 78px;
        width: 100%;
        max-width: none;
        padding: 0 14px;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0;
    }

    /* ------------------------------------------------------------
       VIT LOGO
       ------------------------------------------------------------ */
    #appHeader3 #navContent3 > .navbar-brand {
        flex: 0 0 150px;
        width: 150px;
        min-width: 150px;
        max-width: 150px;
        height: 58px;
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    #appHeader3 #navContent3 > .navbar-brand img {
        display: block;
        width: 150px !important;
        max-width: 150px !important;
        height: 54px;
        max-height: 54px !important;
        object-fit: contain;
        border-radius: 8px !important;
    }

    /* ------------------------------------------------------------
       DESKTOP TITLE
       ------------------------------------------------------------ */
    #appHeader3 #navContent3 > .nav-title {
        position: static;
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 100%;
        margin: 0 !important;
        padding: 0 12px;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        transform: none !important;
        overflow: hidden;
    }

    #appHeader3 #navContent3 > .nav-title #title {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding: 0;
        font-size: 2rem !important;
        line-height: 1.05;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #appHeader3 #navContent3 > .nav-title #subtitle {
        width: 100%;
        max-width: 100%;
        margin: 2px 0 0 !important;
        padding: 0;
        font-size: 0.78rem !important;
        line-height: 1.15;
        letter-spacing: 0.22em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ------------------------------------------------------------
       LOGIN BUTTON
       ------------------------------------------------------------ */
    #appHeader3 #roleSwitch {
        flex: 0 0 auto;
        width: auto;
        height: 38px;
        margin: 0 8px 0 0 !important;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 0 !important;
    }

    #appHeader3 #roleSwitch form {
        margin: 0 !important;
    }

    #appHeader3 #roleSwitch button,
    #appHeader3 #userLoginBtn {
        width: 166px;
        min-width: 166px;
        max-width: 166px;
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        padding: 0 10px !important;
        border-radius: 7px;
        font-size: 0.78rem !important;
        line-height: 1;
        white-space: nowrap;
    }

    #appHeader3 #roleSwitch .role-icon {
        font-size: 0.95rem !important;
        line-height: 1;
    }

    /* ------------------------------------------------------------
       BACK TO HOME BUTTON
       ------------------------------------------------------------ */
    #appHeader3 #goBackBtn {
        flex: 0 0 166px;
        width: 166px;
        min-width: 166px;
        max-width: 166px;
        height: 38px;
        margin: 0 8px 0 0 !important;
        padding: 0;
        display: flex;
        align-items: center;
        gap: 0 !important;
    }

    #appHeader3 #goBackBtn a {
        width: 166px;
        min-width: 166px;
        max-width: 166px;
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        margin: 0;
        padding: 0 10px !important;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.78rem !important;
        line-height: 1;
        white-space: nowrap;
    }

    #appHeader3 #goBackBtn .role-icon {
        font-size: 0.95rem !important;
        line-height: 1;
    }

    #appHeader3 #goBackBtn .fs-6 {
        font-size: 0.78rem !important;
    }

    /* ------------------------------------------------------------
       SOCIAL ICONS
       ------------------------------------------------------------ */
    #appHeader3 #socialIcons {
        flex: 0 0 auto;
        width: 120px;
        min-width: 120px;
        height: 38px;
        margin: 0 !important;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }

    #appHeader3 #socialIcons a {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        margin: 0 !important;
        flex: 0 0 34px;
        font-size: 0.95rem;
    }
}

/*Mobile Responsiveness*/
@media (max-width:768px) {
    .card-login {
        width: 100%;
        max-width: 350px;
        height: 420px;
    }
}

@media (max-width:576px) {
    #mainContent {
        margin-top: 100px;
    }
}

/* ====================================================================== */
/* LAPTOP OPTIMIZATION — 1366px CLASS / SHORT-LAPTOP HEIGHT RANGE         */
/* Real tested laptop viewport: 1366 × 633 CSS px, DPR 1                  */
/* Optimized continuously for approximately 1366 × 633–748.               */
/* Desktop/tablet/mobile rules above remain unchanged outside this range. */
/* ====================================================================== */

@media screen and (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 600px) and (max-height: 800px) {

    #appHeader3 {
        box-sizing: border-box;
        height: clamp(78px, 11.7vh, 90px);
        min-height: 78px;
        max-height: 90px;
    }

    #appHeader3 #navContent3 {
        height: 100%;
        min-height: 0;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        padding-left: 12px;
        padding-right: 12px;
    }

    #appHeader3 .navbar-brand {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 8px;
        padding-top: 0;
        padding-bottom: 0;
    }

    #appHeader3 .navbar-brand img {
        width: clamp(144px, 11.7vw, 170px) !important;
        height: auto;
        max-height: clamp(50px, 6.1vh, 61px) !important;
        object-fit: contain;
        border-radius: 9px !important;
    }

    #appHeader3 .nav-title {
        min-width: 0;
        margin-left: 8px !important;
        margin-right: 8px !important;
        line-height: 1;
    }

    #appHeader3 .header-title {
        font-size: clamp(1.90rem, 3.40vh, 2.25rem) !important;
        line-height: 1.02;
        white-space: nowrap;
    }

    #appHeader3 .header-subtitle {
        font-size: clamp(0.65rem, 1.55vh, 0.82rem) !important;
        line-height: 1.25;
        letter-spacing: 0.24em;
        white-space: nowrap;
    }

    #appHeader3 #roleSwitch,
    #appHeader3 #goBackBtn {
        flex: 0 0 auto;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    #appHeader3 #roleSwitch {
        margin-left: 8px !important;
        margin-right: 6px !important;
        gap: 6px !important;
    }

    #appHeader3 #roleSwitch button {
        height: clamp(34px, 5.1vh, 38px);
        min-height: 34px;
        max-height: 38px;
        padding: 0 10px !important;
        border-radius: 7px;
        font-size: clamp(0.78rem, 1.7vh, 0.90rem) !important;
        line-height: 1;
        white-space: nowrap;
    }

    #appHeader3 #roleSwitch .role-icon {
        font-size: clamp(0.85rem, 1.9vh, 1rem) !important;
    }

    #appHeader3 #goBackBtn {
        width: auto;
        min-width: 132px;
        max-width: 180px;
        height: clamp(34px, 5.1vh, 38px);
        margin-right: 8px !important;
    }

    #appHeader3 #goBackBtn a {
        height: 100%;
        min-height: 34px;
        max-height: 38px;
        padding: 0 10px;
        border-radius: 7px;
        font-size: clamp(0.78rem, 1.7vh, 0.90rem) !important;
        white-space: nowrap;
    }

    #appHeader3 #goBackBtn .role-icon {
        font-size: clamp(0.9rem, 2vh, 1rem) !important;
    }

    #appHeader3 .social-icons {
        display: flex;
        align-items: center;
        gap: clamp(5px, 0.55vw, 8px);
        margin-left: 4px !important;
        flex: 0 0 auto;
    }

    #appHeader3 .social-icons a {
        width: clamp(30px, 4.5vh, 36px);
        height: clamp(30px, 4.5vh, 36px);
        margin-left: 0;
        font-size: clamp(0.82rem, 1.9vh, 1rem);
        flex: 0 0 auto;
    }

    /* Keep hover enlargement from disturbing the header geometry. */
    #appHeader3 .social-icons a:hover,
    #appHeader3 #userLoginBtn:hover,
    #appHeader3 #goBackBtn:hover {
        transform: none;
    }
}

/* 1366 × 633-class short laptop — compact vertical mode. */
@media screen and (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 600px) and (max-height: 639px) {

    #appHeader3 {
        height: 78px;
    }

    #appHeader3 #navContent3 {
        padding-left: 10px;
        padding-right: 10px;
    }

    #appHeader3 .navbar-brand img {
        width: 144px !important;
        max-height: 50px !important;
    }

    #appHeader3 .nav-title {
        margin-left: 6px !important;
        margin-right: 6px !important;
    }

    #appHeader3 .header-title {
        font-size: 1.90rem !important;
    }

    #appHeader3 .header-subtitle {
        display: none !important;
    }

    #appHeader3 #roleSwitch {
        margin-left: 6px !important;
        margin-right: 4px !important;
        gap: 5px !important;
    }

    #appHeader3 #roleSwitch button,
    #appHeader3 #goBackBtn,
    #appHeader3 #goBackBtn a {
        height: 34px;
        min-height: 34px;
    }

    #appHeader3 #roleSwitch button,
    #appHeader3 #goBackBtn a {
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: 0.78rem !important;
    }

    #appHeader3 #goBackBtn {
        min-width: 126px;
        margin-right: 5px !important;
    }

    #appHeader3 .social-icons {
        gap: 4px;
        margin-left: 2px !important;
    }

    #appHeader3 .social-icons a {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }
}

/* 1366 × 700–748-class laptop — preserve the desktop visual scale
   while removing only the excess vertical/header space. */
@media screen and (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 700px) and (max-height: 800px) {

    #appHeader3 {
        height: 90px;
    }

    #appHeader3 .navbar-brand img {
        width: 170px !important;
        max-height: 61px !important;
    }

    #appHeader3 .header-title {
        font-size: 2.25rem !important;
    }

    #appHeader3 .header-subtitle {
        font-size: 0.82rem !important;
    }

    #appHeader3 #roleSwitch button,
    #appHeader3 #goBackBtn,
    #appHeader3 #goBackBtn a {
        height: 38px;
    }

    #appHeader3 .social-icons a {
        width: 36px;
        height: 36px;
    }
}

/* ======================================================================
   FINAL 1366px LAPTOP HEADER CALIBRATION
   Target: 1366 x 633 CSS viewport
   Purpose: deterministic sizing of the existing AppHeader3 only.
   The desktop/mobile header remains unchanged outside this range.
   ====================================================================== */

@media screen and (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 600px) and (max-height: 679px) {

    /* Header frame */
    #appHeader3 {
        height: 78px !important;
        min-height: 78px !important;
        max-height: 78px !important;
        box-sizing: border-box;
    }

    #appHeader3 #navContent3 {
        height: 78px !important;
        min-height: 78px !important;
        max-height: 78px !important;
        padding: 0 10px !important;
        box-sizing: border-box;
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
    }

    /* VIT logo */
    #appHeader3 #navContent3 > .navbar-brand {
        flex: 0 0 144px !important;
        width: 144px !important;
        min-width: 144px !important;
        max-width: 144px !important;
        height: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
        margin: 0 8px 0 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    #appHeader3 #navContent3 > .navbar-brand img {
        display: block !important;
        width: 144px !important;
        min-width: 144px !important;
        max-width: 144px !important;
        height: 50px !important;
        max-height: 50px !important;
        object-fit: contain !important;
        border-radius: 8px !important;
    }

    /* Center title */
    #appHeader3 #navContent3 > .nav-title {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100% !important;
        margin: 0 8px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        transform: none !important;
    }

    #appHeader3 #navContent3 > .nav-title #title,
    #appHeader3 .header-title {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 1.90rem !important;
        line-height: 1.02 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Subtitle is intentionally hidden at 633px-class height,
       matching the existing short-laptop desktop composition. */
    #appHeader3 #navContent3 > .nav-title #subtitle,
    #appHeader3 .header-subtitle {
        display: none !important;
    }

    /* ---------------------------------------------------------------
       RIGHT-SIDE ACTION BUTTONS
       Login and Back buttons use the SAME geometry.
       --------------------------------------------------------------- */

    #appHeader3 #roleSwitch,
    #appHeader3 #goBackBtn {
        flex: 0 0 166px !important;
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    #appHeader3 #roleSwitch {
        margin-left: 6px !important;
        margin-right: 6px !important;
        gap: 0 !important;
    }

    #appHeader3 #goBackBtn {
        margin-left: 0 !important;
        margin-right: 5px !important;
        gap: 0 !important;
    }

    #appHeader3 #roleSwitch form {
        width: 166px !important;
        height: 34px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #appHeader3 #roleSwitch button,
    #appHeader3 #userLoginBtn,
    #appHeader3 #goBackBtn a {
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        margin: 0 !important;
        padding: 0 8px !important;
        border-radius: 7px !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        font-size: 0.78rem !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    #appHeader3 #roleSwitch .role-icon,
    #appHeader3 #goBackBtn .role-icon {
        flex: 0 0 auto !important;
        font-size: 0.90rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    #appHeader3 #goBackBtn .fs-6 {
        font-size: 0.78rem !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    /* Social icons */
    #appHeader3 #socialIcons {
        flex: 0 0 auto !important;
        width: 96px !important;
        min-width: 96px !important;
        max-width: 96px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 4px !important;
    }

    #appHeader3 #socialIcons a {
        flex: 0 0 30px !important;
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.82rem !important;
        line-height: 1 !important;
    }

    /* Prevent hover from changing the calibrated geometry. */
    #appHeader3 #userLoginBtn:hover,
    #appHeader3 #goBackBtn:hover,
    #appHeader3 #socialIcons a:hover {
        transform: none !important;
    }
}


/* ======================================================================
   1366px LAPTOP — 680 TO 699px
   Same component proportions, with only the vertical allowance increased.
   ====================================================================== */

@media screen and (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 680px) and (max-height: 699px) {

    #appHeader3,
    #appHeader3 #navContent3 {
        height: 82px !important;
        min-height: 82px !important;
        max-height: 82px !important;
    }

    #appHeader3 #navContent3 {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    #appHeader3 #navContent3 > .navbar-brand {
        flex-basis: 148px !important;
        width: 148px !important;
        min-width: 148px !important;
        max-width: 148px !important;
        height: 54px !important;
    }

    #appHeader3 #navContent3 > .navbar-brand img {
        width: 148px !important;
        min-width: 148px !important;
        max-width: 148px !important;
        height: 54px !important;
        max-height: 54px !important;
    }

    #appHeader3 .header-title {
        font-size: 2rem !important;
    }

    #appHeader3 #roleSwitch,
    #appHeader3 #goBackBtn {
        flex-basis: 166px !important;
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
        height: 36px !important;
    }

    #appHeader3 #roleSwitch form,
    #appHeader3 #roleSwitch button,
    #appHeader3 #userLoginBtn,
    #appHeader3 #goBackBtn a {
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
        height: 36px !important;
        min-height: 36px !important;
        max-height: 36px !important;
    }

    #appHeader3 #socialIcons {
        width: 102px !important;
        min-width: 102px !important;
        height: 36px !important;
    }

    #appHeader3 #socialIcons a {
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
    }
}


/* ======================================================================
   1366px LAPTOP — 700 TO 748px
   Desktop-like proportions without changing the component arrangement.
   ====================================================================== */

@media screen and (min-width: 1200px) and (max-width: 1399.98px)
and (min-height: 700px) and (max-height: 748px) {

    #appHeader3,
    #appHeader3 #navContent3 {
        height: 90px !important;
        min-height: 90px !important;
        max-height: 90px !important;
    }

    #appHeader3 #navContent3 {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    #appHeader3 #navContent3 > .navbar-brand {
        flex-basis: 170px !important;
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
        height: 61px !important;
    }

    #appHeader3 #navContent3 > .navbar-brand img {
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
        height: 61px !important;
        max-height: 61px !important;
    }

    #appHeader3 .header-title {
        font-size: 2.25rem !important;
    }

    #appHeader3 #roleSwitch,
    #appHeader3 #goBackBtn {
        flex-basis: 166px !important;
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
        height: 38px !important;
    }

    #appHeader3 #roleSwitch form,
    #appHeader3 #roleSwitch button,
    #appHeader3 #userLoginBtn,
    #appHeader3 #goBackBtn a {
        width: 166px !important;
        min-width: 166px !important;
        max-width: 166px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
    }

    #appHeader3 #socialIcons {
        width: 108px !important;
        min-width: 108px !important;
        height: 38px !important;
    }

    #appHeader3 #socialIcons a {
        width: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
    }
}

