body {
    background: #f4f6f9;
}

/* ===== Desktop (yang sekarang sudah benar) ===== */
.sidebar {
    height: 100vh;
    background: #006400;
    color: white;
    position: fixed;
    width: 230px;
    padding-top: 20px;
}

.sidebar .logo {
    text-align: center;
    margin-bottom: 20px;
}

.sidebar .logo img {
    width: 80px;
}

.sidebar a {
    color: white;
    display: block;
    padding: 10px 20px;
    text-decoration: none;
}

.content {
    margin-left: 230px;
    padding: 20px;
}

.sidebar a.active {
    background: #0a4f0a;   /* warna lebih gelap */
    font-weight: bold;
    border-left: 4px solid #fff;
}

.sidebar a:hover {
    background: #0d5d0d;
    text-decoration: none;
}

#limit, #filter, #keyword {
    font-size: 13px;
}

#limit {
    width: 80px;
}

.row.mb-3 .form-control {
    height: 32px;
}

/* ======== STYLE CARD VIEW KARYAWAN ======== */

.kartu-view {
    border-radius: 10px;
    overflow: hidden;
}

.kartu-foto {
    padding: 0;
    background: transparent;
    display: flex;
    align-items: stretch;
}

.kartu-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;     /* ini kunci utama */
    border-radius: 0;
    filter: contrast(1.05);
}

.kartu-detail {
    padding-left: 10px;
    padding-top: 20px;
    background: #f5f5f5;
    box-shadow: -8px 0 15px rgba(0,0,0,0.05);
}

.kartu-nama {
    font-size: 38px;
    font-weight: bold;
    color: #0d1b5e;
    text-transform: uppercase;
    margin-bottom: 25px;
    margin-left: 20px;
}

.kartu-table {
    text-align: left;
    margin-top: 20px;
    margin-left: 20px;
    border-collapse: collapse;
}

.kartu-table th {
    text-align: left;
    padding: 8px 10px;
    width: 120px;
    color: #ffffff;
    background: #28a745 !important;
}

.kartu-table td {
    padding: 8px 10px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;   /* hanya garis bawah */
    vertical-align: middle;
}

.kartu-label {
    font-weight: bold;
    color: #0d1b5e;
}

.kartu-tgl {
    font-size: 15px;
    font-weight: bold;
}

.kartu-sub {
    font-size: 13px;
    color: #444;
}

/* tombol close di pojok kanan atas */
.kartu-close {
    position: absolute;
    right: 10px;
    top: 5px;
    z-index: 999;
    font-size: 30px;
    color: #0d1b5e;
    opacity: 0.8;
    border: none;
    background: transparent;
}

.kartu-close:hover {
    opacity: 1;
    cursor: pointer;
}

.modal-content.kartu-view {
    animation: zoomIn 0.2s ease;
}

#view_pkwt {
    line-height: 1.4;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====== USER AREA SIDEBAR ====== */

.user-area {
    position: relative;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    background: #005200;
    color: white;
}

.user-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    margin-right: 10px;
    border: 2px solid #00ff00;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: bold;
    font-size: 14px;
}

.user-status {
    font-size: 12px;
    opacity: 0.9;
}

.user-arrow {
    margin-left: auto;
    transition: 0.3s;
}

/* POPUP LOGOUT */

.user-popup {
    position: absolute;
    bottom: 55px;
    left: 10px;
    right: 10px;
    background: white;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.2s ease;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.user-popup a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
}

.user-popup a:hover {
    background: #f0f0f0;
    border-radius: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

table th {
    text-align: center;
    vertical-align: middle;
}

table td {
    vertical-align: middle;
}

textarea {
    resize: none;
}

.hari-kinerja {
    background: #e9ecef;
    font-weight: bold;
}

/* GRID TANGGAL */
.kalender-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 15px;
    max-width: 520px;
}

/* KOTAK TANGGAL */
.tanggal-box {
    padding: 8px 0;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tanggal-aktif {
    border: 3px solid #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.6);
    transform: scale(1.08);
    transition: all 0.2s ease;
}

.hijau {
    background: #28a745;
}

.merah {
    background: #dc3545;
}

.tanggal-box:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

#area-kalender h5 {
    font-size: 16px;
    margin-top: 5px;
}

.kalender-wrapper {
    max-width: 520px;
    margin: 0 auto;     /* agar benar-benar di tengah */
}

/* HEADER KALENDER */
.kalender-header {
    max-width: 520px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kalender-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    flex: 1;
}

/* TOMBOL HEADER */
.kalender-header button {
    padding: 3px 8px;
    font-size: 12px;
}

/* HEADER NAMA HARI DI ATAS KALENDER */
.kalender-hari {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    max-width: 520px;
    margin-bottom: 6px;
}

.kalender-hari div {
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: #0d1b5e;
}

/* Disable klik saja, tapi warna tetap */
.tanggal-box.disabled-click {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Disable karena masa depan -> abu abu */
.tanggal-box.disabled-future {
    background-color: #e0e0e0;
    color: #999 !important;
    cursor: not-allowed;
}

.card {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 10px;
}

.card-header .btn-group {
    margin-left: auto;
}

.card-header {
    font-weight: bold;
}

.card-body {
    padding: 15px;
}

.badge {
    padding: 6px 10px;
    font-size: 12px;
}

.tabel-karyawan thead th {
    background: #28a745;
    color: white !important;
}

.table th {
    background: #f5f5f5;
}

.btn {
    margin-top: 5px;
}

#countdown {
    font-size: 16px;
    color: red;
}

/* ===== DESKTOP DEFAULT ===== */
.kinerja-desktop {
    display: block;
}

.kinerja-mobile {
    display: none;
}

.form-kinerja-mobile {
    display: none;
}

.table thead th {
    background-color: #29bbff;
    color: white !important;
}

#sectionRiwayat table thead th {
    background-color: #29bbff;
    color: #ffffff !important;
}

/* ===== FIX HEADER RIWAYAT ===== */
.table-riwayat thead th {
    background-color: #28a745;
    color: #ffffff !important;
    text-align: center;
}

.btn-outline-light{
    color: #b5b5b9;
}

.badge-danger {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== RESPONSIVE MOBILE YANG BENAR ===== */
@media (max-width: 900px) {

    /* Sidebar jadi full width di atas */
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
        display: block;
    }

    /* Konten utama jadi full tanpa margin kiri */
    .content {
        margin-left: 0;
        width: 100%;
        padding: 10px;
    }

    /* Link menu lebih besar biar nyaman di HP */
    .sidebar a {
        padding: 12px 15px;
        font-size: 15px;
    }

    /* User area tetap normal di bawah menu */
    .user-area {
        position: relative;
        width: 100%;
        margin-top: 10px;
    }

    .logo img {
        width: 60px;
    }

    h5.text-center {
        font-size: 16px;
    }
    
    .uraian-kegiatan {
        white-space: normal;
        word-break: break-word;
    }

    #area-data table {
        table-layout: fixed;
        width: 100%;
    }
    
    #area-data table td,
    #area-data table th {
        word-wrap: break-word;
        font-size: 13px;
    }

    #area-data table td:nth-child(5) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .kinerja-mobile {
        display: block !important;
    }
    
    .kinerja-card {
        border-left: 5px solid #28a745;
        border-radius: 10px;
    }

    .uraian-mobile {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .kinerja-desktop {
        display: none;
    }

    .kinerja-mobile {
        display: block;
    }

    /* =================================== */
    /* FORM KINERJA - MOBILE REDESIGN */
    /* =================================== */

    #areaFormKinerja h3 {
        font-size: 18px;
        font-weight: 600;
        text-align: center;
    }

    .form-kinerja-wrapper > table > thead {
        display: none;
    }

    #table-kinerja,
    #table-kinerja tbody,
    #table-kinerja tr,
    #table-kinerja td {
        display: block;
        width: 100%;
    }

    #table-kinerja tr {
        background: #ffffff;
        margin-bottom: 18px;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    #table-kinerja td {
        border: none;
        padding: 6px 0;
    }

    #table-kinerja input,
    #table-kinerja textarea {
        border-radius: 8px;
        font-size: 14px;
    }

    #table-kinerja textarea {
        min-height: 90px;
        resize: none;
    }

    .char-count {
        font-size: 11px;
        display: block;
        margin-top: 3px;
    }

    .form-check {
        margin-bottom: 5px;
    }

    .btn-tambah {
        border-radius: 50%;
        width: 40px;
        height: 40px;
        padding: 0;
    }
    
    .form-kinerja-desktop {
        display: nonet;
    }

    .form-kinerja-mobile {
        display: block;
    }

    .btn-tambah-mobile{
        border-radius: 30px;
        font-weight: 600;
        padding: 10px;
    }

    .form-kinerja-mobile .card{
        border-radius: 14px;
    }
  
    #sectionRiwayat table thead th {
        background-color: #29bbff;
        color: #ffffff;
    }

    .card-header .btn-group {
        margin-top: 5px;
    }

    #sectionRiwayat table {
        font-size: 13px;
    }
    
    .table-riwayat {
        font-size: 13px;
    }

    .table-riwayat th,
    .table-riwayat td {
        padding: 6px;
    }
    
    .card-header {
        padding: 10px 12px;
    }
    
    #sectionRiwayat thead th {
        background: purple;
        color: yellow;
    }
    
    .card-header .d-flex{
        gap: 8px;
    }
    
    .gap-header {
        gap: 8px;
    }
    
    #btnCalendar {
        cursor: pointer;
        font-size: 18px;
        display: inline-flex;
        align-items: center;
    }
    
    .card-header .btn-outline-light {
        color: #2400f9;
    }
}


@media (min-width: 769px) {

    .kinerja-mobile {
        display: none;
    }
    
    #sectionRiwayat table thead {
        display: table-header-group;
    }

    #sectionRiwayat table thead th {
        background-color: #29bbff;
        color: #ffffff;
    }
    
    #btnCalendar{
        margin-left: 6px;
        margin-right: 4px;
        font-size: 18px;
    }

}

.bg-orange {
    background-color: #ff9800;
}

.alert-warning {
    border-left: 5px solid #ff9800;
}

