:root {
    --primary-dark: #0B2D72;
    --primary-blue: #0992C2;
    --primary-cyan: #0AC4E0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 0;
}

header {
    background-color: var(--primary-dark);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hamburger Animation */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background-color: var(--primary-blue);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow-color);
    margin-bottom: 2rem;
}

h2 {
    color: var(--primary-dark);
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.metrics {
    display: flex;
    justify-content: space-around;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.metric-card {
    background-color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    min-width: 250px;
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-card .icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.metric-card p {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    color: var(--primary-blue);
}

.chart-section {
    display: flex;
    flex-direction: column;
}

.chart-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.chart-item {
    flex-basis: calc(50% - 1rem);
    min-width: 400px;
    height: 300px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.5rem;
    background-color: white;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
}

th:first-child {
    border-top-left-radius: 12px;
}

th:last-child {
    border-top-right-radius: 12px;
    border-right: none;
}

td:last-child {
    border-right: none;
}

tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

th {
    background-color: var(--primary-dark);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background-color: #fafbfc;
}

tr:hover {
    background-color: #f1f4f8;
    transition: background-color 0.2s ease;
}

.income {
    color: #2e7d32;
    font-weight: 600;
}

.expense {
    color: #d32f2f;
    font-weight: 600;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.action-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: var(--primary-blue);
    color: white;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: var(--primary-dark);
}

.action-btn i {
    margin-right: 8px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Login Page Styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #ecf0f1;
}

.login-box {
    background-color: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-color);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-cyan);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-box button:hover {
    background-color: var(--primary-blue);
}

.login-info {
    font-size: 0.9rem;
    color: #777;
    margin-top: 1.5rem;
}

.login-btn {
    background: var(--primary-cyan);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.login-btn:hover {
    background: var(--primary-blue);
}


/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        width: 100%;
        padding: 0;
    }

    header h1 {
        font-size: 1.3rem;
        /* Slightly smaller for better fit */
        flex: 1;
        text-align: left;
    }

    .menu-toggle {
        display: flex;
        z-index: 100;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        text-align: center;
        margin-top: 1rem;
        background-color: var(--primary-dark);
        /* Match header */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease-in-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    nav a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: auto;
        margin: 0;
        border-radius: 0;
    }

    nav a:last-child {
        border-bottom: none;
    }

    nav a:hover {
        background-color: var(--primary-blue);
        transform: translateX(5px);
    }

    .chart-container {
        flex-direction: column;
    }

    .chart-item {
        min-width: 100%;
        height: auto;
        /* Let height adjust */
        aspect-ratio: 16/9;
        /* Maintain aspect ratio */
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }

    .action-btn {
        width: 100%;
        /* Full width buttons on mobile */
        justify-content: center;
    }

    main {
        padding: 0 0.5rem;
        /* Reduces padding on small screens */
    }

    section {
        padding: 1rem;
        /* Reduces padding inside sections */
    }

    .metrics {
        gap: 1rem;
    }

    .metric-card {
        min-width: 100%;
        /* Stack cards on mobile */
    }
}

/* Table Responsiveness */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

table {
    min-width: 600px;
    /* Ensure table doesn't squish too much, triggers scroll */
}

/* Logo Styling */
.main-logo {
    height: 45px;
    width: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.1);
}

/* Floating WhatsApp Button Container */
.whatsapp-sticky-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.whatsapp-sticky {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white !important;
    border-radius: 50%;
    text-align: center;
    font-size: 35px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
    cursor: pointer;
    border: none;
}

.whatsapp-sticky:hover {
    background-color: #128c7e;
    transform: scale(1.1);
}

/* WhatsApp Menu */
.wa-menu {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 200px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.wa-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wa-menu-header {
    background: #25d366;
    color: white;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.wa-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.wa-menu-item:last-child {
    border-bottom: none;
}

.wa-menu-item:hover {
    background: #f9f9f9;
    color: #25d366;
}

.wa-menu-item i {
    font-size: 18px;
    color: #25d366;
}

.wa-menu-item span {
    font-size: 14px;
    font-weight: 500;
}

@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (max-width: 768px) {
    .whatsapp-sticky-container {
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-sticky {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }
    .wa-menu {
        bottom: 65px;
        width: 180px;
    }
}