/* =========================================================
   PORTAL ORANG TUA ESEMKALADA
   MODERN • FRESH • ANIMATED
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    color: #0f172a;

    background:
        linear-gradient(
            135deg,
            rgba(2, 18, 42, 0.82),
            rgba(13, 110, 253, 0.42),
            rgba(15, 23, 42, 0.76)
        ),
        url("../uploads/bg.png")
        center center / cover fixed no-repeat;

    overflow-x: hidden;

    position: relative;
}


/* =========================================================
   BACKGROUND ANIMATION
   ========================================================= */

body::before {
    content: "";

    position: fixed;

    inset: -20%;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 20% 30%,
            rgba(13, 110, 253, 0.32),
            transparent 22%
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(25, 135, 84, 0.28),
            transparent 25%
        ),
        radial-gradient(
            circle at 50% 50%,
            rgba(255, 255, 255, 0.08),
            transparent 30%
        );

    animation:
        backgroundMove 12s ease-in-out infinite alternate;

    z-index: 0;
}


body::after {
    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    opacity: 0.15;

    background-image:
        linear-gradient(
            rgba(255,255,255,0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,0.08) 1px,
            transparent 1px
        );

    background-size:
        45px 45px;

    z-index: 0;
}


@keyframes backgroundMove {

    0% {
        transform:
            translate3d(-2%, -2%, 0)
            scale(1);
    }

    100% {
        transform:
            translate3d(2%, 2%, 0)
            scale(1.08);
    }

}


/* =========================================================
   WRAPPER
   ========================================================= */

.portal-wrapper {
    width: 100%;
    max-width: 500px;

    position: relative;

    z-index: 1;

    animation:
        portalEnter 0.8s cubic-bezier(.2,.8,.2,1) both;
}


@keyframes portalEnter {

    from {
        opacity: 0;

        transform:
            translateY(35px)
            scale(0.96);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* =========================================================
   MAIN CARD
   ========================================================= */

.portal-card {
    position: relative;

    overflow: hidden;

    padding:
        42px
        36px
        30px;

    border-radius: 30px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.96),
            rgba(255,255,255,0.83)
        );

    backdrop-filter:
        blur(20px);

    -webkit-backdrop-filter:
        blur(20px);

    border:
        1px solid
        rgba(255,255,255,0.7);

    box-shadow:
        0 30px 80px
        rgba(0,0,0,0.32),
        inset 0 1px 0
        rgba(255,255,255,0.8);

    transition:
        transform 0.5s cubic-bezier(.2,.8,.2,1),
        box-shadow 0.5s ease;
}


.portal-card:hover {

    transform:
        translateY(-8px);

    box-shadow:
        0 40px 100px
        rgba(0,0,0,0.40),
        0 0 0 1px
        rgba(13,110,253,0.12);
}


/* =========================================================
   CARD SHINE
   ========================================================= */

.portal-card::before {
    content: "";

    position: absolute;

    top: -80%;

    left: -100%;

    width: 50%;

    height: 260%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.55),
            transparent
        );

    transform:
        rotate(25deg);

    transition:
        left 1s ease;

    pointer-events: none;
}


.portal-card:hover::before {
    left: 160%;
}


/* =========================================================
   LOGO
   ========================================================= */

.portal-logo {
    display: flex;

    justify-content: center;

    margin-bottom: 20px;

    position: relative;

    z-index: 1;
}


.logo-circle {
    width: 115px;
    height: 115px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    position: relative;

    background:
        linear-gradient(
            135deg,
            #0d6efd,
            #6610f2
        );

    padding: 7px;

    box-shadow:
        0 15px 35px
        rgba(13,110,253,0.35);

    transition:
        transform 0.5s cubic-bezier(.2,.8,.2,1),
        box-shadow 0.5s ease;
}


/* Lingkaran animasi luar */

.logo-circle::before {
    content: "";

    position: absolute;

    inset: -8px;

    border-radius: 50%;

    border:
        2px solid
        rgba(13,110,253,0.25);

    animation:
        logoRing 3s linear infinite;
}


@keyframes logoRing {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* Efek hover logo */

.portal-card:hover .logo-circle {

    transform:
        rotate(-8deg)
        scale(1.15);

    box-shadow:
        0 0 0 10px
        rgba(13,110,253,0.10),
        0 22px 45px
        rgba(13,110,253,0.48);
}


.logo-sekolah {
    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: 50%;

    background: rgb(168, 170, 16);

    padding: 5px;

    transition:
        transform 0.5s ease;
}


.portal-card:hover .logo-sekolah {

    transform:
        rotate(8deg)
        scale(1.04);
}


/* =========================================================
   HEADER
   ========================================================= */

.portal-header {
    text-align: center;

    margin-bottom: 30px;

    position: relative;

    z-index: 1;
}


.portal-header h1 {
    margin: 0;

    font-size: 30px;

    font-weight: 900;

    letter-spacing: -0.8px;

    color: #0f172a;

    transition:
        transform 0.3s ease,
        color 0.3s ease;
}


.portal-card:hover .portal-header h1 {

    color: #0d6efd;

    transform:
        translateY(-2px);
}


.portal-header p {
    margin:
        7px
        0
        3px;

    font-size: 15px;

    font-weight: 600;

    color: #475569;
}


.portal-header small {
    display: inline-block;

    padding:
        4px
        12px;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(13,110,253,0.10),
            rgba(102,16,242,0.12)
        );

    color: #0d6efd;

    font-size: 10px;

    font-weight: 900;

    letter-spacing: 1.5px;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.portal-header small:hover {

    transform:
        scale(1.08);

    box-shadow:
        0 5px 15px
        rgba(13,110,253,0.15);
}


/* =========================================================
   FORM
   ========================================================= */

#formPortal {
    position: relative;

    z-index: 1;
}


.form-group {
    margin-bottom: 18px;
}


.form-group label {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 8px;

    font-size: 13px;

    font-weight: 800;

    color: #334155;
}


.form-group label i {
    color: #0d6efd;

    font-size: 17px;

    transition:
        transform 0.3s ease;
}


.form-group:focus-within label i {

    transform:
        scale(1.2)
        rotate(-8deg);
}


/* =========================================================
   INPUT
   ========================================================= */

.portal-input {
    height: 54px;

    border-radius: 15px !important;

    border:
        1px solid
        #dbe3ee !important;

    background:
        rgba(248,250,252,0.85) !important;

    color: #0f172a !important;

    font-size: 16px;

    font-weight: 700;

    padding:
        12px
        16px;

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease,
        background 0.3s ease;
}


.portal-input::placeholder {

    color: #94a3b8;

    font-size: 14px;

    font-weight: 500;
}


.portal-input:hover {

    transform:
        translateY(-2px);

    border-color:
        rgba(13,110,253,0.45) !important;
}


.portal-input:focus {

    background:
        #ffffff !important;

    border-color:
        #0d6efd !important;

    box-shadow:
        0 0 0 4px
        rgba(13,110,253,0.12),
        0 10px 25px
        rgba(13,110,253,0.10) !important;

    transform:
        translateY(-2px);
}


/* =========================================================
   BUTTON
   ========================================================= */

.btn-portal {
    width: 100%;

    height: 55px;

    border: none !important;

    border-radius: 15px !important;

    background:
        linear-gradient(
            135deg,
            #0d6efd,
            #084298
        ) !important;

    font-size: 15px;

    font-weight: 800;

    letter-spacing: 0.2px;

    position: relative;

    overflow: hidden;

    box-shadow:
        0 12px 25px
        rgba(13,110,253,0.28);

    transition:
        transform 0.35s cubic-bezier(.2,.8,.2,1),
        box-shadow 0.35s ease;
}


.btn-portal::before {
    content: "";

    position: absolute;

    top: 0;

    left: -120%;

    width: 70%;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.45),
            transparent
        );

    transform:
        skewX(-20deg);

    transition:
        left 0.6s ease;
}


.btn-portal:hover {

    transform:
        translateY(-4px)
        scale(1.015);

    box-shadow:
        0 18px 35px
        rgba(13,110,253,0.42);
}


.btn-portal:hover::before {
    left: 160%;
}


.btn-portal:active {

    transform:
        translateY(0)
        scale(0.98);
}


.btn-portal i {

    margin-right: 7px;

    display: inline-block;

    transition:
        transform 0.3s ease;
}


.btn-portal:hover i {

    transform:
        translateX(5px);
}


/* =========================================================
   INFORMASI
   ========================================================= */

.portal-info {
    display: flex;

    align-items: flex-start;

    gap: 13px;

    margin-top: 24px;

    padding: 16px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(224,242,254,0.75),
            rgba(239,246,255,0.85)
        );

    border:
        1px solid
        rgba(13,110,253,0.10);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.portal-info:hover {

    transform:
        translateY(-4px);

    box-shadow:
        0 12px 25px
        rgba(13,110,253,0.12);
}


.info-icon {

    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #0d6efd,
            #6610f2
        );

    color: white;

    font-size: 19px;

    box-shadow:
        0 7px 15px
        rgba(13,110,253,0.20);

    transition:
        transform 0.4s ease;
}


.portal-info:hover .info-icon {

    transform:
        rotate(10deg)
        scale(1.1);
}


.portal-info strong {

    display: block;

    margin-bottom: 3px;

    font-size: 13px;

    color: #0f172a;
}


.portal-info p {

    margin: 0;

    color: #64748b;

    font-size: 12px;

    line-height: 1.6;
}


/* =========================================================
   REALTIME INFORMATION
   ========================================================= */

.realtime-info {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    margin-top: 17px;

    padding:
        10px
        14px;

    border-radius: 13px;

    background:
        rgba(240,253,244,0.82);

    color: #198754;

    font-size: 11px;

    font-weight: 700;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.realtime-info:hover {

    transform:
        translateY(-3px);

    box-shadow:
        0 8px 20px
        rgba(25,135,84,0.12);
}


.realtime-dot {

    width: 9px;
    height: 9px;

    display: inline-block;

    border-radius: 50%;

    background: #198754;

    box-shadow:
        0 0 0 4px
        rgba(25,135,84,0.12),
        0 0 12px
        rgba(25,135,84,0.55);

    animation:
        realtimePulse 1.5s infinite;
}


@keyframes realtimePulse {

    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.45;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }

}


/* =========================================================
   FOOTER
   ========================================================= */

.portal-footer {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    margin-top: 28px;

    padding-top: 20px;

    border-top:
        1px solid
        rgba(15,23,42,0.08);

    transition:
        transform 0.3s ease;
}


.portal-footer:hover {

    transform:
        translateY(-2px);
}


.footer-logo {

    width: 46px;
    height: 46px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 4px;

    border-radius: 13px;

    background:
        #ffffff;

    border:
        1px solid
        #edf2f7;

    box-shadow:
        0 7px 18px
        rgba(15,23,42,0.08);

    transition:
        transform 0.4s ease;
}


.portal-footer:hover .footer-logo {

    transform:
        rotate(-8deg)
        scale(1.1);
}


.footer-logo img {

    width: 100%;
    height: 100%;

    object-fit: contain;
}


.footer-text {

    display: flex;

    flex-direction: column;

    text-align: left;
}


.footer-text strong {

    font-size: 9px;

    font-weight: 900;

    letter-spacing: 0.4px;

    color: #334155;
}


.footer-text span {

    margin-top: 2px;

    font-size: 11px;

    color: #64748b;
}


.footer-text small {

    margin-top: 2px;

    font-size: 9px;

    color: #94a3b8;
}


/* =========================================================
   RESPONSIVE TABLET
   ========================================================= */

@media (max-width: 768px) {

    body {
        padding: 16px;

        background-position:
            center center;
    }


    .portal-wrapper {
        max-width: 480px;
    }


    .portal-card {

        padding:
            35px
            28px
            25px;

        border-radius: 26px;
    }


    .logo-circle {

        width: 105px;
        height: 105px;
    }


    .portal-header h1 {
        font-size: 27px;
    }

}


/* =========================================================
   RESPONSIVE HP
   ========================================================= */

@media (max-width: 576px) {

    body {
        padding: 12px;

        align-items: flex-start;
    }


    .portal-wrapper {

        max-width: 100%;

        margin:
            15px
            auto;
    }


    .portal-card {

        padding:
            30px
            20px
            24px;

        border-radius: 24px;
    }


    .portal-card:hover {

        transform:
            translateY(-3px);
    }


    .portal-logo {
        margin-bottom: 15px;
    }


    .logo-circle {

        width: 90px;
        height: 90px;
    }


    .portal-header {

        margin-bottom: 24px;
    }


    .portal-header h1 {
        font-size: 24px;
    }


    .portal-header p {
        font-size: 13px;
    }


    .portal-header small {
        font-size: 9px;
    }


    .portal-input {

        height: 52px;

        font-size: 15px;
    }


    .btn-portal {
        height: 53px;
    }


    .portal-info {

        padding: 14px;

        gap: 10px;
    }


    .info-icon {

        width: 36px;
        height: 36px;

        font-size: 17px;
    }


    .portal-footer {

        align-items: center;

        gap: 9px;

        margin-top: 22px;

        padding-top: 16px;
    }


    .footer-logo {

        width: 40px;
        height: 40px;
    }


    .footer-text strong {
        font-size: 8px;
    }


    .footer-text span {
        font-size: 10px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }

}
/* =========================================================
   FIX DASHBOARD - BACKGROUND & VISIBILITAS
   ========================================================= */

/* Background halaman */
html,
body {
    min-height: 100%;
}

body {
    position: relative;

    background-image:
        linear-gradient(
            135deg,
            rgba(4, 32, 72, 0.78),
            rgba(10, 67, 100, 0.62),
            rgba(15, 90, 70, 0.68)
        ),
        url("../uploads/bg.png");

    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;

    color: #172033;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.portal-container {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 1100px;

    margin: 0 auto;

    padding: 20px 16px 40px;
}


/* =========================================================
   SEMUA CARD HARUS PUTIH
   ========================================================= */

.portal-header,
.student-card,
.attendance-status-card,
.history-card,
.loading-box,
.identity-warning {
    position: relative;
    z-index: 3;

    background: rgba(255, 255, 255, 0.97) !important;

    color: #172033 !important;

    border: 1px solid rgba(255, 255, 255, 0.8);

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   HEADER
   ========================================================= */

.portal-header h1 {
    color: #0f172a !important;
}

.portal-header p {
    color: #475569 !important;
}

.header-status {
    color: #475569 !important;
}


/* =========================================================
   IDENTITAS SISWA
   ========================================================= */

.student-card {
    color: #172033 !important;
}

.student-info .label {
    color: #64748b !important;
}

.student-info h2 {
    color: #0f172a !important;
}

.student-meta {
    color: #64748b !important;
}

.student-meta strong {
    color: #1e293b !important;
}

.student-meta i {
    color: #2563eb !important;
}


/* =========================================================
   STATUS KEHADIRAN
   ========================================================= */

.status-title {
    color: #334155 !important;
}

.status-title > span:first-child {
    color: #1e293b !important;
}

.status-title > span:last-child {
    color: #64748b !important;
}

.status-title i {
    color: #2563eb !important;
}


/* =========================================================
   STATUS CARD
   ========================================================= */

.attendance-status {
    position: relative;
    z-index: 4;
}


/* Jangan biarkan background status hilang */
.attendance-status.normal {
    background:
        linear-gradient(
            135deg,
            #e8f8f0,
            #f4fcf8
        ) !important;

    color: #198754 !important;
}

.attendance-status.terlambat {
    background:
        linear-gradient(
            135deg,
            #fff0f1,
            #fff8f8
        ) !important;

    color: #dc3545 !important;
}

.attendance-status.izin {
    background:
        linear-gradient(
            135deg,
            #eaf3ff,
            #f7fbff
        ) !important;

    color: #0d6efd !important;
}

.attendance-status.sakit {
    background:
        linear-gradient(
            135deg,
            #eaf8f0,
            #f7fcf9
        ) !important;

    color: #198754 !important;
}

.attendance-status.alpha {
    background:
        linear-gradient(
            135deg,
            #f0f1f3,
            #fafafa
        ) !important;

    color: #6c757d !important;
}

.attendance-status.awal {
    background:
        linear-gradient(
            135deg,
            #fff8df,
            #fffdf4
        ) !important;

    color: #9a7600 !important;
}

.attendance-status.belum {
    background:
        linear-gradient(
            135deg,
            #f1f5f9,
            #ffffff
        ) !important;

    color: #475569 !important;
}


/* =========================================================
   STATUS TEXT
   ========================================================= */

.status-content h2 {
    color: currentColor !important;

    font-weight: 900;
}

.status-content p {
    color: #475569 !important;
}

.status-label {
    color: currentColor !important;
}


/* =========================================================
   ICON STATUS
   ========================================================= */

.status-icon {
    background: rgba(255, 255, 255, 0.85) !important;

    color: inherit !important;

    box-shadow:
        0 6px 15px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   DETAIL ABSEN
   ========================================================= */

.latest-item {
    background: #f8fafc !important;

    border: 1px solid #e5e7eb !important;

    color: #172033 !important;
}

.latest-item span {
    color: #64748b !important;
}

.latest-item strong {
    color: #0f172a !important;
}


/* =========================================================
   HISTORY
   ========================================================= */

.history-card {
    color: #172033 !important;
}

.section-title h3 {
    color: #0f172a !important;
}

.section-title h3 i {
    color: #2563eb !important;
}

.section-title p {
    color: #64748b !important;
}

.last-update {
    background: #f1f5f9 !important;

    color: #475569 !important;
}


/* =========================================================
   HISTORY ITEM
   ========================================================= */

.history-item {
    background: #f8fafc !important;

    border: 1px solid #e5e7eb !important;

    color: #172033 !important;
}

.history-info strong {
    color: #0f172a !important;
}

.history-info span {
    color: #64748b !important;
}

.history-time strong {
    color: #0f172a !important;
}

.history-time small {
    color: #64748b !important;
}


/* =========================================================
   EMPTY HISTORY
   ========================================================= */

.empty-history {
    color: #64748b !important;
}

.empty-history i {
    color: #94a3b8 !important;
}

.empty-history p {
    color: #64748b !important;
}


/* =========================================================
   LIVE INFORMATION
   ========================================================= */

.live-information {
    position: relative;
    z-index: 3;

    background:
        rgba(255, 255, 255, 0.94) !important;

    border: 1px solid rgba(255, 255, 255, 0.8) !important;

    color: #475569 !important;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12);
}

.live-information strong {
    color: #15803d !important;
}

.live-information > span:last-child {
    color: #475569 !important;
}


/* =========================================================
   LOADING
   ========================================================= */

.loading-box {
    color: #172033 !important;
}

.loading-box p {
    color: #64748b !important;
}


/* =========================================================
   ERROR
   ========================================================= */

#errorBox {
    position: relative;
    z-index: 10;
}


/* =========================================================
   ANIMASI HOVER
   ========================================================= */

.portal-header,
.student-card,
.attendance-status-card,
.history-card,
.latest-item,
.history-item,
.live-information {
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        background 0.35s ease;
}

.portal-header:hover,
.student-card:hover,
.attendance-status-card:hover,
.history-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.22);
}

.latest-item:hover {
    transform: translateY(-4px);

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.12);
}

.history-item:hover {
    transform:
        translateX(5px)
        translateY(-2px);

    background: #ffffff !important;

    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.12);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    body {
        background-position: center;
        background-attachment: scroll;
    }

    .portal-container {
        padding:
            12px
            12px
            30px;
    }

}


@media (max-width: 576px) {

    .portal-container {
        padding:
            8px
            8px
            25px;
    }

}
/* =========================================================
   MOBILE RESPONSIVE FINAL FIX
   KHUSUS DASHBOARD - TIDAK MENGUBAH DESAIN DESKTOP
   ========================================================= */

/* ---------- TABLET ---------- */
@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        display: block;
        min-height: 100vh;
        padding: 0;
    }

    .portal-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 12px 12px 30px;
    }

    /* Semua elemen jangan sampai keluar layar */
    .portal-container *,
    .portal-container *::before,
    .portal-container *::after {
        max-width: 100%;
    }

    /* Card */
    .portal-header,
    .student-card,
    .attendance-status-card,
    .history-card,
    .loading-box,
    .identity-warning,
    .live-information {
        width: 100%;
        max-width: 100%;
    }

    /* Header */
    .portal-header {
        padding: 20px 18px !important;
    }

    .portal-header h1 {
        font-size: 25px !important;
        line-height: 1.25;
        word-break: break-word;
    }

    .portal-header p {
        font-size: 13px !important;
        line-height: 1.5;
    }

    /* Student */
    .student-card {
        padding: 20px !important;
    }

    .student-info h2 {
        font-size: 22px !important;
        line-height: 1.3;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .student-meta {
        font-size: 13px !important;
        line-height: 1.6;
    }

    /* Status */
    .attendance-status-card {
        padding: 20px !important;
    }

    .attendance-status {
        width: 100%;
        max-width: 100%;
    }

    .status-content h2 {
        font-size: 24px !important;
        line-height: 1.25;
        word-break: break-word;
    }

    .status-content p {
        font-size: 13px !important;
        line-height: 1.5;
    }

    /* Detail absensi */
    .latest-item {
        width: 100%;
        min-width: 0;
        padding: 13px !important;
    }

    .latest-item span,
    .latest-item strong {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* History */
    .history-card {
        padding: 20px !important;
    }

    .section-title {
        min-width: 0;
    }

    .section-title h3 {
        font-size: 19px !important;
        line-height: 1.3;
    }

    .section-title p {
        font-size: 12px !important;
        line-height: 1.5;
    }

    .history-item {
        width: 100%;
        min-width: 0;
        padding: 13px !important;
    }

    .history-info,
    .history-time {
        min-width: 0;
    }

    .history-info strong,
    .history-info span,
    .history-time strong,
    .history-time small {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Live information */
    .live-information {
        padding: 12px 14px !important;
        font-size: 11px !important;
        line-height: 1.5;
    }

    /* Loading & warning */
    .loading-box,
    .identity-warning {
        padding: 20px !important;
        text-align: center;
    }

    /* Animasi hover tidak terlalu agresif di tablet */
    .portal-header:hover,
    .student-card:hover,
    .attendance-status-card:hover,
    .history-card:hover {
        transform: translateY(-2px);
    }

    .history-item:hover {
        transform: translateY(-1px);
    }
}


/* =========================================================
   HP BESAR
   ========================================================= */

@media (max-width: 576px) {

    html,
    body {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    body {
        padding: 0 !important;
        display: block;
    }

    .portal-container {
        width: 100%;
        padding: 8px 8px 25px !important;
    }

    /* ---------- HEADER ---------- */

    .portal-header {
        padding: 18px 15px !important;
        border-radius: 20px !important;
    }

    .portal-header h1 {
        font-size: 21px !important;
        letter-spacing: -0.3px;
    }

    .portal-header p {
        font-size: 12px !important;
        margin-top: 6px;
    }

    .header-status {
        font-size: 11px !important;
    }


    /* ---------- STUDENT CARD ---------- */

    .student-card {
        padding: 17px 15px !important;
        border-radius: 20px !important;
    }

    .student-info .label {
        font-size: 11px !important;
    }

    .student-info h2 {
        font-size: 19px !important;
        line-height: 1.3;
        margin-top: 3px;
    }

    .student-meta {
        font-size: 12px !important;
    }


    /* ---------- STATUS CARD ---------- */

    .attendance-status-card {
        padding: 16px !important;
        border-radius: 20px !important;
    }

    .status-title {
        font-size: 12px !important;
    }

    .status-title > span:first-child {
        font-size: 13px !important;
    }

    .status-title > span:last-child {
        font-size: 10px !important;
    }

    .attendance-status {
        padding: 16px !important;
        border-radius: 17px !important;
    }

    .status-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        font-size: 20px !important;
    }

    .status-content h2 {
        font-size: 20px !important;
    }

    .status-content p {
        font-size: 11px !important;
    }

    .status-label {
        font-size: 10px !important;
    }


    /* ---------- DETAIL ABSENSI ---------- */

    .latest-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 11px !important;
        border-radius: 12px !important;
        font-size: 11px !important;
    }

    .latest-item span {
        font-size: 10px !important;
    }

    .latest-item strong {
        font-size: 11px !important;
    }


    /* ---------- HISTORY ---------- */

    .history-card {
        padding: 16px 13px !important;
        border-radius: 20px !important;
    }

    .section-title h3 {
        font-size: 17px !important;
    }

    .section-title p {
        font-size: 10px !important;
    }

    .last-update {
        font-size: 9px !important;
        padding: 6px 8px !important;
    }

    .history-item {
        display: flex;
        width: 100%;
        padding: 11px !important;
        border-radius: 12px !important;
        gap: 8px;
    }

    .history-info {
        flex: 1;
        min-width: 0;
    }

    .history-info strong {
        font-size: 11px !important;
        line-height: 1.35;
    }

    .history-info span {
        font-size: 9px !important;
        line-height: 1.4;
    }

    .history-time {
        flex-shrink: 0;
        text-align: right;
    }

    .history-time strong {
        font-size: 11px !important;
    }

    .history-time small {
        font-size: 8px !important;
    }


    /* ---------- LIVE INFORMATION ---------- */

    .live-information {
        width: 100%;
        padding: 10px 11px !important;
        border-radius: 12px !important;
        font-size: 10px !important;
        line-height: 1.45;
    }


    /* ---------- LOADING ---------- */

    .loading-box {
        padding: 18px 12px !important;
        border-radius: 18px !important;
    }

    .loading-box p {
        font-size: 12px !important;
    }


    /* ---------- ERROR ---------- */

    #errorBox {
        width: 100%;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}


/* =========================================================
   HP KECIL
   360px / 375px / 390px
   ========================================================= */

@media (max-width: 390px) {

    .portal-container {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .portal-header {
        padding: 16px 12px !important;
    }

    .portal-header h1 {
        font-size: 19px !important;
    }

    .portal-header p {
        font-size: 11px !important;
    }

    .student-card,
    .attendance-status-card,
    .history-card {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .student-info h2 {
        font-size: 17px !important;
    }

    .attendance-status {
        padding: 13px !important;
    }

    .status-icon {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        font-size: 17px !important;
    }

    .status-content h2 {
        font-size: 18px !important;
    }

    .status-content p {
        font-size: 10px !important;
    }

    .history-item {
        padding: 9px !important;
    }
}


/* =========================================================
   HP SANGAT KECIL
   ========================================================= */

@media (max-width: 350px) {

    .portal-container {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .portal-header h1 {
        font-size: 18px !important;
    }

    .student-info h2 {
        font-size: 16px !important;
    }

    .status-content h2 {
        font-size: 17px !important;
    }

    .history-info strong {
        font-size: 10px !important;
    }

    .history-time strong {
        font-size: 10px !important;
    }
}


/* =========================================================
   CEGAH HORIZONTAL SCROLL
   ========================================================= */

.portal-container,
.portal-header,
.student-card,
.attendance-status-card,
.history-card,
.live-information,
.loading-box,
.identity-warning,
.attendance-status,
.latest-item,
.history-item {
    min-width: 0;
}


/* =========================================================
   PERBAIKAN FLEX AGAR TEKS TIDAK MEMAKSA CARD MELEBAR
   ========================================================= */

.student-card *,
.attendance-status-card *,
.history-card *,
.live-information *,
.latest-item *,
.history-item * {
    min-width: 0;
}


/* =========================================================
   INPUT / BUTTON / FORM JIKA ADA DI DASHBOARD
   ========================================================= */

.portal-container input,
.portal-container select,
.portal-container button,
.portal-container textarea {
    max-width: 100%;
}


/* =========================================================
   TOUCH DEVICE
   Hilangkan efek hover yang terlalu besar di HP
   ========================================================= */

@media (hover: none) and (pointer: coarse) {

    .portal-header:hover,
    .student-card:hover,
    .attendance-status-card:hover,
    .history-card:hover,
    .latest-item:hover,
    .history-item:hover,
    .live-information:hover {
        transform: none;
    }

    .portal-header,
    .student-card,
    .attendance-status-card,
    .history-card,
    .latest-item,
    .history-item,
    .live-information {
        transition:
            box-shadow 0.25s ease;
    }
}