/* ========================================
   PART 1: BASE STYLES & HEADER
   ======================================== */

/* Base Reset */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100%;
}

/* ========================================
   HEADER & LOGO
   ======================================== */
.logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px clamp(20px, 5vw, 50px);
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-family: Arial, sans-serif;
    min-height: 70px;
    flex-wrap: nowrap;
    gap: 20px;
}

.logo h1 {
    color: #fff;
    font-weight: bolder;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin: 0;
    flex-shrink: 0;
}

/* User Section */
#log_out {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-left: auto;
}

#user_name {
    margin: 0;
    font-size: clamp(12px, 2vw, 14px);
    color: #fff;
    font-weight: 500;
}
.logo #log_out_button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo #log_out_button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
.modal-content #log_out_button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
    background-color: #dc3545;
    color: white;
    font-weight: 500;
}

.modal-content #log_out_button:hover {
    background-color: #c82333;
}

#log_out_button,
#profile {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

#log_out_button {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#log_out_button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#profile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: #6366f1;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 1.3rem;
    padding: 0;
}

#profile::before {
    content: "👤";
}

#profile:hover {
    background-color: #f1f5f9;
    transform: scale(1.1);
}
/* Add Transaction Button */
#add-transaction-btn {
    padding: 10px 25px;
    border: gray 1px solid;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

#add-transaction-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* ========================================
   NAVIGATION
   ======================================== */
nav {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: clamp(5px, 2vw, 50px);
    flex-wrap: nowrap;
    padding: 0 5px;
    width: 100%;
}

nav button {
    background-color: #fff;
    border: none;
    font-size: clamp(0.75rem, 2vw, 1.5rem);
    cursor: pointer;
    padding: clamp(8px, 2vw, 20px) clamp(10px, 3vw, 20px);
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

nav button:hover {
    background-color: #e0e7ff;
    color: #3b4cca;
    border-bottom: #3b4cca 5px solid;
    transform: scale(1.05);
}

nav button.active {
    background-color: #e0e7ff;
    color: #3b4cca;
    border-bottom: #3b4cca 5px solid;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Content Sections */
.content {
    display: none;
}

.content.active {
    display: block;
}

/* ========================================
   MOBILE RESPONSIVE - HEADER
   ======================================== */
@media (max-width: 768px) {
    .logo {
        padding: 12px 15px;
        min-height: 60px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .logo h1 {
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    #add-transaction-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    #log_out {
        gap: 8px;
        flex-shrink: 0;
    }

    #user_name {
        display: none;
    }

    #log_out_button{
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    #profile {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        padding: 10px 10px;
        min-height: 55px;
        gap: 8px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    #add-transaction-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    #log_out_button {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    #profile {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}


/* ========================================
   PART 2: MODALS & POPUPS
   ======================================== */

/* Add Transaction Popup */
#add-transaction-popUp {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
}

#add-transaction-popUpp {
    background: #fff;
    width: 90%;
    max-width: 800px;
    padding: clamp(15px, 3vw, 20px);
    border-radius: 10px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: popup 0.3s ease-out forwards;
    position: relative;
}

@keyframes popup {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#transaction_heading {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

#transaction_popUp_close {
    background-color: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    padding: 5px;
    line-height: 1;
    transition: color 0.3s ease;
}

#transaction_popUp_close:hover {
    color: #000;
}

/* Transaction Form */
#transaction_form {
    display: flex;
    flex-direction: column;
}

#transaction_form label {
    margin: 10px 10px 5px 10px;
    font-weight: 600;
    color: #333;
    font-size: clamp(13px, 2vw, 14px);
}

#transaction_form input {
    margin: 5px 10px;
    padding: 10px;
    height: 40px;
    border: grey solid 1px;
    border-radius: 5px;
    font-size: clamp(13px, 2vw, 14px);
    width: calc(100% - 20px);
}

#transaction_form select {
    margin: 5px 10px;
    height: 40px;
    border: grey solid 1px;
    border-radius: 5px;
    padding: 8px;
    font-size: clamp(13px, 2vw, 14px);
    width: calc(100% - 20px);
}

#transaction_form input:focus,
#transaction_form select:focus {
    outline: none;
    border-color: #667eea;
}

#added_trasaction {
    margin: 15px 10px 5px 10px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 45px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: clamp(14px, 2vw, 16px);
    transition: all 0.3s ease;
}

#added_trasaction:hover {
    background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.02);
}

/* ========================================
   PROFILE MODALS
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    padding: 10px;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: clamp(20px, 4vw, 30px);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal,
.close-update-modal,
.close-password-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-modal:hover,
.close-update-modal:hover,
.close-password-modal:hover {
    color: #000;
}

.modal-content h2 {
    margin-top: 0;
    color: #333;
    font-size: clamp(20px, 3vw, 24px);
    margin-bottom: 20px;
    clear: both;
}

.profile-info {
    background: #f8f9fa;
    padding: clamp(15px, 3vw, 20px);
    border-radius: 8px;
    margin-bottom: 20px;
}

.profile-info p {
    margin: 10px 0;
    font-size: clamp(14px, 2vw, 16px);
    color: #555;
    word-break: break-word;
}

.profile-info strong {
    color: #333;
    display: inline-block;
    min-width: 130px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-update,
.btn-change {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.btn-update {
    background-color: #28a745;
    color: white;
}

.btn-update:hover {
    background-color: #218838;
}

.btn-change {
    background-color: #007bff;
    color: white;
}

.btn-change:hover {
    background-color: #0056b3;
}

/* Form Styles in Modals */
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content label {
    font-weight: 600;
    color: #333;
    font-size: clamp(13px, 2vw, 14px);
}

.modal-content input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: clamp(13px, 2vw, 14px);
    transition: border-color 0.3s;
    width: 100%;
}

.modal-content input:focus {
    outline: none;
    border-color: #007bff;
}

.btn-submit,
.btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: clamp(14px, 2vw, 16px);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background-color: #28a745;
    color: white;
}

.btn-submit:hover {
    background-color: #218838;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

.btn-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ========================================
   MOBILE RESPONSIVE - MODALS
   ======================================== */
@media (max-width: 768px) {
    #add-transaction-popUpp {
        width: 95%;
        padding: 15px;
        max-height: 85vh;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }

    .profile-info strong {
        display: block;
        margin-bottom: 5px;
        min-width: auto;
    }

    .profile-actions {
        flex-direction: column;
    }

    .btn-update,
    .btn-change {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #add-transaction-popUpp {
        padding: 10px;
    }

    #transaction_form input,
    #transaction_form select {
        height: 36px;
        margin: 5px 5px;
        width: calc(100% - 10px);
    }

    #transaction_form label {
        margin: 8px 5px 3px 5px;
    }

    #added_trasaction {
        margin: 10px 5px;
        height: 42px;
    }

    .modal-content {
        padding: 15px;
    }

    .profile-info {
        padding: 15px;
    }
}
/* ========================================
   PART 3: DASHBOARD & HISTORY
   ======================================== */

/* ========================================
   DASHBOARD SECTION
   ======================================== */
#dashboard {
    background: linear-gradient(to right, #eef2f7, #d9e2ec);
    padding: clamp(20px, 5vw, 50px) clamp(10px, 3vw, 50px);
    justify-content: center;
    align-items: center;
}

.dashboard-boxes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.dia_boxs {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#dashboard h1 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: bold;
    margin: 10px;
}

#add_trasaction {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 50px;
    width: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 2rem;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
}

#add_trasaction:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#transaction_icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

#transaction_icon h1 {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: bold;
    color: #333;
    flex-shrink: 0;
}

/* Dashboard Stats */
#total_income,
#current_balance {
    color: #28a745;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

#total_expenses {
    color: #e74c3c;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

#total_transactions {
    color: #5B72F2;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

/* Transaction Details */
.transaction_details {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 10px;
}

#No_trasnsaction {
    flex: 1;
    text-align: center;
    padding: 30px;
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: bolder;
    color: #666;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.edit-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

/* ========================================
   HISTORY & FILTER SECTION
   ======================================== */
#history {
    background: linear-gradient(to right, #eef2f7, #d9e2ec);
    padding: clamp(20px, 5vw, 50px) clamp(10px, 5vw, 100px);
    justify-content: center;
    align-items: center;
}

#filter {
    background-color: #fff;
    padding: clamp(15px, 3vw, 20px);
    border-radius: 15px;
    margin-bottom: 20px;
}

#filter_options {
    display: flex;
    margin: 10px;
    flex-direction: row;
    gap: clamp(20px, 3vw, 50px);
    flex-wrap: wrap;
}

#transaction_filter_options {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

#transaction_filter {
    height: 40px;
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: clamp(13px, 2vw, 14px);
}

#transaction_filter_button {
    margin-top: 15px;
}

#transaction_filter_button button {
    background-color: #f1f5f9;
    border-radius: 5px;
    border: gray 1px solid;
    padding: 8px 16px;
    cursor: pointer;
    font-size: clamp(13px, 2vw, 14px);
    transition: all 0.2s ease;
}

#transaction_filter_button button:hover {
    background-color: #e2e8f0;
}

/* Filter Options (Dynamic Display) */
#transaction_type_options,
#selected_date_options,
#selected_month_options,
#start_date_options,
#end_date_options,
#selected_year_options {
    display: none;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

#transaction_type,
#seleted_date,
#seleted_month,
#start_date,
#end_date {
    height: 40px;
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: clamp(13px, 2vw, 14px);
}

#selected_year {
    height: 40px;
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: clamp(13px, 2vw, 14px);
}

/* Form Elements */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: clamp(13px, 2vw, 1rem);
    transition: border-color 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 2px solid #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: clamp(13px, 2vw, 14px);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: clamp(14px, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Color Classes */
.positive {
    color: #10b981;
}

.negative {
    color: #ef4444;
}

/* ========================================
   MOBILE RESPONSIVE - DASHBOARD & HISTORY
   ======================================== */
@media (max-width: 1024px) {
    .dia_boxs {
        width: calc(50% - 20px);
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    #dashboard,
    #history {
        padding: 20px 15px;
    }

    .dia_boxs {
        width: 100%;
        max-width: 100%;
        margin: 10px 0;
        min-width: 0;
    }

    .transaction_details {
        padding: 12px 15px;
    }

    #filter_options {
        flex-direction: column;
        gap: 15px;
    }

    #transaction_filter_options,
    #transaction_type_options,
    #selected_date_options,
    #selected_month_options,
    #start_date_options,
    #end_date_options,
    #selected_year_options {
        min-width: 100%;
    }

    #transaction_filter,
    #transaction_type,
    #seleted_date,
    #seleted_month,
    #start_date,
    #end_date,
    #selected_year {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #dashboard,
    #history {
        padding: 20px 15px;
    }
    .dashboard-boxes-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dashboard-boxes-container {
        gap: 8px;
    }

    .dia_boxs {
        padding: 10px 12px;
    }
}
/* ========================================
   PART 4: CALENDAR & ANALYSIS (FINAL)
   ======================================== */

/* ========================================
   CALENDAR SECTION - 100% FIT SCREEN
   ======================================== */
.calendar-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto 2rem;
    height: calc(100vh - 280px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.calendar-title {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.calendar-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.calendar-controls .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

.btn-calendar-today {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-calendar-today:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Calendar Grid - Day Headers */
.flight-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    border-bottom: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.flight-day-header {
    padding: 0.75rem 0.5rem;
}

/* Calendar Days Grid - Fills remaining space */
#flight-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(auto-fill, 1fr);
    flex: 1;
    overflow: hidden;
}

.flight-day {
    border: 1px solid #f1f5f9;
    padding: 0.4rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    background: #fefefe;
    text-align: left;
    overflow: hidden;
}

.flight-day:hover {
    background: #f8fafc;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.flight-day.other-month {
    color: #cbd5e1;
    background: #fafbfc;
    cursor: default;
}

.flight-day.other-month:hover {
    transform: none;
    box-shadow: none;
}

.flight-day.today {
    border: 2px solid #667eea;
    box-shadow: inset 0 0 0 1px #667eea;
}

.flight-day.selected {
    background: #f0f9ff;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.flight-day.profit {
    background-color: rgba(34, 197, 94, 0.1);
}

.flight-day.loss {
    background-color: rgba(239, 68, 68, 0.1);
}

.flight-day.break-even {
    background-color: rgba(245, 158, 11, 0.1);
}

.flight-day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
}

.flight-day-amounts {
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    margin-top: auto;
    line-height: 1.3;
}

.flight-day-amounts .positive {
    font-weight: 500;
}

.flight-day-amounts .negative {
    font-weight: 500;
}

.flight-transaction-count {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: clamp(0.6rem, 1vw, 0.7rem);
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-footer {
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.calendar-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.calendar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Day Details Panel - Compact */
.day-details-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 0.75rem;
    border: 2px solid #667eea;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.day-details-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    flex-shrink: 0;
}

.day-details-header h3 {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.close-panel-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.day-details-content {
    padding: 1rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.day-stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.mini-stat {
    text-align: center;
}

.mini-stat-label {
    display: block;
    font-size: clamp(0.75rem, 1.5vw, 0.8rem);
    color: #64748b;
    margin-bottom: 0.25rem;
}

.mini-stat-value {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: bold;
}

.day-transactions-list {
    max-height: 200px;
    overflow-y: auto;
}

.day-transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
    flex-wrap: wrap;
    gap: 10px;
}

.day-transaction-item:hover {
    background: #f8fafc;
}

.day-transaction-item:last-child {
    border-bottom: none;
}

/* ========================================
   ANALYSIS SECTION
   ======================================== */
#analysis {
    background: linear-gradient(to right, #eef2f7, #d9e2ec);
    padding: clamp(20px, 5vw, 50px) clamp(10px, 3vw, 50px);
    justify-content: center;
    align-items: center;
}

.analysis-boxes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.dia_boxs_graphs {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    align-items: center;
}

.chart-container {
    position: relative;
    height: 350px;
    margin-bottom: 20px;
}

.legend-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

#avg_daily_expense {
    color: #e74c3c;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

#expense_ratio {
    color: #667eea;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

#largest_single_expense {
    color: #e74c3c;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

#savings_rate {
    color: #28a745;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

.analysis-graphs-row {
    display: flex;
    gap: 15px;                 
    max-width: 1200px;
    margin: 20px auto 0;
    width: 100%;
    align-items: stretch;      
}
.analysis-graphs-row .dia_boxs_graphs {
    flex: 1;
    min-width: 0; 
}
/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
    .calendar-container {
        height: calc(100vh - 200px);
        min-height: 350px;
        border-radius: 8px;
    }

    .dia_boxs_graphs {
        width: calc(100% - 20px) !important;
        max-width: 100%;
    }

    .chart-container {
        height: 300px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .calendar-container {
        height: calc(100vh - 180px);
        min-height: 400px;
        border-radius: 8px;
    }

    .calendar-header {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .calendar-nav {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .calendar-title {
        order: 1;
        width: 100%;
    }

    .calendar-controls {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .flight-calendar-grid {
        font-size: 0.7rem;
    }

    .flight-day-header {
        padding: 0.5rem 0.25rem;
    }

    .flight-day {
        padding: 0.3rem;
    }

    .flight-day-number {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .flight-day-amounts {
        font-size: 0.65rem;
    }

    .flight-transaction-count {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

   .calendar-footer {
        padding: 0.4rem 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .calendar-legend {
        justify-content: center;
        gap: 0.75rem;
    }

    .calendar-actions {
        justify-content: center;
        width: 100%;
    }

    .day-details-panel {
        max-height: 300px;
    }

    .day-details-header {
        padding: 0.75rem 1rem;
    }

    .day-details-content {
        padding: 0.75rem 1rem;
    }

    .day-stats-mini {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .mini-stat {
        display: flex;
        justify-content: space-between;
        text-align: left;
        padding: 0.5rem;
    }

    .day-transactions-list {
        max-height: 150px;
    }

    #analysis {
        padding: 20px 15px;
    }

    .analysis-boxes-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .analysis-boxes-container {
        gap: 8px;
    }

    .dia_boxs_graphs {
        padding: 10px 12px;
        min-width: 0;
    }

    .chart-container {
        height: 250px;
    }

    .legend-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE
   ======================================== */
@media (max-width: 480px) {
    .calendar-container {
        height: calc(100vh - 170px);
        min-height: 320px;
        border-radius: 6px;
    }

    .calendar-header {
        padding: 0.4rem 0.5rem;
    }

    .calendar-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .calendar-title {
        font-size: 0.9rem;
        min-width: 100px;
    }

    .btn-calendar-today {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }

    .flight-calendar-grid {
        font-size: 0.65rem;
    }

    .flight-day-header {
        padding: 0.4rem 0.2rem;
    }

    .flight-day {
        padding: 0.25rem;
    }

    .flight-day-number {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .flight-day-amounts {
        font-size: 0.6rem;
        line-height: 1.2;
    }

    .flight-transaction-count {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
        top: 3px;
        right: 3px;
    }

    .calendar-footer {
        padding: 0.5rem 0.75rem;
    }

    .legend-item {
        font-size: 0.7rem;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    .day-details-panel {
        max-height: 250px;
        margin-top: 0.5rem;
    }

    .day-details-header {
        padding: 0.6rem 0.75rem;
    }

    .day-details-content {
        padding: 0.6rem 0.75rem;
    }

    .day-stats-mini {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .day-transactions-list {
        max-height: 120px;
    }

    #analysis {
        padding: 15px 10px;
    }

    .dia_boxs_graphs {
        padding: 10px 12px;
        margin: 8px 0;
        min-width: 100%;
    }

    .chart-container {
        height: 220px;
    }
    .analysis-graphs-row {
        flex-direction: column;
    }
}

/* ========================================
   LANDSCAPE MODE FIX
   ======================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .calendar-container {
        height: calc(100vh - 120px);
        min-height: 300px;
    }

    .flight-day {
        padding: 0.2rem;
    }

    .chart-container {
        height: 200px;
    }

    .day-details-panel {
        max-height: 200px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .calendar-header,
    .calendar-footer,
    nav,
    #add-transaction-btn,
    .actions,
    #log_out {
        display: none !important;
    }

    .calendar-container {
        height: auto;
        box-shadow: none;
        break-inside: avoid;
    }

    .dia_boxs,
    .dia_boxs_graphs {
        box-shadow: none;
        break-inside: avoid;
    }
}
/* Apply Filters button - Purple gradient */
.btn-apply-filter {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: clamp(13px, 2vw, 14px);
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
}

.btn-apply-filter:hover {
    background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

/* Clear All button - Red/Orange gradient */
.btn-clear-filter {
    background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
    border-radius: 5px;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: clamp(13px, 2vw, 14px);
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
}

.btn-clear-filter:hover {
    background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}
#logo_title {
    display: flex;
    align-items: center;
    gap: 15px;
}

#logo_title img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 25px;
}

#logo_title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}