/* === FONT & GLOBAL SETTINGS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0E7490; /* Teal Tua */
    --primary-hover: #155E75;   /* Teal lebih gelap */
    --secondary-color: #F0F9FF; /* Biru sangat terang */
    --text-dark: #1E293B;       /* Abu-abu tua kebiruan */
    --text-light: #64748B;      /* Abu-abu medium */
    --border-color: #CBD5E1;    /* Abu-abu terang untuk border */
    --background-color: #F8FAFC;/* Latar belakang halaman */
    --danger-color: #DC2626;    /* Merah untuk logout/error */
    --success-color: #16A34A;   /* Hijau untuk sukses */
    --secondary-btn-bg: #E2E8F0; /* Latar tombol sekunder */
    --secondary-btn-text: #475569; /* Teks tombol sekunder */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    color: var(--text-dark);
}

/* === HEADER & NAVIGATION BAR === */
.header-main {
    background-color: #FFFFFF;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 40px;
    width: 40px;
}

.header-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.header-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav li {
    margin: 0;
}

.header-nav a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-nav a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.header-nav a.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--secondary-color);
}

#btnLogout {
    background-color: #FFF1F2;
    color: var(--danger-color);
}

#btnLogout:hover {
    background-color: var(--danger-color);
    color: #FFFFFF;
}

/* === MAIN CONTENT & CARDS === */
.content {
    max-width: 900px;
    margin: 40px auto;
    padding: 2rem 2.5rem;
    background-color: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.content h2 {
    text-align: left;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h2 {
    margin: 0;
}

.content-dashboard {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 3rem;
    padding-bottom: 3rem;
    min-height: 50vh;
}

.dashboard-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.content-dashboard h2 {
    text-align: center;
}

.content-dashboard p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 450px;
    margin: 0 auto;
}

/* === DETAIL PAGE & INTERACTIVE LISTS === */
.info-block {
    background-color: var(--secondary-color);
    border: 1px solid #E2E8F0;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
}

.info-grid strong {
    font-weight: 600;
    color: var(--text-dark);
}

.form-section {
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid #E2E8F0;
}

.interactive-list {
    margin-top: 1rem;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    background-color: #FFFFFF;
}

.interactive-list-selected {
    background-color: var(--background-color);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid #E2E8F0;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
}

/* === LAYOUT MODIFIERS === */
.content-full-width {
    max-width: 95%;
}

.content-form {
    max-width: 700px;
}

/* === FORM STYLING === */
form, .login-form-box form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.span-2 {
    grid-column: span 2;
}

label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #FFFFFF;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}

/* === BUTTONS === */
.btn, button {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}
.btn:hover, button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-update { background-color: #0ea5e9; }
.btn-delete { background-color: var(--danger-color); }
.view-btn { background-color: #6c757d; }
.btn-secondary {
    background-color: var(--secondary-btn-bg);
    color: var(--secondary-btn-text);
}
.btn-secondary:hover {
    background-color: #d1d5db;
    color: var(--text-dark);
}
.btn-add-sm {
    background-color: var(--success-color);
    font-size: 0.8rem;
    padding: 4px 10px;
}
.btn-sm {
    font-size: 0.8rem;
    padding: 4px 10px;
}
.btn-primary-full {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* === MODAL / DIALOG KONFIRMASI === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal-box {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}
.modal-body p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
#pesan-sukses-container {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
    background-color: #F0FDF4;
    color: #15803D;
    border: 1px solid #BBF7D0;
    display: none;
}

/* === TOOLBAR & SEARCH FORM === */
.toolbar {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="text"] {
    flex-grow: 1;
    padding: 10px 14px;
    font-size: 0.95rem;
}
.search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.search-form button:hover {
    background-color: var(--primary-hover);
}

/* === TABLE STYLING === */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}
thead th {
    background-color: #F8FAFC;
    font-weight: 600;
    color: var(--text-light);
}
tbody tr:hover { background-color: var(--secondary-color); }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* === LOGIN PAGE STYLES === */
body.login-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.login-data-container {
    flex: 3;
    background-color: var(--background-color);
    padding: 2rem;
    overflow-y: auto;
}
.login-data-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-form-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #FFFFFF;
    padding: 2rem;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
}
.login-form-box {
    max-width: 350px;
    width: 100%;
    text-align: left;
}
.login-form-box h2 { text-align: center; }
.login-logo {
    display: block;
    max-width: 120px;
    margin: 0 auto 1.5rem auto;
}
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}

/*
==============================================
=== 📱 BAGIAN RESPONSIVE UNTUK LAYAR KECIL 📱 ===
==============================================
*/
@media (max-width: 768px) {

    /* Penyesuaian Header & Navigasi */
    .header-main {
        padding: 0 1rem;
    }
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
    }
    .header-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin-top: 1rem;
    }
    .header-nav li {
        width: 100%;
    }
    .header-nav a {
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    .header-nav li:last-child a {
        border-bottom: none;
    }

    /* Penyesuaian Konten & Card */
    .content {
        margin: 20px 10px;
        padding: 1.5rem 1rem;
    }
    .content h2 {
        font-size: 1.5rem;
    }
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    .content-header .btn {
        width: 100%;
        text-align: center;
    }

    /* Penyesuaian Form */
    form, .login-form-box form {
        grid-template-columns: 1fr; /* Form menjadi 1 kolom */
        gap: 18px;
    }
    .span-2 {
        grid-column: span 1; /* Reset span untuk 1 kolom */
    }

    /* Penyesuaian Halaman Login */
    body.login-page {
        flex-direction: column; /* Tata letak atas-bawah */
        height: auto;
        overflow: auto;
    }
    .login-data-container {
        flex: none; /* Reset flex */
        padding: 1.5rem 1rem;
    }
    .login-form-container {
        flex: none;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    }

    /* Penyesuaian Toolbar & Search */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .search-form {
        width: 100%;
    }
}