/* =========================================================
   CARDS
   ========================================================= */

.card,
.chart-card {
    box-sizing: border-box;
    /* background: var(--card-bg); */
    background: var(--background);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow:
        0 2px 8px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.chart-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    gap: 8px;
    display: flex;
    flex-direction: column;
    /* Use lighter background for chart areas */
    background: var(--chart-bg);
}

/* Chart card header */
.chart-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.chart-card-header h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
}

/* Expand button */
.expand-button,
.close-button {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 22px;
    cursor: pointer;
}

.expand-button:hover,
.close-button:hover {
    background: var(--shadow-color);
}

/* Modal overlay */
.chart-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    /* background: rgba(0, 0, 0, 0.75 ); */
}

.chart-modal.hidden {
    display: none;
}

/* Expanded chart panel */
.chart-modal-content {
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 10px;
    background: var(--card-bg);/*#1e1e1e;*/
    color: var(--text-primary);/*white*/
    overflow: hidden;
}

.chart-modal-header {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chart-modal-header h3 {
    margin: 0;
}

@media (max-width: 768px) {
    .chart-modal {
        padding: 5px;
    }

    .chart-modal-content {
        padding: 10px;
        border-radius: 6px;
    }
}



/* =========================================================
   DASHBOARD IMPROVEMENTS
   ========================================================= */

/* Better spacing for dashboard elements */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-card {
    padding: 16px;
}


/* =========================================================
   HOME PAGE
   ========================================================= */

/* .home-page { */
/*     display: flex; */
/*     flex-direction: column; */
/*     height: calc(100vh - 20px); */
/*     padding: 12px; */
/*     box-sizing: border-box; */
/* } */


/* title section */
.page-title-card {
    flex-shrink: 0;

    background: var(--card-bg);
    color: var(--text-primary);

    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 10px;

    box-shadow: 0 2px 8px var(--shadow-color);

    border: 1px solid var(--border-color);
}

.page-title {
    margin: 0;
    color: var(--text-primary);
}

.page-subtitle {
    margin: 4px 0;
    color: var(--light-foreground);
}

/* table card */

.table-card {
    background: var(--card-bg);
    color: var(--text-primary);

    border-radius: 12px;
    padding: 8px;

    box-shadow: 0 2px 8px var(--shadow-color);

    border: 1px solid var(--border-color);

    display: flex;
    flex: 1;
    min-height: 0;
}

.table-card .dash-table-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.table-card .dash-spreadsheet-container {
    flex: 1;
}

.table-card .dash-spreadsheet-inner {
    height: 100%;
}
