:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    color: white;
    position: fixed;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar h2 {
    font-size: 1.5rem;
    text-align: center;
    color: #ecf0f1;
    margin: 0;
    flex: 1;
}

.close-sidebar {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: #bdc3c7;
    line-height: 1;
}

.sidebar nav a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: block;
    transition: all 0.3s ease;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: var(--secondary-color);
    color: white;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 2rem;
}

.header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header .actions {
    display: flex;
    gap: 0.5rem;
}

.header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Cards & Forms */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background: var(--accent-color); color: white; }
.btn-primary:hover { background: #2980b9; }

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: #219150; }

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.pending-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .pending-filter-grid {
        grid-template-columns: 1fr;
    }
}

.add-month-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .add-month-container {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Receipt Premium Style */
.receipt-wrapper {
    background-color: #f0f2f5;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.premium-receipt {
    width: 380px; /* Reduced width */
    background-color: #f7f3e9; /* Light beige */
    position: relative;
    padding: 2.5rem 1.5rem; /* Reduced padding */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: 'Outfit', 'Inter', sans-serif;
    text-align: center;
}

/* Corner Decorations */
.premium-receipt::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 120px;
    height: 120px;
    background-color: #2c7a7b; /* Dark Teal */
    border-radius: 50%;
    z-index: 0;
}

.premium-receipt::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background-color: #f6ad55; /* Light Orange/Yellow */
    border-radius: 50%;
    z-index: 0;
}

.corner-bottom {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background-color: #dd6b20; /* Darker Orange */
    border-radius: 50%;
    z-index: 0;
}

.receipt-content {
    position: relative;
    z-index: 1;
}

.masjid-logo {
    margin-bottom: 1.5rem;
    color: #1a9494;
}

.masjid-logo svg {
    width: 60px; /* Reduced from 100px */
    height: auto;
}

.masjid-name {
    color: #483d8b;
    font-size: 1.5rem; /* Reduced from 1.8rem */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.receipt-divider {
    border-top: 2px solid #ed8936;
    border-bottom: 2px solid #ed8936;
    margin: 1.5rem 0;
    padding: 0.8rem 0;
}

.receipt-date-time {
    color: #ed8936;
    font-weight: 700;
    font-size: 0.9rem; /* Reduced from 1.1rem */
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.member-name {
    color: #1a9494;
    font-size: 1.3rem; /* Reduced from 1.6rem */
    font-weight: 700;
    margin-top: 1rem;
    text-transform: uppercase;
}

.receipt-amount {
    color: #e67e22; /* Pure Orange */
    font-size: 3.8rem; /* Reduced from 4.5rem */
    font-weight: 800;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.receipt-amount .currency {
    font-size: 2rem; /* Reduced from 2.5rem */
    margin-right: 5px;
}

.receipt-footer-new {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    border-top: 2px solid #ed8936;
    padding-top: 1.5rem;
}

.signature-block {
    flex: 1;
    text-align: center;
}

.signature-name {
    color: #1a9494;
    font-weight: 700;
    font-size: 0.75rem; /* Reduced from 0.85rem */
    text-transform: uppercase;
    margin-bottom: 2px;
}

.signature-role {
    color: #1a9494;
    font-size: 0.65rem; /* Reduced from 0.75rem */
    font-weight: 600;
    text-transform: uppercase;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* Media Queries */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        left: -100%;
        transition: left 0.3s ease;
        z-index: 1000;
        width: 80%;
        max-width: 300px;
    }

    .sidebar.active {
        left: 0;
    }

    .close-sidebar {
        display: block;
    }

    .mobile-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-top: 4rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header .actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .premium-receipt {
        width: 100%;
        max-width: 340px; /* Force a smaller width on mobile */
        margin: 0 auto;
        padding: 2rem 1rem;
    }

    .receipt-amount {
        font-size: 3.2rem;
    }

    .receipt-amount .currency {
        font-size: 1.8rem;
    }

    .masjid-name {
        font-size: 1.3rem;
    }

    .receipt-date-time {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .receipt-footer-new {
        flex-direction: row; /* Keep in one line */
        gap: 0.5rem;
    }

    .signature-block {
        margin-bottom: 0;
    }

    .signature-name {
        font-size: 0.65rem;
    }

    .signature-role {
        font-size: 0.55rem;
    }
}

@media print {
    .sidebar, .btn, .header, .back-btn, .mobile-toggle { display: none !important; }
    .main-content { margin: 0; width: 100%; padding: 0; }
    .receipt-wrapper { background: white; padding: 0; }
    .premium-receipt { 
        box-shadow: none; 
        border: 1px solid #eee;
        width: 100%;
        max-width: 100%;
        height: auto;
    }
}
