.backoffice .costs-page-head { margin-bottom: 20px; }
.backoffice .costs-page-head h1 { font-size: 50px !important; line-height: 1.12; }
.backoffice .costs-page-head p { font-size: 17px; }
.backoffice .costs-page-head .eyebrow { font-size: 13px; }
.backoffice .costs-page-head + .costs-alert { font-size: 15px; }
.backoffice .costs-price-panel h2, .backoffice .costs-alert-panel h2, .backoffice .costs-suppliers-panel h2, .backoffice .costs-analytics-panel h2, .backoffice .costs-recipe-panel h2, .backoffice .costs-history-panel h2 { font-size: 24px; line-height: 1.25; }
.backoffice .costs-form-panel h2 { font-size: 22px; }
.backoffice .costs-form-panel .eyebrow, .backoffice .costs-analytics-panel .eyebrow { font-size: 12px; }
.backoffice .costs-alert { margin-bottom: 18px; }
.backoffice .costs-setup-notice { max-width: 760px; padding: 30px; border-color: var(--gold); background: linear-gradient(135deg, var(--panel), var(--panel-2)); }
.backoffice .costs-setup-notice h2 { margin: 8px 0; font: 500 25px var(--serif); }
.backoffice .costs-setup-notice p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.backoffice .costs-setup-notice code { display: inline-block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--gold); background: var(--input); font-size: 14px; }
.backoffice .costs-setup-notice small { display: block; margin-top: 14px; color: var(--dim); font-size: 12px; }
.backoffice .costs-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.backoffice .costs-metric-card { min-height: 126px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, var(--card-start), var(--card-end)); }
.backoffice .costs-metric-card.is-warning { border-color: var(--danger); }
.backoffice .costs-metric-card span { display: block; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.backoffice .costs-metric-card strong { display: block; margin-top: 12px; color: var(--gold); font: 500 31px var(--serif); }
.backoffice .costs-metric-card small { display: block; margin-top: 5px; color: var(--dim); font-size: 12px; }
.backoffice .costs-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr); gap: 16px; margin-bottom: 16px; }
.backoffice .costs-price-panel, .backoffice .costs-alert-panel, .backoffice .costs-form-panel, .backoffice .costs-recipe-panel, .backoffice .costs-history-panel { min-width: 0; }
.backoffice .cost-table-wrap { width: 100%; overflow-x: auto; }
.backoffice .cost-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.backoffice .cost-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--dim); text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; }
.backoffice .cost-table td { padding: 13px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; vertical-align: middle; }
.backoffice .cost-table tr:last-child td { border-bottom: 0; }
.backoffice .cost-table td strong, .backoffice .cost-table td small { display: block; }
.backoffice .cost-table td strong { color: var(--text); font-size: 14px; }
.backoffice .cost-table td small { margin-top: 4px; color: var(--dim); font-size: 11px; }
.backoffice .cost-inline-link { color: var(--gold); font-size: 12px; white-space: nowrap; }
.backoffice .cost-inline-danger { padding: 4px 7px; border: 1px solid var(--danger); border-radius: 4px; background: transparent; color: #ffb2aa; font-size: 11px; }
.backoffice .cost-inline-danger:hover { background: var(--danger); color: #fff; }
.backoffice .cost-variance, .backoffice .cost-stock-pill, .backoffice .cost-food-pill { display: inline-block; padding: 5px 8px; border-radius: 5px; font-size: 12px; white-space: nowrap; }
.backoffice .cost-variance.up { color: #ffb2aa; background: #552b2a; }
.backoffice .cost-variance.down { color: #b6d49e; background: #2d4230; }
.backoffice .cost-variance.stable { color: var(--gold); background: #493b24; }
.backoffice .cost-stock-pill.normal { color: #b6d49e; background: #2d4230; }
.backoffice .cost-stock-pill.low { color: #ffb2aa; background: #552b2a; }
.backoffice .cost-food-pill.good { color: #b6d49e; background: #2d4230; }
.backoffice .cost-food-pill.warning { color: var(--gold); background: #493b24; }
.backoffice .cost-food-pill.danger { color: #ffb2aa; background: #552b2a; }
.backoffice .cost-empty { padding: 28px 12px !important; color: var(--muted) !important; text-align: center; font-size: 14px !important; }
.backoffice .cost-empty-box { display: grid; gap: 8px; padding: 32px 12px; color: var(--text); text-align: center; }
.backoffice .cost-empty-box small { color: var(--muted); font-size: 12px; }
.backoffice .cost-alert-list { display: grid; gap: 9px; }
.backoffice .cost-alert-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--input); }
.backoffice .cost-alert-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 700; }
.backoffice .cost-alert-row strong, .backoffice .cost-alert-row small { display: block; }
.backoffice .cost-alert-row strong { color: var(--text); font-size: 14px; }
.backoffice .cost-alert-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.backoffice .cost-alert-row a { color: var(--gold); font-size: 12px; }
.backoffice .costs-source-note { margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--card-end); }
.backoffice .costs-source-note strong, .backoffice .costs-source-note small { display: block; }
.backoffice .costs-source-note strong { color: var(--gold); font-size: 13px; }
.backoffice .costs-source-note small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.backoffice .costs-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.backoffice .costs-suppliers-panel { margin-bottom: 16px; }
.backoffice .costs-analytics-panel { margin-bottom: 16px; }
.backoffice .costs-form-panel { padding: 20px; }
.backoffice .cost-form { display: grid; gap: 12px; margin-top: 18px; }
.backoffice .cost-form label, .backoffice .cost-recipe-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.backoffice .cost-form input, .backoffice .cost-form select, .backoffice .cost-form textarea, .backoffice .cost-recipe-form input, .backoffice .cost-recipe-form select { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: var(--input); color: var(--text); font: inherit; font-size: 14px; }
.backoffice .cost-form textarea { resize: vertical; }
.backoffice .cost-form input:focus, .backoffice .cost-form select:focus, .backoffice .cost-form textarea:focus, .backoffice .cost-recipe-form input:focus, .backoffice .cost-recipe-form select:focus { border-color: var(--gold); }
.backoffice .cost-form-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.backoffice .cost-form-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.backoffice .cost-form-actions { display: flex; align-items: center; gap: 8px; }
.backoffice .cost-recipe-panel, .backoffice .costs-history-panel { margin-bottom: 16px; }
.backoffice .cost-recipe-form { display: grid; grid-template-columns: 1.4fr 1.4fr .7fr .7fr 1.3fr auto; gap: 10px; align-items: end; margin: 18px 0 20px; }
.backoffice .cost-recipe-form .gold-btn { min-height: 44px; white-space: nowrap; }
.backoffice .cost-profitability-wrap { border-top: 1px solid var(--line); padding-top: 4px; }
.backoffice .cost-recipe-detail { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.backoffice .cost-recipe-detail-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 7px; color: var(--text); font-size: 14px; }
.backoffice .cost-recipe-detail-head small { color: var(--muted); font-size: 12px; }
.backoffice .cost-algorithm-note { margin: -4px 0 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--card-end); font-size: 12px; }
.backoffice .cost-algorithm-note strong { color: var(--gold); }
.backoffice .supplier-score-badge { display: inline-block; min-width: 48px; padding: 5px 7px; border-radius: 5px; text-align: center; font-size: 12px; }
.backoffice .supplier-score-badge.great { background: #2d4230; color: #b6d49e; }
.backoffice .supplier-score-badge.good { background: #493b24; color: var(--gold); }
.backoffice .supplier-score-badge.weak { background: #552b2a; color: #ffb2aa; }
.backoffice .cost-recommendation-head { display: flex; justify-content: space-between; gap: 14px; margin: 20px 0 7px; color: var(--text); font-size: 14px; }
.backoffice .cost-recommendation-head small { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
    .backoffice .costs-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backoffice .costs-form-panel:last-child { grid-column: 1 / -1; }
    .backoffice .cost-recipe-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .backoffice .costs-page-head h1 { font-size: 39px !important; }
    .backoffice .costs-page-head p { font-size: 15px; }
    .backoffice .costs-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backoffice .costs-dashboard-grid { grid-template-columns: 1fr; }
    .backoffice .costs-form-grid { grid-template-columns: 1fr; }
    .backoffice .costs-form-panel:last-child { grid-column: auto; }
    .backoffice .cost-recipe-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .backoffice .costs-metric-card { min-height: 112px; padding: 14px; }
    .backoffice .costs-metric-card span { font-size: 10px; }
    .backoffice .costs-metric-card strong { font-size: 25px; }
    .backoffice .cost-form-two, .backoffice .cost-form-three, .backoffice .cost-recipe-form { grid-template-columns: 1fr; }
    .backoffice .cost-alert-row { grid-template-columns: 28px minmax(0, 1fr); }
    .backoffice .cost-alert-row a { grid-column: 2; }
}
