/* =================================================================================================
   THE BACK OFFICE'S CATALOGUE TOOLS IN HQ (2026-12-01)

   Global Changes, Import Utility, Scheduled Pricing and Price Schedules were built against the
   Back Office's app.css. HQ does not load that file, and loading it would restyle all of HQ. So
   this file holds only the rules those four pages use, copied from AdvDeli.WebOffice/wwwroot/app.css
   (Tables, States, .rf-card, .rf-pair, .sts-warn, the Scheduled Pricing block, the weekday picker
   and the t-cards phone layout). Keep them in step if the Back Office's versions change.

   The Back Office's --line / --muted tokens become HQ's --c-line / --c-text-dim, with the Back
   Office's values as fallbacks.
   ================================================================================================= */

/* ---- the frame: a catalogue store bar inside HQ's own layout ---- */
.hq-cat.embed { min-height: 0; background: none; }
.hq-catbar.embed { position: static; border: 1px solid var(--c-line); border-radius: var(--r-md);
    margin: 0 0 16px; }
.hq-catbar.embed .hq-catbar-spacer { display: none; }

/* ---- Tables ---- */
.grid-wrap { background: #fff; border: 1px solid var(--c-line, #e6e9ee); border-radius: 14px; overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.grid thead th { text-align: left; background: #f7f9fb; color: var(--c-text-dim, #6b7785); font-weight: 700;
    font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.4px; padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--c-line, #e6e9ee); white-space: nowrap; }
table.grid tbody td { padding: 0.7rem 0.9rem; border-bottom: 1px solid #eef1f5; }
table.grid tbody tr:hover { background: #fafbfd; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid thead th.act { width: 1%; text-align: center; }

/* ---- States ---- */
.state { padding: 3rem 1rem; text-align: center; color: var(--c-text-dim, #6b7785); }
.state.err { color: #b3261e; }

.rf-in.short { max-width: 170px; }
.rf-pair { display: flex; gap: 10px; flex-wrap: wrap; }
.rf-card { background: #fff; border: 1px solid #e6ecf3; border-radius: 12px; padding: 18px 20px; }

.sts-warn { margin: 14px 6px 0; background: #fdf3e3; border: 1px solid #e8d3a8; color: #8a5a12;
    padding: 10px 14px; border-radius: 10px; font-size: .88rem; }

/* ---- Scheduled pricing: the bulk pricing grid ---- */
.sp2 { max-width: 1280px; margin: 0 auto; padding: 8px 4px; color: #1f2733; }
.sp2-bar, .sp2-apply { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
    background: #fff; border: 1px solid #e4e9f0; border-radius: 12px; padding: 14px 16px; margin: 0 6px 12px; }
.sp2-apply { background: #f7f9fc; }
.sp2-f { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.sp2-f.grow { flex: 1; min-width: 220px; }
.sp2-f.narrow { min-width: 110px; }
.sp2-f > label { font-size: .74rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: #8a94a2; }
.sp2-acts { display: flex; gap: 8px; margin-left: auto; }
.sp2-empty p { margin: 0 0 14px; }
.sp2-fixed { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px;
    border: 1px dashed #d6dce6; border-radius: 10px; background: #f7f9fc;
    font-size: .92rem; font-weight: 700; color: #1f2733; }
.sp2-fixed-note { font-size: .72rem; font-weight: 600; color: #8a94a2; text-transform: uppercase; letter-spacing: .3px; }
.sp2-basis { display: block; font-size: .66rem; font-weight: 600; color: #8a94a2;
    text-transform: none; letter-spacing: 0; margin-top: 1px; }
.sp2-empty { margin: 0 6px; padding: 48px 20px; text-align: center; color: #8a94a2;
    font-style: italic; background: #fff; border: 1px solid #e4e9f0; border-radius: 12px; }
.sp2-dirty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 6px 12px; padding: 11px 16px; border-radius: 10px;
    background: #fdf3e3; border: 1px solid #e8d3a8; color: #8a5a12; font-size: .88rem; }
.sp2-grid th.chk, .sp2-grid td.chk { width: 34px; text-align: center; }
.sp2-grid tr.sp2-changed { background: #fff8e8; }
.sp2-grid tr.sp2-changed td { border-bottom-color: #e8d3a8; }
.sp2-price { width: 92px; border: 1px solid #d7dfe9; border-radius: 7px; padding: 5px 8px;
    font-size: .88rem; text-align: right; font-variant-numeric: tabular-nums;
    color: #1f2733; background: #fff; }
.sp2-price:focus { outline: 2px solid #c6ccf7; border-color: #4f5bd5; }

/* ---- Scheduled pricing: weekday picker ---- */
.sp-days { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-day { border: 1px solid #d6dce6; border-radius: 8px; padding: 5px 10px; font-size: .8rem;
    font-weight: 700; color: #55636f; cursor: pointer; user-select: none; background: #fff; }
.sp-day.on { background: #4f5bd5; border-color: #4f5bd5; color: #fff; }
.sp-day input { display: none; }

.grid-wrap, .rf-tablewrap { overflow-x: auto; max-width: 100%; }

/* ---- phones: tables become labelled cards ---- */
@media (max-width: 560px) {
    .sp2-f, .sp2-f.grow, .sp2-f.narrow { min-width: 0; width: 100%; }
    .rf-in.short { max-width: none; }

    .t-cards { border: 0; width: 100%; }
    .t-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .t-cards, .t-cards tbody, .t-cards tfoot, .t-cards tr, .t-cards td { display: block; width: auto; }
    .t-cards tr { border: 1px solid var(--c-line, #e6e9ee); border-radius: 10px; margin-bottom: 10px;
        padding: 4px 2px; background: var(--c-s2, #fff); }
    .t-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
        padding: 7px 11px; border: 0; text-align: right; }
    .t-cards td + td { border-top: 1px solid var(--c-line, #eef1f5); }
    .t-cards td::before { content: attr(data-label); flex: 0 0 auto; text-align: left; font-size: .74rem;
        font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--c-text-dim, #6b7785); }
    .t-cards td:not([data-label])::before { display: none; }
    .t-cards td:not([data-label]) { justify-content: flex-start; text-align: left; }
    .t-cards td.t-head { display: block; font-size: 1rem; font-weight: 700; color: var(--c-text, #22303c);
        text-align: left; padding-top: 10px; }
    .t-cards td.t-head::before { display: none; }
    .t-cards td.t-empty { justify-content: center; text-align: center; color: var(--c-text-dim, #6b7785); }
    .t-cards td.t-empty::before { display: none; }
    .t-cards td:not([data-label]):empty { display: none; }
    .t-cards td.act { display: inline-block; width: auto; border: 0; padding: 8px 5px 10px; }
    .t-cards td.act:first-of-type { padding-left: 11px; }
}
