/* income.css - Maximized Table View */

/* 1. OVERRIDE BODY/HTML CONSTRAINTS */
html,
body {
    height: 100%;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
    display: block !important;
    width: 100%;
}

/* 2. OVERRIDE APP-CONTAINER CONSTRAINTS */
.app-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
}

/* Compact Header */
.app-container>header {
    margin: 8px 12px;
    width: auto;
    flex-shrink: 0;
    padding: 12px 20px !important;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-row h1 {
    font-size: 1.3rem !important;
    margin: 0 !important;
}

.btn-back {
    color: var(--text-primary);
    font-size: 1.1rem;
    text-decoration: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
}

/* TABLE CARD - Maximized */
.table-card {
    padding: 0;
    margin: 8px 12px 12px 12px;
    overflow: hidden;
    width: auto;
    max-width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-card .card-header {
    padding: 16px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.table-card .card-header h3 {
    font-size: 1rem !important;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    max-height: none;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

.income-table {
    width: 100%;
    border-collapse: collapse;
    min-width: max-content;
}

.income-table th,
.income-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    font-size: 0.9rem;
}

.income-table th:first-child,
.income-table td:first-child {
    padding-left: 20px;
}

.income-table th:last-child,
.income-table td:last-child {
    padding-right: 20px;
}

.income-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.income-table td {
    color: var(--text-primary);
}

.income-table input {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.income-table input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

.income-table input[type="date"] {
    width: 120px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.add-row-container {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 0;
}

/* ESTILOS PARA INPUTS NUMÉRICOS (Símbolo $) */
.input-with-currency {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    width: 100px;
}

.input-with-currency .table-input.currency-input {
    border: none;
    width: auto;
    flex-grow: 1;
    padding: 8px 10px;
    background: transparent;
}

.input-with-currency span {
    font-weight: 600;
    color: var(--text-muted);
    padding-left: 8px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ESTILOS DE RESALTADO */
.highlight-past {
    background-color: rgba(251, 191, 36, 0.1);
    border-left: 4px solid var(--accent-warning);
}

.highlight-past td {
    font-weight: 600;
    background-color: transparent !important;
}

.highlight-past:hover {
    background-color: rgba(251, 191, 36, 0.15);
}

.highlight-next {
    background-color: rgba(52, 211, 153, 0.1);
    border-left: 4px solid var(--accent-success);
}

.highlight-next td {
    font-weight: 600;
    background-color: transparent !important;
}

.highlight-next:hover {
    background-color: rgba(52, 211, 153, 0.15);
}

.loading-state {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* MEDIA QUERIES */
@media (min-width: 1024px) {
    .app-container {
        display: flex !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .app-container>header {
        margin: 6px 8px;
        padding: 10px 16px !important;
    }

    .header-row h1 {
        font-size: 1.1rem !important;
    }

    .table-card {
        margin: 6px 8px 8px 8px;
    }

    .table-card .card-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table-responsive {
        padding: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .income-table th,
    .income-table td {
        padding: 8px;
    }

    .income-table th:first-child,
    .income-table td:first-child {
        padding-left: 16px;
    }

    .income-table th:last-child,
    .income-table td:last-child {
        padding-right: 16px;
    }

    .add-row-container {
        padding: 10px 16px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}