/* Richesse-tech ERP — self-contained UI, no external font or CDN dependency. */
:root {
    --bg: #f3f5f4;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --ink: #192521;
    --muted: #718079;
    --line: #e3e9e6;
    --brand: #14786c;
    --brand-dark: #0c5e55;
    --sidebar: #132923;
    --sidebar-soft: #1c352e;
    --lime: #d8ed9b;
    --danger: #c84b4b;
    --warning: #bd7828;
    --shadow: 0 8px 30px rgba(21, 46, 38, .045);
    --radius: 16px;
    --sidebar-width: 252px;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
svg { width: 21px; height: 21px; fill: currentColor; flex: 0 0 auto; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(25px, 2.4vw, 32px); line-height: 1.25; letter-spacing: -.8px; }
h2 { letter-spacing: -.3px; }
:focus-visible { outline: 3px solid rgba(20, 120, 108, .22); outline-offset: 2px; }
::selection { color: #10251f; background: var(--lime); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 26px 18px 18px; color: #dce8e2; background: var(--sidebar); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 11px 11px 11px 3px; color: #183026; background: var(--lime); font-family: Georgia, serif; font-size: 26px; font-weight: 700; font-style: italic; }
.brand strong { display: block; color: #fff; font-size: 16px; font-weight: 650; letter-spacing: -.3px; }
.brand small { display: block; margin-top: 1px; color: #8fa69c; font-size: 10px; letter-spacing: 2.5px; }
.navigation { display: flex; flex: 1; flex-direction: column; margin-top: 34px; }
.nav-caption { margin: 22px 13px 8px; color: #708b80; font-size: 10px; font-weight: 650; letter-spacing: 1.8px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 45px; margin: 2px 0; padding: 10px 13px; border-radius: 10px; color: #aac0b6; font-weight: 500; transition: color .18s, background .18s, transform .18s; }
.nav-link svg { width: 19px; height: 19px; opacity: .85; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); transform: translateX(2px); }
.nav-link.active { color: #f3f8e8; background: var(--sidebar-soft); }
.nav-link.active::before { position: absolute; left: -18px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--lime); content: ""; }
.nav-link.active svg { color: var(--lime); opacity: 1; }
.sidebar-account { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 26px; padding: 14px 8px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.account-summary { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; color: #20382d; background: #bdd7c7; font-weight: 700; }
.account-summary strong, .account-summary small { display: block; max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary strong { color: #eef5f1; font-size: 12px; font-weight: 600; }
.account-summary small { color: #7f9a8e; font-size: 10px; }
.account-actions, .account-actions form { display: flex; gap: 2px; }
.account-actions a, .account-actions button { display: grid; place-items: center; width: 28px; height: 30px; padding: 0; border: 0; color: #8da69a; background: transparent; }
.account-actions a:hover, .account-actions button:hover { color: var(--lime); }
.account-actions svg { width: 17px; height: 17px; }
.main-area { display: flex; flex-direction: column; min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 69px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.78); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.breadcrumb span { color: #8b9892; font-size: 10px; font-weight: 650; letter-spacing: 1.5px; }
.breadcrumb i { color: #c0c9c4; font-style: normal; }
.breadcrumb strong { font-weight: 550; }
.system-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.system-state > span { width: 7px; height: 7px; border-radius: 50%; background: #39a67d; box-shadow: 0 0 0 4px rgba(57,166,125,.1); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.language-switch select { width: 112px; min-width: 0; min-height: 34px; padding: 6px 26px 6px 9px; color: #5f6f66; background: #fff; font-size: 11px; }
.menu-button { display: none; width: 38px; height: 38px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.menu-button span { display: block; height: 2px; margin: 3px 0; border-radius: 2px; background: var(--ink); }
.sidebar-backdrop { display: none; }
.content { width: 100%; max-width: 1650px; margin: 0 auto; padding: 32px 34px 42px; flex: 1; }
.footer { display: flex; justify-content: space-between; padding: 16px 34px; border-top: 1px solid var(--line); color: #95a19b; font-size: 10px; letter-spacing: .4px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--brand); font-size: 9px; font-weight: 750; letter-spacing: 2.1px; }
.eyebrow.light { color: var(--lime); }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heading-actions form { display: inline-flex; }
.heading-with-status { display: flex; align-items: center; gap: 15px; }
.heading-with-status .eyebrow { margin: 0; }
.date-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; color: #66746e; background: rgba(255,255,255,.6); font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background .18s, border .18s, transform .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 4px 12px rgba(20,120,108,.13); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 5px 16px rgba(20,120,108,.2); }
.btn-secondary { border-color: #dce3df; color: #405049; background: #fff; }
.btn-secondary:hover { border-color: #c1d0c8; background: #fafcfb; }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-danger-ghost { border-color: #efd7d7; color: var(--danger); background: #fffafa; }
.btn-danger-ghost:hover { background: #fff0f0; }
.btn-small { min-height: 33px; padding: 7px 11px; font-size: 11px; }
.btn-large { min-height: 48px; font-size: 14px; }
.btn-block { width: 100%; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2 { margin: 0; font-size: 15px; font-weight: 650; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.panel-heading > div:has(p) { display: block; }
.panel-heading .section-number { color: #93a29a; font-family: ui-monospace, monospace; font-size: 11px; }
.padded-heading { margin: 0; padding: 22px 24px; }
.text-link, .card-link { color: var(--brand); font-size: 11px; font-weight: 600; }
.text-link:hover, .card-link:hover { text-decoration: underline; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card { position: relative; min-width: 0; padding: 20px 21px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.kpi-card.warning-card { border-color: #eddfc9; background: linear-gradient(145deg, #fff 65%, #fff9ef); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; min-height: 33px; margin-bottom: 16px; }
.kpi-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-family: Georgia, serif; font-size: 17px; font-weight: 600; }
.kpi-icon.green { color: #177262; background: #e6f3ed; }
.kpi-icon.blue { color: #39728f; background: #eaf2f7; }
.kpi-icon.violet { color: #756090; background: #f0ecf5; }
.kpi-icon.amber { color: #aa702b; background: #faf0df; }
.kpi-card > p { margin-bottom: 5px; color: #6b7b73; font-size: 11px; }
.kpi-card h2 { margin-bottom: 5px; font-size: clamp(23px, 2.2vw, 29px); font-weight: 650; letter-spacing: -1px; white-space: nowrap; }
.kpi-card > small { color: #9aa69f; font-size: 10px; }
.trend-label, .count-badge { padding: 3px 8px; border-radius: 20px; color: var(--brand); background: #eaf5f0; font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr); gap: 18px; margin-bottom: 18px; }
.dashboard-grid > .panel { padding: 22px 24px; }
.bar-chart { display: flex; align-items: stretch; justify-content: space-around; gap: 12px; height: 220px; padding: 15px 4px 0; }
.bar-column { display: flex; flex: 1; flex-direction: column; align-items: center; min-width: 25px; }
.bar-value { min-height: 22px; color: #839089; font-size: 9px; white-space: nowrap; }
.bar-track { position: relative; width: min(34px, 65%); height: 160px; border-radius: 7px 7px 3px 3px; background: #f1f4f2; overflow: hidden; }
.bar-fill { position: absolute; right: 0; bottom: 0; left: 0; min-height: 3px; border-radius: 6px 6px 2px 2px; background: #a8c6b8; transition: height .5s ease; }
.bar-fill.today { background: var(--brand); }
.bar-label { margin-top: 10px; color: #7c8b84; font-size: 10px; }
.stock-alert-list, .low-stock-list { display: flex; flex-direction: column; }
.stock-alert-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1ee; }
.stock-alert-item:last-child { border: 0; }
.stock-alert-item > span:nth-child(2) { flex: 1; min-width: 0; }
.stock-alert-item strong, .stock-alert-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-alert-item strong { font-size: 12px; }
.stock-alert-item small { color: var(--muted); font-size: 9px; }
.stock-alert-item b { color: #aa652a; font-size: 11px; white-space: nowrap; }
.product-glyph { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 10px; color: #4c6e5e; background: #edf3ee; font-size: 12px; font-weight: 650; }
.product-thumbnail { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; background: #edf3ee; }
.inventory-section { margin-bottom: 18px; }
.mini-empty { padding: 34px 10px; color: #8a9991; text-align: center; }
.mini-empty > span { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 10px; border-radius: 50%; color: var(--brand); background: #e9f4ef; }
.mini-empty p { margin-bottom: 4px; color: #54645c; }
.mini-empty small { font-size: 11px; }
.table-panel { overflow: hidden; }
.table-panel > .panel-heading { margin-bottom: 0; padding: 22px 24px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 18px; border-bottom: 1px solid var(--line); color: #89968f; background: #f8faf9; font-size: 10px; font-weight: 600; letter-spacing: .35px; text-align: left; white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid #edf1ee; color: #4c5a53; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafcfb; }
td strong { color: #28362f; font-weight: 600; }
.align-right { text-align: right; }
.amount { color: #24352e; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.cell-subtitle { display: block; margin-top: 3px; color: #96a29c; font-size: 10px; font-weight: 400; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .95em; letter-spacing: -.2px; }
.primary-link { color: var(--brand); font-weight: 650; }
.primary-link:hover { text-decoration: underline; }
.row-action { display: inline-flex; margin-left: 10px; padding: 4px 2px; color: var(--brand); font-size: 11px; font-weight: 600; }
.row-action:hover { text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 30px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; opacity: .75; }
.status-draft, .status-quote_draft, .status-order_draft { color: #6f7a75; background: #eef1ef; }
.status-quote_sent { color: #6b5c91; background: #f0edf7; }
.status-quote_accepted { color: #28775c; background: #e9f4ed; }
.status-quote_rejected { color: #9a6666; background: #f5eded; }
.status-confirmed { color: #32738b; background: #eaf3f6; }
.status-completed { color: #28775c; background: #e9f4ed; }
.status-cancelled { color: #9a6666; background: #f5eded; }
.status-low { color: #a76a26; background: #fbf0df; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 160px; }
.entity-avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 50%; color: #496555; background: #e6eee8; font-size: 12px; font-weight: 650; }
.table-empty { padding: 48px 15px; color: #829089; text-align: center; }
.table-empty p { margin-bottom: 5px; color: #5c6b63; }
.table-empty a { color: var(--brand); font-size: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 12px 14px; }
.filter-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: #91a098; transform: translateY(-50%); pointer-events: none; }
.search-box input { width: 290px; padding-left: 37px; }
input, select, textarea { width: 100%; border: 1px solid #dce4df; border-radius: 8px; color: #293a32; background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
input, select { min-height: 39px; padding: 8px 11px; }
select { min-width: 135px; padding-right: 30px; }
textarea { min-height: 90px; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a8b2ad; }
input:focus, select:focus, textarea:focus { border-color: #69a99c; box-shadow: 0 0 0 3px rgba(20,120,108,.08); }
input[type="checkbox"], input[type="radio"] { width: 16px; min-height: 16px; padding: 0; accent-color: var(--brand); }
.filter-check { display: flex; align-items: center; gap: 6px; color: #66756d; font-size: 11px; white-space: nowrap; }
.record-count { color: #8c9992; font-size: 10px; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-top: 1px solid var(--line); color: #8a9790; font-size: 10px; }
.pagination > div { display: flex; gap: 4px; }
.page-btn { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: #627169; background: #fff; }
.page-btn:hover { border-color: #a8c6ba; }
.page-btn.current { border-color: var(--brand); color: #fff; background: var(--brand); }
.form-panel { max-width: 980px; padding: 28px; }
.narrow-panel { max-width: 580px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.form-group { margin-bottom: 18px; }
.form-grid .form-group { margin-bottom: 0; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group > label { display: block; margin-bottom: 7px; color: #53635a; font-size: 11px; font-weight: 600; }
.form-group label em { margin-left: 3px; color: #c25959; font-style: normal; }
.help-text { display: block; margin-top: 6px; color: #8a9790; font-size: 10px; }
.help-text ul { margin: 5px 0; padding-left: 18px; }
.field-error { display: block; margin-top: 5px; color: var(--danger); font-size: 10px; }
.errorlist { margin: 0 0 14px; padding: 10px 14px 10px 30px; border-radius: 8px; color: #9e4242; background: #fff0f0; font-size: 12px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; padding-top: 25px; }
.checkbox-group label { margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 28px -28px -28px; padding: 18px 28px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: #fafbfA; }
.messages { position: relative; z-index: 5; margin-bottom: 18px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; padding: 12px 15px; border: 1px solid #dce8e2; border-radius: 10px; color: #38574a; background: #edf7f1; font-size: 12px; }
.alert button { padding: 0; border: 0; color: inherit; background: transparent; font-size: 20px; }
.alert-error { border-color: #eed5d5; color: #934c4c; background: #fff1f1; }
.alert-warning { border-color: #efdfc8; color: #916328; background: #fff8ed; }
.order-info-panel, .order-lines-panel { padding: 23px 25px; margin-bottom: 18px; }
.order-fields { grid-template-columns: 1.5fr 1fr .6fr; }
.order-fields .full-width { grid-column: 1 / -1; }
.order-lines-panel { padding-bottom: 0; }
.order-lines-panel > .table-wrap { margin: 0 -25px; width: calc(100% + 50px); }
.order-items-table { min-width: 1120px; }
.order-items-table th { padding: 11px 10px; }
.order-items-table td { padding: 12px 10px; vertical-align: top; }
.order-items-table .item-product { width: 27%; min-width: 220px; padding-left: 25px; }
.order-items-table .item-remove { width: 45px; padding-right: 20px; }
.order-items-table .item-quantity { width: 80px; }
.order-items-table .item-price { width: 125px; }
.order-items-table .item-discount-type { width: 120px; }
.order-items-table .item-discount-value { width: 105px; }
.order-items-table .item-tva { width: 90px; }
.order-items-table .item-total { width: 135px; padding-top: 21px; white-space: nowrap; }
.order-items-table select { min-width: 0; }
.delete-control { display: none; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #e6ebe8; border-radius: 7px; color: #9b7777; background: #fff; font-size: 18px; }
.icon-button:hover { border-color: #e5c6c6; background: #fff3f3; }
.removed-row { display: none; }
.document-summary-editor { display: grid; grid-template-columns: minmax(230px, 1fr) 390px; gap: 35px; padding: 22px 0; }
.global-discount-editor { align-self: start; padding: 17px; border: 1px solid #e5eae7; border-radius: 11px; background: var(--surface-soft); }
.global-discount-editor h3 { margin: 0 0 5px; font-size: 13px; }
.global-discount-editor p { margin-bottom: 14px; color: var(--muted); font-size: 10px; }
.discount-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.discount-fields label { display: block; margin-bottom: 6px; color: #66766d; font-size: 10px; }
.order-totals, .detail-totals { width: 330px; max-width: 100%; margin: 16px 0 16px auto; padding-left: 25px; }
.document-summary-editor .order-totals { width: auto; margin: 0; padding: 0; }
.order-totals .total-row, .detail-totals > div { display: flex; justify-content: space-between; gap: 30px; padding: 7px 0; color: #718078; font-size: 11px; }
.order-totals strong, .detail-totals strong { color: #3c4d44; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-totals .discount-amount strong, .detail-totals .global-discount-total strong { color: #a16b2e; }
.order-totals .subtotal-row { border-top: 1px dashed var(--line); }
.order-totals .tax-group-row { color: #89968f; font-size: 10px; }
.detail-totals .global-discount-total { margin: 4px 0; padding: 8px; border-radius: 7px; color: #8a5b20; background: #fff8e9; }
.order-totals .grand-total, .detail-totals .grand-total { margin-top: 6px; padding-top: 13px; border-top: 1px solid var(--line); color: #293b32; font-size: 13px; }
.order-totals .grand-total strong, .detail-totals .grand-total strong { color: var(--brand); font-size: 20px; }
.sticky-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.92); box-shadow: 0 8px 25px rgba(20,45,35,.06); }
.sticky-form-actions > span { color: #87948d; font-size: 10px; }
.sticky-form-actions > div { display: flex; gap: 9px; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.order-detail-grid aside { display: flex; flex-direction: column; gap: 18px; }
.order-notes { margin-top: 18px; padding: 22px 24px; }
.order-notes h2 { font-size: 14px; }
.order-notes p { margin: 0; color: #63736a; font-size: 12px; }
.detail-side-card { padding: 22px; }
.detail-side-card h2 { margin-bottom: 17px; font-size: 15px; }
.customer-detail-name { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
dl { margin: 0; }
.detail-side-card dl dt { margin-top: 13px; color: #95a099; font-size: 9px; }
.detail-side-card dl dd { margin: 3px 0 0; color: #45564d; font-size: 12px; word-break: break-word; }
.order-timeline { margin: 0 0 20px; padding: 0; list-style: none; }
.order-timeline li { position: relative; display: flex; gap: 12px; min-height: 58px; }
.order-timeline li::before { position: absolute; top: 15px; bottom: -2px; left: 5px; width: 1px; background: #e0e7e3; content: ""; }
.order-timeline li:last-child::before { display: none; }
.order-timeline li > span { z-index: 1; width: 11px; height: 11px; flex: 0 0 auto; margin-top: 4px; border: 2px solid #cbd5cf; border-radius: 50%; background: #fff; }
.order-timeline li.done > span { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 3px #e9f3ef; }
.order-timeline li.cancelled > span { border-color: #b66c6c; background: #b66c6c; }
.order-timeline strong, .order-timeline small { display: block; }
.order-timeline strong { color: #506057; font-size: 11px; }
.order-timeline small { color: #99a49e; font-size: 9px; }
.version-list { display: flex; flex-direction: column; }
.version-list > a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1ee; }
.version-list > a:last-child { border-bottom: 0; }
.version-list strong, .version-list small { display: block; }
.version-list strong { color: #405148; font-size: 11px; }
.version-list small { margin-top: 3px; color: #96a29b; font-size: 9px; }
.version-list b { color: var(--brand); }
.version-list > a:hover strong { color: var(--brand); }
.internal-notes { border-color: #eadfc9; background: #fffcf6; }
.inventory-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.adjustment-panel, .low-stock-panel { padding: 22px 24px; }
.adjustment-panel .form-group:last-of-type { margin-bottom: 22px; }
.adjustment-panel ul { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.adjustment-panel ul label { display: flex; align-items: center; gap: 6px; flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: #596960; font-size: 11px; cursor: pointer; }
.low-stock-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(100px, 1fr) 100px; align-items: center; gap: 18px; padding: 13px 0; border-bottom: 1px solid #edf1ee; }
.low-stock-row:last-child { border: 0; }
.low-stock-row b { color: #9f652d; text-align: right; }
.low-stock-row b small { color: #93a098; font-weight: 400; }
.stock-progress { height: 5px; border-radius: 5px; background: #edf1ee; overflow: hidden; }
.stock-progress span { display: block; height: 100%; border-radius: 5px; background: #d79a52; }
.movement { display: inline-block; min-width: 45px; font-weight: 650; text-align: right; }
.movement.positive { color: #298060; }
.movement.negative { color: #b65b5b; }
.report-filter { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 18px; padding: 15px 18px; }
.report-filter .filter-form { align-items: flex-end; }
.report-filter .form-group { width: 155px; margin: 0; }
.date-separator { margin-bottom: 10px; color: #8c9992; font-size: 11px; }
.report-range { margin-bottom: 10px; color: #8b9891; font-size: 10px; }
.report-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reports-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 18px; margin-bottom: 18px; }
.reports-grid > .panel { padding: 22px 24px; }
.ranking-item { display: grid; grid-template-columns: 32px minmax(140px, 1fr) 70px 105px; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1ee; }
.ranking-item:last-child { border: 0; }
.rank { color: #9aa69f; font-family: ui-monospace, monospace; font-size: 11px; }
.top-rank { color: var(--brand); font-weight: 700; }
.rank-quantity { color: #86948c; font-size: 10px; }
.status-count-list dt { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #edf1ee; }
.status-count-list dt span { display: flex; align-items: center; gap: 9px; color: #5a6b62; font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #a3afa8; }
.status-dot.confirmed { background: #5b9bb2; }
.status-dot.completed { background: #4eaa80; }
.status-dot.cancelled { background: #c58e8e; }
.report-note { margin-top: 20px; padding: 14px; border-radius: 10px; color: #6d7d74; background: #f5f8f6; font-size: 10px; }
.report-note strong { color: #4b5d53; }
.report-note p { margin: 5px 0 0; }
.empty-state { padding: 70px 25px; text-align: center; }
.success-state { max-width: 600px; margin: 50px auto; }
.empty-icon { display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto 20px; border-radius: 50%; color: var(--brand); background: #e6f3ed; font-size: 26px; }
.empty-state p { color: var(--muted); }
/* Login */
.login-page { background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(400px, 1.1fr) minmax(450px, 1fr); min-height: 100vh; }
.login-intro { position: relative; display: flex; flex-direction: column; padding: 42px 55px; color: #fff; background: var(--sidebar); overflow: hidden; }
.login-brand { position: relative; z-index: 2; padding: 0; }
.intro-copy { position: relative; z-index: 2; margin: auto 0; }
.intro-copy h1 { margin-bottom: 25px; font-size: clamp(38px, 4.2vw, 60px); font-weight: 550; line-height: 1.3; letter-spacing: -2px; }
.intro-copy p { color: #a9bdb3; font-size: 14px; line-height: 2; }
.intro-features { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; }
.intro-features span { padding: 7px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 30px; color: #9db3a8; font-size: 10px; }
.intro-grid { position: absolute; right: -140px; bottom: -180px; width: 600px; height: 600px; border: 1px solid rgba(216,237,155,.08); border-radius: 50%; }
.intro-grid::before, .intro-grid::after { position: absolute; border: 1px solid rgba(216,237,155,.07); border-radius: 50%; content: ""; }
.intro-grid::before { inset: 70px; }
.intro-grid::after { inset: 145px; background: radial-gradient(circle, rgba(216,237,155,.05), transparent 65%); }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; background: #fbfcfb; }
.login-box { width: 100%; max-width: 385px; }
.login-language { display: flex; justify-content: flex-end; width: 100%; max-width: 385px; margin-bottom: 22px; }
.login-box h2 { margin-bottom: 8px; font-size: 30px; letter-spacing: -1px; }
.muted { color: var(--muted); }
.login-form { margin-top: 32px; }
.login-form .form-group { margin-bottom: 19px; }
.login-form input { min-height: 46px; background: #fff; }
.login-form .btn { margin-top: 8px; justify-content: space-between; padding-right: 20px; padding-left: 20px; }
.login-help { margin-top: 20px; color: #95a19a; font-size: 10px; text-align: center; }
.login-copyright { margin-top: 70px; color: #a0aba5; font-size: 9px; }
.mobile-login-brand { display: none; }
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .order-detail-grid { grid-template-columns: minmax(0, 1fr) 270px; }
    .report-range { display: none; }
}
@media (max-width: 1000px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .main-area { margin-left: 0; }
    .menu-button { display: block; }
    .topbar { padding: 0 24px; }
    .breadcrumb { margin-right: auto; margin-left: 15px; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; border: 0; background: rgba(8,23,18,.45); backdrop-filter: blur(2px); }
    .content { padding: 28px 24px 38px; }
    .dashboard-grid, .reports-grid { grid-template-columns: 1fr; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .order-detail-grid aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: 1fr 1fr; }
    .login-intro { padding: 35px; }
}
@media (max-width: 760px) {
    .content { padding: 23px 16px 32px; }
    .topbar { min-height: 60px; padding: 0 16px; }
    .system-state { display: none; }
    .breadcrumb span, .breadcrumb i { display: none; }
    .footer { padding: 14px 16px; }
    .footer span:last-child { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
    .page-heading > .btn, .heading-actions { width: 100%; }
    .heading-actions .btn, .heading-actions form { flex: 1; }
    .heading-actions form .btn { width: 100%; }
    .heading-actions .date-chip { flex: 1; justify-content: center; }
    .kpi-grid, .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi-card { padding: 16px; }
    .kpi-card h2 { font-size: 22px; }
    .kpi-top { margin-bottom: 12px; }
    .toolbar { align-items: flex-start; flex-direction: column; }
    .filter-form { width: 100%; }
    .search-box { width: 100%; }
    .search-box input { width: 100%; }
    .filter-form select { flex: 1; }
    .form-panel { padding: 21px 18px; }
    .form-grid, .order-fields { grid-template-columns: 1fr; }
    .form-grid .full-width, .order-fields .full-width { grid-column: auto; }
    .form-actions { margin: 25px -18px -21px; padding: 16px 18px; }
    .inventory-grid { grid-template-columns: 1fr; }
    .order-info-panel, .order-lines-panel { padding: 20px 17px; }
    .order-lines-panel > .table-wrap { margin: 0 -17px; width: calc(100% + 34px); }
    .order-items-table .item-product { min-width: 190px; padding-left: 17px; }
    .document-summary-editor { grid-template-columns: 1fr; gap: 18px; }
    .order-totals { padding-left: 0; }
    .sticky-form-actions { align-items: stretch; flex-direction: column; }
    .sticky-form-actions > div .btn { flex: 1; }
    .order-detail-grid aside { grid-template-columns: 1fr; }
    .report-filter { align-items: flex-start; flex-direction: column; }
    .report-filter .form-group { width: 135px; }
    .ranking-item { grid-template-columns: 28px minmax(120px, 1fr) 90px; }
    .rank-quantity { display: none; }
    .pagination { align-items: flex-start; flex-direction: column; }
    .login-shell { display: block; }
    .login-intro { display: none; }
    .login-panel { min-height: 100vh; padding: 28px; }
    .mobile-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 55px; }
    .login-copyright { margin-top: 55px; }
}
@media (max-width: 420px) {
    .kpi-grid, .report-kpis { grid-template-columns: 1fr; }
    .kpi-card { display: grid; grid-template-columns: 1fr auto; }
    .kpi-top { grid-column: 1 / -1; }
    .kpi-card > small { text-align: right; }
}
@media print {
    .sidebar, .topbar, .footer, .heading-actions, .messages, .btn-danger-ghost { display: none !important; }
    .main-area { margin: 0; }
    .content { max-width: none; padding: 0; }
    body { background: #fff; }
    .panel { box-shadow: none; break-inside: avoid; }
}
