﻿.cal-page {
    padding: 18px;
    background: #f6f7fb;
    min-height: calc(100vh - 20px);
}

.cal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    width: 90%;
}

.cal-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.cal-sub {
    color: rgba(0,0,0,.65);
    margin-top: 2px;
}

.cal-kpis {
    display: flex;
    gap: 12px;
}

.kpi {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    min-width: 140px;
}

.kpi-label {
    font-size: 12px;
    color: rgba(0,0,0,.6);
    font-weight: 700;
}

.kpi-value {
    font-size: 24px;
    font-weight: 900;
    margin-top: 4px;
}

.cal-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.06);
    backdrop-filter: blur(10px);
    margin-bottom: 14px;
    justify-content: space-between;
    width: 80%;
}

.cal-month {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 6px;
}

.cal-month-title {
    font-weight: 900;
    font-size: 18px;
    min-width: 160px;
    text-align: center;
}

.cal-legend {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(0,0,0,.65);
    font-size: 13px;
    white-space: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 6px;
}

    .dot.profit {
        background: rgba(16,185,129,.8);
    }

    .dot.loss {
        background: rgba(239,68,68,.8);
    }

    .dot.flat {
        background: rgba(234,179,8,.9);
    }

    .dot.none {
        background: rgba(0,0,0,.18);
    }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, minmax(90px, 1fr));  
    gap: 10px;
    width: 80%;
    height: 80%;
    justify-content:center;
}

.cal-card {
    max-width: 1100px; /* controls overall calendar width */
    margin: 0 auto; /* 🔥 centers it */
    padding: 16px;
    justify-content: center;
}


.calendar-grid-wrap {
    /*max-height: calc(100vh - 260px);*/ /* header + KPIs + toolbar */
    overflow-y: auto;
    padding: 12px;
    justify-content: center;
}


.day {
    aspect-ratio: 1 / 1;
    min-width: 0; /* important for flex/grid */
    min-height: 0;
    padding: 10px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    position:relative;
}


    .day.profit {
        background: rgba(16,185,129,.12);
        border-color: rgba(16,185,129,.25);
    }

    .day.loss {
        background: rgba(239,68,68,.12);
        border-color: rgba(239,68,68,.25);
    }

    .day.flat {
        background: rgba(234,179,8,.12);
        border-color: rgba(234,179,8,.25);
    }

    .day.none {
        background: rgba(255,255,255,.7);
        color: rgba(0,0,0,.55);
    }

.day-num {
    font-weight: 900;
    font-size: 14px;
    color: rgba(0,0,0,.75);
}

.day-pl {
    font-size: clamp(13px, 1.6vw, 18px);
    font-weight: 900;
    margin-top: 6px;
}

.day-meta {
    font-size: clamp(10px, 1.2vw, 11px);
    color: rgba(0,0,0,.65);
    margin-top: 6px;
}

.day-muted {
    margin-top: 10px;
    color: rgba(0,0,0,.35);
    font-weight: 800;
}

@media (max-width: 1400px) {
    .cal-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1100px) {
    .cal-head {
        flex-direction: column;
    }

    .cal-kpis {
        width: 100%;
    }

    .cal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cal-legend {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .cal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-height: 800px) {
    .day {
        padding: 8px;
    }
}
@media (max-width: 768px) {
    .cal-grid {
        grid-template-columns: repeat(7, minmax(80px, 1fr));
        grid-template-rows: repeat(6, minmax(80px, 1fr));
    }

    .cal-day {
        padding: 6px;
        min-height: 80px;
    }

    .cal-day-pl {
        font-size: 14px;
    }
}


