:root {
    --ink: #172033;
    --muted: #667085;
    --brand: #315c4b;
    --brand-dark: #234538;
    --surface: #d3d9c9;
    --accent: #f0b74b;
}

body { background: var(--surface); color: var(--ink); display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; width: 100%; }
.app-footer { border-top: 1px solid #e1e7e2; color: var(--muted); font-size: .82rem; padding: 1rem 0; }
.app-navbar { background: linear-gradient(110deg, var(--brand-dark), var(--brand)); box-shadow: 0 4px 20px rgba(24, 55, 43, .16); }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--brand-dark); margin-right: .3rem; }
.eyebrow { display: block; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric-card, .value-card { background: #fff; border-radius: 1rem; padding: 1.2rem 1.35rem; box-shadow: 0 5px 22px rgba(29, 41, 57, .06); height: 100%; }
.metric-card span, .value-card span { color: var(--muted); display: block; font-size: .86rem; }
.metric-card strong { font-size: 2rem; }
.value-card strong { display: block; font-size: 1.65rem; margin-top: .3rem; }
.value-card.primary { background: var(--brand); color: #fff; }
.value-card.primary span { color: rgba(255, 255, 255, .72); }
.card { border-radius: 1rem; overflow: hidden; }
.table > :not(caption) > * > * { padding: .9rem 1rem; }
.table thead th { background: #f8faf8; color: #475467; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.product-link { color: var(--ink); font-weight: 650; text-decoration: none; }
.product-link:hover, .back-link:hover { color: var(--brand); }
.empty-state { color: var(--muted); padding: 3rem !important; text-align: center; }
.page-heading { max-width: 780px; margin-bottom: 1.5rem; }
.page-heading h1 { font-weight: 750; margin: .35rem 0; }
.page-heading p { color: var(--muted); }
.back-link { color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; }
.form-label:first-letter, .detail-list dt:first-letter { text-transform: uppercase; }
.form-control:focus, .form-select:focus { border-color: #7aa08f; box-shadow: 0 0 0 .25rem rgba(49, 92, 75, .13); }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); }
.compound-note { border: 1px solid #d6e4db; border-left: 4px solid var(--brand); border-radius: .65rem; background: #f4faf6; color: #365746; padding: .9rem 1rem; }
.detail-list { display: grid; gap: 1rem; margin: 0; }
.detail-list div { border-bottom: 1px solid #edf0ec; display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; }
.detail-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { font-weight: 700; margin: 0; }
.composition-table select { min-width: 280px; }
.composition-table input[type=number] { min-width: 145px; }
.confirm-card { margin-top: 8vh; max-width: 560px; }
.danger-icon { align-items: center; background: #fee4e2; border-radius: 50%; color: #b42318; display: inline-flex; font-size: 1.5rem; font-weight: 800; height: 56px; justify-content: center; margin-bottom: 1rem; width: 56px; }
.tree-node { align-items: center; display: flex; gap: .5rem; min-width: 260px; }
.tree-branch { color: #98a2b3; font-size: 1.1rem; }
.calculator-modal { background: #f5f5f5; border: 0; overflow: hidden; }
.calculator-history { font-size: .8rem; min-height: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calculator-display { font-size: 2.5rem; font-weight: 600; line-height: 1.2; min-height: 3.2rem; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.calculator-key { border-color: #dedede !important; border-radius: .35rem; font-size: 1rem; min-height: 50px; }
.calculator-key:hover { background: #e9ecef; }
.calculator-number { background: #fff; font-size: 1.1rem; font-weight: 500; }
.calculator-operation { font-size: 1.25rem; }
.sale-margin-panel { background: #fff; border: 1px solid #dfe4e1; border-radius: .65rem; padding: 1rem; }
.weight-input-group .form-select { flex: 0 0 42%; }
.quote-items-table { min-width: 1180px; }
.quote-items-table .quote-product-cell { min-width: 280px; }
.quote-items-table td:nth-child(2) { min-width: 175px; }
.quote-items-table td:nth-child(3), .quote-items-table td:nth-child(4) { min-width: 145px; }
.quote-items-table td:nth-child(6) { min-width: 210px; }
.latest-quote-row > * { background: #eef8f1 !important; }
.product-title-block { min-width: 0; }
.product-actions { display: flex; flex-shrink: 0; flex-wrap: nowrap; gap: .5rem; justify-content: flex-end; }
.product-actions .btn { align-items: center; display: inline-flex; flex-shrink: 0; justify-content: center; min-height: 44px; min-width: 112px; padding-inline: 1rem; white-space: nowrap; }

@media (max-width: 1199.98px) {
    .product-actions { justify-content: flex-start; }
}

@media (max-width: 575.98px) {
    .product-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .product-actions .btn { min-width: 0; width: 100%; }
}

@media (max-width: 767.98px) {
    .navbar .btn-light { display: none; }
    .display-6 { font-size: 2rem; }
}
