/* General Body and Layout - Based on user's provided CSS */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Ensure no horizontal scroll on body */
    padding-bottom: 60px;
    position: relative;
}

.sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1001;
    top: 0;
    left: 0;
    background-color: #2c3e50;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}
.sidebar a {
    padding: 10px 15px 10px 25px;
    text-decoration: none;
    font-size: 18px;
    color: #ecf0f1;
    display: block;
    transition: 0.3s;
}
.sidebar a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}
.sidebar a:hover {
    background-color: #34495e;
    color: #ffffff;
    border-left: 5px solid #1abc9c;
    padding-left: 20px;
}
.sidebar .closebtn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 36px;
    margin-left: 50px;
    color: #ecf0f1;
}

#main {
    transition: margin-left .5s;
    padding: 0;
    width: 100%; /* Ensure main takes full width */
}

.header {
    background-color: #1abc9c;
    padding: 15px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header .openbtn {
    font-size: 24px;
    cursor: pointer;
    background-color: transparent;
    color: white;
    border: none;
    padding: 0 15px 0 0;
}
.header .header-title {
    font-size: 22px;
    font-weight: bold;
}
.header .header-actions i {
    margin-left: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #ecf0f1;
}

.page-content {
    padding: 20px 15px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
    overflow-x: hidden; /* Prevent horizontal scroll within page content */
}
.content-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; /* Ensure content section takes full width */
    max-width: 950px;
    margin: 0 auto;
    padding-bottom: 30px;
    box-sizing: border-box; /* Include padding in width */
    overflow-x: hidden; /* Prevent horizontal scroll within content section */
}

/* Date Navigation Styling - Styled to match date.jpeg */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the date navigation bar */
    margin-bottom: 20px;
    position: relative; /* Needed for absolute positioning of pickers */
    z-index: 10; /* Ensure pickers appear above other content */
    background-color: #fff; /* White background as in date.jpeg */
    padding: 8px 15px; /* Padding as in date.jpeg */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    width: fit-content; /* Make the container fit its content */
    margin-left: auto; /* Center the block element */
    margin-right: auto; /* Center the block element */
    box-sizing: border-box; /* Crucial for responsive padding */
}

.date-navigation select,
.date-navigation .month-year-display,
.date-navigation .date-picker-toggle {
    font-size: 1.1em;
    padding: 8px;
    margin: 0 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
    background-color: #fff;
}

.date-navigation select {
    padding: 7px 8px; /* Adjust padding slightly for select */
    border: 1px solid #ccc; /* Border for select */
    background-color: #fff; /* Background for select */
    border-radius: 5px;
}

.date-navigation .month-year-display {
     border: none; /* No border for display span */
     background-color: transparent; /* No background for display span */
     font-weight: bold;
     cursor: pointer; /* Make it clear it's clickable */
     padding: 8px; /* Keep padding consistent */
}

.date-navigation .date-picker-toggle {
     border: none; /* No border for icon */
     background-color: transparent; /* No background for icon */
     font-size: 1.2em;
     color: #007bff; /* Icon color */
     cursor: pointer;
     padding: 8px; /* Keep padding consistent */
}

/* Month and Date Picker Containers - Styled and positioned */
.month-picker-container,
.date-picker-container {
    position: absolute;
    top: 100%; /* Position below the date navigation bar */
    left: 50%; /* Center relative to the date-navigation container */
    transform: translateX(-50%); /* Adjust for centering */
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    padding: 10px;
    z-index: 1000; /* Ensure it's on top */
    display: none; /* Hidden by default */
    width: 280px; /* Increased width to accommodate 6 dates per row comfortably */
    max-width: 95%; /* Ensure it scales down on smaller screens */
    box-sizing: border-box; /* Include padding in width */
}

.month-grid,
.date-grid {
    display: grid;
    gap: 5px; /* Space between buttons */
}

.month-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 months per row */
}

/* Styling for date grid rows */
.date-grid-row {
    display: flex; /* Use flexbox for rows */
    gap: 5px; /* Space between date buttons in a row */
    justify-content: flex-start; /* Align left */
    flex-wrap: wrap; /* Allow items to wrap to next line */
}


.month-button,
.date-button {
    padding: 10px 14px; /* Increased padding */
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-size: 1em; /* Increased font size */
    /* Updated for 6 dates per row */
    flex-basis: calc(100% / 6 - (5px * 5) / 6); /* 6 items per row, accounting for gap */
    max-width: calc(100% / 6 - (5px * 5) / 6); /* Ensure max width */
    box-sizing: border-box; /* Include padding and border in size */
    text-align: center; /* Center the day number */
    display: flex; /* Added to center content vertically/horizontally */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.month-button {
     flex-basis: auto; /* Revert flex basis for month buttons */
     max-width: none; /* Revert max width for month buttons */
}


.month-button:hover,
.date-button:hover {
    background-color: #e9ecef;
    border-color: #a0a0a0;
}

.month-button.selected,
.date-button.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}


/* Circle View Styling - Based on user's provided CSS */
.circle-view-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; /* Ensure container takes full width */
    margin: 20px 0;
    box-sizing: border-box;
}

/* Adjusted margin for the balance circle content in the new location */
#statistics-content .circle-view-container {
    margin: 30px 0 10px 0;
}

/* Hide dashboard notes when content is in statistics (Ringkasan Akaun) */
#statistics-content .dashboard-notes {
    display: none;
}


.transaction-list-container {
    width: 100%; /* Ensure container takes full width up to max-width */
    max-width: 800px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-top: 20px;
    box-sizing: border-box; /* Include padding in width */
}
.transaction-list-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.table-responsive {
     overflow-x: auto; /* Allow horizontal scroll only for the table if needed */
     width: 100%;
}

#all-transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#all-transactions-table th,
#all-transactions-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

#all-transactions-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

#all-transactions-table td {
    vertical-align: top;
}

#all-transactions-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#all-transactions-table .transaction-info-cell {
    width: 50%; /* Adjusted width */
}
#all-transactions-table .transaction-info-cell .transaction-date {
    font-size: 1em; /* Slightly larger than category/desc */
    font-weight: bold; /* Bold date */
    color: #333;
    margin-bottom: 5px;
    display: block;
}
#all-transactions-table .transaction-info-cell .transaction-category-display,
#all-transactions-table .transaction-info-cell .transaction-description {
    font-size: 0.9em; /* Smaller than date */
    font-weight: normal;
    color: #555;
    margin-top: 3px;
}
#all-transactions-table .transaction-info-cell .transaction-category-display i {
    margin-right: 5px;
}


#all-transactions-table .transaction-amount-cell {
      width: 20%;
      white-space: nowrap;
      text-align: right;
      font-weight: bold;
}
#all-transactions-table .transaction-amount-cell.income { color: #27ae60; }
#all-transactions-table .transaction-amount-cell.expense { color: #c0392b; }

#all-transactions-table .actions-header {
    width: 30%; /* Adjusted width */
    text-align: center;
    white-space: nowrap;
}

#all-transactions-table .actions-cell {
    width: 30%; /* Adjusted width */
    text-align: center;
    white-space: nowrap;
}
#all-transactions-table .actions-cell button {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 16px;
    margin: 0 5px;
    padding: 5px;
    transition: color 0.2s ease;
}
#all-transactions-table .actions-cell button:hover {
    color: #2980b9;
}
#all-transactions-table .actions-cell button.delete-btn {
      color: #e74c3c;
}
#all-transactions-table .actions-cell button.delete-btn:hover {
      color: #c0392b;
}


.transaction-details-toggle {
    display: none; /* Hide toggle as actions are always visible now */
}

.transaction-details-content {
    display: none !important; /* Hide details content as actions are always visible now */
    background-color: #f9f9f9;
    padding: 8px;
    margin-top: 5px;
    border-radius: 5px;
    font-size: 0.9em;
    white-space: pre-line;
    word-wrap: break-word;
    color: #555;
}

.transaction-actions-detail {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
.transaction-actions-detail button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.transaction-actions-detail button:hover {
    background-color: #2980b9;
}
.transaction-actions-detail button.delete-btn {
    background-color: #e74c3c;
}
.transaction-actions-detail button.delete-btn:hover {
    background-color: #c0392b;
}
.transaction-actions-detail button i {
    margin-right: 5px;
}


.transaction-info-wrapper {
    display: flex;
    align-items: flex-start;
}

.transaction-main-info {
    flex-grow: 1;
}

.recent-transaction-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}
.recent-transaction-item:last-child { border-bottom: none; }

.recent-transaction-item .transaction-date {
    font-weight: bold;
    font-size: 1em;
    color: #333;
    margin-bottom: 4px;
    order: 1;
}

.recent-transaction-item .transaction-amount {
    font-size: 1em;
    color: #333;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
    margin-top: -1.5em;
    order: 2;
}
.recent-transaction-item .transaction-amount.income { color: #27ae60; }
.recent-transaction-item .transaction-amount.expense { color: #c0392b; }

.recent-transaction-item .transaction-category {
      font-weight: normal;
      color: #555;
      font-size: 0.9em;
      display: block;
      order: 3;
      margin-bottom: 4px;
}
.recent-transaction-item .transaction-category i {
    margin-right: 5px;
}

.recent-transaction-item .transaction-description {
    font-size: 0.9em;
    color: #555;
    font-weight: normal;
    display: block;
    order: 4;
}


#recent-transactions-list .no-transactions, #all-transactions-table .no-transactions {
    text-align: center;
    color: #95a5a6;
    padding: 15px;
    font-style: italic;
    width: 100%;
    display: block;
}

.category-icons-area {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
    flex-wrap: wrap;
    gap: 15px;
    box-sizing: border-box;
}

.icon-item {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 7px rgba(0,0,0,0.15);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    text-align: center;
    padding-top: 5px;
}
.icon-item:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}
.icon-item.selected {
    border-width: 3px;
    border-style: solid;
    box-shadow: 0 0 12px;
}
.icon-item[data-category-type="income"].selected {
    border-color: #2ecc71;
    box-shadow: 0 0 12px #2ecc71;
}
.icon-item[data-category-type="expense"].selected {
    border-color: #e74c3c;
    box-shadow: 0 0 12px #e74c3c;
}

.icon-item i {
    font-size: 26px;
    color: #555;
    margin-bottom: 4px;
}
.icon-item span {
    font-size: 10px;
    color: #777;
    font-weight: 500;
}
.icon-item[data-category-type="income"] i { color: #27ae60; }
.icon-item[data-category-type="expense"] i { color: #c0392b; }

.circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    margin-bottom: 20px;
}
.money-in-circle {
    background-color: #e8f8f5;
    border: 8px solid #2ecc71;
}
.money-out-circle {
    background-color: #fdedec;
    border: 8px solid #e74c3c;
}

.balance-circle {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}
.balance-circle .circle-inner-content {
    width: 80%;
    height: 80%;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.circle-label {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.circle-total {
    font-size: 36px;
    font-weight: bold;
}
.money-in-circle .circle-total { color: #27ae60; }
.money-out-circle .circle-total { color: #c0392b; }
.circle-total-main {
    font-size: 40px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}
.balance-details {
    font-size: 18px;
    color: #7f8c8d;
}
.balance-details span {
    display: block;
    margin-top: 5px;
}
.balance-details span:first-child {
    color: #27ae60;
    font-weight: 500;
}
.balance-details span:last-child {
    color: #c0392b;
    font-weight: 500;
}

.arrow-indicator {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    display: none;
    z-index: 5;
}

.circular-buttons-area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.circular-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.circular-btn.expense { background-color: #e74c3c; }
.circular-btn.income { background-color: #2ecc71; }
.circular-btn.home { background-color: #3498db; }

.circular-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    opacity: 0.9;
}

.category-management-area {
    width: 100%;
    max-width: 600px;
    background-color: #ffffff;
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-top: 20px;
    box-sizing: border-box;
}
.category-management-area h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
#addCategoryForm div { margin-bottom: 15px; }
#addCategoryForm label { display: block; margin-bottom: 5px; font-weight: 500; color: #333; }
#addCategoryForm input[type="text"],
#addCategoryForm select {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
}
#addCategoryForm small { font-size: 12px; color: #7f8c8d; display: block; margin-top: 5px; }
#addCategoryForm .add-category-btn {
    margin-top: 10px;
    padding: 12px 30px;
    font-size: 18px;
    background-color: #1abc9c;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
#addCategoryForm .add-category-btn:hover {
      background-color: #16a085;
}

#existingCategoriesList { margin-top: 20px; }
#existingCategoriesList .category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
#existingCategoriesList .category-item:last-child { border-bottom: none; }
#existingCategoriesList .category-item-info { flex-grow: 1; margin-right: 10px; }
#existingCategoriesList .category-item-info i { margin-right: 8px; width: 20px; text-align: center; }
#existingCategoriesList .category-item-info .type-income { color: #27ae60; }
#existingCategoriesList .category-item-info .type-expense { color: #c0392b; }
#existingCategoriesList .category-item-actions { flex-shrink: 0; }
#existingCategoriesList .category-item-actions button {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 5px;
}
#existingCategoriesList .category-item-actions button:hover { color: #c0392b; }

/* Activity Panel - Faster transition and full width on mobile */
.activity-panel {
    position: fixed;
    top: 0;
    right: -350px; /* Initial hidden state for larger screens */
    width: 350px; /* Default width for larger screens */
    max-width: 90%; /* General max-width to prevent overflow */
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.15s ease-out; /* Faster transition as requested */
    z-index: 1002;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.activity-panel.open {
    right: 0;
}

.activity-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.activity-panel-header h4 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.activity-panel-header .close-activity-panel {
    font-size: 28px;
    color: #7f8c8d;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.activity-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
}

/* SweetAlert2 Modal Styling Adjustments for Edit Form */
.swal2-popup {
    border-radius: 15px !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-title {
    font-size: 22px !important;
    font-weight: 600 !important;
    text-align: center !important; /* Center the title */
}

.swal2-html-container {
    font-size: 16px !important;
    text-align: left !important; /* Align the container text left */
    margin-top: 15px !important; /* Add some space below the title */
}

.swal-form-field {
    display: flex; /* Use flexbox for label and input */
    align-items: center; /* Vertically align items */
    margin-bottom: 10px; /* Space between form fields */
    width: 100%; /* Take full width of the container */
    box-sizing: border-box; /* Include padding/border in width */
}

.swal-form-field label {
    flex: 0 0 100px; /* Fixed width for labels (adjust as needed) */
    margin-right: 10px; /* Space between label and input */
    font-weight: 500;
    color: #333;
    text-align: left; /* Ensure label text is left-aligned */
}

.swal2-input,
.swal2-textarea,
.swal2-select {
    flex-grow: 1; /* Allow input/select/textarea to take remaining space */
    border-radius: 8px !important;
    border-color: #ddd !important;
    font-size: 16px !important;
    padding: 10px !important;
    box-sizing: border-box !important; /* Include padding and border in element's total width */
    margin: 0 !important; /* Remove default SweetAlert margin */
    max-width: none !important; /* Remove max-width constraint */
}

.swal2-textarea {
    min-height: 80px !important;
    resize: vertical; /* Allow vertical resizing */
}

.swal2-styled.swal2-confirm {
    background-color: #1abc9c !important;
    border-radius: 8px !important;
    padding: 10px 25px !important;
    font-size: 16px !important;
    margin: 10px 5px !important; /* Adjust button margin */
}

.swal2-styled.swal2-cancel {
    background-color: #e74c3c !important;
    border-radius: 8px !important;
    padding: 10px 25px !important;
    font-size: 16px !important;
    margin: 10px 5px !important; /* Adjust button margin */
}

.swal-wide {
    width: 90% !important;
    max-width: 500px !important; /* Adjust max-width for the modal */
}


footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    color: #555;
    background-color: #f0f2f5;
}
.heart-icon {
    color: red;
}

/* Tooltip styles - KEEPING these as they are for other elements as the request was specific to activity-icon */
/* If you want to remove all tooltips, delete this block */
[title] {
 position: relative;
 cursor: pointer;
}

[title]:hover::before {
 content: attr(title);
 position: absolute;
 bottom: 100%;
 left: 50%;
 transform: translateX(-50%);
 background-color: rgba(0, 0, 0, 0.8);
 color: white;
 padding: 5px 10px;
 border-radius: 5px;
 white-space: pre-wrap; /* Allows newline characters in title */
 font-size: 12px;
 z-index: 10;
 margin-bottom: 5px;
 text-align: left; /* Align tooltip text left */
}

[title]:hover::after {
 content: '';
 position: absolute;
 top: 100%;
 left: 50%;
 transform: translateX(-50%);
 border-width: 5px;
 border-style: solid;
 border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
 z-index: 10;
}

/* Dashboard Specific Styles */
.dashboard-yearly-summary {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

.dashboard-year-select-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-year-select-container label {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.dashboard-year-select-container .year-select {
    padding: 8px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
}

.dashboard-summary-boxes-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap; /* Allow boxes to wrap on smaller screens */
}

.dashboard-summary-box {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
    position: relative; /* For positioning the link */
    padding-bottom: 50px; /* Space for the link */
    width: 100%; /* Default to full width on small screens */
    max-width: 300px; /* Max width for larger screens */
    min-height: 150px; /* Ensure boxes have minimum height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Dashboard summary box background colors */
.dashboard-summary-box.income-box {
    background-color: #19ff00; /* Light green background */
    border: 1px solid #28a745; /* Green border for income */
}
.dashboard-summary-box.expense-box {
    background-color: #ff0000; /* Light red background */
    border: 1px solid #dc3545; /* Red border for expense */
}


.dashboard-summary-box .box-content {
    flex-grow: 1; /* Allows content to push link to bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dashboard-summary-box .box-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.dashboard-summary-box.income-box .box-icon { color: #00a000; }
.dashboard-summary-box.expense-box .box-icon { color: #9f2828; }

.dashboard-summary-box .box-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.dashboard-summary-box .box-amount {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

.dashboard-summary-box .view-full-link {
    position: absolute;
    bottom: 15px; /* Fixed distance from the bottom */
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
    color: #3498db;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #b3d7ff; /* Light blue border */
    background-color: #eaf5ff; /* Very light blue background */
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap; /* Prevent text wrapping */
}

.dashboard-summary-box .view-full-link:hover {
    color: #2980b9;
    background-color: #d1e7fd; /* Slightly darker blue on hover */
    border-color: #9acaf8;
}

.dashboard-summary-box .view-full-link i {
    font-size: 0.9em;
}

/* --- New Styles for Line Chart --- */
.dashboard-graph-section {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
    box-sizing: border-box;
    text-align: center;
}

.dashboard-graph-section h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
}

.line-chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
    max-width: 100%; /* Ensure it doesn't overflow its container */
    margin: 0 auto;
}

.no-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #7f8c8d;
    font-style: italic;
    font-size: 1.1em;
}

.chart-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

.legend-indicator {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    margin-right: 8px;
}

/* --- End of New Styles for Line Chart --- */

/* --- New Styles for Reports Page Table --- */
.report-year-select-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.report-year-select-container label {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.report-year-select-container .year-select {
    padding: 8px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
}

.report-table-container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    box-sizing: border-box;
    text-align: center;
}

#monthly-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#monthly-report-table th,
#monthly-report-table td {
    border: 1px solid #ddd;
    padding: 12px 8px; /* Slightly more vertical padding */
    text-align: right; /* Align amounts to the right */
    white-space: nowrap; /* Prevent text wrapping in cells */
    font-size: 0.95em;
}

#monthly-report-table th:first-child,
#monthly-report-table td:first-child {
    text-align: left; /* Keep month name aligned left */
    width: 25%; /* Give month column more space */
}

#monthly-report-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #555;
}

#monthly-report-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Colors for amounts */
.income-amount { color: #27ae60; font-weight: 500; }
.expense-amount { color: #c0392b; font-weight: 500; }
.balance-positive { color: #27ae60; font-weight: bold; } /* Green for positive balance */
.balance-negative { color: #c0392b; font-weight: bold; } /* Red for negative balance */

/* Yearly Balance Row Styling */
#yearly-balance-row {
    background-color: #eaf2f8; /* Light blue background for emphasis */
    font-size: 1.1em;
    font-weight: bold;
    border-top: 2px solid #aed6f1; /* Stronger top border */
}

#yearly-balance-row td {
    padding: 15px 8px; /* More padding for total row */
}

#yearly-balance-row .total-label {
    text-align: left;
    font-weight: bold;
    color: #2c3e50;
}

#monthly-report-table .no-reports-data {
    text-align: center;
    color: #95a5a6;
    padding: 15px;
    font-style: italic;
}

/* --- End of New Styles for Reports Page Table --- */


@media screen and (max-width: 768px) {
      .circular-buttons-area {
        flex-direction: row;
        gap: 15px;
        margin-top: 20px;
      }
      .circular-btn {
          width: 55px;
          height: 55px;
          font-size: 22px;
      }

    .circle, .balance-circle {
        width: 85vw;
        height: 85vw;
        max-width: 300px;
        max-height: 300px;
    }
    .balance-circle .circle-inner-content {
          width: 80%;
          height: 80%;
    }

    .circle-label { font-size: 14px; }
    .circle-total { font-size: 24px; }
    .circle-total-main { font-size: 28px; }
    .balance-details { font-size: 14px; }
    .category-icons-area {
        gap: 10px;
        max-width: 100%;
        padding: 10px 5px 20px 5px;
    }
    .icon-item { width: 50px; height: 50px; }
    .icon-item i { font-size: 20px; }
    .icon-item span { font-size: 9px; }

    .header .header-title { font-size: 20px; }
    .header .header-actions i { font-size: 18px; margin-left: 10px;}
    .header .openbtn { font-size: 22px; padding-right:10px;}
    .category-management-area { padding: 15px; }

    #all-transactions-table th, #all-transactions-table td {
        padding: 6px;
        font-size: 0.85em;
    }
     #all-transactions-table .actions-cell button {
         font-size: 12px;
         margin: 0 3px;
     }
     #all-transactions-table .transaction-info-cell {
         width: 55%; /* Adjusted width for mobile */
     }
     #all-transactions-table .transaction-amount-cell {
         width: 25%; /* Adjusted width for mobile */
     }
     #all-transactions-table .actions-cell {
         width: 20%; /* Adjusted width for mobile */
     }


.transaction-details-toggle {
    display: none;
}

 .transaction-details-content {
     display: none !important;
 }

     .transaction-details-toggle {
         width: 20px;
         height: 20px;
         font-size: 12px;
         margin-right: 5px;
     }
      .transaction-details-content {
          padding: 6px;
          font-size: 0.8em;
      }
      .transaction-date { font-size: 0.7em; }
      .transaction-category-display { font-size: 0.9em; }
      .transaction-category-display i { margin-right: 3px; }


      .activity-panel {
          width: 300px;
          right: -300px;
      }
      .activity-panel.open {
          right: 0;
      }

    /* SweetAlert2 Modal Responsive Adjustments */
    .swal-wide {
        max-width: 95% !important; /* Allow wider modal on smaller screens */
    }

    .swal-form-field {
        flex-direction: column; /* Stack label and input vertically on smaller screens */
        align-items: flex-start; /* Align stacked items to the left */
    }

    .swal-form-field label {
        flex: none; /* Remove fixed width */
        margin-right: 0; /* Remove margin */
        margin-bottom: 5px; /* Add space below label */
    }

    .swal2-input,
    .swal2-textarea,
    .swal2-select {
        width: 100% !important; /* Make inputs take full width when stacked */
        max-width: none !important; /* Ensure no max width */
    }

    /* Dashboard responsive adjustments */
    .dashboard-summary-boxes-container {
        flex-direction: column; /* Stack boxes vertically */
        align-items: center;
    }

    .dashboard-summary-box {
        width: 90%; /* Take more width on smaller screens */
        max-width: 350px; /* Adjust max-width */
        margin-bottom: 15px;
    }

    .dashboard-graph-section {
        padding: 15px;
        margin-top: 20px;
    }

    .line-chart-wrapper {
        height: 300px; /* Adjust height for mobile */
    }

    /* Reports table responsive adjustments */
    #monthly-report-table th,
    #monthly-report-table td {
        font-size: 0.85em; /* Smaller font size for table cells */
        padding: 8px 5px; /* Reduced padding */
    }

    #yearly-balance-row td {
        padding: 10px 5px; /* Reduced padding for total row */
        font-size: 1em; /* Keep total row font size reasonable */
    }
}

@media screen and (max-width: 480px) {
      .circular-buttons-area {
        flex-direction: row;
        gap: 10px;
        margin-top: 15px;
      }
      .circular-btn {
          width: 50px;
          height: 50px;
          font-size: 20px;
      }

    .circle, .balance-circle {
        width: 95vw;
        height: 95vw;
        max-width: 260px;
        max-height: 260px;
    }
    .balance-circle .circle-inner-content {
          width: 75%;
          height: 75%;
    }

    .circle-label { font-size: 10px; }
    .circle-total { font-size: 20px; }
    .circle-total-main { font-size: 24px; }
    .balance-details { font-size: 12px; }
    .category-icons-area {
        gap: 5px;
        padding: 10px 2px 15px 2px;
    }
    .icon-item { width: 40px; height: 40px; }
    .icon-item i { font-size: 16px; }
    .icon-item span { display: none; }

    /* Date navigation elements on very small screens */
    .date-navigation select,
    .date-navigation .month-year-display,
    .date-navigation .date-picker-toggle {
        font-size: 0.9em; /* Smaller font for main date elements */
        padding: 5px;
        margin: 0 2px; /* Reduce margin */
    }
    /* Date and month picker buttons on very small screens */
    .month-button,
    .date-button {
        padding: 8px 10px; /* Further reduced padding for smallest screens */
        font-size: 0.85em; /* Slightly larger font for date/month buttons */
    }
    /* Adjusted width for date picker container for smaller screens */
    .date-picker-container {
        width: 95%; /* Adjust width for better fit on small screens */
    }


    #addCategoryForm input[type="text"], #addCategoryForm select { font-size: 13px; }
    .category-management-area { padding: 10px; }

    #all-transactions-table th, #all-transactions-table td {
        padding: 4px;
        font-size: 0.8em;
    }
     #all-transactions-table .actions-cell button {
         font-size: 10px;
         margin: 0 2px;
     }
     #all-transactions-table .transaction-info-cell {
         width: 50%; /* Adjusted width for smaller mobile */
     }
     #all-transactions-table .transaction-amount-cell {
         width: 25%; /* Adjusted width for smaller mobile */
     }
     #all-transactions-table .actions-cell {
         width: 25%; /* Adjusted width for smaller mobile */
     }

     .transaction-details-toggle {
         display: none;
     }

     .transaction-details-content {
         display: none !important;
     }

     .transaction-details-toggle {
         width: 18px;
         height: 18px;
         font-size: 10px;
         margin-right: 3px;
     }
      .transaction-details-content {
          padding: 4px;
          font-size: 0.7em;
      }
      .transaction-date { font-size: 0.6em; }
      .transaction-category-display { font-size: 0.8em; }

      /* Activity Panel - Full width on smallest mobile */
      .activity-panel {
          width: 100%; /* Full width on smallest screens */
          right: -100%; /* Ensure it hides completely off screen */
          max-width: 100%; /* Allow it to expand fully */
      }
      .activity-panel.open {
          right: 0;
      }

      .line-chart-wrapper {
          height: 250px;
      }

    /* Reports table responsive adjustments */
    #monthly-report-table th,
    #monthly-report-table td {
        font-size: 0.8em; /* Even smaller font size */
        padding: 6px 3px; /* Even less padding */
    }
    #monthly-report-table th:first-child,
    #monthly-report-table td:first-child {
        width: 30%; /* Adjust month column width */
    }

    #monthly-report-table .income-amount,
    #monthly-report-table .expense-amount,
    #monthly-report-table .balance-amount {
        font-size: 0.9em; /* Keep amounts readable */
    }

    #yearly-balance-row td {
        padding: 8px 3px; /* Reduced padding for total row */
        font-size: 0.9em; /* Slightly smaller for total row */
    }
}

@media screen and (max-height: 450px) {
  .sidebar {padding-top: 15px;}
  .sidebar a {font-size: 16px;}
}


/* --- New Styles for Reports Page Table --- */
.report-year-select-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.report-year-select-container label {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.report-year-select-container .year-select {
    padding: 8px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
}

.report-table-container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    box-sizing: border-box;
    text-align: center;
}

#monthly-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#monthly-report-table th,
#monthly-report-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: right;
    white-space: nowrap;
    font-size: 0.95em;
}

#monthly-report-table th:first-child,
#monthly-report-table td:first-child {
    text-align: left;
    width: 25%;
}

#monthly-report-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #555;
}

#monthly-report-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Colors for amounts */
.income-amount { color: #27ae60; font-weight: 500; }
.expense-amount { color: #c0392b; font-weight: 500; }
.balance-positive { color: #27ae60; font-weight: bold; }
.balance-negative { color: #c0392b; font-weight: bold; }

/* Yearly Balance Row Styling */
#yearly-balance-row {
    background-color: #eaf2f8;
    font-size: 1.1em;
    font-weight: bold;
    border-top: 2px solid #aed6f1;
}

#yearly-balance-row td {
    padding: 15px 8px;
}

#yearly-balance-row .total-label {
    text-align: left;
    font-weight: bold;
    color: #2c3e50;
}

#monthly-report-table .no-reports-data {
    text-align: center;
    color: #95a5a6;
    padding: 15px;
    font-style: italic;
}

/* Responsive adjustments for reports table */
@media screen and (max-width: 768px) {
    #monthly-report-table th,
    #monthly-report-table td {
        font-size: 0.85em;
        padding: 8px 5px;
    }

    #yearly-balance-row td {
        padding: 10px 5px;
        font-size: 1em;
    }
}

@media screen and (max-width: 480px) {
    #monthly-report-table th,
    #monthly-report-table td {
        font-size: 0.8em;
        padding: 6px 3px;
    }
    #monthly-report-table th:first-child,
    #monthly-report-table td:first-child {
        width: 30%;
    }

    #monthly-report-table .income-amount,
    #monthly-report-table .expense-amount,
    #monthly-report-table .balance-amount {
        font-size: 0.9em;
    }

    #yearly-balance-row td {
        padding: 8px 3px;
        font-size: 0.9em;
    }
}
