﻿/* ==========================================
   PAGE
========================================== */

.pegawai-page {
    display: flex;
    gap: 24px;
    padding: 24px;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: #f7f8fa;
}

.pegawai-page.sidebar-hide .pegawai-sidebar {
    width: 0;
    opacity: 0;
    margin-right: -24px;
    pointer-events: none;
}


/* ==========================================
   SIDEBAR
========================================== */

.pegawai-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
}

.pegawai-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #ececec;
}

    .pegawai-sidebar-header h3 {
        margin: 0 0 15px;
        font-size: 20px;
        font-weight: 600;
    }

.pegawai-page.sidebar-hide .pegawai-sidebar {
    width: 0;
    opacity: 0;
    margin-right: -24px;
    overflow: hidden;
    pointer-events: none;
}

.pegawai-search {
    position: relative;
    margin-bottom: 16px;
}

    .pegawai-search input {
        width: 100%;
        height: 44px;
        padding: 0 16px 0 42px;
        border-radius: 10px;
        border: 1px solid #dfe3ea;
        background: #fafbfc;
        transition: .25s;
    }

    .pegawai-search::before {
        content: "🔍";
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        opacity: .55;
    }

        .pegawai-search input:focus {
            border-color: #4b7bec;
        }

.pegawai-btn-primary {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: .25s;
}

    .pegawai-btn-primary:hover {
        background: #0069d9;
    }

.pegawai-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 12px;
}

/* ==========================================
   LIST PEGAWAI
========================================== */

.pegawai-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: .25s;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

    .pegawai-item:hover {
        background: #f7faff;
        border-color: #d8e7ff;
    }

    .pegawai-item.active {
        background: #edf5ff;
        border-color: #b9d3ff;
    }

.pegawai-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f3f5;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border: 2px solid #e8e8e8;
}

.pegawai-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}

.pegawai-avatar i {
    font-size: 28px !important;
    color: #999;
}

.pegawai-info {
    flex: 1;
}

.pegawai-name {
    font-size: 15px;
    font-weight: 600;
    color: #202224;
    margin-bottom: 4px;
}

.pegawai-position {
    font-size: 13px;
    color: #7a7a7a;
}

.pegawai-status {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 30px;
    background: #e9f8ef;
    color: #23a559;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================
   CONTENT
========================================== */

.pegawai-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    min-height: 0;
}

/* ==========================================
   TOOLBAR
========================================== */
.pegawai-toolbar {
    height: 64px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.pegawai-toolbar-right {
    display: flex;
    gap: 10px;
}

.pegawai-btn-secondary {
    height: 40px;
    padding: 0 18px;
    border: 1px solid #d8d8d8;
    background: white;
    border-radius: 8px;
    cursor: pointer;
}

/* ==========================================
   TAB
========================================== */

.pegawai-tabs {
    display: flex;
    gap: 6px;
    background: white;
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
}

    .pegawai-tabs button {
        border: none;
        background: transparent;
        height: 42px;
        padding: 0 18px;
        border-radius: 8px;
        cursor: pointer;
        transition: .2s;
        color: #666;
    }

        .pegawai-tabs button:hover {
            background: #f4f6f9;
        }

        .pegawai-tabs button.active {
            background: #007bff;
            color: white;
        }


/* ===========================================
   DASHBOARD
=========================================== */

.pegawai-dashboard {
    display: grid;
    grid-template-columns: minmax(220px,260px) minmax(0,1fr) minmax(260px,340px);
    grid-template-areas:
        "photo personal personal"
        "photo job job"
        "photo login summary"
        "level level level";
    gap: 24px;
    align-items: start;
    min-width: 0;
}
.pegawai-photo-card {
    grid-area: photo;
}

.pegawai-personal-card {
    grid-area: personal;
}

.pegawai-job-card {
    grid-area: job;
}

.pegawai-login-card {
    grid-area: login;
}

.pegawai-summary-card {
    grid-area: summary;
}

.pegawai-level-card {
    grid-area: level;
}

/* ==========================================
   CARD
========================================== */

.pegawai-card {
    background: white;
    border-radius: 16px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
    overflow: visible;
}

.pegawai-card-header {
    padding: 16px 20px;
    font-weight: 600;
    border-bottom: 1px solid #ececec;
    background: #fafafa;
}

.pegawai-card-body {
    padding: 24px;
    min-height: 180px;
}

/* ==========================================
   PHOTO CARD
========================================== */


.pegawai-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pegawai-photo-preview {
    width: 170px;
    height: 210px;
    border: 2px dashed #d9d9d9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    margin: 15px auto 20px;
}

    .pegawai-photo-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

.pegawai-upload {
    width: 100%;
    margin-top: 10px;
}

/* ==========================================
   FORM GRID
========================================== */

.pegawai-form {
    display: grid;
    grid-template-columns: repeat(2,minmax(250px,1fr));
    gap: 18px 22px;
}

.pegawai-form-3 {
    display: grid;
    grid-template-columns: repeat(3,minmax(180px,1fr));
    gap: 18px 22px;
}

.pegawai-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pegawai-group-full {
    grid-column: 1 / -1;
}

.pegawai-group label {
    font-size: 13px;
    color: #666;
    margin-bottom: 7px;
    font-weight: 600;
}

.pegawai-input {
    width: 100%;
    height: 42px;
    border: 1px solid #dcdfe5;
    border-radius: 10px;
    padding: 0 14px;
    background: white;
    transition: .2s;
    font-size: 14px;
}

    .pegawai-input:focus {
        outline: none;
        border-color: #2b7cff;
        box-shadow: 0 0 0 3px rgba(43,124,255,.12);
    }

select.pegawai-input {
    cursor: pointer;
}

/* placeholder */

.pegawai-placeholder {
    height: 42px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: #fafafa;
}

.pegawai-placeholder-area {
    height: 120px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: #fafafa;
}

/* ==========================================
   LEVEL TABLE
========================================== */

.pegawai-table {
    width: 100%;
    border-collapse: collapse;
}

    .pegawai-table th {
        background: #f8f9fb;
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #ececec;
        font-weight: 600;
        font-size: 13px;
    }

    .pegawai-table td {
        padding: 12px;
        border-bottom: 1px solid #f2f2f2;
        font-size: 14px;
    }

    .pegawai-table tbody tr:hover {
        background: #fafafa;
    }

/* ==========================================
   SUMMARY
========================================== */

.pegawai-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e5e5e5;
}

    .summary-item:last-child {
        border: none;
    }

.summary-title {
    color: #666;
}

.summary-value {
    font-weight: 600;
}

/* ==========================================
   SCROLLBAR
========================================== */

.pegawai-list::-webkit-scrollbar {
    width: 8px;
}

.pegawai-list::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 20px;
}

.pegawai-list::-webkit-scrollbar-track {
    background: transparent;
}

/* ==========================================
   CARD HOVER
========================================== */

.pegawai-card {
    transition: .25s;
}



/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width:1600px) {

    .pegawai-dashboard {
        grid-template-columns: 220px minmax(0,1fr) 280px;
    }
}

@media (min-width: 1367px) {
    .pegawai-login-full {
        grid-column: 2 / 4;
    }
}

@media (max-width:1366px) {

    .pegawai-dashboard {
        grid-template-columns: 220px minmax(0,1fr);
        grid-template-areas:
            "photo personal"
            "photo job"
            "photo login"
            "summary summary"
            "level level";
    }
}

@media (max-width:1024px) {

    .pegawai-dashboard {
        grid-template-columns: 1fr;
        grid-template-areas:
            "photo"
            "personal"
            "job"
            "login"
            "summary"
            "level";
    }
}


@media (max-width:992px) {

    .pegawai-page {
        padding: 16px;
        gap: 16px;
    }

    .pegawai-sidebar {
        width: 280px;
    }

    .pegawai-page.sidebar-hide .pegawai-sidebar {
        width: 0;
        margin-right: -16px;
    }

    .pegawai-dashboard {
        grid-template-columns: 1fr;
        grid-template-areas:
            "photo"
            "personal"
            "job"
            "login"
            "summary"
            "level";
    }

    .pegawai-form {
        grid-template-columns: 1fr;
    }

    .pegawai-form-3 {
        grid-template-columns: 1fr;
    }
}


.pegawai-photo-card .pegawai-card-body {
    min-height: 560px;
}

.pegawai-personal-card .pegawai-card-body {
    min-height: 210px;
}

.pegawai-job-card .pegawai-card-body {
    min-height: 180px;
}

.pegawai-login-card .pegawai-card-body {
    min-height: 180px;
}

.pegawai-summary-card .pegawai-card-body {
    min-height: 180px;
}

.pegawai-level-card .pegawai-card-body {
    min-height: 260px;
}

.pegawai-collapse-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f5f7fb;
    border-radius: 10px;
    cursor: pointer;
    transition: .25s;
    font-size: 18px;
}

    .pegawai-collapse-btn:hover {
        background: #007bff;
        color: white;
    }


/* ==========================================
   INPUT
========================================== */

.pegawai-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    transition: .2s;
}

    .pegawai-input:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0,123,255,.12);
    }

.pegawai-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    font-size: 14px;
    transition: .2s;
}

    .pegawai-textarea:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0,123,255,.12);
    }

    /*FOTO*/

.pegawai-photo-name {
    margin-top: 12px;
    text-align: center;
}

    .pegawai-photo-name h5 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }

    .pegawai-photo-name span {
        color: #888;
        font-size: 13px;
    }

.pegawai-photo-status {
    margin-top: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

    .pegawai-photo-status.aktif {
        background: #e8f8ef;
        color: #20a253;
    }

.pegawai-photo-action {
    width: 100%;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pegawai-btn-danger {
    height: 42px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #fff3f3;
    color: #d93025;
    transition: .25s;
}

    .pegawai-btn-danger:hover {
        background: #d93025;
        color: white;
    }

/*.pegawai-login-full {*/
    /*grid-column: 2 / 4;*/ /* samakan dengan job card (kolom tengah + kanan) */
    /*grid-column: auto;
}*/


/* ===============================
   MAUI / MOBILE RESPONSIVE FIX
================================ */
.pegawai-mobile-backdrop {
    display: none;
}

@media (max-width: 768px) {

    .pegawai-page {
        position: relative;
        display: block;
        height: calc(100dvh - 70px);
        padding: 12px;
        overflow: hidden;
        background: #f6f8fb;
    }

    .pegawai-content {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        gap: 14px;
        padding-bottom: 24px;
    }

    /* sidebar jadi drawer */
    .pegawai-sidebar {
        position: absolute;
        top: 12px;
        left: 12px;
        bottom: 12px;
        z-index: 50;
        width: min(82vw, 320px);
        transform: translateX(0);
        transition: .25s ease;
    }

    .pegawai-page.sidebar-hide .pegawai-sidebar {
        width: min(82vw, 320px);
        margin-right: 0;
        opacity: 1;
        pointer-events: none;
        transform: translateX(calc(-100% - 20px));
    }

    /* toolbar */
    .pegawai-toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
        height: auto;
        min-height: 56px;
        padding: 8px;
        border-radius: 14px;
    }

    .pegawai-toolbar-right {
        gap: 8px;
    }

        .pegawai-toolbar-right .pegawai-btn-primary,
        .pegawai-btn-secondary {
            width: auto;
            min-width: 82px;
            height: 40px;
            padding: 0 14px;
        }

    .pegawai-collapse-btn {
        width: 42px;
        height: 42px;
        background: #007bff;
        color: white;
    }

    /* tabs */
   /* .pegawai-tabs {
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 14px;
        padding: 6px;
    }

        .pegawai-tabs button {
            flex: 0 0 auto;
            height: 40px;
            padding: 0 14px;
        }*/

    /* dashboard jadi 1 kolom */
    .pegawai-dashboard {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "photo"
            "personal"
            "job"
            "login"
            "summary"
            "level";
        gap: 14px;
        width: 100%;
    }

    .pegawai-login-full {
        grid-column: auto;
    }

    .pegawai-card {
        width: 100%;
        border-radius: 14px;
        overflow: hidden;
    }

    .pegawai-card-header {
        padding: 14px 16px;
        font-size: 16px;
    }

    .pegawai-card-body {
        padding: 16px;
        min-height: unset !important;
    }

    .pegawai-photo-card .pegawai-card-body,
    .pegawai-photo-card {
        min-height: unset !important;
    }

    .pegawai-photo-preview {
        width: 160px;
        height: 190px;
        margin: 12px auto 16px;
    }

    .pegawai-photo-action {
        margin-top: 16px;
    }

    .pegawai-form,
    .pegawai-form-3 {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .pegawai-input {
        height: 44px;
        font-size: 14px;
    }

    textarea.pegawai-input,
    .pegawai-textarea {
        min-height: 90px;
        height: auto;
        padding: 12px 14px;
    }

    .pegawai-sidebar-header {
        padding: 18px;
    }

    .pegawai-list {
        padding: 10px;
    }

    .pegawai-item {
        padding: 12px;
        gap: 12px;
    }

    .pegawai-avatar {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
    }

    .pegawai-mobile-backdrop {
        display: block !important;
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, .25);
        z-index: 40;
    }

    .pegawai-sidebar {
        z-index: 60;
    }

    .pegawai-tabs {
        width: 100%;
        min-height: 56px;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px;
        background: #fff;
        border-radius: 14px;
        overflow-x: auto;
        overflow-y: hidden;
    }

        .pegawai-tabs button {
            flex: 0 0 auto;
            height: 42px;
            min-width: auto;
            padding: 0 18px;
            border-radius: 9px;
            white-space: nowrap;
            line-height: 42px;
        }

            .pegawai-tabs button.active {
                background: #007bff;
                color: #fff;
            }
}

.pegawai-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pegawai-upload-input {
    display: none;
}