/* ========== RESET & GLOBAL ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

body {
    background: #f4f7fc;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1.5rem;
    font-size: 1.125rem;
    line-height: 1.6;
    color: #1a202c;
}

/* ========== MAIN WRAPPER ========== */
.main-content {
    max-width: 1200px;
    width: 100%;
}

/* ========== HEADER ========== */
.page-header {
    background: linear-gradient(135deg, #4f6ef7, #7c5cfc);
    padding: 2.2rem 2.8rem;
    border-radius: 28px;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    box-shadow: 0 14px 34px rgba(79, 110, 247, 0.28);
}

.page-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.header-actions .btn {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 1rem;
    padding: 12px 28px;
}

.header-actions .btn:hover {
    background: #fff;
    color: #4f6ef7;
    transform: translateY(-2px);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.btn-primary {
    background: linear-gradient(135deg, #4f6ef7, #7c5cfc);
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 110, 247, 0.3);
    font-size: 1.05rem;
    padding: 14px 32px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(79, 110, 247, 0.4);
}

.btn-secondary {
    background: #eef2f7;
    color: #2d3748;
}
.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========== ALERT ========== */
.alert {
    background: #e6fffa;
    color: #234e52;
    padding: 1.2rem 1.8rem;
    border-radius: 18px;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 6px solid #38b2ac;
    box-shadow: 0 4px 12px rgba(56, 178, 172, 0.12);
    font-size: 1rem;
}

/* ========== CARD ========== */
.card {
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    margin-bottom: 3rem;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.card:hover {
    box-shadow: 0 16px 48px rgba(0,0,0,0.06);
}

.card-header {
    padding: 1.5rem 2.4rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 14px;
}
.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-header h2 i {
    color: #4f6ef7;
}

.card-body {
    padding: 2.4rem;
}

/* ========== FORM ========== */
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
}
.form-group {
    flex: 0 0 calc(50% - 1rem);
    display: flex;
    flex-direction: column;
}
.form-group.full-width {
    flex: 0 0 100%;
}
.form-group label {
    font-weight: 500;
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    background: #fafcff;
    transition: all 0.2s;
    width: 100%;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #4f6ef7;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.12);
    background: #fff;
}
.form-group textarea {
    resize: vertical;
}
.form-group h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a202c;
    margin: 10px 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-group h3 i {
    color: #4f6ef7;
}

/* ========== TABLE ========== */
.table-responsive {
    overflow-x: auto;
    margin-top: 0.5rem;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
table thead {
    background: #f7fafc;
}
table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.95rem;
}
table td {
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
    font-size: 0.95rem;
}
table tbody tr {
    transition: background 0.15s;
}
table tbody tr:hover {
    background: #f7fafc;
}
table tbody tr:nth-child(even) {
    background: #fafcff;
}

.btn-edit,
.btn-hapus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-edit {
    background: #ebf4ff;
    color: #4f6ef7;
}
.btn-edit:hover {
    background: #dbe7fe;
    transform: scale(1.03);
}
.btn-hapus {
    background: #fff5f5;
    color: #e53e3e;
    margin-left: 8px;
}
.btn-hapus:hover {
    background: #fed7d7;
    transform: scale(1.03);
}

.btn-tampil {
    background: #e0f2fe;
    color: #0c4a6e;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-tampil:hover {
    background: #bae6fd;
    transform: scale(1.02);
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: #fff;
    max-width: 650px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 2rem 2rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #333;
}
.modal h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
}
/* Gunakan grid agar label dan value tidak tumpang tindih */
.modal .detail-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: baseline;
}
.modal .detail-item .label {
    font-weight: 600;
    color: #2d3748;
    word-break: break-word;
}
.modal .detail-item .value {
    color: #1a202c;
    word-break: break-word;
    white-space: pre-wrap;
}
/* Responsif untuk layar kecil */
@media (max-width: 600px) {
    .modal .detail-item {
        grid-template-columns: 1fr; /* jadi satu kolom di HP */
        gap: 2px 0;
    }
    .modal .detail-item .label {
        font-weight: 600;
        color: #4a5568;
        font-size: 0.85rem;
    }
    .modal .detail-item .value {
        font-size: 0.95rem;
        padding-bottom: 4px;
        border-bottom: 1px dashed #e2e8f0;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body {
        padding: 1rem;
        font-size: 1rem;
    }
    .page-header {
        padding: 1.8rem;
        flex-direction: column;
        align-items: flex-start;
        border-radius: 22px;
    }
    .page-header h1 {
        font-size: 2rem;
    }
    .header-actions {
        margin-top: 1.2rem;
        width: 100%;
    }
    .header-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
    }
    .form-group {
        flex: 0 0 100%;
    }
    .card-body {
        padding: 1.5rem;
    }
    .card-header {
        padding: 1.2rem 1.5rem;
    }
    .card-header h2 {
        font-size: 1.3rem;
    }
    table th,
    table td {
        padding: 12px 14px;
        font-size: 0.85rem;
    }
    .btn-edit,
    .btn-hapus,
    .btn-tampil {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    .modal {
        padding: 1.5rem;
        max-height: 90vh;
    }
    .modal .detail-item .label {
        width: 100px;
    }
}