/* Pengurus Bayaran — gaya
   Berdasarkan "Payment Manager" daripada personal-efficiency-machine (Farid Rameli). MIT. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0e5c46 0%, #0a4a37 55%, #07382a 100%);
    min-height: 100vh;
    padding: 15px 10px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #0e5c46 0%, #07382a 100%);
    color: white;
    padding: 15px;
    text-align: center;
    border-bottom: 3px solid #d4af37;
}

.header h1 {
    font-size: 1.4em;
    margin-bottom: 0;
}

.header .subtitle {
    font-size: 0.85em;
    opacity: 0.9;
    margin-top: 4px;
}

.header .hijri-today {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.8em;
    letter-spacing: 0.2px;
}

.header .hijri-today[hidden] {
    display: none;
}

.controls {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.month-selector {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
}

.month-selector select {
    padding: 6px 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid #ffc107;
    outline-offset: 1px;
}

.btn-primary {
    background: #0e5c46;
    color: white;
}

.btn-primary:hover {
    background: #0a4a37;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    font-size: 0.75em;
}

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

.btn-edit {
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    font-size: 0.75em;
}

.btn-edit:hover {
    background: #e0a800;
}

.summary {
    padding: 15px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 2px solid #e9ecef;
}

.summary-item {
    text-align: center;
}

.summary-label {
    color: #6c757d;
    font-size: 0.75em;
    margin-bottom: 3px;
}

.summary-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #495057;
}

.summary-value.total {
    color: #0e5c46;
}

.filter-sort-controls {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row + .filter-row {
    margin-top: 10px;
}

.filter-row label {
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
}

.filter-row .label-spaced {
    margin-left: 10px;
}

.hijri-note {
    margin-top: 8px;
    font-size: 0.75em;
    color: #6c757d;
    line-height: 1.4;
}

.filter-row select {
    padding: 6px 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
}

.payments-list {
    padding: 15px;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #d4af37;
    transition: transform 0.2s, box-shadow 0.2s;
}

.payment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-info {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.payment-title {
    font-size: 1em;
    font-weight: 600;
    color: #212529;
    margin-bottom: 3px;
    overflow-wrap: anywhere;
}

.payment-date {
    color: #6c757d;
    font-size: 0.8em;
}

.payment-amount {
    font-size: 1.2em;
    font-weight: bold;
    color: #0e5c46;
    margin: 0 10px;
    white-space: nowrap;
}

.payment-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
    margin-right: 10px;
    white-space: nowrap;
}

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

.status-unpaid {
    background: #f8d7da;
    color: #721c24;
}

.payment-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 600;
    margin-right: 8px;
    white-space: nowrap;
}

.type-monthly {
    background: #e7f3ff;
    color: #0066cc;
}

.type-extra {
    background: #fff4e6;
    color: #cc6600;
}

.payment-actions {
    display: flex;
    gap: 4px;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    padding: 24px 12px;
    font-size: 0.9em;
    line-height: 1.6;
}

.footer {
    text-align: center;
    color: #6c757d;
    font-size: 0.75em;
    padding: 12px 15px 16px;
    border-top: 1px solid #e9ecef;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 15px;
}

.modal-header h2 {
    color: #212529;
    font-size: 1.3em;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 600;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0e5c46;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 15px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
}

.zakat-section {
    background: #f3faf6;
    border-bottom: 2px solid #e9ecef;
}

.zakat-header {
    padding: 12px 15px;
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.zakat-header:hover {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
}

.zakat-header h2 {
    font-size: 1.1em;
    margin: 0;
}

.zakat-toggle {
    font-size: 1.2em;
    transition: transform 0.3s;
}

.zakat-toggle.open {
    transform: rotate(180deg);
}

.zakat-content {
    padding: 15px;
    display: none;
}

.zakat-content.active {
    display: block;
}

.zakat-explainer {
    background: #e0f2fe;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #0d9488;
}

.zakat-explainer p {
    color: #0c4a6e;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0;
}

.zakat-calculator {
    margin-bottom: 15px;
}

.zakat-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background: white;
    border: 2px solid #0d9488;
}

.zakat-status {
    font-size: 0.95em;
    margin-bottom: 10px;
    color: #0c4a6e;
}

.zakat-amount {
    font-size: 1.5em;
    font-weight: bold;
    color: #0d9488;
}

.zakat-info {
    background: #fef3c7;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.zakat-info small {
    color: #78350f;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .month-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .summary {
        flex-direction: column;
        gap: 10px;
    }

    .summary-item {
        width: 100%;
    }

    .payment-item {
        flex-wrap: wrap;
        gap: 6px;
    }

    .payment-info {
        width: 100%;
        flex-basis: 100%;
    }

    .payment-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Halaman privasi */

.legal-page {
    padding: 24px 20px 8px;
    line-height: 1.75;
    color: #333;
}

.legal-back {
    display: inline-block;
    color: #0e5c46;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
}

.legal-back:hover {
    text-decoration: underline;
}

.legal-updated {
    color: #6c757d;
    font-size: 0.85em;
    margin: 6px 0 18px;
}

.legal-highlight {
    background: #f2f7f4;
    border-left: 4px solid #0e5c46;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
}

.legal-page h2 {
    color: #07382a;
    font-size: 1.1em;
    margin: 24px 0 8px;
}

.legal-page p {
    margin-bottom: 12px;
}

.legal-page ul {
    margin: 0 0 12px;
    padding-left: 22px;
}

.legal-page li {
    margin-bottom: 6px;
}

.legal-page a {
    color: #0e5c46;
    overflow-wrap: anywhere;
}

.legal-page code {
    background: #eef2f0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.9em;
}

.legal-back-bottom {
    margin-top: 28px;
}

.footer a {
    color: #0e5c46;
}
