/* Reset dan base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: var(--dark);
    line-height: 1.6;
    padding-bottom: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header styles */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav a, nav span {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Main content */
main {
    margin-top: 2rem;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Card styles */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.card h2 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    font-weight: 600;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success);
}

.btn-success:hover {
    background-color: #05c290;
}

.btn-danger {
    background-color: var(--danger);
}

.btn-danger:hover {
    background-color: #e5365f;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--dark);
}

.btn-warning:hover {
    background-color: #ffc747;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: var(--light);
    font-weight: 600;
    color: var(--dark);
}

tr:hover {
    background-color: #f8f9fa;
}

/* Alert styles */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-lunas {
    background-color: #d4edda;
    color: #155724;
}

.status-tunggak {
    background-color: #f8d7da;
    color: #721c24;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* Dashboard summary */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.report-card h3 {
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-card .amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

/* Filter form */
.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

/* Search box */
.search-box {
    padding: 0.8rem 1rem;
    width: 100%;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

/* Checkbox group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    background: white;
}

.checkbox-item input {
    margin-right: 0.5rem;
}

/* Profile */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-info {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.profile-info p {
    margin-bottom: 0.5rem;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 1rem;
        top: 1rem;
    }
    
    nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        margin-top: 1rem;
    }
    
    nav.active {
        display: flex;
    }
    
    nav a, nav span {
        display: block;
        width: 100%;
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .report-summary {
        grid-template-columns: 1fr;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        margin: 1.5rem auto;
        padding: 1.5rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .report-card {
    animation: fadeIn 0.5s ease;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }

/* Icon styles */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.icon-user { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234361ee"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>'); }
.icon-report { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234361ee"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"/></svg>'); }
.icon-cash { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234361ee"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm-8 4c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3zm6 10H6v-1.23c0-1.79 4-2.77 6-2.77s6 .98 6 2.77V18z"/></svg>'); }


/* Grid layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Flex utilities */
.flex-wrap {
    flex-wrap: wrap;
}

/* Icon styles tambahan */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
}

/* Table improvements */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

.table-responsive table {
    margin-bottom: 0;
}

.table-responsive th,
.table-responsive td {
    white-space: nowrap;
}

/* Checkbox group improvements */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    background: white;
    transition: var(--transition);
}

.checkbox-item:hover {
    border-color: var(--primary);
    background-color: #f8f9ff;
}

.checkbox-item input {
    margin-right: 0.5rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gap-1 > * {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Style untuk organisasi selector */
.org-selector {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
}

.org-selector select {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
    background: white;
    margin-right: 0.5rem;
}

.org-name {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-weight: bold;
}

/* Style untuk mobile */
@media (max-width: 768px) {
    .org-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .org-selector select {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Style untuk modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray);
}

.close:hover {
    color: var(--dark);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        width: 95%;
    }
}