/* =========================================================
   ABSENSI QR - STYLE.CSS
   Responsive Desktop, Tablet, dan Mobile
   ========================================================= */


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f1f7f4;
    color: #17352b;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}


/* =========================================================
   NAVBAR / HEADER
   ========================================================= */

.top {
    position: relative;
    z-index: 1000;

    background: #087443;
    color: white;

    padding: 15px 5%;

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

    gap: 15px;

    box-shadow: 0 2px 10px #00000012;
}

.top-brand {
    display: flex;
    align-items: center;

    min-width: 0;
}

.top b {
    font-size: 18px;
    white-space: nowrap;
}

.top nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.top a {
    color: white;
    text-decoration: none;

    margin-left: 18px;

    transition:
        opacity 0.2s ease,
        background 0.2s ease;
}

.top a:hover {
    opacity: 0.8;
}


/* =========================================================
   NAVBAR ACTIVE
   ========================================================= */

.top nav a.active {
    opacity: 1;
}


/* =========================================================
   TOMBOL HAMBURGER
   ========================================================= */

.menu-toggle {
    display: none;

    width: 44px;
    height: 44px;

    padding: 8px;

    border: 0;
    border-radius: 10px;

    background: transparent;

    cursor: pointer;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;
}

.menu-toggle span {
    display: block;

    width: 25px;
    height: 3px;

    border-radius: 5px;

    background: #ffffff;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}


/* =========================================================
   HAMBURGER MENJADI X
   ========================================================= */

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    width: 100%;
    max-width: 1100px;

    margin: 35px auto;

    padding: 0 18px;
}

.narrow {
    max-width: 650px;
}


/* =========================================================
   HEADING / ROW
   ========================================================= */

.headrow,
.actions {
    display: flex;

    justify-content: space-between;

    gap: 10px;

    align-items: center;
}

.headrow {
    margin-bottom: 20px;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}


/* =========================================================
   GRID
   ========================================================= */

.grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 18px;
}


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

.card,
.qr-card {
    background: white;

    border-radius: 18px;

    padding: 25px;

    box-shadow:
        0 5px 20px #00000012;
}

.card {
    overflow: hidden;
}

.qr-card {
    width: min(500px, 100%);
}


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

.btn {
    display: inline-block;

    border: 0;

    border-radius: 10px;

    background: #087443;

    color: white;

    padding: 12px 18px;

    text-decoration: none;

    cursor: pointer;

    font-size: 15px;

    line-height: 1.2;

    transition:
        background 0.2s ease,
        transform 0.1s ease,
        opacity 0.2s ease;
}

.btn:hover {
    opacity: 0.9;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.secondary {
    background: #64748b;
}

.btn.small {
    padding: 9px 13px;
    font-size: 14px;
}

.btn.big {
    font-size: 20px;

    width: 100%;

    padding: 18px;
}


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

.btn.success {
    background: #15803d;
}

.btn.warning {
    background: #d97706;
}

.btn.danger {
    background: #dc2626;
}


/* =========================================================
   TOTAL / ANGKA
   ========================================================= */

.total,
.big-total {
    font-size: 46px;

    font-weight: 800;

    color: #087443;
}

.big-total {
    text-align: center;
}


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

.muted {
    color: #64748b;
}

.center {
    text-align: center;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}


/* =========================================================
   FORM
   ========================================================= */

label {
    display: block;

    font-weight: 600;

    margin: 15px 0;
}

input,
select,
textarea {
    display: block;

    width: 100%;

    padding: 12px;

    border: 1px solid #cbd5e1;

    border-radius: 9px;

    margin-top: 7px;

    background: white;

    color: #17352b;

    font-size: 15px;

    outline: none;
}

textarea {
    min-height: 100px;

    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #087443;

    box-shadow:
        0 0 0 3px #08744318;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;

    display: inline-block;

    margin-top: 0;
}

input[type="file"] {
    padding: 10px;
}


/* =========================================================
   FORM 2 KOLOM
   ========================================================= */

.two {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;
}


/* =========================================================
   ALERT / PESAN
   ========================================================= */

.alert,
.result {
    padding: 14px;

    border-radius: 10px;

    margin: 15px 0;
}

.warning {
    background: #fff3cd;

    color: #7a5b00;
}

.success {
    background: #dcfce7;

    color: #166534;
}

.error {
    background: #fee2e2;

    color: #991b1b;
}

.info {
    background: #dbeafe;

    color: #1e40af;
}


/* =========================================================
   SCAN PAGE
   ========================================================= */

.scan-page {
    min-height: 100vh;

    display: grid;

    place-items: center;

    padding: 20px;
}

.scan-page .card {
    width: min(650px, 100%);
}


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

.login {
    width: min(420px, 100%);
}

.logo {
    margin: auto;

    background: #087443;

    color: white;

    width: 60px;
    height: 60px;

    border-radius: 50%;

    display: grid;

    place-items: center;

    font-size: 32px;

    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: 50%;
}


/* =========================================================
   HASIL SCAN
   ========================================================= */

.result {
    margin-top: 20px;
}


/* =========================================================
   QR PAGE
   ========================================================= */

.qrpage {
    min-height: 100vh;

    display: grid;

    place-items: center;

    text-align: center;

    background: #f1f7f4;

    padding: 20px;
}

#qrcode {
    display: flex;

    justify-content: center;

    align-items: center;

    margin: 25px 0;
}

#qrcode img {
    max-width: 100%;

    height: auto;
}


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

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;

    border-radius: 12px;
}

table {
    width: 100%;

    border-collapse: collapse;

    background: white;
}

th,
td {
    padding: 10px;

    border-bottom:
        1px solid #e2e8f0;

    text-align: left;

    vertical-align: middle;
}

th {
    background: #f8fafc;

    font-weight: 700;

    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}


/* =========================================================
   BADGE / STATUS
   ========================================================= */

.badge {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 12px;

    font-weight: 700;
}

.badge-success {
    background: #dcfce7;

    color: #166534;
}

.badge-warning {
    background: #fef3c7;

    color: #92400e;
}

.badge-danger {
    background: #fee2e2;

    color: #991b1b;
}

.badge-info {
    background: #dbeafe;

    color: #1e40af;
}


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

.btn-small {
    display: inline-block;

    border: 0;

    border-radius: 8px;

    padding: 8px 10px;

    font-size: 13px;

    text-decoration: none;

    color: white;

    cursor: pointer;

    margin: 2px;

    white-space: nowrap;
}

.btn-qr {
    background: #2563eb;
}

.btn-edit {
    background: #d97706;
}

.btn-rekap {
    background: #087443;
}

.btn-delete {
    background: #dc2626;
}

.btn-small:hover {
    opacity: 0.85;
}


/* =========================================================
   SPACING
   ========================================================= */

.mt-0 {
    margin-top: 0;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    text-align: center;

    padding: 25px 15px;

    color: #64748b;

    font-size: 13px;
}


/* =========================================================
   MOBILE - MAKS 700PX
   ========================================================= */

@media (max-width: 700px) {

    body {
        font-size: 14px;
    }


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

    .top {
        min-height: 62px;

        padding: 9px 13px;

        display: flex;

        align-items: center;

        justify-content: space-between;

        gap: 10px;

        position: relative;
    }


    .top-brand {
        flex: 1;

        min-width: 0;
    }


    .top b {
        display: block;

        font-size: 16px;

        margin: 0;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;
    }


    /* =================================================
       TOMBOL HAMBURGER
       ================================================= */

    .menu-toggle {
        display: flex;

        flex-shrink: 0;
    }


    .menu-toggle:hover {
        background: rgba(255,255,255,0.10);
    }


    .menu-toggle:active {
        background: rgba(255,255,255,0.18);
    }


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

    .top nav {
        display: none;

        position: absolute;

        top: calc(100% + 5px);

        left: 12px;

        right: 12px;

        padding: 8px;

        background: #ffffff;

        border: 1px solid #dfe9e3;

        border-radius: 15px;

        box-shadow:
            0 12px 30px rgba(0, 0, 0, 0.14);

        flex-direction: column;

        align-items: stretch;

        justify-content: flex-start;

        gap: 3px;
    }


    .top nav.show {
        display: flex;

        animation:
            menuDown 0.2s ease;
    }


    .top nav a {
        display: block;

        width: 100%;

        margin-left: 0;

        padding: 12px 13px;

        border-radius: 10px;

        color: #294438;

        font-size: 14px;

        text-decoration: none;

        opacity: 1;
    }


    .top nav a:hover {
        background: #eef8f2;

        opacity: 1;
    }


    .top nav a.active {
        background: #e8f6ee;

        color: #087443;

        font-weight: 700;
    }


    /* =================================================
       CONTAINER
       ================================================= */

    .container {
        width: 100%;

        margin: 20px auto;

        padding: 0 12px;
    }


    /* =================================================
       HEADING
       ================================================= */

    h1 {
        font-size: 23px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 17px;
    }


    /* =================================================
       HEAD ROW
       ================================================= */

    .headrow {
        align-items: flex-start;

        flex-direction: column;
    }


    /* =================================================
       GRID
       ================================================= */

    .grid {
        grid-template-columns: 1fr;

        gap: 14px;
    }


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

    .card,
    .qr-card {
        padding: 18px;

        border-radius: 14px;
    }


    /* =================================================
       FORM
       ================================================= */

    .two {
        grid-template-columns: 1fr;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }


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

    .btn {
        padding: 10px 13px;

        font-size: 14px;
    }

    .btn.small {
        padding: 8px 9px;

        font-size: 12px;
    }

    .btn.big {
        font-size: 17px;

        padding: 15px;
    }

    .actions {
        flex-wrap: wrap;

        justify-content: flex-start;
    }


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

    .table-wrapper {
        width: 100%;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 700px;
    }

    th,
    td {
        padding: 9px 8px;

        font-size: 13px;

        white-space: nowrap;
    }


    /* =================================================
       TOTAL
       ================================================= */

    .total,
    .big-total {
        font-size: 36px;
    }


    /* =================================================
       QR
       ================================================= */

    #qrcode img {
        max-width: 80vw;

        height: auto;
    }


    /* =================================================
       SCAN
       ================================================= */

    .scan-page {
        padding: 10px;
    }

    .scan-page .card {
        padding: 15px;
    }

    .result {
        padding: 12px;
    }


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

    .login {
        width: 100%;
    }


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

    .btn-small {
        padding: 7px 8px;

        font-size: 12px;
    }

}


/* =========================================================
   ANIMASI MENU MOBILE
   ========================================================= */

@keyframes menuDown {

    from {
        opacity: 0;

        transform:
            translateY(-8px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


/* =========================================================
   MOBILE KECIL - MAKS 480PX
   ========================================================= */

@media (max-width: 480px) {

    .top {
        padding: 9px 12px;
    }


    .top b {
        font-size: 15px;
    }


    .menu-toggle {
        width: 42px;

        height: 42px;
    }


    .menu-toggle span {
        width: 23px;

        height: 3px;
    }


    .top nav {
        left: 10px;

        right: 10px;

        border-radius: 14px;
    }


    .top nav a {
        font-size: 13px;

        padding: 11px 12px;
    }


    .container {
        padding: 0 10px;

        margin-top: 15px;
    }


    h1 {
        font-size: 21px;
    }

    h2 {
        font-size: 18px;
    }


    .card,
    .qr-card {
        padding: 15px;
    }


    .btn {
        width: 100%;

        text-align: center;
    }


    .actions {
        width: 100%;
    }


    .actions .btn {
        width: 100%;
    }


    .btn-small {
        font-size: 11px;

        padding: 7px;
    }


    .total,
    .big-total {
        font-size: 32px;
    }


    .scan-page {
        padding: 8px;
    }


    .qrpage {
        padding: 10px;
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (min-width: 701px) and (max-width: 1000px) {

    .top {
        padding-left: 25px;

        padding-right: 25px;
    }


    .container {
        padding: 0 20px;
    }


    .top a {
        margin-left: 10px;
    }

}


/* =========================================================
   PRINT / CETAK
   ========================================================= */

@media print {

    body {
        background: white;
    }


    .btn,
    .top,
    .footer,
    nav {
        display: none !important;
    }


    .qrpage {
        background: white;

        padding: 0;
    }


    .qr-card,
    .card {
        box-shadow: none;

        border: 0;
    }


    .qr-card {
        width: 100%;
    }


    #qrcode img {
        max-width: 400px;
    }

}