* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4cc9f0;
    --warning: #f9c74f;
    --danger: #f94144;
    --psychical: #7209b7;
    --physical: #f3722c;
    --sidebar-width: 250px;
    --header-height: 70px;
}

body {
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    color: var(--dark);
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

.logo-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
    background: rgba(67, 97, 238, 0.2);
    border-left: 4px solid var(--primary);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: white;
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    color: #6c757d;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Content Area */
.content {
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex; /* MENGUBAH KARTU MENJADI FLEXBOX */
    align-items: center; /* MENYEJAJARKAN IKON DAN TEKS */
    gap: 15px; /* MEMBERI JARAK ANTARA IKON DAN TEKS */
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card i {
    font-size: 2.5rem;
    margin-bottom: 0; /* MENGHAPUS MARGIN BAWAH DARI IKON */
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 5px; /* MENGURANGI JARAK BAWAH JUDUL */
    color: var(--dark);
    text-align: left; /* MEMBUAT TEKS RATA KIRI */
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-align: left; /* MEMBUAT TEKS RATA KIRI */
}

.card-warning i {
    color: var(--warning);
}

.card-primary i {
    color: var(--primary);
}

.card-success i {
    color: var(--success);
}

.card-danger i {
    color: var(--danger);
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.form-header {
    margin-bottom: 20px;
}

.form-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
}

.form-description {
    color: #6c757d;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* Table & List Styles */
.complaint-list {
    margin-top: 30px;
}

.complaint-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center; /* DIUBAH MENJADI CENTER */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.complaint-info h3 {
    margin-bottom: 5px;
    color: var(--dark);
}

.complaint-info p {
    color: #6c757d;
}

.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-process {
    background: #cce5ff;
    color: #004085;
}

.status-resolved {
    background: #d4edda;
    color: #155724;
}

/* CSS untuk link item pengaduan */
.complaint-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 15px;
}

.complaint-item-link .complaint-item {
    margin-bottom: 0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.complaint-item-link:hover .complaint-item {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}


/* -- KODE BARU DAN PERBAIKAN -- */

/* Style untuk label urgensi */
.urgency {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.urgency-low {
    background: #cce5ff; /* Biru muda */
    color: #004085;
}

.urgency-medium {
    background: #fff3cd; /* Kuning */
    color: #856404;
}

.urgency-high {
    background: #f8d7da; /* Merah muda */
    color: #721c24;
}

/* Penyesuaian untuk complaint item */
.status-indicators {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px; /* Memberi jarak antara label urgensi dan status */
}


/* -- KODE LAMA YANG TIDAK DIPERLUKAN LAGI TAPI DISIMPAN UNTUK REFERENSI -- */

/* Page Styles */
.page {
    display: none;
    min-height: calc(100vh - var(--header-height));
}

.page.active {
    display: block;
}

/* Logout Modal Styles */
.logout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.logout-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.logout-modal-header {
    margin-bottom: 20px;
}

.logout-modal-header i {
    font-size: 3rem;
    color: var(--warning);
    margin-bottom: 15px;
}

.logout-modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }
    
    .logo-text, .menu-text {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding: 0;
    }
    
    .menu-item {
        justify-content: center;
        padding: 15px;
    }
    
    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        padding: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 0 15px;
    }
    
    .content {
        padding: 15px;
    }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 2000;
        background: var(--primary);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    .sidebar.active {
        width: var(--sidebar-width);
    }
    
    .sidebar.active .logo-text,
    .sidebar.active .menu-text {
        display: block;
    }
    
    .sidebar.active .menu-item {
        justify-content: flex-start;
    }

    .logout-modal-buttons {
        flex-direction: column;
    }
}
