:root {
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --secondary-color: #0284c7;
    --accent-gold: #d97706;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

html, body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Page Layout */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #115e59 100%);
}

.top-row {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-end;
    height: 3.8rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.content {
    padding: 1.5rem 1.8rem;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

/* Hero / Cash In Hand Banner */
.hero-cash-card {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 1.8rem 2rem;
    box-shadow: 0 10px 25px -5px rgba(15, 118, 110, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-cash-card::after {
    content: "";
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}

.hero-amount {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

/* Summary Metric Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Status Badges */
.badge-status-paid {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-weight: 600;
}

.badge-status-pending {
    background-color: #ffe4e6;
    color: #9f1239;
    border: 1px solid #fecdd3;
    font-weight: 600;
}

.badge-status-partial {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 600;
}

.badge-status-advance {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-weight: 600;
}

.badge-status-na {
    background-color: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

/* 12-Month Matrix Table */
.matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.matrix-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.matrix-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
}

.matrix-cell-btn {
    border: none;
    background: transparent;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    width: 100%;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
}

.matrix-cell-btn:hover {
    filter: brightness(0.93);
    transform: scale(1.03);
}

/* Custom Modals */
.modal-backdrop-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content-custom {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    border: none;
}

.modal-header-custom {
    padding: 1.3rem 1.6rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body-custom {
    padding: 1.6rem;
}

.modal-footer-custom {
    padding: 1.2rem 1.6rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Buttons & Custom Controls */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.2rem;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    border-radius: 10px;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.btn-whatsapp {
    background-color: #25D366;
    color: #ffffff;
    font-weight: 600;
    border-radius: 10px;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    color: #ffffff;
}

/* Receipt Print Slip */
.receipt-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    background-color: #ffffff;
    max-width: 480px;
    margin: 0 auto;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    .hero-amount {
        font-size: 2.2rem;
    }
    .matrix-table {
        display: block;
        overflow-x: auto;
    }
}

