/* Reset dan font */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', Arial, sans-serif;
}

/* HEADER */
header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #38482f;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* NAVBAR */
nav {
    padding: 22px 26px;
    text-align: right;
    font-size: 14px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    display: inline-block;
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

nav ul li a.active,
nav ul li a:hover {
    color: #b0c7b6;
}

/* USER INFO */
.user-info{
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    margin-left: 10px;
}

.user-details{
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3c2d3;
    object-fit: cover;
    border: 1px solid #ffffff;
}

.user-details span:first-child {
    font-size: 13px;
    font-weight: bold;
}

.user-details span:last-child {
    font-size: 11px;
    opacity: 0.85;
}

/* MAIN CONTENT */
.main-content {
    width: 100%;
    min-height: calc(100vh - 60px);
    background: url('../images/dashboard.jpg') center center / cover no-repeat;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box; 
    overflow-x: hidden;
}

/* CONTAINER CLUSTERING */
.data-padi, .clustering {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* DATA TOOLS */
.data-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.left-action {
    display: flex;
    gap: 10px;
}

label{
    font-size: 14px;
}

#tahun {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: 0.3s;
    min-width: 120px;
}

#tahun:hover {
    border-color: #38482f;
}

/* TABEL DATA */
.data-table {
    width: 100%;
    overflow-x: auto; /* scroll horizontal di mobile */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 700px; /* cukup lebar tapi scrollable */
}

thead {
    background: #38482f;
    color: #ffffff;
}

thead th {
    padding: 12px 10px;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
}

tbody td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background: #f4f7f4;
}

/* AKSI BUTTON */
.aksi {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
}

.btn-icon.edit {
    background: #38482f;
}

.btn-icon.edit:hover {
    background: #2c3925;
}

button.btn-icon.delete {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #38482f;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.btn-icon.delete:hover {
    background: #b02a37;
}

/* PAGINATION */
.pagination {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.pagination a {
    background: #38482f;
    color: #fff;
    text-decoration: none;
}

.pagination a:hover {
    background: #2c3925;
}

.pagination span.active {
    background: #b0c7b6;
    color: #2c3925;
}

.clustering-form{
    margin-top: 24px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.clustering-form input{
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}
.clustering-form button{
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: #38482f;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.clustering-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hitung-clustering {
    width: 100%;
}

.cluster-summary {
    width: 100%;
    margin-top: 10px;
}


/* RESPONSIVE */
@media (max-width: 768px) {
    header {
        padding: 14px 16px;
    }

    .user-details {
        display: none;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
    }

    nav {
        padding: 0;
        text-align: center;
        font-size: 12px;
    }

    nav ul {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    nav ul li {
        margin-left: 0;
    }

    nav ul li a {
        padding: 6px 6px;
        font-size: 12px;
    }

    .data-tools {
        flex-direction: column;
        align-items: flex-start;
    }

    #tahun {
        width: 100%; /* select full-width di mobile */
        margin-bottom: 12px;
    }

    table {
        font-size: 12px;
        min-width: unset;
    }

    thead th,
    tbody td {
        padding: 6px 4px;
    }
}
