/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
    background:
        #dedfdf 0%;
    ;
    color: #172033;
}


/* =========================================================
   COMMON
========================================================= */

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    width: 100%;
    min-height: 76px;
    padding: 14px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #e5eaf0;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: #16834b;
    color: #ffffff;

    font-size: 23px;
    font-weight: 800;

    box-shadow:
        0 7px 18px rgba(22, 131, 75, 0.22);
}

.brand h1 {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    color: #172033;
}

.brand p {
    margin-top: 3px;
    font-size: 12px;
    color: #748095;
}

.admin-button {
    border: 1px solid #dce3eb;
    background: #ffffff;
    color: #344054;

    padding: 10px 16px;
    border-radius: 10px;

    font-size: 13px;
    font-weight: 700;

    transition: 0.2s ease;
}

.admin-button:hover {
    background: #f4f7fa;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}


/* =========================================================
   PAGE
========================================================= */

.page {
    width: min(760px, 92%);
    margin: 42px auto 30px;
}

#adminDashboardPage {
    width: min(1200px, 94%);
}


/* =========================================================
   ATTENDANCE CARD
========================================================= */

.attendance-card {
    background: #ffffff;
    border: 1px solid #e4e9ef;
    border-radius: 22px;
    padding: 32px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.07);
}

.card-header {
    margin-bottom: 28px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 9px;

    color: #16834b;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.card-header h2,
.admin-login-card h2,
.dashboard-header h2 {
    color: #172033;
    font-size: 25px;
    line-height: 1.2;
    font-weight: 800;
}

.card-header p,
.admin-login-card p,
.dashboard-header p {
    margin-top: 8px;
    color: #7a8597;
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   INPUT
========================================================= */

.input-group {
    margin-bottom: 17px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;

    color: #344054;

    font-size: 13px;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input,
.input-group > input,
.date-filter input {
    width: 100%;
    height: 48px;

    padding: 0 44px 0 15px;

    border: 1px solid #d7dee8;
    border-radius: 11px;

    outline: none;

    background: #ffffff;
    color: #172033;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-group > input {
    padding-right: 15px;
}

.input-wrapper input:focus,
.input-group > input:focus,
.date-filter input:focus {
    border-color: #16834b;

    box-shadow:
        0 0 0 4px rgba(22, 131, 75, 0.09);
}

.input-wrapper input::placeholder {
    color: #a0a9b8;
}

.clear-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);

    width: 32px;
    height: 32px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: #98a2b3;

    font-size: 23px;
    line-height: 1;

    transition: 0.2s ease;
}

.clear-button:hover {
    background: #f1f4f7;
    color: #344054;
}


/* =========================================================
   BUTTON
========================================================= */

.primary-button {
    width: 100%;
    min-height: 48px;

    border: 0;
    border-radius: 11px;

    background: #16834b;
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.primary-button:hover {
    background: #116b3d;

    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(22, 131, 75, 0.20);
}

.primary-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-icon {
    font-size: 16px;
}


/* =========================================================
   CARI NRP
   INPUT + BUTTON BERDAMPINGAN
========================================================= */

/*
   HTML asli:
   
   <div class="input-group">
       <label>Employee ID</label>
       <div class="input-wrapper">
           <input>
       </div>
   </div>

   <button id="checkEmployeeButton">
       Cari NRP
   </button>

   Karena tombol berada DI LUAR .input-group,
   kita atur keduanya menggunakan margin/layout.
*/

.attendance-card .input-group {
    margin-bottom: 17px;
}

.attendance-card .input-group:has(+ #checkEmployeeButton) {
    padding-right: 135px;
}

.attendance-card .input-group:has(+ #checkEmployeeButton)
    + #checkEmployeeButton {
    width: 125px;
    min-height: 48px;
    height: 48px;

    margin-top: -65px;
    margin-left: auto;
    margin-bottom: 17px;

    position: relative;
    z-index: 2;
}


/* =========================================================
   LOADING
========================================================= */

.loading,
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin-top: 18px;

    color: #667085;
    font-size: 13px;
}

.spinner {
    width: 19px;
    height: 19px;

    border: 3px solid #dfe7e2;
    border-top-color: #16834b;

    border-radius: 50%;

    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   EMPLOYEE RESULT
========================================================= */

.employee-result {
    margin-top: 22px;

    padding: 21px;

    border: 1px solid #dce7e1;
    border-radius: 17px;

    background:
        linear-gradient(
            145deg,
            #fbfffd,
            #f5faf7
        );

    animation: resultAppear 0.25s ease;
}

@keyframes resultAppear {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   EMPLOYEE FOUND
========================================================= */

.result-status {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 20px;

    color: #16834b;

    font-size: 13px;
    font-weight: 800;
}

.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: #21a366;

    box-shadow:
        0 0 0 4px rgba(33, 163, 102, 0.10);
}


/* =========================================================
   EMPLOYEE INFORMATION
========================================================= */

.employee-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.employee-avatar {
    width: 50px;
    height: 50px;

    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: #eaf5ef;

    font-size: 25px;
}

.employee-details {
    min-width: 0;
    flex: 1;
}

.employee-id {
    display: block;

    margin-bottom: 3px;

    color: #64748b;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.employee-details h3 {
    color: #172033;

    font-size: 20px;
    line-height: 1.3;
    font-weight: 800;

    word-break: break-word;
}

.store-info {
    margin-top: 8px;

    display: flex;
    align-items: flex-start;
    gap: 7px;

    color: #536174;

    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}

.store-icon {
    flex: 0 0 auto;
}


/* =========================================================
   ATTENDANCE SUCCESS INFO
========================================================= */

.attendance-info {
    margin-top: 17px;

    padding-top: 15px;

    border-top: 1px dashed #d5e0d9;

    display: flex;
    flex-direction: column;
    gap: 9px;
}

.attendance-time {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 13px;
}

.attendance-label {
    color: #667085;
    font-weight: 600;
}

.attendance-time strong {
    color: #172033;
    font-size: 14px;
    font-weight: 800;
}

.attendance-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    width: fit-content;

    padding: 7px 10px;

    border-radius: 8px;

    background: #e8f7ee;

    color: #16834b;

    font-size: 12px;
    font-weight: 800;
}

.attendance-check {
    width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16834b;
    color: #ffffff;

    font-size: 11px;
}


/* =========================================================
   ATTENDANCE BUTTON
========================================================= */

.attendance-button {
    width: 100%;
    min-height: 50px;

    margin-top: 20px;

    border: 0;
    border-radius: 11px;

    background: #16834b;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    font-size: 14px;
    font-weight: 800;

    transition: 0.2s ease;
}

.attendance-button:hover {
    background: #116b3d;

    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(22, 131, 75, 0.20);
}

.attendance-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.attendance-button-icon {
    font-size: 17px;
}


/* =========================================================
   MESSAGE
========================================================= */

.message {
    margin-top: 16px;

    padding: 12px 14px;

    border-radius: 10px;

    font-size: 13px;
    line-height: 1.5;
    font-weight: 600;
}

.message.success {
    background: #eaf7ef;
    border: 1px solid #ccebd8;
    color: #167245;
}

.message.error {
    background: #fff1f1;
    border: 1px solid #f5d0d0;
    color: #c53030;
}


/* =========================================================
   TODAY CARD
========================================================= */

.today-card {
    margin-top: 16px;

    padding: 17px 20px;

    display: flex;
    align-items: center;
    gap: 13px;

    background: #ffffff;

    border: 1px solid #e5eaf0;
    border-radius: 15px;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.04);
}

.today-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #f1f7f3;

    font-size: 20px;
}

.today-card span {
    display: block;

    margin-bottom: 3px;

    color: #8a94a5;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.today-card strong {
    display: block;

    color: #344054;

    font-size: 13px;
}


/* =========================================================
   ADMIN LOGIN
========================================================= */

.admin-login-card {
    width: min(430px, 100%);
    margin: 0 auto;

    padding: 32px;

    background: #ffffff;

    border: 1px solid #e4e9ef;
    border-radius: 20px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.07);
}

.back-button {
    border: 0;
    background: transparent;

    color: #667085;

    font-size: 13px;
    font-weight: 700;

    margin-bottom: 28px;
}

.back-button:hover {
    color: #16834b;
}

.admin-login-icon {
    width: 52px;
    height: 52px;

    margin-bottom: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background: #eef7f2;

    font-size: 25px;
}

.admin-login-card h2 {
    margin-top: 2px;
    margin-bottom: 7px;
}


/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 20px;
}

.logout-button {
    min-height: 42px;

    padding: 0 17px;

    border: 1px solid #ead7d7;
    border-radius: 10px;

    background: #ffffff;
    color: #b42318;

    font-size: 13px;
    font-weight: 800;
}

.logout-button:hover {
    background: #fff5f5;
}

.filter-card {
    padding: 17px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;

    background: #ffffff;

    border: 1px solid #e4e9ef;
    border-radius: 15px;
}

.date-filter {
    width: 240px;
}

.date-filter label {
    display: block;
    margin-bottom: 7px;

    color: #475467;

    font-size: 12px;
    font-weight: 700;
}

.date-filter input {
    height: 43px;
    padding: 0 12px;
}

.secondary-button {
    height: 43px;

    padding: 0 17px;

    border: 1px solid #d9e2dc;
    border-radius: 10px;

    background: #ffffff;
    color: #16834b;

    font-size: 13px;
    font-weight: 800;
}

.secondary-button:hover {
    background: #f3faf6;
}


/* =========================================================
   SUMMARY
========================================================= */

.summary-grid {
    margin-top: 18px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 15px;
}

.summary-card {
    padding: 19px;

    display: flex;
    align-items: center;
    gap: 13px;

    background: #ffffff;

    border: 1px solid #e4e9ef;
    border-radius: 15px;
}

.summary-icon {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #f2f5f8;

    font-size: 19px;
    font-weight: 800;
}

.summary-card span {
    display: block;

    color: #7b8797;

    font-size: 11px;
    font-weight: 700;
}

.summary-card strong {
    display: block;

    margin-top: 3px;

    color: #172033;

    font-size: 24px;
    line-height: 1;
}

.summary-card.hadir .summary-icon {
    background: #eaf7ef;
}

.summary-card.hadir strong {
    color: #16834b;
}

.summary-card.belum .summary-icon {
    background: #fff5e8;
}

.summary-card.belum strong {
    color: #c77b00;
}


/* =========================================================
   DATA CARD
========================================================= */

.data-card {
    position: relative;

    margin-top: 18px;

    background: #ffffff;

    border: 1px solid #e4e9ef;
    border-radius: 17px;

    overflow: hidden;
}

.data-toolbar {
    padding: 17px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    border-bottom: 1px solid #edf0f3;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tab {
    border: 0;

    padding: 8px 12px;

    border-radius: 8px;

    background: #f4f6f8;
    color: #667085;

    font-size: 12px;
    font-weight: 700;
}

.filter-tab:hover {
    background: #eaf0ed;
}

.filter-tab.active {
    background: #16834b;
    color: #ffffff;
}

.search-wrapper {
    width: 250px;
    height: 40px;

    padding: 0 11px;

    display: flex;
    align-items: center;
    gap: 7px;

    border: 1px solid #dce3eb;
    border-radius: 9px;

    color: #98a2b3;
}

.search-wrapper input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    color: #172033;

    font-size: 12px;
}

.search-wrapper input::placeholder {
    color: #98a2b3;
}


/* =========================================================
   EXPORT
========================================================= */

.export-bar {
    padding: 13px 17px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #edf0f3;
}

.export-bar div {
    display: flex;
    align-items: baseline;
    gap: 5px;

    color: #7b8797;

    font-size: 12px;
}

.export-bar strong {
    color: #172033;
    font-size: 16px;
}

.export-button {
    min-height: 38px;

    padding: 0 13px;

    border: 1px solid #cfe5d7;
    border-radius: 9px;

    background: #f3faf6;
    color: #16834b;

    font-size: 12px;
    font-weight: 800;
}

.export-button:hover {
    background: #e8f6ed;
}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;

    font-size: 12px;
}

thead {
    background: #f8fafb;
}

th {
    padding: 12px 13px;

    text-align: left;

    color: #667085;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.04em;

    white-space: nowrap;
}

td {
    padding: 13px;

    border-top: 1px solid #edf0f3;

    color: #475467;

    white-space: nowrap;
}

tbody tr:hover {
    background: #fbfdfc;
}

.employee-id-cell {
    font-weight: 800;
    color: #344054;
}

.employee-name-cell {
    font-weight: 700;
    color: #172033;
}

.status-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 8px;

    border-radius: 7px;

    font-size: 10px;
    font-weight: 800;
}

.status-badge.absen {
    background: #eaf7ef;
    color: #16834b;
}

.status-badge.belum {
    background: #fff4e5;
    color: #b86f00;
}


/* =========================================================
   EMPTY / LOADING
========================================================= */

.table-empty {
    min-height: 180px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 6px;

    color: #98a2b3;

    text-align: center;
}

.table-empty div {
    font-size: 30px;
}

.table-empty strong {
    color: #475467;
    font-size: 14px;
}

.table-empty span {
    font-size: 12px;
}

.dashboard-loading {
    min-height: 150px;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
    margin-top: auto;

    padding: 22px 5%;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;

    color: #98a2b3;

    font-size: 10px;
    text-align: center;
}


/* =========================================================
   MODAL
========================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(15, 23, 42, 0.45);

    backdrop-filter: blur(4px);
}

.modal {
    width: min(410px, 100%);

    padding: 30px;

    background: #ffffff;

    border-radius: 20px;

    text-align: center;

    box-shadow:
        0 25px 70px rgba(15, 23, 42, 0.20);

    animation: modalAppear 0.2s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 58px;
    height: 58px;

    margin: 0 auto 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 27px;
    font-weight: 900;
}

.modal-icon.success {
    background: #e8f7ee;
    color: #16834b;
}

.modal-icon.error {
    background: #fff0f0;
    color: #d92d20;
}

.modal h2 {
    color: #172033;
    font-size: 21px;
}

.modal > p {
    margin-top: 7px;

    color: #7a8597;

    font-size: 13px;
    line-height: 1.5;
}

.modal-employee {
    margin-top: 19px;

    padding: 13px;

    display: flex;
    flex-direction: column;
    gap: 3px;

    border-radius: 11px;

    background: #f7f9fa;
}

.modal-employee strong {
    color: #172033;
    font-size: 15px;
}

.modal-employee span {
    color: #7b8797;
    font-size: 12px;
}

.modal-time {
    margin: 12px 0 20px;

    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-time span {
    color: #7b8797;
    font-size: 12px;
}

.modal-time strong {
    color: #16834b;
    font-size: 22px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .topbar {
        padding: 12px 4%;
    }

    .brand h1 {
        font-size: 15px;
    }

    .brand p {
        font-size: 10px;
    }

    .brand-icon {
        width: 39px;
        height: 39px;
        border-radius: 11px;
    }

    .admin-button {
        padding: 8px 11px;
        font-size: 11px;
    }

    .page {
        width: 94%;
        margin-top: 24px;
    }

    .attendance-card {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .card-header h2,
    .admin-login-card h2 {
        font-size: 21px;
    }

    .employee-result {
        padding: 17px;
    }

    .employee-avatar {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 12px;
    }

    .employee-details h3 {
        font-size: 17px;
    }

    .store-info {
        font-size: 12px;
    }

    .today-card {
        padding: 14px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-card {
        align-items: stretch;
        flex-direction: column;
    }

    .date-filter {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .data-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-wrapper {
        width: 100%;
    }

    .export-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .export-button {
        width: 100%;
    }

    footer {
        flex-direction: column;
        gap: 4px;
    }


    /* =====================================================
       CARI NRP - MOBILE
       TETAP BERDAMPINGAN
    ===================================================== */

    .attendance-card .input-group:has(+ #checkEmployeeButton) {
        padding-right: 118px;
    }

    .attendance-card .input-group:has(+ #checkEmployeeButton)
        + #checkEmployeeButton {
        width: 110px;
        min-height: 48px;
        height: 48px;

        margin-top: -65px;
        margin-left: auto;
        margin-bottom: 17px;

        font-size: 13px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .topbar {
        align-items: flex-start;
    }

    .brand {
        align-items: flex-start;
    }

    .brand p {
        max-width: 170px;
    }

    .admin-button {
        font-size: 0;
    }

    .admin-button:first-letter {
        font-size: 15px;
    }

    .employee-info {
        gap: 11px;
    }

    .employee-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        font-size: 20px;
    }

    .employee-details h3 {
        font-size: 16px;
    }


    /* =====================================================
       CARI NRP - HP KECIL
    ===================================================== */

    .attendance-card .input-group:has(+ #checkEmployeeButton) {
        padding-right: 107px;
    }

    .attendance-card .input-group:has(+ #checkEmployeeButton)
        + #checkEmployeeButton {
        width: 100px;
        min-height: 48px;
        height: 48px;

        font-size: 12px;
    }

}