/* ==================================================
   OTALEX Daily Movement Chart
   Reusable network / store component
   ================================================== */

.daily-movement{
    margin-top:16px;
    padding:17px;
    border:1px solid var(--line);
    border-radius:18px;
    background:#fff;
}

.daily-movement-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
    margin-bottom:15px;
}

.daily-movement-title h2{
    margin:0;
    font-size:15px;
}

.daily-movement-title p{
    margin:5px 0 0;
    color:var(--muted);
    font-size:9px;
    line-height:1.45;
}

.daily-periods{
    display:flex;
    gap:5px;
    flex-shrink:0;
}

.daily-period{
    min-width:42px;
    height:31px;
    padding:0 8px;
    border:1px solid var(--line);
    border-radius:9px;
    background:#fff;
    color:var(--muted);
    font-size:9px;
    font-weight:850;
}

.daily-period.active{
    border-color:#c9c3ff;
    background:#efedff;
    color:#5949d4;
}

.daily-period:disabled{
    opacity:.42;
    cursor:not-allowed;
}

.daily-movement-summary{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:9px;
    margin-bottom:12px;
}

.daily-movement-stat{
    padding:10px 12px;
    border-radius:12px;
    background:#f7f8fb;
}

.daily-movement-stat span{
    display:block;
    margin-bottom:4px;
    color:var(--muted);
    font-size:8px;
}

.daily-movement-stat strong{
    font-size:16px;
}

.daily-movement-stat.sales strong{
    color:#6557f5;
}

.daily-movement-stat.restock strong{
    color:#168562;
}

.daily-movement-stat.net strong.negative{
    color:#d9514e;
}

.daily-movement-stat.net strong.positive{
    color:#168562;
}


/* Chart */

.daily-chart-wrap{
    position:relative;
    width:100%;
    overflow:hidden;
    border-radius:14px;
    background:
        linear-gradient(
            180deg,
            #fafbfe,
            #fff
        );
}

.daily-chart-svg{
    display:block;
    width:100%;
    height:auto;
    min-height:245px;
}

.daily-grid-line{
    stroke:#e8ebf1;
    stroke-width:1;
}

.daily-axis-text{
    fill:#8a93a5;
    font-size:10px;
    font-family:inherit;
}

.daily-axis-date{
    fill:#727d91;
    font-size:10px;
    font-family:inherit;
}

.daily-sales-line{
    fill:none;
    stroke:#6557f5;
    stroke-width:3;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.daily-restock-line{
    fill:none;
    stroke:#32a77d;
    stroke-width:3;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.daily-sales-area{
    fill:url(#dailySalesFill);
}

.daily-restock-area{
    fill:url(#dailyRestockFill);
}

.daily-sales-point{
    fill:#6557f5;
    stroke:#fff;
    stroke-width:2;
}

.daily-restock-point{
    fill:#32a77d;
    stroke:#fff;
    stroke-width:2;
}

.daily-legend{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:14px;
    margin-top:11px;
    color:var(--muted);
    font-size:9px;
}

.daily-legend-item{
    display:flex;
    align-items:center;
    gap:6px;
}

.daily-legend-line{
    width:18px;
    height:3px;
    border-radius:999px;
}

.daily-legend-line.sales{
    background:#6557f5;
}

.daily-legend-line.restock{
    background:#32a77d;
}

.daily-coverage{
    margin-left:auto;
}

.daily-method-note{
    margin-top:11px;
    padding-top:10px;
    border-top:1px solid #eef1f5;
    color:var(--muted);
    font-size:8px;
    line-height:1.45;
}

.daily-chart-empty{
    min-height:220px;
    display:grid;
    place-items:center;
    color:var(--muted);
    font-size:10px;
}

.daily-chart-error{
    padding:18px;
    border:1px solid #f0d7d5;
    border-radius:13px;
    background:#fff6f5;
    color:#a54b47;
    font-size:10px;
}


@media(max-width:700px){

    .daily-movement{
        padding:14px;
    }

    .daily-movement-head{
        display:block;
    }

    .daily-periods{
        margin-top:11px;
    }

    .daily-period{
        flex:1;
    }

    .daily-movement-summary{
        gap:6px;
    }

    .daily-movement-stat{
        padding:9px;
    }

    .daily-movement-stat strong{
        font-size:14px;
    }

    .daily-chart-svg{
        min-height:220px;
    }

    .daily-axis-text{
        font-size:9px;
    }

    .daily-axis-date{
        font-size:9px;
    }

    .daily-coverage{
        width:100%;
        margin-left:0;
        margin-top:3px;
    }
}


/* ==================================================
   Daily movement money mode
   ================================================== */

.daily-controls{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:9px;
    flex-wrap:wrap;
}

.daily-metric-switch{
    display:flex;
    align-items:center;
    padding:3px;
    border:1px solid var(--line);
    border-radius:10px;
    background:#f6f7fa;
}

.daily-metric-btn{
    min-width:48px;
    height:27px;
    padding:0 9px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:var(--muted);
    font-size:9px;
    font-weight:850;
}

.daily-metric-btn.active{
    background:#fff;
    color:#5949d4;
    box-shadow:
        0 1px 5px
        rgba(34,45,72,.10);
}

.daily-price-coverage{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:5px;
    margin-top:10px;
    padding:8px 10px;
    border-radius:10px;
    background:#f7f8fb;
    color:var(--muted);
    font-size:8px;
}

.daily-price-coverage strong{
    color:var(--ink);
    font-size:9px;
}

.daily-price-coverage small{
    font-size:8px;
    color:var(--muted);
}


@media(max-width:700px){

    .daily-controls{
        justify-content:flex-start;
        margin-top:11px;
    }

    .daily-movement-head
    .daily-periods{
        margin-top:0;
    }

    .daily-metric-switch{
        flex-shrink:0;
    }
}
