/* Reports page + tidy toolbar (layout only) — v5: v4 fixes re-scoped so they actually match the synced-sales panel; upload feedback (spinner/clear/hint) styles */
.live-page-head{margin:4px 0 18px}
.live-page-head h1{margin:6px 0 4px;font-size:26px;color:#1c2b4a}
.live-page-head p{margin:0;color:#6b7893;font-size:14px}
html[data-kp-theme=dark] .live-page-head h1{color:#e6ebff}
.live-sales-form{align-items:flex-end}
/* toolbar order: soft actions first, one orange primary last */
#liveSalesSync{order:1}
#liveSalesMonth{order:2}
#liveSalesLoad{order:3}
/* one soft style for the secondary actions (sync + month total) */
#liveSalesSync,#liveSalesMonth{background:#fff!important;color:#c9691b!important;border:1.5px solid #f1b27a!important;border-radius:12px!important;box-shadow:none!important;font-weight:700!important}
#liveSalesSync:hover,#liveSalesMonth:hover{background:#fff6ee!important}
html[data-kp-theme=dark] #liveSalesSync,html[data-kp-theme=dark] #liveSalesMonth{background:transparent!important;border-color:#6b4a2b!important;color:#f0a465!important}
/* same soft look for the file-check step so each card has one orange primary */
#csvImportCheck{background:#fff!important;color:#c9691b!important;border:1.5px solid #f1b27a!important;box-shadow:none!important;font-weight:700!important}
#csvImportCheck:hover{background:#fff6ee!important}
html[data-kp-theme=dark] #csvImportCheck{background:transparent!important;border-color:#6b4a2b!important;color:#f0a465!important}

/* ---- v2: one aligned grid for the synced-sales fields and buttons ---- */
.live-sales-panel .live-sales-form{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;gap:12px!important;align-items:end!important}
.live-sales-panel .live-sales-form>label{flex:none!important;width:100%;max-width:none!important;display:grid!important;gap:7px;align-self:end}
.live-sales-panel .live-sales-form input,.live-sales-panel .live-sales-form select{width:100%!important;height:44px!important;border:1.5px solid #dfe4f2!important;border-radius:12px!important;padding:0 12px!important;box-sizing:border-box}
.live-sales-panel .live-sales-form>button,.live-sales-panel .live-sales-form>.primary-btn,.live-sales-panel .live-sales-form>.outline-btn{min-width:0!important;width:100%!important;height:44px!important;align-self:end;grid-column:auto!important}

/* ---- v2: reports card, file pickers on one aligned row ---- */
.live-reports .live-sales-form{display:grid!important;grid-template-columns:1fr 1fr minmax(180px,max-content)!important;gap:12px!important;align-items:end!important}
.live-reports .live-sales-form>label{flex:none!important;width:100%;max-width:none!important}
.live-reports .live-sales-form>button{align-self:end;height:44px!important}
@media(max-width:800px){.live-reports .live-sales-form{grid-template-columns:1fr!important}}

/* ---- v2: styled file picker (real input stays in place, visually hidden) ---- */
.kp-file{position:relative;display:flex!important;align-items:center;gap:10px;height:44px;min-height:44px;padding:0 14px;border:1.5px dashed #f1b27a;border-radius:12px;background:#fffdf9;color:#a06a2c;font-size:13px;font-weight:600;cursor:pointer;overflow:hidden;box-sizing:border-box}
.kp-file:hover{border-style:solid;background:#fff6ee}
.kp-file:focus-within{border-style:solid;box-shadow:0 0 0 3px #fbe3c2}
.kp-file.has-file{border-style:solid;border-color:#2fae8a;background:#f4fbf8;color:#1d7a5c}
.kp-file input[type=file]{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;opacity:0;overflow:hidden;padding:0!important;border:0!important;background:transparent}
.kp-file-icon{flex:0 0 auto;width:28px;height:28px;border-radius:50%;background:#fdefdd;color:#d97c1d;display:grid;place-items:center}
.kp-file-icon svg{display:block}
.kp-file.has-file .kp-file-icon{background:#d9f2e7;color:#1d7a5c}
.kp-file-ph{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
.kp-file-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;color:#1d7a5c;margin:0}
.kp-file [hidden]{display:none!important}
.live-sales-form label.kp-file>span:first-child::before{content:none!important}
html[data-kp-theme=dark] .kp-file{background:#14233b;border-color:#6b4a2b;color:#f0a465}
html[data-kp-theme=dark] .kp-file:hover{background:#18293f}
html[data-kp-theme=dark] .kp-file.has-file{background:#12261f;border-color:#2fae8a;color:#7fd8b5}
html[data-kp-theme=dark] .kp-file-icon{background:#3a2c1c;color:#f0a465}
html[data-kp-theme=dark] .kp-file.has-file .kp-file-icon{background:#173c30;color:#7fd8b5}
html[data-kp-theme=dark] .kp-file-name{color:#7fd8b5}

/* helper line explaining when Save turns on */
.live-sales-form .kp-btn-help{grid-column:1/-1;order:5;color:#8b98a8;font-size:11px}
html[data-kp-theme=dark] .live-sales-form .kp-btn-help{color:#9fb0c6}

/* ---- v2: clear result card after check / save ---- */
.kp-result{border-radius:14px;padding:16px;margin-top:12px;border:1.5px solid}
.kp-result-ok{background:#eefaf3;border-color:#bfe6cf}
.kp-result-info{background:#f1f6fd;border-color:#cfdff5}
.kp-result-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.kp-result-icon{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:15px;flex:0 0 auto}
.kp-result-ok .kp-result-icon{background:#2fae8a;color:#fff}
.kp-result-info .kp-result-icon{background:#4a7be8;color:#fff}
.kp-result-ok .kp-result-head strong{color:#173025}
.kp-result-info .kp-result-head strong{color:#1d2f52}
.kp-result-head strong{font-size:15px}
.kp-result .live-sales-metrics{margin-top:8px}
.kp-result-note{margin:8px 0 0;font-size:12px;color:#4b5a6a}
.save-state.kp-state-err{color:#c0392b;font-weight:600}
html[data-kp-theme=dark] .kp-result-ok{background:#12261f;border-color:#245c47}
html[data-kp-theme=dark] .kp-result-info{background:#14233b;border-color:#2c4a7c}
html[data-kp-theme=dark] .kp-result-ok .kp-result-head strong{color:#a9e8cf}
html[data-kp-theme=dark] .kp-result-info .kp-result-head strong{color:#bcd3ff}
html[data-kp-theme=dark] .kp-result-note{color:#9fb0c6}

/* ---- v2: keep the Link Foodics button aligned beside the notice text ---- */
#customerModeStatus{align-items:center}
#customerModeStatus .kp-notice-cta{margin-inline-start:0}
@media(max-width:700px){#customerModeStatus .kp-notice-cta{width:100%}}
.kp-result .live-sales-metric strong{white-space:nowrap;font-size:clamp(15px,1.4vw,20px)}

/* ---- v3: synced-sales form — four fields on one baseline, one tidy button row ---- */
.live-reports .live-sales-form{grid-template-columns:minmax(220px,1.15fr) repeat(3,minmax(135px,1fr))!important;align-items:stretch!important}
.live-reports .live-sales-form>label{display:flex!important;flex-direction:column;justify-content:flex-end;gap:7px;min-height:102px}
.live-reports .live-sales-form>label>select,.live-reports .live-sales-form>label>input{height:44px!important}
.live-reports .live-sales-form>button{grid-row:2;height:44px!important;align-self:stretch}
@media(max-width:800px){.live-reports .live-sales-form>label{min-height:0}.live-reports .live-sales-form>button{grid-row:auto}}

/* ---- v4: helper out of the field cell; fields wrap instead of clipping on narrow screens ---- */
.live-sales-panel .live-sales-form{grid-template-columns:repeat(4,minmax(140px,1fr))!important;align-items:end!important;position:relative!important;padding-bottom:24px!important}
.live-sales-panel .live-sales-form>label{display:flex!important;flex-direction:column;justify-content:flex-end;gap:7px;min-height:0!important}
.live-sales-panel .live-sales-form>label>select,.live-sales-panel .live-sales-form>label>input{height:44px!important;width:100%!important}
.live-sales-panel .live-sales-form>button{grid-row:2!important;height:44px!important;align-self:end!important}
@media(max-width:800px){.live-sales-panel .live-sales-form{grid-template-columns:1fr!important;padding-bottom:0!important}.live-sales-panel .live-sales-form>button{grid-row:auto!important}.live-sales-panel .live-sales-form .kp-help{position:static!important}}
.live-sales-panel .live-sales-form .kp-help{position:absolute!important;bottom:2px!important;inset-inline-start:2px;max-width:65%;font-size:11px;color:#8b98a8;line-height:1.5}
html[data-kp-theme=dark] .live-sales-panel .live-sales-form .kp-help{color:#9fb0c6}

/* ---- v5: upload flow feedback — spinner, change-file, clearer hints ---- */
.kp-busy{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:700;color:#1c2b4a;padding:10px 2px}
.kp-spin{width:18px;height:18px;border-radius:50%;border:2.5px solid #f2d3ae;border-top-color:#e87924;animation:kpspin .8s linear infinite;flex:0 0 auto}
@keyframes kpspin{to{transform:rotate(360deg)}}
html[data-kp-theme=dark] .kp-busy{color:#e6ebff}
.kp-file-clear{align-self:end;height:44px!important;width:auto!important;min-width:0!important;padding:0 14px!important;white-space:nowrap}
.kp-ready-hint{font-size:13px;font-weight:700;color:#b45a12;padding:6px 2px}
html[data-kp-theme=dark] .kp-ready-hint{color:#f0a465}
.live-csv-import .kp-btn-help{font-size:12px!important;color:#6b7889!important}
html[data-kp-theme=dark] .live-csv-import .kp-btn-help{color:#9fb0c6!important}
.kp-result .live-sales-metric strong{font-size:clamp(17px,1.6vw,22px)}
.kp-result-head strong{font-size:16px}
