body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header Styles (unchanged from previous) --- */
.main-header {
    background-color: #007bff;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    margin: 0;
    font-size: 1.8em;
    display: flex;
    align-items: center;
}

.main-header h1 i {
    margin-right: 10px;
}

.main-header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.main-header nav ul li {
    margin-left: 25px;
}

.main-header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-header nav ul li a:hover {
    color: #e2e6ea;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-header-signup {
    background-color: #28a745;
    color: #fff;
    margin-left: 15px;
}

.btn-header-signup:hover {
    background-color: #218838;
}

/* --- Page Hero Section (unchanged) --- */
.page-hero {
    background-color: #e9ecef;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 30px;
}

.page-hero h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.page-hero p {
    font-size: 1.1em;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* --- Content Section (unchanged) --- */
.content-section {
    padding: 40px 0;
}

/* --- Form Styles (unchanged) --- */
.signup-container {
    max-width: 500px;
    margin: 50px auto;
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.signup-header h1 {
    font-size: 2em;
    color: #007bff;
    margin-bottom: 10px;
}

.signup-header p {
    color: #666;
    margin-bottom: 30px;
}

.signup-form .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.signup-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.signup-form input[type="text"],
.signup-form input[type="email"],
.signup-form input[type="tel"],
.signup-form input[type="password"],
.signup-form textarea {
    width: calc(100% - 20px);
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

.signup-form textarea {
    resize: vertical;
}

.form-terms {
    text-align: left;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #555;
    display: flex;
    align-items: center;
}

.form-terms input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.form-terms a {
    color: #007bff;
    text-decoration: none;
}

.btn-signup {
    background-color: #28a745;
    color: #fff;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}

.btn-signup:hover {
    background-color: #218838;
}

.signup-footer {
    margin-top: 30px;
    font-size: 0.9em;
    color: #666;
}

.signup-footer a {
    color: #007bff;
    text-decoration: none;
}

.back-home {
    margin-top: 20px;
}
.back-home a {
    display: inline-flex;
    align-items: center;
}
.back-home a i {
    margin-right: 8px;
}


/* --- Dashboard Specific Styles (NEW or MODIFIED) --- */
.internal-header {
    background-color: #0056b3; /* Slightly darker blue for internal header */
}

.internal-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    margin-right: 15px;
    cursor: pointer;
    display: none; /* Hidden by default, show on smaller screens */
}

.internal-nav ul {
    display: flex;
    align-items: center;
}

.internal-nav ul li {
    margin-left: 20px;
}

.internal-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.profile-link {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}

.profile-pic {
    border-radius: 50%;
    margin-right: 8px;
    width: 30px;
    height: 30px;
    object-fit: cover;
    border: 2px solid #fff;
}

.internal-nav .dropdown {
    position: relative;
}

.internal-nav .dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0;
    top: 100%;
    border-radius: 5px;
    overflow: hidden;
}

.internal-nav .dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    white-space: nowrap;
    font-weight: normal;
}

.internal-nav .dropdown-content a:hover {
    background-color: #ddd;
}

.internal-nav .dropdown:hover .dropdown-content {
    display: block;
}

.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 70px); /* Adjust based on header height */
}

.sidebar {
    width: 250px;
    background-color: #343a40; /* Dark sidebar */
    padding-top: 30px;
    color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: width 0.3s ease; /* For toggle functionality */
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #adb5bd; /* Light gray text */
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar nav ul li a i {
    margin-right: 10px;
    font-size: 1.2em;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li.active a {
    background-color: #495057; /* Darker gray on hover/active */
    color: #fff;
}

.dashboard-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #f0f2f5; /* Lighter background for content */
    transition: margin-left 0.3s ease; /* For sidebar toggle */
}

/* Dashboard Summary Cards */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.summary-card h3 {
    font-size: 1.1em;
    color: #666;
    margin-top: 0;
    margin-bottom: 10px;
}

.summary-card .amount {
    font-size: 2.2em;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0;
}

.summary-card i {
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 4em;
    color: rgba(0, 123, 255, 0.1); /* Light transparent icon */
}

/* Colors for specific summary cards (can be customized) */
.summary-card:nth-child(1) .amount, .summary-card:nth-child(1) i { color: #28a745; opacity: 0.8; } /* Income */
.summary-card:nth-child(1) i { color: rgba(40, 167, 69, 0.1); }
.summary-card:nth-child(2) .amount, .summary-card:nth-child(2) i { color: #dc3545; opacity: 0.8; } /* Expenses */
.summary-card:nth-child(2) i { color: rgba(220, 53, 69, 0.1); }
.summary-card:nth-child(3) .amount, .summary-card:nth-child(3) i { color: #ffc107; opacity: 0.8; } /* Profit */
.summary-card:nth-child(3) i { color: rgba(255, 193, 7, 0.1); }
.summary-card:nth-child(4) .amount.overdue-amount { color: #fd7e14; } /* Overdue Debts - Orange */
.summary-card:nth-child(4) i { color: rgba(253, 126, 20, 0.1); }


/* Account Balances Section (NEW) */
.account-balances-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.account-balances-section h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.account-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-content: center;
}

.account-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease-in-out;
}

.account-card:hover {
    transform: translateY(-5px);
}

.account-card .account-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 50%; /* If logos are square, make them circular */
    border: 1px solid #dee2e6;
    padding: 5px;
    background-color: #fff;
}

.account-card h3 {
    font-size: 1.2em;
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
}

.account-card .balance-amount {
    font-size: 1.8em;
    font-weight: 700;
    color: #007bff; /* Default blue for balances */
}

/* Specific colors for each account type (optional) */
.account-card.zaad .balance-amount { color: #28a745; } /* Green */
.account-card.edahab .balance-amount { color: #6f42c1; } /* Purple */
.account-card.darasalam .balance-amount { color: #17a2b8; } /* Teal */
.account-card.dahabshiil .balance-amount { color: #fd7e14; } /* Orange */


/* Chart Grid */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 400px; /* Fixed height for charts */
    display: flex;
    flex-direction: column;
}

.chart-card.full-width {
    grid-column: 1 / -1; /* Spans across all columns */
}

.chart-card h3 {
    font-size: 1.3em;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.chart-card canvas {
    flex-grow: 1; /* Allow canvas to fill available space */
    max-height: calc(100% - 50px); /* Adjust based on heading height */
}

/* Overdue Debts Section (NEW) */
.overdue-debts-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.overdue-debts-section h2 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Table Styles (reused from top expenses, with added status colors) */
.table-responsive {
    overflow-x: auto; /* Enables horizontal scroll on small screens */
}

.overdue-debts-section table,
.top-expenses-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.overdue-debts-section th,
.overdue-debts-section td,
.top-expenses-section th,
.top-expenses-section td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.overdue-debts-section th,
.top-expenses-section th {
    background-color: #f2f2f2;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.9em;
}

.overdue-debts-section tbody tr:last-child td,
.top-expenses-section tbody tr:last-child td {
    border-bottom: none;
}

.overdue-debts-section tbody tr:hover,
.top-expenses-section tbody tr:hover {
    background-color: #f5f5f5;
}

/* Table Status Colors */
.status-paid {
    color: #28a745; /* Green */
    font-weight: 600;
}
.status-pending {
    color: #ffc107; /* Yellow */
    font-weight: 600;
}
.status-overdue {
    color: #dc3545; /* Red */
    font-weight: 600;
}


/* Media Queries for Responsiveness (Important for Dashboard) */
@media (max-width: 992px) {
    .dashboard-summary,
    .dashboard-charts-grid,
    .account-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjust for medium screens */
    }

    .sidebar {
        width: 70px; /* Collapse sidebar */
    }

    .sidebar nav ul li a {
        justify-content: center;
    }

    .sidebar nav ul li a span {
        display: none; /* Hide text on collapsed sidebar */
    }
    .sidebar nav ul li a i {
        margin-right: 0;
    }

    .dashboard-content {
        margin-left: 70px; /* Shift content */
    }

    .menu-toggle {
        display: block; /* Show toggle button */
    }

    /* Adjust sidebar when active (toggled) */
    .sidebar.active {
        width: 250px;
    }
    .sidebar.active nav ul li a span {
        display: inline;
    }
    .sidebar.active nav ul li a i {
        margin-right: 10px;
    }
    .dashboard-content.shifted {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-header nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
    }
    .main-header nav ul li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
    .main-header nav ul li a {
        padding: 8px 0;
    }

    .page-hero {
        padding: 40px 0;
    }
    .page-hero h2 {
        font-size: 2em;
    }

    .signup-container {
        margin: 20px auto;
        padding: 25px;
    }

    .dashboard-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%; /* Full width for sidebar on small screens */
        padding-top: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .sidebar nav ul {
        display: flex;
        flex-wrap: wrap; /* Allow items to wrap */
        justify-content: center;
    }
    .sidebar nav ul li {
        margin: 5px 10px; /* Smaller margins for horizontal layout */
    }
    .sidebar nav ul li a {
        padding: 10px 15px;
    }
    .sidebar nav ul li a span {
        display: inline; /* Always show text on small screens */
    }
    .sidebar nav ul li a i {
        margin-right: 5px; /* Adjust icon margin */
    }
    .dashboard-content {
        margin-left: 0; /* No margin when sidebar is full width */
        padding: 20px;
    }

    .dashboard-summary,
    .dashboard-charts-grid,
    .account-cards-grid {
        grid-template-columns: 1fr; /* Single column layout for small screens */
    }
}

/* Extra small screens (mobile landscape) */
@media (max-width: 576px) {
    .summary-card .amount {
        font-size: 1.8em;
    }
    .summary-card h3 {
        font-size: 1em;
    }
    .chart-card {
        height: 300px; /* Make charts slightly shorter on smaller phones */
    }
}