/* Pilotage: the shared visual contract, also used by embedded workspaces. */
:root {
    --color-primary: #f51b2b;
    --color-primary-dark: #c90d22;
    --color-primary-light: #ffe4e9;
    --color-primary-hover-light: #ffd9e1;
    --color-primary-border: #ffaab8;
    --color-text: #20242a;
    --color-text-secondary: #69717d;
    --color-background: #f5f6f8;
    --color-surface: #fff;
    --color-border: #e6e9ed;
    --color-table-header: #f5f6f8;
    --color-success: #008648;
    --color-success-dark: #007a40;
    --color-success-light: #d4f7e4;
    --color-success-border: #8cdbb0;
    --color-warning: #f59b00;
    --color-warning-dark: #9c5100;
    --color-warning-light: #ffe8bc;
    --color-warning-border: #f0b44c;
    --color-chart-main: var(--color-primary);
    --color-chart-secondary: #69717d;
    --color-chart-tertiary: #9aa4b1;
    --color-chart-quaternary: #cfd5dd;
    --app-font: Poppins, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --app-radius: 14px;
    --app-shadow: 0 2px 8px #20242a05;
}
body:is(.app-theme, .app-login) { font-family: var(--app-font); color: var(--color-text); }
body.app-theme :is(p, .btn, .nav-link, .app-nav-link, .app-nav-child, .app-breadcrumb ol, .form-control, .custom-select, .input-group-text, .dropdown-menu, .app-eyebrow, button:not(.fa), summary, input, select, textarea),
body.app-theme input.datepicker,
body.app-login :is(input, button, label, p) { font-family: var(--app-font) !important; }
body.app-theme :is(h1,h2,h3,h4,h5,h6) { font-family: var(--app-font); font-weight: 600; letter-spacing: -.025em; }
body.app-theme :is(h4,h5,h6,.app-panel-title,.app-section-title) { letter-spacing: -.015em; }
body.app-theme .app-topbar-heading h1 { font-weight: 600; letter-spacing: -.035em; }
body.app-theme .app-eyebrow { font-weight: 600; letter-spacing: .1em; }
body.app-theme :is(.box,.card,.article-card,.product-photo-card,.uber-panel,.uber-sales-panel,.app-panel,.app-employee-section,.home-shortcuts,.home-kpi-card,.bg_releve_temperature) {
    border-color: var(--color-border); border-radius: var(--app-radius); background: var(--color-surface); box-shadow: var(--app-shadow);
}
body.app-theme :is(.app-flat-panel,.box.app-flat-panel) { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
body.app-theme :is(.pos-metric-card,.app-metric,.hp-kpi,.uber-mini-stat,.hs-kpi-inline) { background: var(--color-surface); border-radius: var(--app-radius); }
body.app-theme .hs-pilotage .hp-kpi { background: var(--color-surface) !important; }
body.app-theme .hs-pilotage { --hp-blue: #69717d; }
body.app-theme .hs-pilotage .hp-kpi-regular .hp-kpi-icon { background: var(--color-background) !important; }
body.app-theme :is(.pos-metric-card .fs-20,.pos-sales-kpi .fs-20,.app-metric strong,.home-kpi-card__value,.hp-kpi-value,.uber-mini-stat__value) {
    color: var(--color-text); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.04em;
}
body.app-theme :is(.pos-metric-card,.pos-sales-kpi) .fs-20 { font-size: 26px; line-height: 1.35; margin-top: 10px; }
body.app-theme .pos-metric-card > .text-muted { font-size: 12px; }
body.app-theme :is(.pos-metric-card,.pos-sales-kpi) > .text-muted { color: #515966 !important; font-weight: 500; }
body.app-theme :is(.pos-metric-card,.pos-sales-kpi) .fs-20 { font-weight: 700; }
body.app-theme :is(.pos-metric-card,.pos-sales-kpi) :is([data-pos-value="summary.ca_ttc"],[data-pos-value="products.ca_ttc"],[data-pos-value="vat.ca_ttc"],[data-pos-value="payments.montant"]) { color: var(--color-primary); }
body.app-theme :is(.btn,.uber-button,.uber-sales-button,.app-button-primary) { border-radius: 8px; font-weight: 500; letter-spacing: 0; }
body.app-theme :is(.btn-outline-secondary,.btn-light,.btn-secondary,.btn-default,.uber-button--soft,.uber-sales-button--soft) { background: #eef0f3; color: var(--color-text); }
body.app-theme :is(.btn-outline-secondary,.btn-light,.btn-secondary,.btn-default,.uber-button--soft,.uber-sales-button--soft):hover { background: #e6e9ed; color: var(--color-text); }
body.app-theme :is(.nav-pills,.nav-tabs,[role="tablist"]) :is(.nav-link,[role="tab"]) { font-family: var(--app-font); border-radius: 8px; font-weight: 500; }
body.app-theme :is(.nav-pills,.nav-tabs,[role="tablist"]) :is(.nav-link.active,[role="tab"][aria-selected="true"]) { background: var(--color-primary-light); color: var(--color-primary-dark); }
body.app-theme #sidebar.app-sidebar { background: #111; }
body.app-theme #sidebar :is(.app-nav-link,.app-nav-child) { border-radius: 8px; font-weight: 500; }
.app-nav-collapsed body.app-theme .app-nav-children { background: #111; }
body.app-theme :is(.form-control,.custom-select,.input-group-text,.bootstrap-select > .dropdown-toggle) { border-radius: 8px; }
/* Keep joined controls joined; heights remain owned by torigal-forms.css. */
body.app-theme .input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.app-theme .input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
body.app-theme .input-group-append .input-group-text { border-top-left-radius: 0; border-bottom-left-radius: 0; }
body.app-theme .input-group-prepend .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.app-theme .table thead th { color: var(--color-text-secondary); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
body.app-theme .table { font-variant-numeric: tabular-nums; }
body.app-theme .table > :is(tbody,tfoot) > tr.app-table-total > :is(th,td) { color: var(--color-primary-dark); font-weight: 600; border-top: 2px solid var(--color-border); }
body.app-theme .app-schedule-table .is-different { background: var(--app-table-row-background, var(--color-surface)); }
body.app-theme :is(.app-table-scroll,div.table-responsive) { border-radius: 10px; }
body.app-theme :is(.modal-content,.catalog-dialog,.history-dialog,.app-table-print-dialog) { border-radius: 16px; }
body.app-theme :is(.modal-header,.catalog-dialog-head) { background: var(--color-surface); }
body.app-theme .app-chart-card { padding: 22px; }
.app-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.app-chart-head h5 { margin: 0; }
.app-chart-status { color: var(--color-text-secondary); font-size: 11px; }
.app-chart-scroll { overflow: auto; max-height: 440px; overscroll-behavior: contain; }
.app-chart-plot { position: relative; height: 300px; min-width: 0; }
.app-chart-head .app-table-badge { flex-shrink: 0; }
.app-sales-filters { display: grid; grid-template-columns: minmax(320px,1fr) 150px minmax(320px,2fr); align-items: start; }
.app-sales-filters > [class*="col-"] { max-width: 100%; width: auto; }
@media (min-width:768px) and (max-width:1250px) {
    .app-sales-filters { grid-template-columns: minmax(320px,1fr) 150px; }
    .app-sales-filters > :last-child { grid-column: 1 / -1; margin-top: 8px; }
}
.pos-sales-change-chart { height: 320px; }
.app-chart-reference-note { font-size: 11px; color: var(--color-text-secondary); margin: 8px 0 0; }
.app-chart-key, .app-chart-key > span, .app-chart-key > button { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text-secondary); font-size: 11px; }
.app-chart-key { gap: 18px; }
.app-chart-key > button { min-height: 36px; padding: 4px 0; background: transparent; border: 0; cursor: pointer; }
.app-chart-key > button[hidden] { display: none; }
.app-chart-key > button[aria-pressed="false"] { text-decoration: line-through; opacity: .65; }
.app-chart-swatch { display: inline-block; width: 15px; height: 3px; background: var(--color-primary); border-radius: 1px; }
.app-chart-swatch--reference { background: repeating-linear-gradient(to right,#9aa4b1 0 4px,transparent 4px 7px); }
body.app-theme .pos-sales-meter span { background: var(--color-primary); }
body.app-theme .pos-sales-panel:has(#salesLow) .pos-sales-meter span { background: var(--color-chart-tertiary); }
body.app-login .app-login-card { border-radius: 20px; box-shadow: 0 12px 48px #20242a0a; }
@media (max-width: 767px) {
    .app-sales-filters { grid-template-columns: minmax(0,1fr); }
    body.app-theme :is(.app-chart-card,.box.app-chart-card) { padding: 16px !important; }
    body.app-theme :is(.pos-metric-card,.pos-sales-kpi) .fs-20 { font-size: 22px; }
    body.app-theme :is(.nav-pills,.nav-tabs,[role="tablist"]) :is(.nav-link,[role="tab"]) { min-height: 44px; }
    .app-chart-plot { height: 260px; }
    .app-chart-scroll { max-height: 380px; }
    .pos-sales-change-chart { height: 340px; }
    .app-chart-key > button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    body.app-theme :is(.btn,.card,.box,.home-kpi-card) { transition: none; }
}
@media print {
    body.app-theme :is(.box,.card,.app-panel) { box-shadow: none; break-inside: avoid; }
}
