Body {
    font-family: 'Roboto', sans-serif;
    background: #f5f5f5;
    padding: 20px;
    margin: 0;
    box-sizing: border-box;
}



.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 75%;
    max-width: 350px;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    overflow-y: auto;
}

.popup-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.popup-form input[type="number"],
.popup-form input[type="password"],
.popup-form input[type="text"],
.popup-form input[type="email"] {
    width: calc(100% - 40px);
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8em;
}

.remember-me {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    padding-left: 20px;
    box-sizing: border-box;
}

.remember-me input[type="checkbox"] {
    margin-right: 8px;
}

.remember-me label {
    font-size: 0.8em;
    color: #555;
}

.button-container {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 10px; /* Space between buttons */
    margin-top: 10px;
    padding: 0 20px;
    box-sizing: border-box;
}

.button-container button {
    width: calc(50% - 5px); /* 50% width minus half the gap */
    padding: 12px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s ease;
}

.button-container button.login-btn {
    background-color: #007bff;
    color: white;
}

.button-container button.login-btn:hover {
    background-color: #0056b3;
}

.button-container button.forget-btn,
.button-container button.close-btn {
    background-color: #6c757d;
    color: white;
}

.button-container button.forget-btn:hover,
.button-container button.close-btn:hover {
    background-color: #5a6268;
}

.button-container button.create-btn,
.button-container button.register-submit-btn {
    background-color: #28a745;
    color: white;
}

.button-container button.create-btn:hover,
.button-container button.register-submit-btn:hover {
    background-color: #218838;
}

.registration-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
}

.registration-link a {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
}

.registration-link a:hover {
    text-decoration: underline;
}

/* Page content styling (initially hidden) */
#mainContent {
    display: none;
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
    color: #333;
}




        






/* main container top button page start*/
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.top-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.top-buttons button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.filter-btn {
    background: #009688;
} /* Changed from home-btn */
.filter-btn:hover {
    background: #007a6a;
}

.create-btn {
    background: #4caf50;
} /* Changed class from add-new-btn */
.create-btn:hover {
    background: #388e3c;
}

.download-btn {
    background: #007bff;
}

.download-btn:hover {
    background: #0056b3;
}

/* Filter Modal Styles */
.filter-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.filter-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%; /* Could be adjusted */
    max-width: 400px; /* Max width for the modal */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: animatetop 0.4s;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Adjusted styles for centering */
    align-items: center; /* Center items horizontally within the modal content */
    text-align: center; /* Center text within the modal content */
}

@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }
    to {
        top: 0;
        opacity: 1
    }
}

.filter-modal-content h3 {
    margin-top: 0;
    color: #333;
    width: 100%; /* Ensure heading takes full width for centering */
}

.filter-modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    width: 100%; /* Ensure label takes full width for alignment */
    text-align: center; /* Align label text to the left */
}

.filter-modal-content select,
.filter-modal-content input[type="date"] {
    width: 100%; /* Increased width for better centering and spacing */
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.filter-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center; /* Center the buttons */
    width: 100%; /* Ensure buttons container takes full width */
}

.filter-modal-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    flex: 1; /* Make buttons take equal width within their container */
}

.filter-modal-buttons .close-btn {
    background: #ccc;
    color: #333;
}

.filter-modal-buttons .close-btn:hover {
    background: #bbb;
}

.filter-modal-buttons .apply-filter-btn {
    background: #009688;
    color: white;
}

.filter-modal-buttons .apply-filter-btn:hover {
    background: #007a6a;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    align-items: flex-end;
}

.filter-section > div {
    flex: 1 1 calc(33.33% - 10px);
    min-width: 100px;
}

.filter-section button {
    flex: 1 1 calc(33.33% - 10px);
    max-width: 100px;
    padding: 8px 15px;
    background: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.filter-section button:hover {
    background: #555;
}

.filter-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.filter-section select,
.filter-section input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Summary Panel Styles */
.summary-panel-container {
    display: flex;
    justify-content: flex-end; /* Align to the right */
    margin-top: 20px; /* Gap from apply filter button */
    margin-bottom: 10px; /* Gap from table */
    padding-right: 0; /* No right padding from overall body */
}

.summary-panel {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 30%; /* 30% of its parent container */
    max-width: 300px; /* Optional: set a max-width if desired */
    box-sizing: border-box;
}

.summary-item {
    display: flex;
    column-gap: 10px; /* Adjust this value as needed */
    margin-bottom: 5px;
    font-size: 14px;
    position: relative; /* For the pseudo-element colon */
}

.summary-item .title {
    font-weight: bold;
    color: #555;
    flex-grow: 1; /* Allows title to take up remaining space on the left */
    text-align: left;
}

.summary-item .amount {
    font-weight: bold;
    color: #333;
    text-align: right;
    flex-shrink: 0; /* Prevent it from shrinking */
    max-width: 80px; /* Adjust as needed */
}

.summary-item::after {
    content: ":";
    display: block;
    position: absolute;
    left: 60%; /* Adjust this percentage to shift the colon's column */
    transform: translateX(-50%); /* Centers the colon horizontally based on its own width */
    color: #555;
    font-weight: bold;
}

.summary-item.profit .amount {
    color: #4CAF50; /* Green for profit */
}

.summary-item.loss .amount {
    color: #E53935; /* Red for loss */
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    border: 1px solid #e0e0e0;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

th {
    background: #f0f0f0;
    font-weight: bold;
    color: #333;
}

.action-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    font-size: 12px;
}

.action-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.no-data-message {
    text-align: center;
    padding: 20px;
}

/* Download Modal specific styles */
.download-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1001; /* Higher than filter modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.download-modal-content {
    background-color: #fefefe;
    margin: 20px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 70%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.download-modal-content h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.download-modal-content .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.download-modal-content .form-group label {
    font-weight: bold;
    color: #555;
}

.download-modal-content .form-group select,
.download-modal-content .form-group input[type="date"],
.download-modal-content .form-group input[type="number"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}

.download-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

.download-modal-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
}

.download-modal-buttons .close-btn {
    background: #e53935;
    color: white;
}

.download-modal-buttons .export-btn {
    background: #4CAF50;
    color: white;
}

.download-date-range-inputs,
.page-orientation-select,
.page-weight-input {
    display: none; /* Hidden by default */
}

/* Create Modal Styles */
.create-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1002; /* Higher than other modals */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.create-modal-content {
    background-color: #fefefe;
    margin: 20px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 70%; /* As requested */
    max-width: 500px; /* Optional: limit max width */
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.create-modal-content h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.create-modal-content .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.create-modal-content .form-group label {
    font-weight: bold;
    color: #555;
}

.create-modal-content .form-group input[type="text"],
.create-modal-content .form-group input[type="number"],
.create-modal-content .form-group input[type="date"],
.create-modal-content .form-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.create-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

.create-modal-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    flex: 1; /* 50% each */
}

.create-modal-buttons .close-btn {
    background: #e53935;
    color: white;
}

.create-modal-buttons .submit-btn {
    background: #4CAF50;
    color: white;
}

.create-modal-buttons .submit-btn:disabled {
    background: #a5d6a7;
    cursor: not-allowed;
}

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

    .top-buttons,
    .filter-section {
        flex: 1 1 100%;
        min-width: unset;
        flex-direction: row;
        gap: 10px;
    }

    .filter-section > div {
        flex: 1 1 30%;
        min-width: unset;
    }

    .filter-section button {
        width: 18%;
    }

    .summary-panel-container {
        justify-content: center; /* Center on smaller screens */
        padding-right: 0;
    }

    .summary-panel {
        width: 90%; /* Larger width on smaller screens */
        max-width: unset; /* Remove max-width on smaller screens */
    }

    /* Adjust colon position for smaller screens if needed */
    .summary-item::after {
        left: 55%; /* Example adjustment for smaller screens */
    }

    .create-modal-content {
        width: 70%; /* Adjust for smaller screens */
    }
}
