/* Reset & Dasar */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    margin: 0;
    font-size: 14px;
}
* {
    box-sizing: border-box;
}
a {
    text-decoration: none;
    color: #3498db;
    transition: all 0.2s;
}
h1, h2, h3, h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
img {
    max-width: 100%;
    height: auto;
}
/* Spasi untuk ikon Font Awesome */
i.fas, i.fab {
    margin-right: 8px;
    width: 16px; 
    text-align: center;
}

/* === Layout Halaman (Wrapper & Sidebar) === */
.page-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    transition: grid-template-columns 0.3s ease;
}

/* Saat .sidebar-open, sembunyikan sidebar di desktop */
.page-wrapper.sidebar-open {
    grid-template-columns: 0 1fr;
}

.sidebar {
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    transition: all 0.3s ease;
}
.sidebar-header {
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid #3a506b;
}
.sidebar-header h2 {
    color: #fff;
    margin: 0;
    font-size: 1.25rem;
}
.user-info {
    padding: 15px 20px;
    background-color: #34495e;
    margin-bottom: 10px;
}
.user-info p { margin: 0; font-size: 0.9rem; color: #bdc3c7; }
.user-info strong {
    color: #fff;
    display: block;
    font-size: 1rem;
    white-space: normal;
    word-break: break-word;
}
.user-info span { font-size: 0.8rem; color: #95a5a6; }

.sidebar-nav-container { flex-grow: 1; overflow-y: auto; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    border-left: 3px solid transparent;
    transition: background-color 0.2s ease, border-left 0.2s ease;
    white-space: nowrap;
}
.sidebar-nav li a:hover { background-color: #3a506b; }
.sidebar-nav li a.active {
    background-color: #1abc9c;
    border-left-color: #fff;
    color: #fff;
    font-weight: 600;
}

/* Sub-menu */
.sidebar-nav li .sub-menu {
    list-style: none; padding: 0; margin: 0;
    background-color: #233a50;
    display: none;
}
.sidebar-nav li.open .sub-menu { display: block; }
.sidebar-nav li a.submenu-toggle { position: relative; }
.sidebar-nav li a .sub-arrow {
    position: absolute; right: 15px; top: 50%;
    transform: translateY(-50%); font-size: 0.8rem;
    transition: transform 0.2s ease;
    width: auto; margin: 0;
}
.sidebar-nav li.open > a.submenu-toggle > .sub-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.sidebar-nav li .sub-menu li a { padding-left: 45px; font-size: 0.9rem; }
.sidebar-nav li .sub-menu li a:hover { background-color: #3f5d7d; }
.sidebar-nav li .sub-menu li a.active {
    background-color: #16a085; border-left-color: transparent;
}

.sidebar-footer {
    padding: 15px 20px; text-align: center;
    font-size: 0.8rem; color: #95a5a6;
    border-top: 1px solid #3a506b;
}
.sidebar-footer a { color: #ecf0f1; font-weight: 600; }

/* --- Konten Utama --- */
.main-content { overflow-y: auto; background-color: #f4f7f6; }
.main-content-header {
    display: flex; align-items: center; padding: 15px 20px;
    background-color: #ffffff; border-bottom: 1px solid #ecf0f1;
    position: sticky; top: 0; z-index: 10;
}
.main-content-header h2 { margin: 0; font-size: 1.5rem; }
.sidebar-toggle-btn {
    background: none; border: none; color: #2c3e50;
    font-size: 1.25rem; cursor: pointer;
    padding: 5px; margin-right: 15px;
}
#desktop-toggle-btn { display: block; }
.top-bar {
    display: none; justify-content: space-between; align-items: center;
    background-color: #fff; padding: 0 15px; height: 60px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    border-bottom: 1px solid #ecf0f1;
}
.top-bar h2 { font-size: 1.2rem; margin: 0; color: #2c3e50; }
#mobile-toggle-btn { display: none; }
.container {
    max-width: 1200px; margin: 15px auto 15px auto; padding: 20px;
}
.footer {
    padding: 20px; text-align: center; font-size: 0.9rem;
    color: #777; margin-top: 20px;
}

/* === Komponen UI === */
.btn {
    display: inline-block; padding: 10px 16px; font-size: 14px;
    font-weight: 600; text-decoration: none; color: #fff;
    border: none; border-radius: 6px; cursor: pointer;
    transition: background-color 0.2s ease; text-align: center;
}
.btn i { margin-right: 4px; }
.btn-primary { background-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; }
.btn-success { background-color: #2ecc71; }
.btn-success:hover { background-color: #27ae60; }
.btn-warning { background-color: #f39c12; }
.btn-warning:hover { background-color: #e67e22; }
.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }
.btn-secondary { background-color: #95a5a6; color: #fff; }
.btn-secondary:hover { background-color: #7f8c8d; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.badge-notif {
    background-color: #e74c3c; color: #fff; font-size: 0.75rem;
    font-weight: bold; padding: 2px 8px; border-radius: 12px;
    margin-left: 10px; display: inline-block; min-width: 20px;
    text-align: center; line-height: 1.2;
}
.sidebar-nav li a:hover .badge-notif, .sidebar-nav li a.active .badge-notif {
    background-color: #fff; color: #e74c3c;
}


/* Kontrol Tabel & Pencarian */
.table-controls {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 15px;
}
.search-form { display: flex; align-items: center; gap: 5px; }
.search-form input[type="text"] {
    min-width: 250px; padding: 10px; border: 1px solid #ccc;
    border-radius: 6px; font-family: inherit; font-size: 1rem;
}
.search-form .btn { padding: 10px; }
.table-wrapper {
    width: 100%; overflow-x: auto; background-color: #fff;
    border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
table { width: 100%; border-collapse: collapse; }
table th, table td {
    padding: 12px 15px; border-bottom: 1px solid #ddd;
    text-align: left; white-space: nowrap;
}
table th { background-color: #ecf0f1; color: #34495e; font-weight: 600; }
table tr:hover { background-color: #f9f9f9; }
.action-links { display: flex; gap: 5px; white-space: nowrap; }
.pagination { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 5px; }
.pagination a, .pagination span {
    padding: 8px 12px; border: 1px solid #ddd; border-radius: 5px;
    text-decoration: none; color: #3498db; background-color: #fff; font-size: 0.9rem;
}
.pagination span.current {
    background-color: #3498db; color: #fff; border-color: #3498db; font-weight: 600;
}
.pagination span.disabled { color: #aaa; background-color: #f4f4f4; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; color: #555; font-size: 0.9rem; }
.form-group input[type="text"], .form-group input[type="date"],
.form-group input[type="email"], .form-group input[type="password"],
.form-group input[type="number"], .form-group select, .form-group textarea {
    width: 100%; padding: 10px; border: 1px solid #ccc;
    border-radius: 6px; box-sizing: border-box; font-family: inherit; font-size: 1rem;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #3498db; outline: none; box-shadow: 0 0 5px rgba(52,152,219,0.2);
}
.form-group input[disabled], .form-group select[disabled], .form-group textarea[disabled] {
    background-color: #f4f4f4; cursor: not-allowed; opacity: 0.7;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.full-width { grid-column: 1 / -1; }
h3.full-width { grid-column: 1 / -1; }
.form-actions {
    grid-column: 1 / -1; border-top: 1px solid #ecf0f1;
    padding-top: 20px; margin-top: 10px; text-align: right;
    display: flex; justify-content: flex-end; gap: 10px;
}
.form-container, .table-container, .summary-card, .portal-container {
    background: #fff; padding: 20px; border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.error-message, .alert-info { padding: 15px; margin-bottom: 20px; border-radius: 6px; border: 1px solid; }
.error-message { background-color: #fdeded; color: #c0392b; border-color: #e74c3c; }
.alert-info { background-color: #eaf5fb; color: #2980b9; border-color: #3498db; }

/* Kartu Dashboard */
.summary-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.summary-card h3 {
    margin-top: 0;
}
.summary-card p {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Grid Kontak (Horizontal) */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    padding: 10px 0;
}
.contact-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #3498db;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 
        "icon name button"
        "icon job button";
    align-items: center;
    gap: 0 15px;
    text-align: left;
}
.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.contact-icon {
    grid-area: icon;
    font-size: 2.2rem;
    color: #bdc3c7;
    display: flex;
    align-items: center;
}
.contact-card h3 {
    grid-area: name;
    font-size: 1rem;
    margin: 0;
    color: #2c3e50;
    line-height: 1.3;
    align-self: end;
}
.contact-card .job-title {
    grid-area: job;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin: 0;
    align-self: start;
}
.btn-wa {
    grid-area: button;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.2s;
    width: auto;
}
.btn-wa:hover { background-color: #128C7E; color: white; }
.btn-wa i { margin-right: 6px; font-size: 1rem; }

/* Portal Style */
.portal-container {
    width: 100%; max-width: 600px; margin: 40px auto; text-align: center; padding: 30px 40px;
}
.portal-header h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.portal-header h2 { font-size: 1.75rem; margin-top: 0; color: #34495e; }
.portal-login, .portal-cuti-check {
    margin-top: 30px; padding-top: 30px; border-top: 1px solid #ecf0f1;
}
.hasil-cuti-container { text-align: left; margin-top: 20px; }
.hasil-cuti-container hr { border: 0; border-top: 1px solid #bdc3c7; margin: 10px 0; }
.loading-text { color: #7f8c8d; font-style: italic; text-align: center; }

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    background-color: #fff;
}
.checkbox-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}
.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}
.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    display: inline-block;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
    padding-top: 5px;
}
.radio-group label {
    font-weight: normal;
    margin: 0;
}

/* === STYLE LOGIN V4 KHUSUS (Agar tidak berantakan) === */
.limiter { width: 100%; margin: 0 auto; }
.container-login100 {
    width: 100%; min-height: 100vh; display: flex;
    flex-wrap: wrap; justify-content: center; align-items: center;
    padding: 15px;
    background-image: linear-gradient(135deg, #00dbde 0%, #fc00ff 100%);
}
.wrap-login100 {
    width: 500px; background: #fff; border-radius: 10px;
    overflow: hidden; padding: 55px 55px 37px 55px;
    box-shadow: 0 5px 30px 0px rgba(0, 0, 0, 0.2);
}
.login100-form { width: 100%; }
.login100-form-title {
    display: block; font-family: inherit; font-weight: bold;
    font-size: 30px; color: #333333; line-height: 1.2; text-align: center;
}
.p-b-49 { padding-bottom: 49px; }
.wrap-input100 {
    width: 100%; position: relative; border-bottom: 2px solid #d9d9d9; margin-bottom: 30px;
}
.label-input100 {
    font-family: inherit; font-size: 14px; color: #333333; line-height: 1.5; padding-left: 7px;
}
.input100 {
    font-family: inherit; font-size: 16px; color: #333333; line-height: 1.2;
    display: block; width: 100%; height: 45px; background: transparent;
    padding: 0 5px 0 38px; border: none; outline: none;
}
.focus-input100 {
    position: absolute; display: block; width: 100%; height: 100%;
    top: 0; left: 0; pointer-events: none;
}
.focus-input100::before {
    content: ""; display: block; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 2px; transition: all 0.4s;
    background: linear-gradient(to right, #00dbde, #fc00ff);
}
.focus-input100::after {
    font-family: "Font Awesome 5 Free"; content: attr(data-symbol);
    font-weight: 900; color: #adadad; font-size: 22px;
    display: block; width: 100%; position: absolute;
    top: 25px; left: 0px; padding-left: 5px; transition: all 0.4s;
}
.input100:focus + .focus-input100::after { color: #a64bf4; }
.input100:focus + .focus-input100::before { width: 100%; }
.container-login100-form-btn {
    display: flex; flex-wrap: wrap; justify-content: center; padding-top: 20px;
}
.wrap-login100-form-btn {
    width: 100%; display: block; position: relative; z-index: 1;
    border-radius: 25px; overflow: hidden; margin: 0 auto;
}
.login100-form-bgbtn {
    position: absolute; z-index: -1; width: 300%; height: 100%;
    background: linear-gradient(to right, #00dbde, #fc00ff, #00dbde);
    top: 0; left: -100%; transition: all 0.4s;
}
.login100-form-btn {
    font-family: inherit; font-size: 16px; color: #fff; line-height: 1.2;
    text-transform: uppercase; display: flex; justify-content: center;
    align-items: center; padding: 0 20px; width: 100%; height: 50px;
    background: transparent; border: none; cursor: pointer; outline: none;
}
.wrap-login100-form-btn:hover .login100-form-bgbtn { left: 0; }
.flex-c-m {
    display: flex; justify-content: center; align-items: center;
}
.login-icon-item {
    font-size: 25px; color: #fff; display: flex;
    justify-content: center; align-items: center;
    width: 50px; height: 50px; border-radius: 50%; margin: 5px;
}
.bg1 { background-color: #3b5998; }
.bg2 { background-color: #1da1f2; }
.bg3 { background-color: #ea4335; }
.txt1 { font-size: 14px; color: #555555; line-height: 1.5; }
.txt3 { font-size: 14px; color: #333333; text-transform: uppercase; font-weight: bold; }
.txt3:hover { color: #a64bf4; text-decoration: none; }
.p-t-54 { padding-top: 54px; }
.p-b-20 { padding-bottom: 20px; }
.p-t-30 { padding-top: 30px; }
.p-b-9 { padding-bottom: 9px; display: block; }
.text-center { text-align: center; }
.error-message-login {
    background: #ffebee; color: #c62828; padding: 10px;
    border-radius: 5px; text-align: center; margin-bottom: 20px;
    font-size: 13px; border: 1px solid #ffcdd2;
}

/* === Responsif === */
@media (max-width: 992px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr; /* Top-bar + Konten */
    }
    .page-wrapper.sidebar-open {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        /* [DIPERBAIKI] Menggunakan transform agar tersembunyi sempurna */
        top: 0;
        bottom: 0;
        left: 0; 
        width: 240px; /* Tetapkan lebar agar konsisten */
        z-index: 1000;
        transform: translateX(-100%); /* Geser 100% ke kiri layar */
        transition: transform 0.3s ease; /* Animasi pada transform */
        box-shadow: 2px 0 5px rgba(0,0,0,0.2); /* Tambah bayangan agar terlihat 'mengambang' saat muncul */
    }
    .page-wrapper.sidebar-open .sidebar {
        /* [DIPERBAIKI] Kembalikan ke posisi 0 saat dibuka */
        transform: translateX(0);
    }
    
    /* Overlay gelap saat sidebar terbuka */
    .page-wrapper.sidebar-open::after {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .main-content {
        padding-top: 40px; /* Ruang untuk top-bar */
    }
    .main-content-header {
        display: none; /* Sembunyikan header desktop */
    }
    #desktop-toggle-btn {
        display: none; /* Sembunyikan tombol desktop */
    }
    
    .top-bar {
        display: flex; /* Tampilkan top-bar */
    }
    #mobile-toggle-btn {
        display: block; /* Tampilkan tombol mobile */
    }

    /* Responsive Form Grid */
    .form-grid[style*="1fr 2fr"] {
         grid-template-columns: 1fr;
    }
    
    .contact-card {
        grid-template-columns: auto 1fr;
        grid-template-areas: 
            "icon name"
            "icon job"
            "button button";
        gap: 5px 15px;
    }
    .btn-wa { margin-top: 10px; width: 100%; }
}

@media (max-width: 576px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.span-2 { grid-column: span 1; }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .search-form {
        width: 100%;
        flex-direction: column;
    }
    .search-form input[type="text"] {
        width: 100%;
        min-width: 0;
        margin-bottom: 10px; /* Jarak antara input dan tombol */
    }
    .search-form .btn {
        width: 100%;
    }
    
    .wrap-login100 { padding: 30px 20px; }
}