/* =====================================================
   ระบบยืม-คืนครุภัณฑ์
   สาขาเทคโนโลยีธุรกิจดิจิทัล
   วิทยาลัยเทคโนโลยีอักษรบางละมุง
   ===================================================== */

:root {
    --primary-dark: #0d3b66;
    --primary: #1a4d7c;
    --primary-light: #2a6cb0;
    --accent: #4a9eff;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    min-height: 100vh;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-logo {
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-logo {
    display: block;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.school-logo--auth {
    width: 120px;
    height: 120px;
    padding: 3px;
}


.school-logo--sidebar {
    width: 76px;
    height: 76px;
    padding: 2px;
    margin: 0 auto;
}

.auth-demo {
    border-left: 3px solid var(--primary);
}

/* ===== Layout ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
}

.logo-text h6 {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.logo-text small {
    font-size: 0.68rem;
    opacity: 0.85;
    line-height: 1.45;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    border-left: 3px solid #fff;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Top Navbar ===== */
.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.navbar-title h5 {
    color: var(--primary-dark);
    font-weight: 600;
}

.navbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.user-name {
    font-size: 0.9rem;
    color: #555;
}

.sidebar-toggle {
    color: var(--primary-dark);
    font-size: 1.2rem;
    padding: 0;
}

/* ===== Content ===== */
.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-primary { border-color: var(--primary-dark); }
.stat-success { border-color: #28a745; }
.stat-warning { border-color: #ffc107; }
.stat-info    { border-color: #17a2b8; }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-primary .stat-icon { background: rgba(13, 59, 102, 0.1); color: var(--primary-dark); }
.stat-success .stat-icon { background: rgba(40, 167, 69, 0.1); color: #28a745; }
.stat-warning .stat-icon { background: rgba(255, 193, 7, 0.15); color: #d39e00; }
.stat-info .stat-icon    { background: rgba(23, 162, 184, 0.1); color: #17a2b8; }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-dark);
}

.stat-info p {
    margin: 0;
    color: #888;
    font-size: 0.85rem;
}

.pending-count {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
}

/* ===== Cards ===== */
.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* ===== Tables ===== */
.table thead th {
    background: #f8f9fa;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid #e0e6ed;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ===== Equipment ===== */
.eq-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}

.eq-thumb-placeholder {
    width: 48px;
    height: 48px;
    background: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.equipment-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.equipment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.eq-card-img {
    height: 160px;
    object-fit: cover;
}

.eq-card-placeholder {
    height: 160px;
    background: linear-gradient(135deg, #e8f0fe, #d0e4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

/* ===== Welcome Banner ===== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 12px;
}

.welcome-banner h4 {
    font-weight: 700;
}

/* ===== Steps ===== */
.steps-list .step-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary-dark);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== Profile ===== */
.profile-avatar {
    font-size: 5rem;
    color: var(--primary-light);
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary {
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.text-primary {
    color: var(--primary-dark) !important;
}

.bg-primary {
    background-color: var(--primary-dark) !important;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-dark);
}

a {
    color: var(--primary-light);
}

a:hover {
    color: var(--primary-dark);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(26, 77, 124, 0.25);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .content-area {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info h3 {
        font-size: 1.4rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}
.sidebar-footer .btn{
    transition: .25s;
    font-weight:600;
}

.sidebar-footer .btn:hover{
    transform: translateY(-2px);
    box-shadow:0 8px 20px rgba(220,53,69,.35);
}
.stat-card{
    cursor:pointer;
    transition:.25s;
}

.stat-card:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,.15);
}
/* ==============================
   UI Animation
================================ */

/* หน้าเว็บตอนเปิด */
.content-area {
    animation: pageEnter 0.35s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ตอนกำลังเปลี่ยนหน้า */
.content-area.page-leaving {
    opacity: 0;
    transform: translateX(-12px);
    transition: all 0.2s ease;
}

/* การ์ด Dashboard */
.stat-card {
    cursor: pointer;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(-3deg);
}

.stat-card:active {
    transform: translateY(-1px) scale(0.98);
}

.stat-icon {
    transition: transform 0.25s ease;
}

/* ปุ่ม */
.btn {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.btn:active {
    transform: scale(0.96);
}

/* เมนู Sidebar */
.sidebar .nav-link {
    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}

.sidebar .nav-link:hover {
    transform: translateX(5px);
}

/* ไอคอนใน Sidebar */
.sidebar .nav-link i {
    transition: transform 0.2s ease;
}

.sidebar .nav-link:hover i {
    transform: scale(1.15);
}


/* ===== A-TECH GLOBAL PAGE ANIMATION ===== */
@keyframes atechFloatUp {
    0% { opacity: 0; transform: translateY(26px) scale(.985); }
    70% { opacity: 1; transform: translateY(-2px) scale(1.002); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* JS จะเติม class นี้ให้ส่วนต่าง ๆ ของทุกหน้า */
.atech-enter-item {
    opacity: 0;
    will-change: opacity, transform;
    animation: atechFloatUp .52s cubic-bezier(.22,.61,.36,1) forwards;
    animation-delay: var(--atech-delay, 0ms);
}

/* ออกจากหน้าปัจจุบันอย่างนุ่มนวล */
.content-area {
    transition: opacity .18s ease, transform .18s ease;
}
.content-area.page-leaving {
    opacity: 0;
    transform: translateY(-8px) scale(.995);
}

/* hover ของกล่องที่กดได้ */
.stat-card,
.card-clickable {
    transition: transform .24s ease, box-shadow .24s ease;
}
.stat-card:hover,
.card-clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgba(0,0,0,.12);
}
.stat-card:active,
.card-clickable:active {
    transform: translateY(-1px) scale(.975);
}

@media (prefers-reduced-motion: reduce) {
    .atech-enter-item {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
    .content-area { transition: none !important; }
}
/* =====================================================
   SIDEBAR FINAL STYLE
   ===================================================== */

/* พื้นที่เมนู */
.sidebar-nav {
    padding: 14px 10px;
}

/* เมนูแต่ละอัน */
.sidebar-nav .nav-link {
    margin: 4px 0;
    padding: 12px 16px;

    border-radius: 12px;

    color: rgba(255,255,255,.82);
    background: transparent;

    transition:
        transform .22s ease,
        background .22s ease,
        box-shadow .22s ease,
        color .22s ease;
}

/* Hover */
.sidebar-nav .nav-link:hover {
    color: #fff;

    background: rgba(255,255,255,.10);

    transform: translateX(5px);

    box-shadow: 0 5px 14px rgba(0,0,0,.10);
}

/* Active */
.sidebar-nav .nav-link.active {
    color: #fff;

    background: rgba(255,255,255,.15);

    border-left: none;

    box-shadow:
        0 5px 15px rgba(0,0,0,.10),
        inset 0 1px 0 rgba(255,255,255,.08);

    transform: translateX(3px);
}

/* เส้นขาวของหน้าปัจจุบัน */
.sidebar-nav .nav-link.active::before {
    content: "";
    position: absolute;

    left: -10px;
    top: 50%;

    width: 4px;
    height: 55%;

    transform: translateY(-50%);

    background: #fff;
    border-radius: 0 5px 5px 0;
}

/* ต้องมี position เพื่อให้ ::before ทำงานถูก */
.sidebar-nav .nav-link {
    position: relative;
}

/* ไอคอน ไม่ขยาย */
.sidebar-nav .nav-link i,
.sidebar-nav .nav-link:hover i,
.sidebar-nav .nav-link.active i {
    transform: none !important;
}

/* ตอนกด ไม่ scale */
.sidebar-nav .nav-link:active {
    transform: translateX(3px);
}


/* =====================================================
   LOGOUT AREA
   ===================================================== */

.sidebar-footer {
    padding: 14px;

    /* เอาแถบ/เส้นที่เห็นออก */
    border-top: none !important;

    background: transparent !important;
    box-shadow: none !important;
}

/* Logout */
.sidebar-footer .btn,
.sidebar-footer .nav-link,
.sidebar-footer a {
    border-radius: 12px !important;

    /* สำคัญ: ห้ามเคลื่อน */
    transform: none !important;

    transition:
        background-color .2s ease,
        box-shadow .2s ease !important;
}

/* Hover logout */
.sidebar-footer .btn:hover,
.sidebar-footer .nav-link:hover,
.sidebar-footer a:hover {
    transform: none !important;

    box-shadow:
        0 6px 16px rgba(220,53,69,.25);
}

/* ตอนกดก็ห้ามยุบ */
.sidebar-footer .btn:active,
.sidebar-footer .nav-link:active,
.sidebar-footer a:active {
    transform: none !important;
}


/* =====================================================
   ป้องกัน Global .btn animation ไปโดน Logout
   ===================================================== */

.sidebar-footer .btn:hover {
    transform: none !important;
}

.sidebar-footer .btn:active {
    transform: none !important;
}
/* ===== กล่องรายการครุภัณฑ์เด้งตอนเปิดหน้า ===== */

@keyframes equipmentPanelUp {
    0% {
        opacity: 0;
        transform: translateY(35px);
    }

    70% {
        opacity: 1;
        transform: translateY(-4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* หน้า equipments: กล่องฝั่งขวา */
.content-area .row > .col-lg-8 {
    animation: equipmentPanelUp .6s
               cubic-bezier(.22,.61,.36,1) both;
}

/* กล่องเพิ่มครุภัณฑ์ฝั่งซ้ายขึ้นก่อน */
.content-area .row > .col-lg-4 {
    animation: equipmentPanelUp .55s
               cubic-bezier(.22,.61,.36,1) both;

    animation-delay: .05s;
}

/* ฝั่งรายการตามขึ้นมา */
.content-area .row > .col-lg-8 {
    animation-delay: .15s;
}
/* ตารางขึ้นทีละแถว */
@keyframes equipmentRowUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table tbody tr {
    opacity: 0;
    animation: equipmentRowUp .35s ease forwards;
}

.table tbody tr:nth-child(1) { animation-delay: .20s; }
.table tbody tr:nth-child(2) { animation-delay: .24s; }
.table tbody tr:nth-child(3) { animation-delay: .28s; }
.table tbody tr:nth-child(4) { animation-delay: .32s; }
.table tbody tr:nth-child(5) { animation-delay: .36s; }
.table tbody tr:nth-child(6) { animation-delay: .40s; }
.table tbody tr:nth-child(7) { animation-delay: .44s; }
.table tbody tr:nth-child(8) { animation-delay: .48s; }
.table tbody tr:nth-child(9) { animation-delay: .52s; }
.table tbody tr:nth-child(10) { animation-delay: .56s; }
.table tbody tr:nth-child(11) { animation-delay: .58s; }
.table tbody tr:nth-child(12) { animation-delay: .60s; }
.table tbody tr:nth-child(13) { animation-delay: .62s; }
.table tbody tr:nth-child(14) { animation-delay: .64s; }
.table tbody tr:nth-child(15) { animation-delay: .66s; }
.table tbody tr:nth-child(16) { animation-delay: .68s; }
.table tbody tr:nth-child(17) { animation-delay: .70s; }
.table tbody tr:nth-child(18) { animation-delay: .72s; }
.table tbody tr:nth-child(19) { animation-delay: .74s; }
.table tbody tr:nth-child(20) { animation-delay: .76s; }
.table tbody tr:nth-child(21) { animation-delay: .78s; }
.table tbody tr:nth-child(22) { animation-delay: .80s; }
.table tbody tr:nth-child(23) { animation-delay: .82s; }
.table tbody tr:nth-child(24) { animation-delay: .84s; }
.table tbody tr:nth-child(25) { animation-delay: .86s; }
.table tbody tr:nth-child(26) { animation-delay: .88s; }
.table tbody tr:nth-child(27) { animation-delay: .90s; }
.table tbody tr:nth-child(28) { animation-delay: .92s; }
.table tbody tr:nth-child(29) { animation-delay: .94; }
.table tbody tr:nth-child(30) { animation-delay: .96s; }
.table tbody tr:nth-child(31) { animation-delay: .98s; }
/* ========================================
   TABLE ROW - HOVER / SELECT EFFECT
======================================== */

.table tbody tr {
    transition:
        transform .20s ease,
        box-shadow .20s ease,
        background-color .20s ease;
}

/* เอาเมาส์ชี้แถว */
.table tbody tr:hover {
    position: relative;
    z-index: 2;

    /* เด้งขึ้นอย่างเดียว ไม่ขยาย */
    transform: translateY(-3px);

    background: #f8fbff;

    box-shadow:
        0 5px 14px rgba(13, 59, 102, .12);
}

/* ตอนกดเมาส์ */
.table tbody tr:active {
    transform: translateY(-1px);
}
/* =========================================
   A-TECH COOL TONE THEME
   Blue • Indigo • Purple
========================================= */

:root {
    --cool-navy: #102a56;
    --cool-blue: #185fa8;
    --cool-indigo: #4f46e5;
    --cool-purple: #7c3aed;
    --cool-light: #eef4ff;
    --cool-purple-light: #f3efff;
}


/* ===== พื้นหลังเว็บ ===== */

body {
    background:
        linear-gradient(
            135deg,
            #f4f8ff 0%,
            #f1f4ff 50%,
            #f6f2ff 100%
        );
}


/* ===== SIDEBAR ===== */

.sidebar {
    background:
        linear-gradient(
            180deg,
            #102a56 0%,
            #164f8c 50%,
            #40328a 100%
        );
}


/* ===== Sidebar Active ===== */

.sidebar-nav .nav-link.active {
    background:
        linear-gradient(
            90deg,
            rgba(74,158,255,.22),
            rgba(124,58,237,.18)
        );

    box-shadow:
        0 6px 18px rgba(10,30,70,.18);
}


/* ===== Sidebar Hover ===== */

.sidebar-nav .nav-link:hover {
    background:
        linear-gradient(
            90deg,
            rgba(74,158,255,.16),
            rgba(124,58,237,.12)
        );
}


/* ===== Welcome Banner ===== */

.welcome-banner {
    background:
        linear-gradient(
            120deg,
            #123f73 0%,
            #246bb2 55%,
            #6350c9 100%
        );

    box-shadow:
        0 10px 25px rgba(45,70,150,.15);
}


/* ===== CARD ===== */

.card,
.stat-card {
    border-radius: 16px;

    box-shadow:
        0 5px 18px rgba(35,55,110,.08);

    border: 1px solid rgba(90,110,180,.08);
}


/* ===== CARD HOVER ===== */

.card:hover {
    box-shadow:
        0 9px 24px rgba(54,65,150,.12);
}


/* ===== Primary Card ===== */

.stat-primary {
    border-color: #2563eb;
}

.stat-primary .stat-icon {
    color: #2563eb;

    background:
        linear-gradient(
            135deg,
            #e8f2ff,
            #e7e9ff
        );
}


/* ===== Success ===== */

.stat-success {
    border-color: #22a884;
}


/* ===== Warning เปลี่ยนเป็นม่วง ===== */

.stat-warning {
    border-color: #7c3aed;
}

.stat-warning .stat-icon {
    color: #7c3aed;

    background:
        linear-gradient(
            135deg,
            #eee9ff,
            #f5eaff
        );
}


/* ===== Info ===== */

.stat-info {
    border-color: #4f46e5;
}

.stat-info .stat-icon {
    color: #4f46e5;

    background: #eef0ff;
}


/* ===== ปุ่ม Primary ===== */

.btn-primary {
    border: none;

    background:
        linear-gradient(
            120deg,
            #185fa8,
            #4f46e5
        );

    box-shadow:
        0 4px 12px rgba(79,70,229,.18);
}

.btn-primary:hover {
    background:
        linear-gradient(
            120deg,
            #2472c4,
            #6d5bea
        );

    box-shadow:
        0 7px 16px rgba(79,70,229,.24);
}


/* ===== Outline Button ===== */

.btn-outline-primary {
    color: #315ca8;
    border-color: #607ad1;
}

.btn-outline-primary:hover {
    color: #fff;

    background:
        linear-gradient(
            120deg,
            #2563a9,
            #6350c9
        );

    border-color: transparent;
}


/* ===== INPUT ===== */

.form-control,
.form-select {
    border-radius: 10px;

    border-color: #dce3f2;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #6366f1;

    box-shadow:
        0 0 0 3px rgba(99,102,241,.12);
}


/* ===== TABLE ===== */

.table thead th {
    background:
        linear-gradient(
            180deg,
            #f6f8ff,
            #eef2ff
        );

    color: #253b70;
}


/* เวลาเลือกแถว */

.table tbody tr:hover {
    background: #f4f5ff;

    box-shadow:
        0 5px 14px rgba(79,70,229,.10);
}


/* ===== Header ===== */

.top-navbar {
    background:
        rgba(255,255,255,.96);

    box-shadow:
        0 3px 14px rgba(30,50,100,.07);
}


/* ===== Scrollbar ===== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #edf1fa;
}

::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            #3b82f6,
            #7065d8
        );

    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(
            #2563eb,
            #7c3aed
        );
}
/* =====================================================
   A-TECH LOGIN - COOL BLUE / PURPLE
===================================================== */

.auth-wrapper {
    position: relative;
    overflow: hidden;

    background:
        radial-gradient(circle at 20% 20%,
            rgba(91, 115, 255, .28),
            transparent 32%),
        radial-gradient(circle at 80% 75%,
            rgba(124, 58, 237, .30),
            transparent 35%),
        linear-gradient(
            135deg,
            #092f59 0%,
            #155c9c 48%,
            #4338a8 100%
        );
}

/* แสงด้านหลัง */
.auth-wrapper::before,
.auth-wrapper::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

/* ลูกแสงซ้าย */
.auth-wrapper::before {
    width: 420px;
    height: 420px;

    left: -120px;
    top: -100px;

    background:
        radial-gradient(
            circle,
            rgba(72, 180, 255, .22),
            rgba(72, 180, 255, 0) 70%
        );

    animation: loginGlow1 8s ease-in-out infinite alternate;
}

/* ลูกแสงขวา */
.auth-wrapper::after {
    width: 500px;
    height: 500px;

    right: -130px;
    bottom: -160px;

    background:
        radial-gradient(
            circle,
            rgba(154, 93, 255, .25),
            rgba(154, 93, 255, 0) 70%
        );

    animation: loginGlow2 10s ease-in-out infinite alternate;
}

@keyframes loginGlow1 {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(60px, 45px);
    }
}

@keyframes loginGlow2 {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-60px, -40px);
    }
}


/* =====================================================
   LOGIN CARD
===================================================== */

.auth-card {
    position: relative;
    z-index: 2;

    border-radius: 22px;

    border: 1px solid rgba(255, 255, 255, .65);

    background:
        rgba(255, 255, 255, .96);

    box-shadow:
        0 30px 70px rgba(3, 25, 70, .28),
        0 8px 25px rgba(75, 55, 180, .12);

    animation:
        loginCardEnter .65s cubic-bezier(.22,.61,.36,1) both;

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}


/* ตอนเปิดหน้า ลอยขึ้น */
@keyframes loginCardEnter {

    0% {
        opacity: 0;
        transform: translateY(35px);
    }

    70% {
        opacity: 1;
        transform: translateY(-4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ไม่ขยาย แค่ลอย */
.auth-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 35px 80px rgba(3, 25, 70, .32),
        0 10px 30px rgba(100, 70, 220, .14);
}


/* =====================================================
   LOGO
===================================================== */

.school-logo--auth {
    border: 4px solid rgba(255,255,255,.95);

    box-shadow:
        0 8px 25px rgba(20, 70, 140, .18),
        0 0 0 5px rgba(79, 70, 229, .05);

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.school-logo--auth:hover {
    transform: translateY(-3px);

    box-shadow:
        0 12px 30px rgba(79, 70, 229, .22),
        0 0 0 6px rgba(79, 70, 229, .07);
}


/* =====================================================
   INPUT
===================================================== */

.auth-card .form-control {
    min-height: 46px;

    border-radius: 11px;

    border: 1px solid #dce3f0;

    background: #f9fbff;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.auth-card .input-group-text {
    border-radius: 11px 0 0 11px;

    border-color: #dce3f0;

    background:
        linear-gradient(
            135deg,
            #f3f7ff,
            #f3efff
        );

    color: #315f9e;
}


/* คลิกช่องกรอก */
.auth-card .form-control:focus {
    background: #fff;

    border-color: #6366f1;

    box-shadow:
        0 0 0 4px rgba(99,102,241,.10);
}


/* =====================================================
   LOGIN BUTTON
===================================================== */

.auth-card .btn-primary {
    min-height: 46px;

    border: none;

    border-radius: 11px;

    background:
        linear-gradient(
            100deg,
            #1768b5,
            #4f46e5,
            #7138d0
        );

    box-shadow:
        0 7px 18px rgba(79,70,229,.24);

    font-weight: 600;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}


/* ชี้ปุ่ม */
.auth-card .btn-primary:hover {
    /* ไม่ขยาย */
    transform: translateY(-3px);

    filter: brightness(1.07);

    box-shadow:
        0 11px 25px rgba(79,70,229,.32);
}


/* กด */
.auth-card .btn-primary:active {
    transform: translateY(0);
}


/* =====================================================
   REGISTER LINK
===================================================== */

.auth-card a {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: none;
    position: relative;
}

.auth-card a:hover {
    color: #7138d0;
}

.auth-card a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -2px;

    width: 0;
    height: 2px;

    border-radius: 10px;

    background:
        linear-gradient(
            90deg,
            #3b82f6,
            #7c3aed
        );

    transition: width .25s ease;
}

.auth-card a:hover::after {
    width: 100%;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 575.98px) {

    .auth-card {
        border-radius: 18px;
    }

    .auth-wrapper::before {
        width: 280px;
        height: 280px;
    }

    .auth-wrapper::after {
        width: 320px;
        height: 320px;
    }
}
/* =====================================================
   LOGIN EXTRA EFFECTS
   Cool / Tech / Blue Purple
===================================================== */

/* ---------- 1. ลาย Grid จาง ๆ ด้านหลัง ---------- */
.auth-wrapper {
    isolation: isolate;
}

.auth-wrapper {
    background-color: #0d3b66;
}

/* ใช้ pseudo element เพิ่มไม่ได้เพราะ before/after มีแล้ว
   เลยใส่ grid ผ่าน background-image */
.auth-wrapper {
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
        radial-gradient(circle at 20% 20%,
            rgba(59,130,246,.30), transparent 30%),
        radial-gradient(circle at 80% 75%,
            rgba(139,92,246,.28), transparent 35%),
        linear-gradient(135deg,
            #092f59 0%,
            #155c9c 50%,
            #4338a8 100%);

    background-size:
        45px 45px,
        45px 45px,
        auto,
        auto,
        auto;
}


/* ---------- 2. เส้นแสงบน Login Card ---------- */

.auth-card {
    overflow: hidden;
}

/* เส้น Gradient บนสุด */
.auth-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 8%;

    width: 84%;
    height: 3px;

    border-radius: 0 0 10px 10px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #38bdf8,
            #6366f1,
            #a855f7,
            transparent
        );

    box-shadow:
        0 0 15px rgba(99,102,241,.55);
}


/* ---------- 3. แสงวิ่งผ่าน Card ---------- */

.auth-card::after {
    content: "";

    position: absolute;

    top: -50%;
    left: -100%;

    width: 45%;
    height: 200%;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.22),
            transparent
        );

    transform: rotate(18deg);

    animation: cardShine 7s ease-in-out infinite;
}

@keyframes cardShine {

    0%, 65% {
        left: -100%;
    }

    85%, 100% {
        left: 150%;
    }
}


/* ---------- 4. Logo ลอยเบา ๆ ---------- */

.auth-logo {
    animation: logoFloat 3.5s ease-in-out infinite;
}

@keyframes logoFloat {

    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}


/* ---------- 5. Input icon มีลูกเล่น ---------- */

.auth-card .input-group-text i {
    transition:
        transform .25s ease,
        color .25s ease;
}

/* เมื่อคลิกช่องกรอก */
.auth-card .input-group:focus-within .input-group-text i {
    color: #6366f1;

    transform: translateY(-2px);
}

.auth-card .input-group:focus-within .input-group-text {
    border-color: #6366f1;

    background:
        linear-gradient(
            135deg,
            #eef6ff,
            #f2edff
        );
}


/* ---------- 6. Input ยกขึ้นเล็กน้อยตอนเลือก ---------- */

.auth-card .input-group {
    transition:
        transform .22s ease,
        filter .22s ease;
}

.auth-card .input-group:focus-within {
    transform: translateY(-2px);

    filter:
        drop-shadow(0 5px 7px rgba(79,70,229,.08));
}


/* ---------- 7. ปุ่มมีแสงวิ่ง ---------- */

.auth-card .btn-primary {
    position: relative;
    overflow: hidden;
}

.auth-card .btn-primary::before {
    content: "";

    position: absolute;

    top: 0;
    left: -100%;

    width: 55%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.30),
            transparent
        );

    transform: skewX(-20deg);

    transition: left .55s ease;
}

/* เอาเมาส์ชี้แล้วแสงวิ่ง */
.auth-card .btn-primary:hover::before {
    left: 150%;
}


/* ---------- 8. ตอนกด Login ---------- */

.auth-card .btn-primary:active {
    transform: translateY(1px);
    box-shadow:
        0 4px 10px rgba(79,70,229,.20);
}


/* ---------- 9. Cursor กระพริบตอน Focus ---------- */

.auth-card .form-control:focus {
    caret-color: #7c3aed;
}


/* ---------- 10. Selection สีให้เข้าธีม ---------- */

.auth-card ::selection {
    background: rgba(99,102,241,.20);
    color: #172554;
}


/* ---------- ลด animation ถ้าเครื่องตั้งไว้ ---------- */

@media (prefers-reduced-motion: reduce) {

    .auth-logo,
    .auth-card::after {
        animation: none !important;
    }
}
/* =========================================
   LOGIN - SOFT LIGHT RUNNING BACKGROUND
========================================= */

.auth-wrapper {
    position: relative;
    overflow: hidden;
}

/* แสงวิ่ง */
.auth-wrapper::after {
    content: "";
    display: block !important;

    position: absolute;
    z-index: 1;

    top: -40%;
    left: -50%;

    width: 32%;
    height: 180%;

    pointer-events: none;

    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.02) 20%,
        rgba(160,215,255,0.10) 40%,
        rgba(220,210,255,0.18) 50%,
        rgba(160,215,255,0.10) 60%,
        rgba(255,255,255,0.02) 80%,
        transparent 100%
    );

    filter: blur(28px);

    transform: rotate(15deg);

    animation: atechLightRun 7s ease-in-out infinite;
}

@keyframes atechLightRun {
    0% {
        left: -50%;
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    75% {
        opacity: 1;
    }

    100% {
        left: 125%;
        opacity: 0;
    }
}

/* กล่อง Login อยู่เหนือแสง */
.auth-card {
    position: relative;
    z-index: 5;
}
/* =========================================
   TOP NAVBAR USER - CLEAR & MODERN
========================================= */

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 7px 12px;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, .08),
        rgba(124, 58, 237, .08)
    );

    border: 1px solid rgba(79, 70, 229, .10);

    transition:
        background .2s ease,
        box-shadow .2s ease;
}


/* Hover มีมิติ แต่ไม่ขยับ */
.navbar-user:hover {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, .13),
        rgba(124, 58, 237, .12)
    );

    box-shadow:
        0 5px 15px rgba(50, 70, 150, .10);
}


/* ชื่อผู้ใช้ */
.navbar-user .user-name {
    color: #243b64 !important;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
}


/* ไอคอนคน */
.navbar-user .fa-user-circle,
.navbar-user .fa-circle-user,
.navbar-user > i {
    color: #4267b2;

    font-size: 17px;
}


/* Badge บทบาท เช่น ผู้ดูแลระบบ */
.navbar-user .badge {
    padding: 6px 9px;

    border-radius: 8px;

    color: #4338ca !important;

    background: linear-gradient(
        135deg,
        #eef4ff,
        #eeeaff
    ) !important;

    border: 1px solid rgba(99, 102, 241, .12);

    font-size: 11px;
    font-weight: 700;
}


/* แบ่งชื่อกับ Role นิดหนึ่ง */
.navbar-user .badge {
    margin-left: 3px;
}


/* มือถือ */
@media (max-width: 575.98px) {

    .navbar-user {
        padding: 6px 8px;
        gap: 5px;
    }

    .navbar-user .user-name {
        font-size: 12px;
    }
}
/* =========================================
   LOGOUT BUTTON - MODERN
========================================= */

.sidebar-footer {
    padding: 14px 15px 16px;
    border-top: none !important;
    background: transparent !important;
}

/* ปุ่มออกจากระบบ */
.sidebar-footer .btn,
.sidebar-footer a {
    position: relative;
    overflow: hidden;

    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 1px solid rgba(255,255,255,.15) !important;
    border-radius: 13px !important;

    color: #fff !important;
    font-weight: 600;

    background: linear-gradient(
        120deg,
        #e63955,
        #dc3545,
        #b83280
    ) !important;

    box-shadow:
        0 6px 16px rgba(190, 40, 80, .25),
        inset 0 1px 0 rgba(255,255,255,.18);

    transform: none !important;

    transition:
        box-shadow .25s ease,
        filter .25s ease !important;
}


/* แสงวิ่งผ่านปุ่ม */
.sidebar-footer .btn::before,
.sidebar-footer a::before {
    content: "";

    position: absolute;
    top: 0;
    left: -80%;

    width: 45%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.30),
        transparent
    );

    transform: skewX(-20deg);

    transition: left .55s ease;
}


/* Hover */
.sidebar-footer .btn:hover,
.sidebar-footer a:hover {
    transform: none !important;

    filter: brightness(1.08);

    box-shadow:
        0 8px 20px rgba(190, 40, 90, .34),
        inset 0 1px 0 rgba(255,255,255,.20);
}


/* แสงวิ่งตอนเอาเมาส์ชี้ */
.sidebar-footer .btn:hover::before,
.sidebar-footer a:hover::before {
    left: 140%;
}


/* ตอนกด — ไม่ยุบ ไม่ขยาย */
.sidebar-footer .btn:active,
.sidebar-footer a:active {
    transform: none !important;
    filter: brightness(.93);
}


/* ไอคอน Logout */
.sidebar-footer i {
    font-size: 15px;
    color: #fff;

    transform: none !important;
}
/* =========================================
   WELCOME BANNER - ไฟวิ่งวนรอบกรอบ
========================================= */

.welcome-banner {
    position: relative;
    z-index: 0;
    overflow: hidden;

    /* ความหนาของขอบไฟ */
    padding: calc(1.5rem + 2px) calc(2rem + 2px);

    border-radius: 14px;

    /* พื้นหลังเดิม */
    background:
        linear-gradient(
            135deg,
            #124a7c,
            #2572bd,
            #5b45d6
        );
}

/* ไฟหมุน */
.welcome-banner::before {
    content: "";

    position: absolute;
    z-index: -2;

    /* ทำให้ใหญ่กว่ากล่องเพื่อหมุนได้ */
    width: 160%;
    height: 500%;

    top: -200%;
    left: -30%;

    background: conic-gradient(
        transparent 0deg,
        transparent 280deg,

        #ffffff 300deg,
        #62d9ff 315deg,
        #7c6cff 330deg,
        #d27cff 345deg,

        transparent 360deg
    );

    animation: welcomeBorderSpin 3.5s linear infinite;
}

/* ปิดตรงกลาง เหลือเฉพาะขอบไฟ */
.welcome-banner::after {
    content: "";

    position: absolute;
    z-index: -1;

    inset: 2px;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #124a7c 0%,
            #2572bd 55%,
            #5b45d6 100%
        );
}

/* หมุนไฟรอบกรอบ */
@keyframes welcomeBorderSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ให้ข้อความอยู่ด้านหน้า */
.welcome-banner h4,
.welcome-banner p {
    position: relative;
    z-index: 2;
}
/* =========================================
   WELCOME BANNER - INNER EFFECT
========================================= */

/* ข้อความเข้าหน้าแบบลอยขึ้น */
.welcome-banner h4 {
    animation: welcomeTextIn .6s ease-out both;
}

.welcome-banner p {
    animation: welcomeTextIn .6s .12s ease-out both;
}

@keyframes welcomeTextIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ===== แสง Glow หลังข้อความ ===== */

.welcome-banner h4 {
    text-shadow:
        0 0 8px rgba(255,255,255,.15),
        0 0 18px rgba(120,200,255,.12);
}


/* ===== แสงวิ่งผ่านตัวหนังสือหัวข้อ ===== */

.welcome-banner h4 {
    position: relative;

    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #ffffff 35%,
        #bde9ff 45%,
        #ffffff 55%,
        #ffffff 100%
    );

    background-size: 250% 100%;

    -webkit-background-clip: text;
    background-clip: text;

    -webkit-text-fill-color: transparent;

    animation:
        welcomeTextIn .6s ease-out both,
        welcomeTextShine 5s linear infinite;
}

@keyframes welcomeTextShine {
    0% {
        background-position: 150% 0;
    }

    100% {
        background-position: -150% 0;
    }
}


/* ===== ข้อความด้านล่าง ===== */

.welcome-banner p {
    color: rgba(255,255,255,.90);

    text-shadow:
        0 2px 8px rgba(0,0,0,.12);
}


/* ===== ไอคอน ถ้ามีใน Banner ===== */

.welcome-banner i {
    display: inline-block;

    filter:
        drop-shadow(0 0 5px rgba(150,220,255,.35));

    animation: welcomeIconFloat 2.5s ease-in-out infinite;
}

@keyframes welcomeIconFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}
/* =====================================================
   STAT CARDS - FLOAT + ICON ROTATE
===================================================== */

/* การ์ดเด้งขึ้น */
.stat-card {
    cursor: pointer;

    opacity: 0;

    animation: statCardEnter .55s
        cubic-bezier(.22,.61,.36,1)
        forwards;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}


/* เด้งขึ้นแบบนุ่ม ๆ */
@keyframes statCardEnter {

    0% {
        opacity: 0;
        transform: translateY(25px);
    }

    70% {
        opacity: 1;
        transform: translateY(-4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==============================
   ให้ 4 ใบขึ้นทีละใบ
================================ */

.row .col-sm-6:nth-child(1) .stat-card {
    animation-delay: .05s;
}

.row .col-sm-6:nth-child(2) .stat-card {
    animation-delay: .13s;
}

.row .col-sm-6:nth-child(3) .stat-card {
    animation-delay: .21s;
}

.row .col-sm-6:nth-child(4) .stat-card {
    animation-delay: .29s;
}


/* =====================================================
   ICON
===================================================== */

.stat-icon {
    position: relative;

    transition:
        transform .45s cubic-bezier(.34,1.56,.64,1),
        box-shadow .3s ease;

    animation: statIconEnter .65s ease-out both;
}


/* ไอคอนหมุนตอนเปิดหน้า */
@keyframes statIconEnter {

    0% {
        opacity: 0;
        transform:
            rotate(-90deg)
            translateY(8px);
    }

    70% {
        opacity: 1;
        transform:
            rotate(8deg)
            translateY(-2px);
    }

    100% {
        opacity: 1;
        transform:
            rotate(0deg)
            translateY(0);
    }
}


/* ให้ Icon หมุนตามการ์ดทีละใบ */
.row .col-sm-6:nth-child(1) .stat-icon {
    animation-delay: .12s;
}

.row .col-sm-6:nth-child(2) .stat-icon {
    animation-delay: .20s;
}

.row .col-sm-6:nth-child(3) .stat-icon {
    animation-delay: .28s;
}

.row .col-sm-6:nth-child(4) .stat-icon {
    animation-delay: .36s;
}


/* =====================================================
   HOVER
===================================================== */

/* การ์ดลอย แต่ไม่ขยาย */
.stat-card:hover {
    transform: translateY(-5px) !important;

    box-shadow:
        0 12px 28px rgba(55, 70, 160, .15);
}


/* ไอคอนหมุนตอนเอาเมาส์ชี้ */
.stat-card:hover .stat-icon {
    transform:
        rotate(12deg)
        translateY(-2px) !important;

    box-shadow:
        0 7px 18px rgba(90, 80, 220, .13);
}


/* ตอนกด */
.stat-card:active {
    transform: translateY(-2px) !important;
}


/* ตอนกด Icon หมุนกลับ */
.stat-card:active .stat-icon {
    transform: rotate(-8deg) !important;
}
/* ==========================================
   A-TECH LOGOUT MODAL
========================================== */

.logout-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(4, 13, 35, .58);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.logout-modal.show {
    opacity: 1;
    visibility: visible;
}


/* ===== กล่อง ===== */

.logout-modal-box {
    position: relative;

    width: 100%;
    max-width: 390px;

    padding: 32px 28px 27px;

    text-align: center;

    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(
            135deg,
            #2196f3,
            #5448e8,
            #9c4dff
        ) border-box;

    border: 2px solid transparent;
    border-radius: 25px;

    box-shadow:
        0 30px 70px rgba(0,0,0,.28),
        0 0 40px rgba(76,75,255,.20);

    opacity: 0;

    transform:
        translateY(35px)
        scale(.88);

    transition:
        transform .4s cubic-bezier(.34,1.56,.64,1),
        opacity .25s ease;
}


/* ===== ตอนเปิด ===== */

.logout-modal.show .logout-modal-box {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}


/* ===== ICON ===== */

.logout-modal-icon {
    width: 75px;
    height: 75px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 23px;

    font-size: 29px;
    color: #fff;

    background: linear-gradient(
        135deg,
        #2587ff,
        #6347e9,
        #9c45ef
    );

    box-shadow:
        0 12px 30px rgba(78,74,240,.35);
}


/* หมุน + เด้ง */

.logout-modal.show .logout-modal-icon {
    animation: logoutIconPop .6s
        cubic-bezier(.34,1.56,.64,1);
}

@keyframes logoutIconPop {

    0% {
        opacity: 0;
        transform:
            scale(.3)
            rotate(-40deg);
    }

    65% {
        transform:
            scale(1.12)
            rotate(8deg);
    }

    100% {
        opacity: 1;
        transform:
            scale(1)
            rotate(0);
    }
}


/* ===== TEXT ===== */

.logout-modal-box h4 {
    margin: 0 0 9px;

    color: #123f69;

    font-size: 1.35rem;
    font-weight: 750;
}

.logout-modal-box p {
    margin: 0 0 25px;

    color: #687385;

    font-size: .92rem;
    line-height: 1.65;
}

.logout-modal-box p strong {
    color: #5645df;
}


/* ===== BUTTONS ===== */

.logout-modal-buttons {
    display: flex;
    gap: 11px;
}

.logout-cancel,
.logout-confirm {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 45px;

    padding: 10px 15px;

    border: 0;
    border-radius: 13px;

    font-size: .9rem;
    font-weight: 650;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}


/* ยกเลิก */

.logout-cancel {
    color: #526172;
    background: #edf1f6;
}

.logout-cancel:hover {
    background: #e4e9f0;
}


/* ออกจากระบบ */

.logout-confirm {
    color: #fff;

    background: linear-gradient(
        135deg,
        #ef405c,
        #dc317b
    );

    box-shadow:
        0 8px 20px rgba(225,50,100,.28);
}

.logout-confirm:hover {
    color: #fff;

    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(225,50,100,.38);
}


/* ตอนกด */

.logout-cancel:active,
.logout-confirm:active {
    transform: scale(.95);
}


/* ===== MOBILE ===== */

@media (max-width: 575px) {

    .logout-modal-box {
        max-width: 335px;
        padding: 27px 20px 21px;
        border-radius: 21px;
    }

    .logout-modal-icon {
        width: 65px;
        height: 65px;

        border-radius: 20px;

        font-size: 25px;
    }

    .logout-modal-box h4 {
        font-size: 1.2rem;
    }
}
/* =====================================================
   A-TECH MOBILE SIDEBAR - FINAL
===================================================== */

@media (max-width: 991.98px) {

    html,
    body {
        width: 100%;
        min-height: 100%;
        overflow-x: hidden;
    }

    /* =========================
       SIDEBAR
    ========================= */

    .sidebar {
        position: fixed !important;

        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;

        width: 270px !important;
        max-width: 85vw !important;

        /* สำคัญ: ไม่ fix ด้วย 100vh อย่างเดียว */
        height: auto !important;
        min-height: 0 !important;

        display: flex !important;
        flex-direction: column !important;

        overflow: hidden !important;

        z-index: 10000 !important;

        transform: translateX(-100%) !important;

        transition:
            transform .3s cubic-bezier(.22,.61,.36,1) !important;

        background:
            linear-gradient(
                180deg,
                #0d3b66 0%,
                #185d99 48%,
                #373696 100%
            ) !important;

        box-shadow:
            10px 0 35px rgba(0,0,0,.20);
    }


    /* เปิด Sidebar */
    .sidebar.show {
        transform: translateX(0) !important;
    }


    /* =========================
       LOGO
    ========================= */

    .sidebar-header {
        flex: 0 0 auto !important;

        padding: 15px 12px 12px !important;

        border-bottom:
            1px solid rgba(255,255,255,.10);
    }


    .school-logo--sidebar {
        width: 62px !important;
        height: 62px !important;
    }


    .sidebar-brand {
        gap: .4rem !important;
    }


    /* =========================
       MENU
    ========================= */

    .sidebar-nav {
        /* ตัวนี้กินพื้นที่ทั้งหมดที่เหลือ */
        flex: 1 1 0 !important;

        min-height: 0 !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        padding: 7px 8px !important;

        -webkit-overflow-scrolling: touch;

        overscroll-behavior: contain;
    }


    .sidebar-nav .nav-link {
        margin: 2px 0 !important;

        padding: 10px 13px !important;

        border-radius: 11px !important;

        font-size: .86rem !important;

        color:
            rgba(255,255,255,.82) !important;
    }


    /* เมนูที่เลือก */
    .sidebar-nav .nav-link.active {
        border-left: 0 !important;

        color: #fff !important;

        background:
            linear-gradient(
                90deg,
                rgba(50,140,255,.30),
                rgba(110,70,235,.30)
            ) !important;
    }


    /* =========================
       LOGOUT
    ========================= */

    .sidebar-footer {
        /* ห้าม sticky / fixed */
        position: static !important;

        flex: 0 0 auto !important;

        width: 100% !important;

        margin: 0 !important;

        padding:
            9px 13px
            calc(10px + env(safe-area-inset-bottom))
            !important;

        border-top:
            1px solid rgba(255,255,255,.10) !important;

        background:
            rgba(46,51,145,.96) !important;
    }


    /* ปุ่มออกจากระบบ */
    .sidebar-footer .btn {
        position: relative !important;

        width: 100% !important;
        max-width: none !important;

        min-height: 42px;

        margin: 0 !important;

        border-radius: 12px !important;

        transform: none !important;
    }


    .sidebar-footer .btn:hover {
        transform: none !important;
    }


    .sidebar-footer .btn:active {
        transform: none !important;
    }


    /* =========================
       MAIN CONTENT
    ========================= */

    .main-content {
        width: 100% !important;
        min-width: 0 !important;

        margin-left: 0 !important;
    }


    .content-area {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* =====================================================
   จอเตี้ย / มือถือแนวนอน
===================================================== */

@media (max-width: 991.98px) and (max-height: 650px) {

    .sidebar-header {
        padding: 7px 10px !important;
    }

    .school-logo--sidebar {
        width: 45px !important;
        height: 45px !important;
    }

    .sidebar-brand {
        gap: 2px !important;
    }

    .logo-text h6 {
        font-size: .72rem !important;
    }

    .logo-text small {
        display: none !important;
    }

    .sidebar-nav {
        padding: 4px 8px !important;
    }

    .sidebar-nav .nav-link {
        padding: 7px 12px !important;
        margin: 1px 0 !important;
    }

    .sidebar-footer {
        padding:
            6px 12px
            calc(7px + env(safe-area-inset-bottom))
            !important;
    }

    .sidebar-footer .btn {
        min-height: 38px;
    }
}
/* =====================================================
   MOBILE TOP NAVBAR - 2 ROWS
===================================================== */

@media (max-width: 991.98px) {

    .top-navbar {
        width: 100% !important;
        height: auto !important;
        min-height: 70px !important;

        padding: 8px 12px !important;

        display: grid !important;

        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-rows: auto auto;

        column-gap: 8px !important;
        row-gap: 4px !important;

        align-items: center !important;

        overflow: hidden !important;
    }


    /* ปุ่มสามขีด อยู่ซ้ายและกิน 2 แถว */
    .sidebar-toggle {
        grid-column: 1;
        grid-row: 1 / 3;

        width: 44px !important;
        height: 44px !important;

        padding: 0 !important;
        margin: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        font-size: 1.45rem !important;
    }


    /* =========================
       บรรทัด 1 : ชื่อหน้า
    ========================= */

    .navbar-title {
        grid-column: 2;
        grid-row: 1;

        min-width: 0 !important;
        width: 100% !important;
    }

    .navbar-title h5 {
        margin: 0 !important;

        font-size: 1rem !important;
        line-height: 1.2 !important;

        white-space: normal !important;

        color: var(--primary-dark);
    }


    /* =========================
       บรรทัด 2 : ชื่อ + บทบาท
    ========================= */

    .navbar-user {
        grid-column: 2;
        grid-row: 2;

        width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;

        display: flex !important;
        align-items: center !important;

        gap: 6px !important;

        overflow: hidden !important;
    }


    /* ชื่อผู้ใช้ */
    .navbar-user .user-name {
        min-width: 0 !important;

        font-size: .76rem !important;

        white-space: nowrap !important;

        overflow: hidden !important;
        text-overflow: ellipsis !important;

        color: #536273;
    }


    /* บทบาท */
    .navbar-user .badge {
        display: inline-flex !important;

        flex: 0 0 auto !important;

        margin-left: 0 !important;

        font-size: .68rem !important;

        padding: 4px 7px !important;

        border-radius: 8px !important;

        white-space: nowrap !important;
    }
}


/* จอเล็ก */
@media (max-width: 575.98px) {

    .top-navbar {
        padding: 7px 9px !important;

        grid-template-columns: 40px minmax(0, 1fr);

        column-gap: 7px !important;
    }

    .sidebar-toggle {
        width: 40px !important;
        height: 40px !important;

        font-size: 1.35rem !important;
    }

    .navbar-title h5 {
        font-size: .95rem !important;
    }

    .navbar-user .user-name {
        font-size: .72rem !important;
    }

    .navbar-user .badge {
        font-size: .63rem !important;
        padding: 3px 6px !important;
    }
}
/* ===== FIX ปุ่ม 3 ขีดบนมือถือ ===== */
@media (max-width: 991.98px) {

    .sidebar-toggle {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;

        width: auto !important;
        height: auto !important;

        min-width: 40px !important;

        padding: 8px !important;
        margin: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        color: #0d3b66 !important;
        background: transparent !important;

        border: 0 !important;
        border-radius: 10px !important;

        box-shadow: none !important;

        transform: none !important;
    }

    .sidebar-toggle i {
        font-size: 28px !important;
        line-height: 1 !important;

        width: auto !important;

        transform: none !important;
    }

    .sidebar-toggle:hover,
    .sidebar-toggle:focus,
    .sidebar-toggle:active {
        color: #1a4d7c !important;
        background: rgba(13, 59, 102, .07) !important;

        box-shadow: none !important;
        transform: none !important;
    }
}
/* =====================================================
   A-TECH HAMBURGER BUTTON
===================================================== */

@media (max-width: 991.98px) {

    #sidebarToggle {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;

        width: 40px !important;
        height: 40px !important;

        min-width: 40px !important;
        min-height: 40px !important;

        margin: 0 !important;
        padding: 8px !important;

        border: 0 !important;
        outline: 0 !important;

        background: transparent !important;

        box-shadow: none !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;

        gap: 5px !important;

        transform: none !important;
    }


    /* ขีดทั้ง 3 */
    #sidebarToggle .hamburger-line {
        display: block !important;

        width: 24px !important;
        height: 3px !important;

        flex: 0 0 3px !important;

        margin: 0 !important;
        padding: 0 !important;

        border: 0 !important;
        border-radius: 10px !important;

        background: #0d3b66 !important;

        transition:
            transform .25s ease,
            opacity .2s ease !important;
    }


    /* Hover */
    #sidebarToggle:hover {
        background: rgba(13, 59, 102, .07) !important;
        transform: none !important;
        box-shadow: none !important;
    }


    /* ตอนกด */
    #sidebarToggle:active {
        transform: scale(.94) !important;
    }
}
/* =====================================================
   A-TECH RESET SYSTEM MODAL
===================================================== */

.reset-modal {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(5, 12, 30, .62);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .25s ease,
        visibility .25s ease;
}


/* เปิด Modal */
.reset-modal.show {
    opacity: 1;
    visibility: visible;
}


/* =====================================================
   กล่อง
===================================================== */

.reset-modal-box {

    width: 100%;
    max-width: 420px;

    padding: 32px 28px 27px;

    text-align: center;

    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(
            135deg,
            #ff4757,
            #e63970,
            #7b4dff
        ) border-box;

    border: 2px solid transparent;

    border-radius: 25px;

    box-shadow:
        0 30px 70px rgba(0,0,0,.30),
        0 0 40px rgba(255,65,100,.16);

    opacity: 0;

    transform:
        translateY(30px)
        scale(.90);

    transition:
        transform .38s cubic-bezier(.34,1.56,.64,1),
        opacity .25s ease;
}


.reset-modal.show .reset-modal-box {

    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}


/* =====================================================
   ICON
===================================================== */

.reset-modal-icon {

    width: 76px;
    height: 76px;

    margin:
        0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 23px;

    color: #fff;

    font-size: 30px;

    background:
        linear-gradient(
            135deg,
            #ff4d5f,
            #e83274
        );

    box-shadow:
        0 12px 30px
        rgba(230,50,90,.30);
}


/* เด้งตอนเปิด */
.reset-modal.show .reset-modal-icon {

    animation:
        resetWarningPop .6s
        cubic-bezier(.34,1.56,.64,1);
}


@keyframes resetWarningPop {

    0% {
        opacity: 0;

        transform:
            scale(.3)
            rotate(-20deg);
    }

    65% {
        transform:
            scale(1.12)
            rotate(5deg);
    }

    100% {
        opacity: 1;

        transform:
            scale(1)
            rotate(0);
    }
}


/* =====================================================
   TEXT
===================================================== */

.reset-modal-box h4 {

    margin:
        0 0 9px;

    color: #173e68;

    font-size: 1.35rem;
    font-weight: 750;
}


.reset-modal-box p {

    margin:
        0 0 17px;

    color: #687385;

    font-size: .92rem;

    line-height: 1.65;
}


.reset-modal-box p strong {
    color: #e23458;
}


/* =====================================================
   WARNING BOX
===================================================== */

.reset-modal-warning {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 23px;

    padding:
        10px 12px;

    border-radius: 12px;

    text-align: left;

    color: #956300;

    background: #fff5d9;

    border:
        1px solid #ffe29a;

    font-size: .78rem;

    line-height: 1.4;
}


.reset-modal-warning i {

    flex-shrink: 0;

    color: #e8a400;

    font-size: 17px;
}


/* =====================================================
   BUTTON
===================================================== */

.reset-modal-actions {

    display: flex;

    gap: 10px;
}


.reset-cancel,
.reset-confirm {

    flex: 1;

    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding:
        10px 14px;

    border: 0;

    border-radius: 13px;

    font-size: .9rem;

    font-weight: 650;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}


/* ยกเลิก */
.reset-cancel {

    color: #536273;

    background: #edf1f6;
}


.reset-cancel:hover {

    background: #e3e8ef;

    transform:
        translateY(-2px);
}


/* รีเซ็ต */
.reset-confirm {

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #f0445c,
            #db3175
        );

    box-shadow:
        0 8px 20px
        rgba(225,50,90,.27);
}


.reset-confirm:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 12px 25px
        rgba(225,50,90,.38);
}


.reset-confirm:disabled {

    opacity: .7;

    cursor: not-allowed;

    transform: none;
}


/* ตอนกด */
.reset-cancel:active,
.reset-confirm:active {

    transform:
        scale(.96);
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 575.98px) {

    .reset-modal {
        padding: 15px;
    }

    .reset-modal-box {

        max-width: 340px;

        padding:
            27px 20px 21px;

        border-radius: 21px;
    }

    .reset-modal-icon {

        width: 64px;
        height: 64px;

        border-radius: 19px;

        font-size: 25px;
    }

    .reset-modal-box h4 {
        font-size: 1.2rem;
    }

    .reset-modal-warning {
        font-size: .73rem;
    }
}
/* =====================================================
   REGISTER SUCCESS MODAL
===================================================== */

.register-success-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(5, 15, 35, .58);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}


/* กล่อง */
.register-success-box {
    width: 100%;
    max-width: 390px;

    padding: 32px 28px 28px;

    text-align: center;

    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(
            135deg,
            #2388ff,
            #6247e9,
            #9a4cff
        ) border-box;

    border: 2px solid transparent;
    border-radius: 25px;

    box-shadow:
        0 30px 70px rgba(0,0,0,.28),
        0 0 40px rgba(80,80,255,.18);

    animation:
        registerBoxPop .45s
        cubic-bezier(.34,1.56,.64,1);
}


/* กล่องเด้ง */
@keyframes registerBoxPop {

    from {
        opacity: 0;
        transform:
            translateY(30px)
            scale(.88);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}


/* ICON */
.register-success-icon {
    width: 78px;
    height: 78px;

    margin: 0 auto 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: #fff;

    font-size: 32px;

    background:
        linear-gradient(
            135deg,
            #20c997,
            #24a7e8,
            #6247e9
        );

    box-shadow:
        0 12px 30px
        rgba(40,150,220,.30);

    animation:
        registerCheckPop .65s
        cubic-bezier(.34,1.56,.64,1);
}


/* เครื่องหมายถูกเด้ง */
@keyframes registerCheckPop {

    0% {
        opacity: 0;
        transform:
            scale(.2)
            rotate(-35deg);
    }

    65% {
        transform:
            scale(1.15)
            rotate(7deg);
    }

    100% {
        opacity: 1;
        transform:
            scale(1)
            rotate(0);
    }
}


/* TITLE */
.register-success-box h4 {
    margin: 0 0 9px;

    color: #123f69;

    font-size: 1.35rem;
    font-weight: 750;
}


/* TEXT */
.register-success-box p {
    margin: 0 0 24px;

    color: #687385;

    font-size: .92rem;
    line-height: 1.65;
}


/* LOGIN BUTTON */
.register-login-btn {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 11px 18px;

    border-radius: 13px;

    color: #fff !important;

    font-weight: 650;
    text-decoration: none;

    background:
        linear-gradient(
            135deg,
            #2587ff,
            #6247e9
        );

    box-shadow:
        0 9px 22px
        rgba(70,80,230,.28);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}


.register-login-btn:hover {
    color: #fff !important;

    transform: translateY(-2px);

    box-shadow:
        0 13px 27px
        rgba(70,80,230,.38);
}


.register-login-btn:active {
    transform: scale(.97);
}


/* MOBILE */
@media (max-width: 575.98px) {

    .register-success-modal {
        padding: 15px;
    }

    .register-success-box {
        max-width: 340px;

        padding: 27px 20px 22px;

        border-radius: 21px;
    }

    .register-success-icon {
        width: 66px;
        height: 66px;

        font-size: 27px;
    }

    .register-success-box h4 {
        font-size: 1.2rem;
    }
}
