:root {
    --green-950: #0d2d20;
    --green-900: #123d2b;
    --green-800: #14583a;
    --green-700: #126b43;
    --green-600: #168052;
    --green-500: #22a366;
    --green-100: #dff4e8;
    --green-50: #effaf3;
    --ink: #16231c;
    --muted: #68766e;
    --line: #dfe7e2;
    --surface: #fff;
    --canvas: #f3f6f4;
    --danger: #c43d3d;
    --danger-bg: #fff0f0;
    --warning: #9b6112;
    --warning-bg: #fff6df;
    --info: #2369a8;
    --info-bg: #eaf4ff;
    --shadow: 0 10px 32px rgba(23, 54, 38, .07);
    --shadow-lg: 0 24px 70px rgba(13, 45, 32, .16);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar: 272px;
    --sidebar-compact: 76px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
body, input, select, textarea, button { font: inherit; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); }
button, select { cursor: pointer; }
button, input, select, textarea { outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-500) !important; box-shadow: 0 0 0 3px rgba(34, 163, 102, .13); }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-danger { color: var(--danger); }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--green-600); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.app-layout { min-height: 100vh; }
.app-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: var(--sidebar); flex-direction: column;
    color: #e9f5ed; background: linear-gradient(175deg, var(--green-950), #113824 68%, #17482f); box-shadow: 7px 0 30px rgba(6, 29, 19, .13);
    transition: width .2s ease, transform .22s ease, box-shadow .2s ease;
}
.sidebar-brand { display: flex; min-height: 84px; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-brand-mark, .login-logo { display: grid; width: 46px; height: 46px; flex: 0 0 auto; overflow: hidden; place-items: center; color: white; background: #030504; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; box-shadow: 0 9px 22px rgba(0, 0, 0, .25); }
.brand-logo-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.sidebar-brand > span:nth-child(2) { min-width: 0; }
.sidebar-brand strong { display: block; color: #fff; font-size: 1.08rem; }
.sidebar-brand small { display: block; overflow: hidden; margin-top: 2px; color: #9fc4af; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-close { display: none !important; margin-left: auto; color: white !important; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 15px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav-link, .nav-group summary { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 10px 12px; color: #bdd5c7; border-radius: 10px; font-size: .88rem; font-weight: 650; list-style: none; transition: .18s ease; }
.nav-link:hover, .nav-group summary:hover { color: white; background: rgba(255,255,255,.07); }
.nav-link.active { color: #fff; background: rgba(52, 181, 111, .2); box-shadow: inset 3px 0 var(--green-500); }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary .chevron { margin-left: auto; transition: transform .2s; }
.nav-group[open] summary { color: #fff; }
.nav-group[open] summary .chevron { transform: rotate(180deg); }
.nav-group-links { position: relative; margin: 1px 0 7px 22px; padding: 2px 0 3px 20px; }
.nav-group-links::before { position: absolute; top: 0; bottom: 5px; left: 5px; width: 1px; content: ""; background: rgba(255,255,255,.12); }
.nav-group-links a { position: relative; display: block; padding: 7px 9px; color: #94b6a3; border-radius: 7px; font-size: .79rem; }
.nav-group-links a::before { position: absolute; top: 50%; left: -15px; width: 8px; height: 1px; content: ""; background: rgba(255,255,255,.17); }
.nav-group-links a:hover, .nav-group-links a.active { color: white; background: rgba(255,255,255,.07); }
.nav-group-links a.active::before { background: var(--green-500); }
.sidebar-user { display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 9px; margin: 10px 12px 14px; padding: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 13px; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: white; font-size: .79rem; }
.sidebar-user small { color: #9fc4af; font-size: .68rem; }
.sidebar-user .icon-button { color: #b9d4c4; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: linear-gradient(145deg, #27865a, #52b77b); border-radius: 11px; font-size: .86rem; font-weight: 800; }
.avatar.small { width: 31px; height: 31px; border-radius: 9px; font-size: .72rem; }

.app-content { min-height: 100vh; margin-left: var(--sidebar); transition: margin-left .2s ease; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; height: 72px; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(15px); }
.topbar-leading { display: flex; min-width: 0; align-items: center; gap: 9px; }
.topbar-context strong, .topbar-context span { display: block; }
.topbar-context strong { font-size: .9rem; }
.topbar-context .eyebrow { margin-bottom: 1px; color: #839087; font-size: .58rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding: 4px 7px 4px 4px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; font-size: .78rem; font-weight: 700; }
.sidebar-toggle { color: var(--green-800); background: var(--green-50); border-color: #d5e8dc; }
.mobile-menu { display: none !important; }
.sidebar-backdrop { display: none; }
.page-container { width: min(1500px, 100%); margin: 0 auto; padding: 28px 34px 52px; }
.document-editor-page .page-container { width: min(1760px, 100%); }
.page-title { display: flex; min-height: 78px; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-title h1 { margin: 0; font-size: clamp(1.55rem, 2.3vw, 2.15rem); line-height: 1.12; }
.page-title p { max-width: 700px; margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.page-actions, .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 21px 22px; border-bottom: 1px solid var(--line); }
.card-heading h2, .section-heading h2 { margin: 0; font-size: 1.08rem; }
.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: .79rem; }
.card-heading > a { font-size: .78rem; font-weight: 750; }
.section-heading { margin: -22px -22px 20px; }
.settings-subheading { margin-top: 0; }
.btn { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: .78rem; font-weight: 750; line-height: 1.1; white-space: nowrap; transition: .16s ease; }
.btn:hover { color: var(--ink); border-color: #bdccc3; transform: translateY(-1px); box-shadow: 0 6px 15px rgba(23,54,38,.08); }
.btn-primary { color: #fff !important; background: linear-gradient(135deg, var(--green-700), var(--green-600)); border-color: var(--green-700); box-shadow: 0 7px 16px rgba(18,107,67,.18); }
.btn-primary:hover { background: linear-gradient(135deg, var(--green-600), var(--green-500)); }
.btn-secondary { color: var(--green-800); background: var(--green-50); border-color: #cde8d8; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-large { min-height: 48px; padding: 12px 19px; font-size: .88rem; border-radius: 11px; }
.btn-small { min-height: 32px; padding: 5px 9px; font-size: .7rem; }
.btn-block { width: 100%; }
.icon-button { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; padding: 0; color: #526158; background: transparent; border: 1px solid transparent; border-radius: 9px; }
.icon-button:hover { color: var(--green-700); background: var(--green-50); border-color: #d6e9dc; }
.icon-button.danger:hover { color: var(--danger); background: var(--danger-bg); border-color: #f3d1d1; }

.flash, .alert { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: .82rem; line-height: 1.5; }
.flash { position: relative; align-items: center; }
.flash > span { flex: 1; }
.flash button { display: grid; width: 27px; height: 27px; place-items: center; color: inherit; background: transparent; border: 0; }
.flash-success, .alert-success { color: #17623e; background: var(--green-50); border-color: #c8e9d5; }
.flash-danger, .alert-danger { color: #8f2929; background: var(--danger-bg); border-color: #f0cccc; }
.flash-warning, .alert-warning { color: #82500c; background: var(--warning-bg); border-color: #efdcae; }
.flash-info, .alert-info { color: #245c8d; background: var(--info-bg); border-color: #c6ddf4; }
.alert ul { margin: 6px 0 0; padding-left: 19px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; min-width: 270px; flex: 1; align-items: center; gap: 8px; height: 40px; padding: 0 11px; color: var(--muted); background: #f8faf9; border: 1px solid var(--line); border-radius: 9px; }
.search-field input { width: 100%; height: 100%; padding: 0; background: transparent; border: 0; box-shadow: none !important; }
.toolbar > select { min-height: 40px; padding: 0 33px 0 10px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .79rem; }
.data-table th { padding: 11px 15px; color: #718078; background: #f8faf9; border-bottom: 1px solid var(--line); font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 15px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: .67rem; }
.cell-primary { min-width: 160px; font-weight: 720; }
.cell-primary a { color: var(--ink); }
.actions-column { width: 55px; }
.row-actions { width: 92px; text-align: right; white-space: nowrap; }
.document-list-card { container: document-list / inline-size; }
.document-list-page .page-actions .btn { transition: background-color .15s, box-shadow .15s, transform .15s; }
.document-list-filters > * { min-width: 0; max-width: 100%; }
.document-list-filters .search-field { min-width: 0; flex: 1 1 240px; }
.document-list-filters > input { flex: 0 1 140px; min-height: 40px; padding: 8px 10px; background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; font-size: .75rem; }
.document-list-filters > .filter-number { flex-basis: 85px; }
.document-list-table { table-layout: fixed; }
.document-list-table th, .document-list-table td { padding: 12px 10px; overflow-wrap: anywhere; }
.document-list-table th:nth-child(1) { width: 140px; }
.document-list-table th:nth-child(3) { width: 120px; }
.document-list-table th:nth-child(4), .document-list-table th:nth-child(5) { width: 120px; }
.document-list-table th:nth-child(6) { width: 125px; }
.document-list-table th:nth-child(7) { width: 250px; }
.document-list-table .cell-primary { min-width: 0; }
.document-list-table .amount { white-space: normal; font-size: .74rem; }
.document-list-table .badge { max-width: 100%; white-space: normal; text-align: center; }
.document-creator-cell { font-size: .70rem; line-height: 1.5; }
.document-list-row[data-tone="negative"] .badge { color: #9d2e47; background: #ffe2e8; }
.document-list-row[data-tone="muted"] .badge { color: #576171; background: #e2e6ed; }
.document-list-subject { line-height: 1.5; }
.document-list-row, .document-status-legend > span { --document-state-color: #7c8997; --document-state-bg: #f8fafc; }
.document-list-row[data-tone="positive"], .document-status-legend > [data-tone="positive"] { --document-state-color: #168052; --document-state-bg: #f0faf3; }
.document-list-row[data-tone="info"], .document-status-legend > [data-tone="info"] { --document-state-color: #377aba; --document-state-bg: #f1f7ff; }
.document-list-row[data-tone="warning"], .document-status-legend > [data-tone="warning"] { --document-state-color: #b77614; --document-state-bg: #fff9ec; }
.document-list-row[data-tone="negative"], .document-status-legend > [data-tone="negative"] { --document-state-color: #c43d56; --document-state-bg: #fff3f4; }
.document-list-row[data-tone="muted"], .document-status-legend > [data-tone="muted"] { --document-state-color: #717987; --document-state-bg: #f1f2f5; }
.document-list-row td { background: var(--document-state-bg); }
.document-list-row td:first-child { box-shadow: inset 4px 0 var(--document-state-color); }
.document-list-row:hover td { background: var(--document-state-bg); }
.document-status-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.document-status-legend > span { display: inline-flex; align-items: center; gap: 6px; font-size: .62rem; color: #56636b; }
.document-status-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--document-state-color); }
.document-row-actions { display: flex; align-items: center; gap: 4px; }
.document-row-action { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; gap: 6px; min-width: 34px; min-height: 38px; padding: 5px; border: 1px solid; border-radius: 9px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.document-row-action > span { display: none; }
.document-row-action:hover:not(:disabled) { color: inherit; transform: translateY(-1px); box-shadow: 0 3px 8px #142a2018; }
.document-row-action:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.document-row-action:disabled { color: #77818c; background: #f1f3f6; border-color: #dfe3e8; cursor: not-allowed; opacity: .6; }
.document-action-view { color: #225e9c; background: #eaf3ff; border-color: #cbdff5; }
.document-action-edit { color: #8d5910; background: #fff6e3; border-color: #efd8a8; }
.document-action-download { color: #136640; background: #e8f7ed; border-color: #bddfc9; }
.document-action-share { color: #09656a; background: #e7f7f7; border-color: #b9e0e1; }
.document-action-print { color: #485967; background: #edf2f7; border-color: #d4dfe7; }
.document-action-convert { color: #684296; background: #f2ebfc; border-color: #ddccf0; }
.document-convert-dialog .form-help { margin: 14px 0 0; line-height: 1.6; }
@container document-list (max-width: 1050px) {
    .document-list-scroll { overflow: visible; }
    .document-list-table, .document-list-table tbody { display: block; width: 100%; }
    .document-list-table thead { display: none; }
    .document-list-table tbody { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; padding: 16px; }
    .document-list-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding: 14px; min-width: 0; background: var(--document-state-bg); border: 1px solid var(--line); border-left: 4px solid var(--document-state-color); border-radius: 13px; }
    .document-list-row:hover { background: var(--document-state-bg); }
    .document-list-table .document-list-row td { display: block; width: auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
    .document-number-cell { grid-column: 1; grid-row: 1; }
    .document-status-cell { grid-column: 2; grid-row: 1; justify-self: end; }
    .document-party-cell { grid-column: 1 / -1; grid-row: 2; }
    .document-total-cell { grid-column: 1; grid-row: 3; text-align: left; }
    .document-remaining-cell { grid-column: 2; grid-row: 3; text-align: right; }
    .document-creator-cell { grid-column: 1 / -1; grid-row: 4; color: var(--muted); font-size: .7rem; }
    .document-actions-cell { grid-column: 1 / -1; grid-row: 5; }
    .document-list-table [data-label]::before { display: block; margin-bottom: 4px; content: attr(data-label); color: #62706a; font-size: .61rem; font-weight: 600; }
    .document-list-table .document-creator-cell::before { display: inline; margin: 0 6px 0 0; }
    .document-row-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding-top: 12px; border-top: 1px solid #dde5e080; }
    .document-row-action { min-height: 44px; min-width: 0; padding: 8px 5px; font-size: .65rem; }
    .document-row-action > svg { flex: 0 0 auto; }
    .document-row-action > span { display: inline; overflow-wrap: anywhere; }
}
@container document-list (max-width: 620px) {
    .document-list-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
    .document-list-filters .search-field, .document-list-filters [name="status"], .document-list-filters [name="created_by"] { grid-column: 1 / -1; }
    .document-list-filters > input, .document-list-filters > select { width: 100%; }
    .document-list-filters > .btn { justify-content: center; padding-inline: 6px; }
    .document-list-table tbody { padding: 12px; }
    .document-status-legend { padding: 12px 14px; gap: 7px 11px; }
}
@container document-list (max-width: 380px) {
    .document-row-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-list-row { padding: 12px; }
    .document-status-cell .badge { white-space: normal; text-align: center; }
}
.product-catalog-card { container: product-catalog / inline-size; }
.product-catalog-toolbar .search-field { min-width: 0; flex: 1 1 260px; }
.product-category-filter { display: grid; flex: 0 1 260px; min-width: 0; gap: 4px; }
.product-category-filter > span { color: var(--muted); font-size: .65rem; font-weight: 700; }
.product-category-filter select { width: 100%; min-width: 0; }
.product-category-filter select, .document-category-toolbar select { min-height: 44px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #d5e1da; border-radius: 9px; font: inherit; font-size: .78rem; }
.product-category-filter select:focus-visible, .document-category-toolbar select:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.product-catalog-table { table-layout: fixed; }
.product-catalog-table th, .product-catalog-table td { padding: 12px 10px; overflow-wrap: anywhere; line-height: 1.5; }
.product-catalog-table th { white-space: normal; letter-spacing: .025em; }
.product-catalog-table .cell-primary { min-width: 0; }
.product-catalog-table .product-col-photo { width: 80px; }
.product-catalog-table .product-col-sku { width: 8%; }
.product-catalog-table .product-col-name { width: 18%; }
.product-catalog-table .product-col-category_name { width: 8%; }
.product-catalog-table .product-col-supplier_name { width: 12%; }
.product-catalog-table .product-col-unit { width: 5%; }
.product-catalog-table .product-col-purchase_price_ht, .product-catalog-table .product-col-sale_price_ht { width: 10%; text-align: right; }
.product-catalog-table .product-col-min_stock { width: 5%; text-align: right; }
.product-catalog-table .product-col-status { width: 7%; }
.product-catalog-table .actions-column { width: 90px; }
.product-catalog-table .product-col-purchase_price_ht, .product-catalog-table .product-col-sale_price_ht, .product-catalog-table .product-col-min_stock { font-variant-numeric: tabular-nums; }
.product-catalog-table .amount { font-variant-numeric: tabular-nums; white-space: normal; }
.product-catalog-table .badge { max-width: 100%; white-space: normal; text-align: center; }
.product-catalog-actions .icon-button { width: 32px; height: 36px; }
.product-catalog-photo { display: inline-flex; width: 60px; height: 60px; max-width: 100%; align-items: center; justify-content: center; overflow: hidden; color: #64766a; background: #f4f8f5; border: 1px solid var(--line); border-radius: 10px; vertical-align: middle; text-decoration: none; }
a.product-catalog-photo:hover { border-color: var(--green-700); background: #edf7f0; }
a.product-catalog-photo:focus-visible { outline: 2px solid var(--green-700); outline-offset: 3px; }
a.product-catalog-photo[role="button"] { cursor: pointer; }
a.product-catalog-photo[aria-busy="true"] { cursor: progress; }
.product-catalog-photo img { display: block; width: 56px; height: 56px; max-width: 100%; object-fit: contain; }
.product-catalog-photo-placeholder { display: flex; width: 100%; min-width: 0; align-items: center; flex-direction: column; justify-content: center; gap: 3px; text-align: center; }
.product-catalog-table .product-catalog-photo-placeholder small { margin: 0; font-size: 8px; line-height: 1.2; white-space: nowrap; }
.product-catalog-photo img[hidden], .product-catalog-photo-placeholder[hidden] { display: none; }
@container product-catalog (max-width: 1120px) {
    .product-catalog-scroll { overflow: visible; }
    .product-catalog-table, .product-catalog-table tbody { display: block; width: 100%; }
    .product-catalog-table thead { display: none; }
    .product-catalog-table tbody { display: grid; gap: 12px; padding: 14px; }
    .product-catalog-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
    .product-catalog-table .product-catalog-row > td { display: block; width: auto; min-width: 0; padding: 0; border: 0; text-align: left; }
    .product-catalog-table [data-label]::before { display: block; content: attr(data-label); margin-bottom: 4px; color: var(--muted); font-size: .65rem; font-weight: 650; }
    .product-catalog-table .product-col-photo { grid-column: 1; grid-row: 1 / 3; }
    .product-catalog-table .product-col-photo::before { display: none; }
    .product-catalog-table .product-col-name { grid-column: 2 / -1; grid-row: 1; font-size: .9rem; }
    .product-catalog-table .product-col-sku { grid-column: 2; grid-row: 2; }
    .product-catalog-table .product-col-status { grid-column: 3; grid-row: 2; justify-self: end; text-align: right; }
    .product-catalog-table .product-col-category_name { grid-column: 1 / 3; grid-row: 3; }
    .product-catalog-table .product-col-unit { grid-column: 3; grid-row: 3; }
    .product-catalog-table .product-col-supplier_name { grid-column: 1 / -1; grid-row: 4; }
    .product-catalog-table .product-col-purchase_price_ht { grid-column: 1; grid-row: 5; }
    .product-catalog-table .product-col-sale_price_ht { grid-column: 2; grid-row: 5; }
    .product-catalog-table .product-col-min_stock { grid-column: 3; grid-row: 5; }
    .product-catalog-table .product-catalog-row > .product-catalog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
    .product-catalog-actions::before { margin-right: auto; align-self: center; }
    .product-catalog-actions .icon-button { width: 44px; height: 44px; border-color: var(--line); background: #f8faf9; }
    .product-catalog-actions .danger { border-color: #f3d1d1; background: var(--danger-bg); }
}
@container product-catalog (max-width: 600px) {
    .product-catalog-toolbar { padding: 12px; }
    .product-catalog-toolbar .search-field { flex-basis: 100%; }
    .product-catalog-toolbar .product-category-filter { flex: 1 0 100%; width: 100%; }
    .product-catalog-table tbody { padding: 12px; }
    .product-catalog-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
    .product-catalog-table .product-col-photo { grid-column: 1; grid-row: 1; }
    .product-catalog-table .product-col-name { grid-column: 1 / -1; grid-row: 2; }
    .product-catalog-table .product-col-sku { grid-column: 1; grid-row: 3; }
    .product-catalog-table .product-col-status { grid-column: 2; grid-row: 1; }
    .product-catalog-table .product-col-supplier_name { grid-column: 1 / -1; grid-row: 4; }
    .product-catalog-table .product-col-category_name { grid-column: 2; grid-row: 3; }
    .product-catalog-table .product-col-unit { grid-column: 1; grid-row: 5; }
    .product-catalog-table .product-col-min_stock { grid-column: 2; grid-row: 5; }
    .product-catalog-table .product-col-purchase_price_ht { grid-column: 1; grid-row: 6; }
    .product-catalog-table .product-col-sale_price_ht { grid-column: 2; grid-row: 6; }
}
.product-delete-form { display: inline-flex; margin: 0; vertical-align: middle; }
.product-delete-form .icon-button { color: var(--danger); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.badge-success { color: #12663d; background: #daf3e3; }
.badge-danger { color: #a02f2f; background: #fde6e6; }
.badge-warning { color: #8b580f; background: #fff0c9; }
.badge-info { color: #225f96; background: #dfefff; }
.badge-neutral { color: #5d6962; background: #edf1ef; }
.progress-cell { display: flex; min-width: 130px; align-items: center; gap: 8px; }
.progress-cell > span, .project-progress > i, .hero-progress > i { position: relative; display: block; height: 7px; flex: 1; overflow: hidden; background: #e7eeea; border-radius: 99px; }
.progress-cell i, .project-progress b, .hero-progress b { position: absolute; inset: 0 auto 0 0; display: block; background: linear-gradient(90deg, var(--green-700), #4abb7c); border-radius: 99px; }
.progress-cell small { min-width: 32px; margin: 0 !important; }
.empty-state { display: grid; min-height: 230px; place-items: center; align-content: center; padding: 35px; color: #819087; text-align: center; }
.empty-state svg { margin-bottom: 11px; color: #a7b7ae; }
.empty-state h3 { margin: 0 0 5px; color: #56635b; font-size: 1rem; }
.empty-state p { max-width: 420px; margin: 0; font-size: .79rem; }
.pagination { display: flex; flex-wrap: wrap; gap: 5px; padding: 15px 18px; border-top: 1px solid var(--line); }
.pagination a { display: grid; width: 32px; height: 32px; place-items: center; color: var(--muted); border-radius: 8px; font-size: .73rem; font-weight: 700; }
.pagination a:hover, .pagination a.active { color: white; background: var(--green-700); }

.form-card { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.document-editor-page .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field > span:first-child { color: #4d5c53; font-size: .72rem; font-weight: 750; }
.field input, .field select, .field textarea, .stack-form input, .stack-form select { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #d7e0da; border-radius: 9px; font-size: .82rem; }
.field textarea { min-height: 90px; resize: vertical; }
.field small { color: var(--muted); font-size: .66rem; line-height: 1.35; }
.select-other { display: flex; flex-direction: column; gap: 9px; }
.select-other-manual { display: flex; flex-direction: column; gap: 6px; padding: 11px; background: var(--green-50); border: 1px solid #cde8d8; border-radius: 9px; }
.select-other-manual[hidden] { display: none; }
.select-other-manual > span { color: var(--green-800); font-size: .68rem; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
.inline-field { min-width: 145px; }
.inline-field input, .inline-field select { min-height: 38px; }
.checkbox-field { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 8px 10px; background: #f8faf9; border: 1px solid var(--line); border-radius: 9px; }
.checkbox-field input { width: 17px; min-height: 17px; accent-color: var(--green-700); }
.checkbox-field span { color: var(--ink) !important; font-size: .79rem !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 22px -22px -22px; padding: 16px 22px; background: #fbfcfb; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.form-card hr { margin: 25px 0; border: 0; border-top: 1px solid var(--line); }
.form-card h3 { font-size: 1rem; }
.client-profile-guide { margin: 0 0 19px; padding: 13px 15px; background: linear-gradient(135deg, var(--green-50), #f8fbff); border: 1px solid #cfe4d8; border-radius: 11px; }
.client-profile-guide > div { display: flex; align-items: center; gap: 11px; }
.client-profile-guide > div[hidden], .client-profile-field[hidden] { display: none !important; }
.client-profile-symbol { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; color: var(--green-700); background: #fff; border: 1px solid #d6e7dc; border-radius: 10px; }
.client-profile-guide strong, .client-profile-guide small { display: block; }
.client-profile-guide strong { color: var(--green-900); font-size: .82rem; }
.client-profile-guide small { margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.compact-form { margin-top: 15px; padding: 16px; background: #f8faf9; border: 1px solid var(--line); border-radius: 11px; }
.compact-form > .btn { align-self: end; justify-self: start; }
.stack-form { display: flex; flex-direction: column; gap: 11px; }
.inline-create { margin: 17px 20px; padding: 11px 13px; background: #fbfcfb; border: 1px dashed #cbd8d0; border-radius: 11px; }
.inline-create summary { color: var(--green-700); font-size: .76rem; font-weight: 800; cursor: pointer; list-style: none; }
.inline-create summary svg { margin-right: 6px; vertical-align: -3px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric-card { display: flex; min-height: 130px; align-items: flex-start; gap: 13px; padding: 19px; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; color: var(--green-700); background: var(--green-50); border-radius: 12px; }
.metric-card > div { min-width: 0; }
.metric-card small, .metric-card strong, .metric-card span, .metric-card a { display: block; }
.metric-card small { color: var(--muted); font-size: .7rem; font-weight: 700; }
.metric-card strong { overflow: hidden; margin: 7px 0 4px; font-size: 1.32rem; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > div > span, .metric-card a { color: #8a978f; font-size: .65rem; }
.metric-card a { color: var(--green-700); font-weight: 700; }
.metric-orange .metric-icon { color: #a96209; background: #fff3dc; }
.metric-blue .metric-icon { color: #2869a8; background: #e9f4ff; }
.metric-red .metric-icon { color: var(--danger); background: var(--danger-bg); }
.metric-green .metric-icon { color: var(--green-700); background: var(--green-50); }
.compact-metrics .metric-card { min-height: 110px; }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.dashboard-grid .card { min-width: 0; margin: 0; }
.dashboard-wide { grid-column: 1 / -1; }
.dashboard-page { background: #f6f5f8; }
.dashboard-page .page-container { width: min(1540px, 100%); }
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.dashboard-kpi {
    position: relative; display: flex; min-width: 0; min-height: 132px; flex-direction: column; justify-content: center;
    overflow: hidden; padding: 23px 22px 21px; color: #fff !important; border: 1px solid rgba(255,255,255,.18);
    border-radius: 13px; box-shadow: 0 13px 29px rgba(50, 54, 86, .13); isolation: isolate; transition: .2s ease;
}
.dashboard-kpi::before, .dashboard-kpi::after { position: absolute; z-index: -1; content: ""; pointer-events: none; }
.dashboard-kpi::before { right: -45px; bottom: -78px; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.dashboard-kpi::after { right: -73px; bottom: -44px; width: 185px; height: 185px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.dashboard-kpi:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 17px 34px rgba(50, 54, 86, .18); }
.dashboard-kpi-paid { background: linear-gradient(135deg, #6967ef, #3d51d7); }
.dashboard-kpi-unpaid { background: linear-gradient(135deg, #fb527d, #df2f5b); }
.dashboard-kpi-clients { background: linear-gradient(135deg, #1acb9e, #04a97e); }
.dashboard-kpi-cash { background: linear-gradient(135deg, #13c79d, #00a47e); }
.dashboard-kpi-icon { position: absolute; top: 18px; right: 18px; display: grid; width: 34px; height: 34px; place-items: center; color: rgba(255,255,255,.96); }
.dashboard-kpi-label { width: calc(100% - 38px); margin-bottom: 8px; color: rgba(255,255,255,.91); font-size: .68rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.dashboard-kpi strong { overflow: hidden; font-size: clamp(1.08rem, 1.55vw, 1.48rem); font-variant-numeric: tabular-nums; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-kpi small { overflow: hidden; margin-top: 7px; color: rgba(255,255,255,.82); font-size: .6rem; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-analytics-grid { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(520px, 1.55fr); gap: 20px; }
.dashboard-analytics-grid .card { min-width: 0; margin: 0; border-color: #ebe9ef; border-radius: 13px; box-shadow: 0 10px 28px rgba(56, 49, 76, .055); }
.dashboard-chart-card { overflow: hidden; }
.dashboard-card-title { display: flex; min-height: 76px; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.dashboard-card-title h2 { margin: 3px 0 0; color: #27242e; font-size: .89rem; font-weight: 850; letter-spacing: .005em; text-transform: uppercase; }
.dashboard-card-title span { color: #9691a0; font-size: .58rem; font-weight: 780; letter-spacing: .09em; text-transform: uppercase; }
.dashboard-card-title > a, .dashboard-card-title > small { margin-top: 3px; color: #77717f; font-size: .64rem; font-weight: 700; white-space: nowrap; }
.dashboard-card-title > a:hover { color: var(--green-700); }
.dashboard-donut-wrap { display: grid; min-height: 290px; place-items: center; align-content: start; padding: 3px 22px 22px; }
.dashboard-donut { position: relative; display: grid; width: min(190px, 72%); aspect-ratio: 1; place-items: center; background: conic-gradient(#13c89a 0 var(--paid-share), #f34d78 var(--paid-share) 100%); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.dashboard-donut::before { position: absolute; width: 59%; aspect-ratio: 1; content: ""; background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(28, 37, 32, .025); }
.dashboard-donut.is-empty { background: #e8ecea; }
.dashboard-donut > span { position: relative; z-index: 1; text-align: center; }
.dashboard-donut strong, .dashboard-donut small { display: block; }
.dashboard-donut strong { color: #27242e; font-size: 1.34rem; font-variant-numeric: tabular-nums; }
.dashboard-donut small { margin-top: 2px; color: #8c8791; font-size: .58rem; font-weight: 700; text-transform: uppercase; }
.dashboard-donut-legend { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.dashboard-donut-legend > span { display: grid; grid-template-columns: 9px 1fr; align-items: center; gap: 2px 7px; min-width: 0; }
.dashboard-donut-legend i { width: 9px; height: 9px; grid-row: 1 / span 2; border-radius: 50%; }
.dashboard-donut-legend .legend-paid { background: #13c89a; }
.dashboard-donut-legend .legend-unpaid { background: #f34d78; }
.dashboard-donut-legend b { color: #4e4954; font-size: .65rem; }
.dashboard-donut-legend small { overflow: hidden; color: #98929d; font-size: .58rem; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-bar-chart { min-height: 290px; padding: 6px 20px 20px; }
.dashboard-bar-plot { display: flex; height: 260px; align-items: stretch; gap: clamp(10px, 3vw, 35px); padding: 10px 17px 0 25px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, #ebe9ee 50px); border-bottom: 1px solid #dad7df; }
.dashboard-bar-item { display: grid; min-width: 0; height: 100%; flex: 1; grid-template-rows: 24px minmax(0, 1fr) 43px; align-items: end; justify-items: center; color: #77717f; }
.dashboard-bar-item:hover { color: #4f91a8; }
.dashboard-bar-value { align-self: center; color: #77717f; font-size: .61rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dashboard-bar-item i { width: min(68px, 74%); height: var(--bar-height); min-height: 0; align-self: end; background: linear-gradient(180deg, #55b7d7, #47aaca); border-radius: 6px 6px 2px 2px; box-shadow: 0 5px 12px rgba(65, 165, 199, .18); transform: scaleY(0); transform-origin: bottom; animation: dashboard-bar-grow .7s cubic-bezier(.2,.8,.3,1) var(--bar-delay) forwards; }
.dashboard-bar-item small { align-self: start; overflow: hidden; width: 100%; padding-top: 10px; color: currentColor; font-size: .6rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
@keyframes dashboard-bar-grow { to { transform: scaleY(1); } }
.dashboard-revenue-chart { grid-column: 1 / -1; }
.dashboard-line-chart { overflow-x: auto; padding: 0 16px 13px; }
.dashboard-line-chart svg { display: block; width: 100%; min-width: 690px; height: auto; }
.dashboard-chart-gridline { stroke: #e7e5eb; stroke-width: 1; }
.dashboard-chart-axis-value, .dashboard-chart-month, .dashboard-chart-currency { fill: #8d8793; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 10px; font-weight: 650; }
.dashboard-chart-currency { fill: #aaa5ad; font-size: 8px; letter-spacing: .08em; }
.dashboard-revenue-area { fill: url(#dashboardRevenueArea); }
.dashboard-revenue-line { fill: none; stroke: #20b7c2; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 5px rgba(32,183,194,.17)); }
.dashboard-revenue-point circle { fill: #fff; stroke: #20b7c2; stroke-width: 3; transition: .15s ease; }
.dashboard-revenue-point:hover circle { r: 7; fill: #20b7c2; }
.dashboard-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 32px 2px 17px; }
.dashboard-section-heading h2 { margin: 0; font-size: 1.22rem; }
.dashboard-section-heading p { margin: 0; color: var(--muted); font-size: .75rem; }
.dashboard-operations-grid { padding-bottom: 5px; }
.project-list { padding: 2px 0; }
.project-row { display: grid; grid-template-columns: 95px minmax(180px, 1fr) 165px 120px; align-items: center; gap: 15px; padding: 13px 20px; color: var(--ink); border-bottom: 1px solid #edf1ef; }
.project-row:last-child { border: 0; }
.project-row:hover { color: var(--ink); background: #fbfdfc; }
.project-code { font-size: .7rem; font-weight: 800; }
.project-main strong, .project-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-main strong { font-size: .82rem; }
.project-main small { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.project-progress { display: flex; align-items: center; gap: 8px; }
.project-progress small { min-width: 28px; color: var(--muted); font-size: .65rem; }
.compact-list { padding: 4px 0; }
.compact-list > .muted { display: block; padding: 16px 18px; }
.compact-list > a, .compact-list > .plain-row { display: flex; min-height: 61px; align-items: center; gap: 11px; padding: 10px 18px; color: var(--ink); border-bottom: 1px solid #edf1ef; }
.compact-list > a:last-child, .compact-list > .plain-row:last-child { border: 0; }
.compact-list > a:hover { background: #fbfdfc; }
.compact-list > a > span:nth-child(2), .plain-row > span:first-child { min-width: 0; flex: 1; }
.compact-list strong, .compact-list small { display: block; }
.compact-list strong { font-size: .75rem; }
.compact-list small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.date-chip { display: grid; width: 38px; height: 42px; flex: 0 0 auto; place-items: center; align-content: center; color: var(--green-700); background: var(--green-50); border-radius: 9px; }
.date-chip b { font-size: .83rem; line-height: 1; }
.date-chip small { margin: 3px 0 0 !important; font-size: .52rem !important; }
.doc-mini { display: grid; width: 35px; height: 35px; place-items: center; color: var(--info); background: var(--info-bg); border-radius: 9px; }
.document-compact-list .amount { margin-left: auto; font-size: .7rem; }
.priority-dot { width: 8px; height: 8px; flex: 0 0 auto; background: #93a198; border-radius: 50%; }
.priority-urgent { background: #d23e3e !important; }
.priority-high { background: #e89127 !important; }
.priority-normal { background: #3c85c8 !important; }
.priority-low { background: #7b9484 !important; }

.document-form { display: flex; flex-direction: column; gap: 17px; }
.document-editor-page { --document-actionbar-height: 128px; --document-actionbar-offset: 0px; --document-actionbar-left: var(--sidebar); }
.document-editor-page .page-container { padding-bottom: calc(var(--document-actionbar-height) + 24px); }
.document-form :is(input, select, textarea, [data-line]) { scroll-margin-top: 90px; scroll-margin-bottom: calc(var(--document-actionbar-height) + var(--document-actionbar-offset) + 16px); }
.document-actionbar { position: fixed; z-index: 40; right: 0; bottom: var(--document-actionbar-offset); left: var(--document-actionbar-left); padding: 12px max(20px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgba(255, 255, 255, .97); border-top: 1px solid #cddfd4; box-shadow: 0 -8px 26px rgba(13, 45, 32, .10); backdrop-filter: blur(12px); transition: left .2s ease; container: document-actions / inline-size; }
.document-actionbar-inner { display: grid; grid-template-areas: "totals totals totals" "line title save"; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; width: min(1692px, 100%); margin: 0 auto; }
.document-actionbar .btn { min-height: 44px; min-width: 0; transition: background-color .16s, box-shadow .16s, transform .16s; }
.document-actionbar [data-add-line] { grid-area: line; }
.document-actionbar [data-add-title] { grid-area: title; }
.document-actionbar .btn > svg { flex: 0 0 auto; }
.document-actionbar .btn:focus-visible { outline: 2px solid var(--green-700); outline-offset: 3px; }
.document-actionbar-save { grid-area: save; min-width: 0 !important; width: 100%; }
.document-action-label-short { display: none; }
.document-pinned-totals { grid-area: totals; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.document-pinned-totals > div { min-width: 0; padding: 5px 12px; border-left: 1px solid var(--line); }
.document-pinned-totals > div:first-child { border-left: 0; }
.document-pinned-totals > div > span { display: block; color: var(--muted); font-size: .61rem; font-weight: 650; line-height: 1.3; }
.document-pinned-totals strong { display: block; margin-top: 3px; color: var(--ink); font-size: .88rem; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.document-pinned-amount { display: inline-block; white-space: nowrap; }
.document-pinned-currency { display: inline-block; font-size: .78em; }
.document-pinned-totals .document-pinned-grand-total { color: var(--green-700); background: var(--green-50); border-left: 0; border-radius: 8px; }
.document-pinned-grand-total :is(span, strong) { color: var(--green-700); }
.document-actionbar.is-compact-height { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.document-actionbar.is-compact-height .document-pinned-totals > div { padding-top: 3px; padding-bottom: 3px; }
@container document-actions (min-width: 1050px) {
    .document-actionbar-inner { grid-template-areas: "line title totals save"; grid-template-columns: max-content max-content minmax(0, 1fr) max-content; gap: 12px; }
    .document-pinned-totals { justify-self: end; width: min(540px, 100%); }
    .document-actionbar-save { min-width: 150px !important; }
}
@container document-actions (max-width: 600px) {
    .document-actionbar .btn { padding: 9px 6px; gap: 5px; font-size: .73rem; }
    .document-action-label { display: none; }
    .document-action-label-short { display: inline; }
    .document-pinned-totals { gap: 4px; }
    .document-pinned-totals > div { padding-right: 6px; padding-left: 6px; }
    .document-pinned-totals strong { font-size: .78rem; }
}
@container document-actions (max-width: 340px) {
    .document-actionbar-save > svg { display: none; }
    .document-pinned-totals strong { font-size: .72rem; }
}
@media (min-width: 921px) {
    body.document-editor-page.sidebar-collapsed { --document-actionbar-left: var(--sidebar-compact); }
}
@media (max-width: 920px) {
    .document-editor-page { --document-actionbar-left: 0px; }
}
@media (max-width: 480px) {
    .document-actionbar { padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
    .document-actionbar.is-compact-height { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
.document-lines-card { overflow: hidden; container: document-lines / inline-size; }
.document-lines { width: 100%; min-width: 1260px; border-collapse: collapse; }
.document-lines th { padding: 10px 8px; color: var(--muted); background: #f8faf9; border-bottom: 1px solid var(--line); font-size: .62rem; text-align: center; text-transform: uppercase; }
.document-lines td { padding: 7px 5px; border-bottom: 1px solid #edf1ef; }
.document-lines input, .document-lines select, .document-lines textarea { width: 100%; min-width: 0; min-height: 38px; padding: 7px 8px; color: var(--ink); background: white; border: 1px solid #dce4df; border-radius: 7px; font-size: .74rem; }
.document-lines textarea { min-height: 54px; line-height: 1.4; resize: vertical; overflow-wrap: anywhere; }
.line-order-help { display: flex; align-items: center; gap: 6px; margin: 7px 0 0; color: var(--muted); font-size: .67rem; }
.line-order-heading, .line-order-cell { width: 78px; text-align: center !important; }
.line-order-controls { display: flex; align-items: center; justify-content: center; gap: 4px; }
.line-drag-handle { display: inline-grid; width: 34px; height: 38px; padding: 0; place-items: center; color: var(--muted); background: #f4f7f5; border: 1px solid #d8e2dc; border-radius: 8px; cursor: grab; touch-action: none; }
.line-drag-handle:hover, .line-drag-handle:focus-visible { color: var(--green-700); background: var(--green-50); border-color: #a8d2bb; }
.line-drag-handle:active { cursor: grabbing; }
.line-nudge-buttons { display: grid; gap: 2px; }
.line-nudge-buttons button { display: grid; width: 25px; height: 18px; padding: 0; place-items: center; color: var(--muted); background: #fff; border: 1px solid #d8e2dc; border-radius: 5px; font-size: .65rem; line-height: 1; }
.line-nudge-buttons button:hover:not(:disabled) { color: var(--green-700); background: var(--green-50); }
.line-nudge-buttons button:disabled { cursor: not-allowed; opacity: .3; }
.document-lines tr[data-line] { transition: background-color .15s ease, opacity .15s ease, box-shadow .15s ease; }
.document-lines tr[data-line].is-dragging { opacity: .52; background: #eef8f2; }
.document-lines tr[data-line].is-drag-over { box-shadow: inset 0 3px var(--green-500); }
.document-title-line { background: #edf4f0; }
.line-title-field { display: flex; align-items: center; gap: 12px; }
.line-title-field > span { white-space: nowrap; color: var(--green-700); font-size: .7rem; font-weight: 800; }
.line-title-field input, .line-title-field textarea { min-width: 0; flex: 1; margin: 0; color: var(--green-800); font-weight: 700; }
.document-title-help { margin: 8px 20px 0; color: var(--muted); font-size: .7rem; }
.line-quantity { width: 76px; }
.line-unit { width: 90px; }
.line-price { width: 120px; }
.line-discount, .line-tax { width: 85px; }
.line-quantity input, .line-unit input, .line-tax select { text-align: center; }
.line-price input, .line-discount input, .line-total { text-align: right; }
.line-total { width: 110px; }
.line-delete { width: 82px; }
.line-product { min-width: 360px; }
.line-product input { margin-top: 5px; }
.line-product select[data-product][hidden], .document-product-picker[hidden], .document-product-summary[hidden], .document-product-results[hidden] { display: none; }
.document-product-picker { display: flex; align-items: stretch; gap: 5px; }
.document-product-picker input[data-product-search] { min-width: 0; flex: 1; margin-top: 0; padding-right: 8px; }
.document-product-picker button { width: 34px; flex: 0 0 34px; color: var(--green-700); background: var(--green-50); border: 1px solid #c9ded1; border-radius: 7px; font-size: 1rem; cursor: pointer; }
.document-product-summary { margin: 6px 0; color: var(--muted); font-size: .61rem; line-height: 1.55; white-space: normal; }
.document-product-results { position: fixed; z-index: 70; overflow-y: auto; overscroll-behavior: contain; padding: 5px; color: var(--ink); background: white; border: 1px solid #b9d7c5; border-radius: 12px; box-shadow: 0 16px 45px rgba(15,48,31,.22); }
.document-product-results-heading { position: sticky; top: -5px; z-index: 1; padding: 9px 10px; color: var(--muted); background: #f4f8f5; border-bottom: 1px solid var(--line); font-size: .65rem; font-weight: 750; }
.document-product-result { display: block; width: 100%; padding: 11px 12px; color: var(--ink); background: white; border: 0; border-bottom: 1px solid #edf2ef; border-radius: 7px; font: inherit; text-align: left; cursor: pointer; }
.document-product-result:hover, .document-product-result[aria-selected="true"] { background: #edf8f1; box-shadow: inset 3px 0 var(--green-500); }
.document-product-result-name { display: block; font-size: .79rem; font-weight: 800; white-space: normal; overflow-wrap: anywhere; }
.document-product-result-header { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; }
.document-product-result-identity { min-width: 0; }
.document-product-result-identity > small { display: block; margin-top: 3px; color: var(--muted); font-size: .6rem; overflow-wrap: anywhere; }
.document-product-result-identity > .document-product-result-category { color: var(--green-700); font-weight: 700; }
.document-category-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #f7faf8; }
.document-category-toolbar label { display: grid; flex: 0 1 340px; min-width: 0; gap: 5px; }
.document-category-toolbar label > span { color: var(--green-800); font-size: .7rem; font-weight: 700; }
.document-category-toolbar select { width: 100%; min-width: 0; }
.document-category-toolbar > small { flex: 1 1 220px; color: var(--muted); font-size: .65rem; line-height: 1.5; }
.document-product-result-photo { position: relative; display: grid; width: 72px; height: 72px; overflow: hidden; place-items: center; background: #f5f8f6; border: 1px solid #dce8e0; border-radius: 9px; }
.document-product-result-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: white; object-fit: contain; }
.document-product-result-photo-placeholder { padding: 4px; color: var(--muted); font-size: .58rem; line-height: 1.3; text-align: center; }
.document-product-result-photo-placeholder[hidden] { display: none; }
.document-product-result-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 12px; margin-top: 9px; }
.document-product-result-fields > span { display: grid; align-content: start; gap: 3px; }
.document-product-result-fields small { color: var(--muted); font-size: .58rem; }
.document-product-result-fields b { font-size: .69rem; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.document-product-result-fields > span:nth-last-child(-n+2) { grid-column: span 1; }
.document-product-no-results { margin: 12px; color: var(--muted); font-size: .73rem; }
@media (max-width: 640px) {
    .document-product-result-header { grid-template-columns: 56px minmax(0, 1fr); gap: 9px; }
    .document-product-result-photo { width: 56px; height: 56px; }
    .document-product-result-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-product-result-fields > span:last-child { grid-column: 1 / -1; }
}
.line-total { font-size: .75rem; font-weight: 800; }
.line-action-buttons { display: flex; align-items: center; justify-content: center; gap: 5px; }
.line-text-editor { min-width: 0; margin: 5px 0 7px; }
.line-format-open { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 9px; color: var(--green-700); background: #f1f7f3; border: 1px solid #d7e6dd; border-radius: 7px; font-size: .65rem; font-weight: 700; cursor: pointer; }
.line-format-open > span { font-family: Georgia, serif; font-size: .9rem; }
.line-format-open[aria-expanded="true"] { background: var(--green-700); border-color: var(--green-700); color: white; }
.line-format-panel[hidden] { display: none !important; }
.line-format-panel { display: flex; min-width: 0; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 7px; padding: 10px; background: #f8fbf9; border: 1px solid #d6e4db; border-radius: 9px; }
.line-format-panel label { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.line-format-panel label > span { color: var(--muted); font-size: .6rem; font-weight: 700; }
.document-lines .line-format-panel select { min-width: 100px; min-height: 40px; padding: 6px 8px; font-size: .7rem; }
.line-format-column { flex: 1 1 160px; max-width: 100%; }
.document-lines .line-format-column select { width: 100%; max-width: 100%; min-width: 0; }
.line-format-panel label.line-format-all { flex: 1 0 100%; flex-direction: row; align-items: center; gap: 7px; min-height: 36px; cursor: pointer; }
.line-format-panel .line-format-all input { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--green-700); }
.line-format-panel .line-format-all > span { color: var(--green-800); font-size: .7rem; }
.document-lines [data-text-cell] { max-width: 100%; }
.line-format-options { display: flex; flex-wrap: wrap; gap: 4px; }
.line-format-options button { width: 40px; height: 40px; background: white; border: 1px solid #ccdcd2; border-radius: 7px; color: var(--ink); font-size: .95rem; cursor: pointer; }
.line-format-options button[aria-pressed="true"] { color: white; background: var(--green-700); border-color: var(--green-700); }
.document-lines .line-format-panel input[type="color"] { width: 46px; height: 40px; min-height: 40px; margin: 0; padding: 3px; cursor: pointer; }
.line-format-reset { min-height: 40px; padding: 6px 9px; background: white; border: 1px solid #ccdcd2; border-radius: 7px; color: var(--muted); font-size: .65rem; cursor: pointer; }
.line-format-panel > small { flex: 1 0 100%; color: var(--muted); font-size: .61rem; line-height: 1.4; }
.line-format-open:focus-visible, .line-format-panel button:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
@media (max-width: 600px) {
    .line-format-open, .line-format-options button, .line-format-reset { min-height: 44px; }
    .line-format-options button { width: 44px; }
    .document-lines .line-format-panel select, .document-lines .line-format-panel input[type="color"] { min-height: 44px; }
}
.line-margin-tools { display: grid; grid-template-columns: 92px 82px 74px minmax(145px, 1fr); align-items: end; gap: 6px; margin-top: 6px; padding: 7px; background: #f6f9f7; border: 1px solid #e0e8e3; border-radius: 8px; }
.line-margin-tools label span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .55rem; font-weight: 750; text-transform: uppercase; }
.line-margin-tools input { min-height: 32px; margin: 0; padding: 5px 6px; font-size: .68rem; }
.line-margin-tools button { min-height: 32px; padding: 5px 7px; color: white; background: var(--green-700); border: 0; border-radius: 7px; font-size: .62rem; font-weight: 800; }
.line-margin-tools output { align-self: center; color: var(--green-800); font-size: .62rem; font-weight: 750; line-height: 1.3; }
.document-lines-heading { align-items: flex-start; }
.document-autosave-status { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; color: var(--muted); background: #f2f5f3; border-radius: 999px; font-size: .62rem; font-weight: 750; }
.document-autosave-status[data-state="saved"] { color: var(--green-800); background: var(--green-50); }
.document-autosave-status[data-state="saving"], .document-autosave-status[data-state="pending"] { color: #77571a; background: #fff6dc; }
.document-autosave-status[data-state="error"] { color: var(--danger); background: var(--danger-bg); }
.document-number-status { display: block; min-height: 1.2em; }
.document-number-status[data-state="available"] { color: var(--green-700); }
.document-number-status[data-state="checking"], .document-number-status[data-state="warning"] { color: #77571a; }
.document-number-status[data-state="error"] { color: var(--danger); font-weight: 750; }
[data-document-number][aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 35, .10); }
.document-productivity-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) auto minmax(180px, .7fr); align-items: end; gap: 10px; padding: 0 20px 14px; border-bottom: 1px solid #edf1ef; }
.document-productivity-toolbar .field { margin: 0; }
.document-productivity-toolbar .btn { min-height: 43px; }
.document-copy-status { align-self: center; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.document-line-add-actions { display: flex; justify-content: flex-end; padding: 14px 20px 4px; border-top: 1px solid #edf1ef; }
.document-line-add-actions .btn { min-width: 170px; justify-content: center; }
.document-line-add-actions .btn[data-letterhead-toggle] { min-width: 0; max-width: 100%; white-space: normal; line-height: 1.35; text-align: center; }
.document-total-panel { width: min(390px, 100%); margin-left: auto; padding: 16px 23px 20px; }
.document-total-panel > div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; font-size: .78rem; }
.document-total-panel > div[hidden] { display: none; }
.document-total-panel span { color: var(--muted); }
.document-total-panel .grand-total { margin-top: 6px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 1rem; }
.document-total-panel .grand-total strong { color: var(--green-700); font-size: 1.18rem; }
.document-total-panel .grand-total { align-items: center; gap: 10px; flex-wrap: wrap; }
.document-total-value { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-left: auto; }
.document-rounding-actions { display: flex; gap: 4px; }
.document-rounding-actions button { display: inline-grid; place-items: center; min-width: 30px; min-height: 34px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green-700); font-size: 1rem; cursor: pointer; }
.document-rounding-actions button[aria-pressed="true"] { background: var(--green-700); border-color: var(--green-700); color: white; }
.document-rounding-actions button:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.document-rounding-actions button:disabled { cursor: default; opacity: .4; }
.document-rounding-help { display: block; margin-top: 7px; font-size: .65rem; line-height: 1.45; color: var(--muted); }

@container document-lines (max-width: 1320px) {
    .document-lines-card .table-scroll { overflow: visible; }
    .document-lines { display: block; min-width: 0; padding: 0; }
    .document-lines thead { display: none; }
    .document-lines tbody { display: grid; gap: 12px; padding: 14px; background: #f6f9f7; }
    .document-lines tr[data-line] {
        display: grid; min-width: 0; grid-template-columns: 56px repeat(6, minmax(88px, 1fr));
        align-items: start; gap: 10px; padding: 13px; background: white; border: 1px solid var(--line);
        border-radius: 13px; box-shadow: 0 5px 15px rgba(23, 54, 38, .045);
    }
    .document-lines tr[data-line]:hover { border-color: #c8d8ce; box-shadow: 0 8px 20px rgba(23, 54, 38, .075); }
    .document-lines tr[data-line] > td { display: block; min-width: 0; width: auto; padding: 0; border: 0; text-align: left; }
    .document-lines td[data-field-label]::before {
        display: block; margin: 0 0 5px; color: var(--muted); content: attr(data-field-label);
        font-size: .56rem; font-weight: 800; letter-spacing: .045em; line-height: 1.2; text-transform: uppercase;
    }
    .document-lines .line-order-cell { grid-column: 1; grid-row: 1; align-self: start; }
    .document-lines .line-order-controls { flex-direction: column; }
    .document-lines .line-product { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
    .document-lines .line-quantity { grid-column: 2; }
    .document-lines .line-unit { grid-column: 3; }
    .document-lines .line-price { grid-column: 4; }
    .document-lines .line-discount { grid-column: 5; }
    .document-lines .line-tax { grid-column: 6; }
    .document-lines .line-stock-impact { grid-column: 7; min-width: 0; }
    .document-lines .line-stock-impact label { min-height: 38px; justify-content: flex-start; }
    .document-lines .line-custom { grid-column: 2 / -1; min-width: 0; }
    .document-lines .line-total { grid-column: 2 / span 3; display: grid; min-height: 52px; align-content: center; padding: 7px 10px; color: var(--green-800); background: var(--green-50); border: 1px solid #d3eadc; border-radius: 8px; font-size: .9rem; text-align: left; }
    .document-lines .line-total::before { margin-bottom: 3px; }
    .document-lines .line-delete { grid-column: 5 / -1; align-self: end; }
    .document-lines .line-delete::before { text-align: right; }
    .document-lines .line-action-buttons { min-height: 38px; justify-content: flex-end; }
    .document-lines tr.document-title-line { grid-template-columns: 56px minmax(0, 1fr) 82px; align-items: center; background: #edf4f0; }
    .document-lines tr.document-title-line .line-order-cell { grid-column: 1; }
    .document-lines tr.document-title-line .line-title-content { grid-column: 2; }
    .document-lines tr.document-title-line .line-delete { grid-column: 3; align-self: center; }
}

@container document-lines (max-width: 720px) {
    .document-lines tbody { gap: 10px; padding: 10px; }
    .document-lines tr[data-line] { grid-template-columns: 48px repeat(2, minmax(0, 1fr)); gap: 9px; padding: 11px; }
    .document-lines .line-product { grid-column: 2 / -1; }
    .document-lines .line-quantity, .document-lines .line-price, .document-lines .line-tax { grid-column: 2; }
    .document-lines .line-unit, .document-lines .line-discount, .document-lines .line-stock-impact { grid-column: 3; }
    .document-lines .line-custom { grid-column: 2 / -1; }
    .document-lines .line-total { grid-column: 2; }
    .document-lines .line-delete { grid-column: 3; }
    .line-margin-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .line-margin-tools button { grid-column: 1; }
    .line-margin-tools output { grid-column: 2; }
    .document-lines tr.document-title-line { grid-template-columns: 48px minmax(0, 1fr) 76px; }
    .document-lines tr.document-title-line .line-title-content { grid-column: 2; }
    .document-lines tr.document-title-line .line-delete { grid-column: 3; }
    .line-title-field { align-items: stretch; flex-direction: column; gap: 6px; }
}

@container document-lines (max-width: 480px) {
    .document-lines tr[data-line] { grid-template-columns: 42px minmax(0, 1fr); }
    .document-lines .line-product,
    .document-lines .line-quantity,
    .document-lines .line-unit,
    .document-lines .line-price,
    .document-lines .line-discount,
    .document-lines .line-tax,
    .document-lines .line-stock-impact,
    .document-lines .line-custom,
    .document-lines .line-total,
    .document-lines .line-delete { grid-column: 2; }
    .document-lines .line-delete::before { text-align: left; }
    .document-lines .line-action-buttons { justify-content: flex-start; }
    .line-margin-tools { grid-template-columns: 1fr; }
    .line-margin-tools button, .line-margin-tools output { grid-column: 1; }
    .document-lines tr.document-title-line { grid-template-columns: 42px minmax(0, 1fr); }
    .document-lines tr.document-title-line .line-title-content { grid-column: 2; }
    .document-lines tr.document-title-line .line-delete { grid-column: 2; }
}

.document-view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 18px; }
.document-preview-card { min-width: 0; overflow: hidden; }
.document-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.document-preview-heading h2 { margin: 0; font-size: 1rem; }
.document-preview-heading p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; }
.document-preview-scroll { width: 100%; overflow: hidden; padding: 15px; background: #e9eeeb; }
.document-preview-frame { display: block; width: 100%; min-width: 0; height: clamp(680px, 78vh, 1060px); background: #e9eeeb; border: 0; border-radius: 8px; }
.document-actions-column { display: flex; flex-direction: column; gap: 14px; }
.document-actions-column .card { margin: 0; }
.action-card { padding: 18px; }
.action-card h3 { margin-bottom: 6px; font-size: .9rem; }
.action-card > p { color: var(--muted); font-size: .7rem; line-height: 1.5; }
.action-card form + form { margin-top: 7px; }
.payment-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.payment-list strong, .payment-list small { display: block; font-size: .7rem; }
.payment-list small { color: var(--muted); }
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-list a { display: flex; align-items: center; gap: 7px; padding: 8px; color: var(--ink); background: #f8faf9; border-radius: 7px; font-size: .72rem; }

.project-hero { position: relative; margin-bottom: 17px; padding: 22px; overflow: hidden; }
.project-hero::after { position: absolute; top: -70px; right: -50px; width: 220px; height: 220px; content: ""; background: radial-gradient(circle, rgba(34,163,102,.12), transparent 67%); }
.project-hero-status { position: relative; z-index: 1; display: flex; gap: 7px; margin-bottom: 18px; }
.priority-tag { display: inline-flex; align-items: center; padding: 3px 8px; color: #4e5b53; background: #edf1ef; border-radius: 999px; font-size: .64rem; font-weight: 800; }
.priority-tag.priority-urgent { color: white; }
.project-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.project-hero-grid small, .project-hero-grid strong, .project-hero-grid span { display: block; }
.project-hero-grid small { color: var(--muted); font-size: .65rem; }
.project-hero-grid strong { margin-top: 5px; font-size: .82rem; }
.project-hero-grid span { color: var(--muted); font-size: .66rem; }
.hero-progress { position: relative; z-index: 1; margin-top: 22px; }
.hero-progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: .7rem; }
.hero-progress > i { height: 9px; }
.tabs { display: flex; gap: 5px; margin: 23px 0 15px; padding: 5px; overflow-x: auto; background: #e8eeea; border-radius: 12px; }
.tabs button { min-height: 36px; padding: 7px 12px; color: #65736b; background: transparent; border: 0; border-radius: 8px; font-size: .7rem; font-weight: 750; white-space: nowrap; }
.tabs button span { margin-left: 4px; padding: 2px 5px; background: rgba(0,0,0,.06); border-radius: 99px; font-size: .58rem; }
.tabs button.active { color: var(--green-800); background: white; box-shadow: 0 3px 8px rgba(20,55,37,.09); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.project-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.project-detail-grid .card { min-width: 0; margin: 0; }
.detail-list { margin: 0; padding: 8px 20px 18px; }
.detail-list > div { display: grid; grid-template-columns: 145px 1fr; gap: 15px; padding: 10px 0; border-bottom: 1px solid #edf1ef; font-size: .75rem; }
.detail-list > div:last-child { border: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 650; }
.rich-note { margin: 0 20px 20px; padding: 14px; color: #4d5a52; background: #f8faf9; border-radius: 10px; font-size: .74rem; line-height: 1.5; }
.rich-note p { margin: 6px 0 0; }
.cost-breakdown { padding: 12px 20px 5px; }
.cost-breakdown > div { display: flex; justify-content: space-between; padding: 9px 0; color: var(--muted); border-bottom: 1px solid #edf1ef; font-size: .75rem; }
.cost-breakdown strong { color: var(--ink); }
.cost-result { margin-top: 7px; padding: 14px 0 !important; color: var(--ink) !important; border-bottom: 0 !important; font-weight: 800; }
.cost-result strong { color: var(--green-700); font-size: 1.06rem; }
.cost-breakdown + p { padding: 0 20px 15px; }
.reception-item { margin: 12px 20px; padding: 13px; background: #f8faf9; border-radius: 10px; font-size: .72rem; }
.reception-item > strong, .reception-item > span { display: inline-block; margin-right: 8px; }
.reception-item p { margin: 7px 0 0; }
.reception-item small { color: var(--muted); }
.task-board { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 13px; padding: 18px; overflow-x: auto; }
.task-column { min-height: 260px; padding: 11px; background: #f5f8f6; border: 1px solid #e7ece9; border-radius: 11px; }
.task-column > h3 { display: flex; justify-content: space-between; margin: 0 3px 11px; font-size: .76rem; }
.task-column > h3 span { display: grid; width: 21px; height: 21px; place-items: center; background: white; border-radius: 6px; font-size: .6rem; }
.task-card { position: relative; display: block; margin-bottom: 8px; padding: 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 4px 10px rgba(26,57,41,.04); }
.task-card > .priority-dot { position: absolute; top: 13px; right: 12px; }
.task-card strong, .task-card small { display: block; padding-right: 12px; }
.task-card strong { font-size: .72rem; }
.task-card small { margin-top: 5px; color: var(--muted); font-size: .62rem; }
.task-card > div { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: .59rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; padding: 18px; }
.photo-grid figure { overflow: hidden; margin: 0; background: #f7f9f8; border: 1px solid var(--line); border-radius: 11px; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e7ece9; }
.photo-grid figcaption { padding: 10px; }
.photo-grid figcaption strong, .photo-grid figcaption span, .photo-grid figcaption small { display: block; }
.photo-grid figcaption strong { font-size: .69rem; }
.photo-grid figcaption span { overflow: hidden; margin-top: 3px; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.photo-grid figcaption small { margin-top: 5px; color: var(--muted); font-size: .58rem; }
.report-list { padding: 5px 20px; }
.report-list article, .intervention-list article { margin: 14px 0; padding: 16px; background: #f8faf9; border-left: 3px solid var(--green-500); border-radius: 0 10px 10px 0; font-size: .73rem; line-height: 1.5; }
.report-list header, .intervention-list header { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.report-list header span { color: var(--muted); font-size: .65rem; }
.report-list h4, .intervention-list h4 { margin: 11px 0 3px; font-size: .69rem; }
.report-list p, .intervention-list p { margin: 0; color: #536159; }
.lead-text { padding: 0 20px; color: #405048; font-size: .82rem; line-height: 1.65; }
.intervention-list { padding: 5px 20px; }

.pos-page .page-container { width: 100%; max-width: none; padding-bottom: 20px; }
.pos-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.pos-header h1 { margin: 0; font-size: 1.8rem; }
.pos-session-stats { display: flex; align-items: center; gap: 18px; }
.pos-session-stats > span small, .pos-session-stats > span strong { display: block; }
.pos-session-stats small { color: var(--muted); font-size: .6rem; }
.pos-session-stats strong { font-size: .82rem; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; align-items: start; min-height: calc(100vh - 145px); gap: 15px; }
.pos-catalog, .pos-cart { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pos-catalog { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.pos-search { display: flex; align-items: center; gap: 9px; margin: 15px 15px 8px; padding: 0 12px; color: var(--muted); background: #f6f9f7; border: 1px solid var(--line); border-radius: 11px; }
.pos-search input { width: 100%; height: 46px; background: transparent; border: 0; box-shadow: none !important; }
.pos-categories { display: flex; gap: 6px; padding: 5px 15px 13px; }
.pos-categories button { padding: 6px 11px; color: var(--muted); background: #f2f5f3; border: 0; border-radius: 99px; font-size: .67rem; font-weight: 750; }
.pos-categories button.active { color: white; background: var(--green-700); }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); align-content: start; gap: 9px; padding: 2px 15px 16px; overflow-y: auto; }
.pos-product { position: relative; display: flex; min-height: 135px; flex-direction: column; align-items: flex-start; padding: 12px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 11px; transition: .14s ease; }
.pos-product:hover { border-color: #9ccbb0; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(20,75,47,.09); }
.product-symbol { display: grid; width: 34px; height: 34px; place-items: center; color: var(--green-700); background: var(--green-50); border-radius: 9px; }
.pos-product strong { margin-top: 9px; font-size: .73rem; line-height: 1.25; }
.pos-product small { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.pos-product b { margin-top: auto; padding-top: 9px; color: var(--green-700); font-size: .72rem; }
.pos-cart { position: sticky; top: 88px; display: flex; height: calc(100dvh - 188px); min-height: 500px; max-height: calc(100dvh - 188px); align-self: start; flex-direction: column; overflow: hidden; }
.pos-cart-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.pos-cart-header h2 { margin: 0; font-size: 1.05rem; }
.pos-cart-header h2 span { color: var(--muted); font-size: .7rem; }
.pos-cart-lines { min-height: 70px; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 5px 13px; scrollbar-gutter: stable; }
.pos-cart-empty { display: grid; height: 100%; min-height: 160px; place-items: center; align-content: center; color: #9ba9a1; text-align: center; }
.pos-cart-empty p { margin: 8px 0 0; font-size: .7rem; }
.pos-cart-line { display: grid; grid-template-columns: 1fr 95px 30px; gap: 7px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.pos-cart-line > span strong, .pos-cart-line > span small { display: block; }
.pos-cart-line > span strong { font-size: .7rem; }
.pos-cart-line > span small { margin-top: 4px; color: var(--muted); font-size: .58rem; }
.cart-quantity { display: flex; align-items: center; }
.cart-quantity button { width: 26px; height: 29px; padding: 0; background: #f2f5f3; border: 0; }
.cart-quantity input { width: 39px; height: 29px; padding: 0; text-align: center; border: 1px solid var(--line); }
.pos-checkout { position: relative; z-index: 2; flex: 0 0 auto; background: white; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -10px 24px rgba(23,54,38,.06); }
.pos-client, .pos-payment, .pos-totals { padding: 10px 15px; border-top: 1px solid var(--line); }
.pos-client .field select, .pos-payment .field input, .pos-payment .field select { min-height: 37px; }
.pos-totals > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: .72rem; }
.pos-totals span { color: var(--muted); }
.pos-totals .grand-total { margin-top: 6px; padding-top: 9px; border-top: 1px dashed #cbd4ce; font-size: .93rem; }
.pos-totals .grand-total strong { color: var(--green-700); font-size: 1.12rem; }
.pos-payment { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-payment .field:last-child { grid-column: 1 / -1; }
.pos-checkout > .btn { margin: 12px 15px 15px; width: calc(100% - 30px); }
.pos-open { display: grid; width: min(600px, 100%); grid-template-columns: 160px 1fr; align-items: center; margin: 30px auto; padding: 30px; }
.pos-open-icon { display: grid; width: 100px; height: 100px; place-items: center; color: var(--green-700); background: var(--green-50); border-radius: 28px; }
.receipt-layout { display: grid; grid-template-columns: minmax(320px, 500px) 310px; justify-content: center; align-items: start; gap: 18px; }
.receipt-paper { padding: 25px; }
.receipt-paper > header { text-align: center; }
.receipt-logo { display: grid; width: 46px; height: 46px; overflow: hidden; place-items: center; margin: 0 auto 8px; color: white; background: #030504; border-radius: 12px; }
.receipt-paper header h2 { margin: 0; font-size: 1.15rem; }
.receipt-paper header p { color: var(--muted); font-size: .7rem; }
.receipt-meta { display: flex; justify-content: space-between; gap: 8px; margin: 18px 0; padding: 10px 0; border-top: 1px dashed #bdc9c1; border-bottom: 1px dashed #bdc9c1; font-size: .62rem; }
.receipt-lines > div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px dotted #d7dfda; }
.receipt-lines strong, .receipt-lines small { display: block; font-size: .7rem; }
.receipt-lines small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.receipt-totals { margin: 15px 0; }
.receipt-totals > div { display: flex; justify-content: space-between; padding: 4px 0; font-size: .7rem; }
.receipt-totals > div:last-child { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--ink); font-size: .9rem; }
.receipt-payment, .receipt-paper > footer { padding: 10px 0; color: var(--muted); border-top: 1px dashed #bdc9c1; font-size: .65rem; text-align: center; }

.attendance-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; padding: 23px; background: linear-gradient(140deg, white, var(--green-50)); }
.attendance-hero h2 { margin: 0 0 5px; font-size: 1.25rem; }
.attendance-hero p { margin: 0; color: var(--muted); font-size: .75rem; }
.payroll-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 17px; margin-bottom: 17px; }
.payroll-grid .card { margin: 0; min-width: 0; }
.period-list { padding: 7px; }
.period-list > a { display: flex; justify-content: space-between; gap: 10px; padding: 11px; color: var(--ink); border-radius: 9px; }
.period-list > a:hover, .period-list > a.active { background: var(--green-50); }
.period-list span, .period-list strong, .period-list small, .period-list b { display: block; }
.period-list strong { font-size: .73rem; }
.period-list small { margin-top: 3px; color: var(--muted); font-size: .6rem; }
.period-list > a > span:last-child { text-align: right; }
.period-list b { margin-bottom: 3px; font-size: .65rem; }

.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell > span:last-child { display: block; }
.permissions-card { margin-top: 17px !important; overflow: hidden; }
.permission-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 18px; }
.permission-groups fieldset { min-width: 0; margin: 0; padding: 10px; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; }
.permission-groups legend { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 0 5px; color: var(--green-800); font-size: .72rem; font-weight: 850; }
.permission-groups legend button { color: var(--green-700); background: none; border: 0; font-size: .56rem; }
.permission-item { display: flex; min-width: 0; align-items: flex-start; gap: 8px; padding: 8px; border-radius: 7px; cursor: pointer; }
.permission-item:hover { background: white; }
.permission-item input { margin-top: 2px; accent-color: var(--green-700); }
.permission-item span, .permission-item strong, .permission-item small { display: block; min-width: 0; }
.permission-item strong { font-size: .68rem; }
.permission-item small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.sticky-form-actions { position: sticky; bottom: 12px; z-index: 10; display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; padding: 11px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 15px; }
.role-card { margin: 0 !important; padding: 20px; }
.role-icon { display: grid; width: 42px; height: 42px; place-items: center; color: var(--green-700); background: var(--green-50); border-radius: 11px; }
.role-card h2 { margin: 13px 0 5px; font-size: 1rem; }
.role-card p { min-height: 36px; color: var(--muted); font-size: .69rem; }
.role-card > div { display: flex; gap: 24px; margin: 15px 0; }
.role-card > div strong, .role-card > div small { display: block; }
.role-card > div strong { font-size: 1rem; }
.role-card > div small { color: var(--muted); font-size: .57rem; }
.audit-filters .field { flex: 1; }
.audit-timeline { padding: 10px 18px; }
.audit-item { position: relative; display: grid; grid-template-columns: 12px 72px minmax(220px, 1fr) auto; align-items: start; gap: 11px; padding: 13px 3px; border-bottom: 1px solid #edf1ef; }
.audit-dot { width: 8px; height: 8px; margin-top: 5px; background: #95a29a; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 2px #d8e0db; }
.audit-success { background: var(--green-500); }
.audit-failure, .audit-denied { background: var(--danger); }
.audit-time strong, .audit-time small, .audit-main strong, .audit-main p, .audit-main small { display: block; }
.audit-time strong { font-size: .72rem; }
.audit-time small { margin-top: 3px; color: var(--muted); font-size: .57rem; }
.audit-main strong { font-size: .73rem; }
.audit-main p { margin: 3px 0; color: #4f5c54; font-size: .68rem; }
.audit-main small { color: var(--muted); font-size: .58rem; }
.audit-item details { grid-column: 3 / -1; }
.audit-item summary { color: var(--green-700); font-size: .6rem; cursor: pointer; }
.audit-item pre { max-height: 250px; overflow: auto; padding: 11px; color: #d9efe2; background: #102b20; border-radius: 8px; font-size: .61rem; white-space: pre-wrap; }

.notification-list { overflow: hidden; }
.notification-list > a { display: flex; gap: 12px; padding: 15px 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.notification-list > a.unread { background: var(--green-50); }
.notification-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; color: var(--green-700); background: white; border: 1px solid var(--line); border-radius: 9px; }
.notification-list strong, .notification-list p, .notification-list small { display: block; }
.notification-list strong { font-size: .75rem; }
.notification-list p { margin: 4px 0; color: #536159; font-size: .7rem; }
.notification-list small { color: var(--muted); font-size: .59rem; }
.timeline { padding: 10px 20px; }
.timeline-row { display: grid; grid-template-columns: 125px 12px 1fr auto; align-items: center; gap: 12px; padding: 13px 0; color: var(--ink); border-bottom: 1px solid #edf1ef; }
.timeline-row time { color: var(--muted); font-size: .67rem; }
.timeline-dot { width: 9px; height: 9px; background: var(--green-500); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 2px #c9dfd2; }
.timeline-row strong, .timeline-row small { display: block; }
.timeline-row strong { font-size: .75rem; }
.timeline-row small { margin-top: 3px; color: var(--muted); font-size: .61rem; }

.modal { width: min(570px, calc(100% - 24px)); max-height: calc(100vh - 35px); padding: 0; overflow: auto; background: white; border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(10, 31, 22, .55); backdrop-filter: blur(3px); }
.modal > form > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 1.08rem; }
.modal-body { padding: 19px 20px; }
.modal > form > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; background: #f8faf9; border-top: 1px solid var(--line); }

.guest-shell { min-height: 100vh; }
.login-page { background: var(--green-950); }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: 1.08fr .92fr; }
.login-panel { padding: clamp(30px, 6vw, 90px); }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: white; background: radial-gradient(circle at 70% 20%, rgba(61,181,114,.22), transparent 34%), linear-gradient(150deg, #0d2d20, #123d2b); }
.login-intro::before { position: absolute; right: -15%; bottom: -20%; width: 600px; height: 600px; content: ""; background: repeating-radial-gradient(circle, transparent 0 30px, rgba(255,255,255,.025) 31px 32px); }
.login-intro > * { position: relative; z-index: 1; }
.login-brand-lockup { display: flex; align-items: center; gap: 13px; color: white; font-size: 1.08rem; letter-spacing: .01em; }
.login-brand-lockup .login-logo { width: 62px; height: 62px; border-radius: 17px; }
.login-intro h1 { max-width: 700px; margin: 12px 0 20px; font-size: clamp(2.4rem, 4.4vw, 4.7rem); line-height: .98; letter-spacing: -.055em; }
.login-intro p { max-width: 590px; color: #b8d3c3; font-size: 1rem; line-height: 1.65; }
.login-features { display: flex; flex-wrap: wrap; gap: 11px 20px; color: #b8d3c3; font-size: .7rem; }
.login-features span { display: flex; align-items: center; gap: 6px; }
.login-form-panel { display: grid; place-items: center; background: #f4f7f5; }
.login-form { width: min(410px, 100%); padding: 34px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); }
.login-form h2 { margin: 5px 0; font-size: 2rem; }
.login-form > p { margin-bottom: 24px; color: var(--muted); font-size: .82rem; }
.login-form .field { margin-bottom: 14px; }
.login-form > .btn { margin-top: 8px; }
.password-field { display: flex; border: 1px solid #d7e0da; border-radius: 9px; }
.password-field input { border: 0; box-shadow: none !important; }
.password-field button { padding: 0 10px; color: var(--green-700); background: transparent; border: 0; font-size: .65rem; font-weight: 750; }
.security-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 17px; color: var(--muted); font-size: .6rem; }
.mobile-brand { display: none; }
.error-page .guest-shell { display: grid; place-items: center; padding: 20px; }
.error-card { max-width: 550px; padding: 40px; background: white; border-radius: 20px; box-shadow: var(--shadow-lg); text-align: center; }
.error-code { color: var(--green-500); font-size: 4rem; font-weight: 900; letter-spacing: -.08em; }
.error-card p { color: var(--muted); }

.settings-navigation { display: flex; overflow-x: auto; gap: 8px; margin: -4px 0 18px; padding: 5px; background: #e8efeb; border-radius: 13px; }
.settings-navigation a { flex: 0 0 auto; padding: 10px 15px; color: var(--muted); border-radius: 9px; font-size: .76rem; font-weight: 750; }
.settings-navigation a.active { color: white; background: var(--green-700); box-shadow: 0 5px 14px rgba(18,107,67,.18); }
.branding-upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; }
.branding-upload-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.branding-upload-card h3 { margin: 10px 0 4px; font-size: .84rem; }
.branding-upload-card p { min-height: 32px; color: var(--muted); font-size: .65rem; }
.branding-preview { display: grid; height: 118px; overflow: hidden; place-items: center; color: var(--green-600); background: #f6f9f7; border: 1px dashed #cbd8d0; border-radius: 10px; }
.branding-preview img { width: 100%; height: 100%; object-fit: contain; }
.company-header-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.company-header-mode-option { position: relative; display: block; cursor: pointer; }
.company-header-mode-option input { position: absolute; top: 15px; right: 15px; width: 18px; height: 18px; accent-color: var(--green-700); }
.company-header-mode-option > span { display: grid; min-height: 125px; align-content: start; gap: 7px; padding: 18px 48px 18px 18px; color: var(--muted); background: #f8faf9; border: 1px solid var(--line); border-radius: 13px; transition: .18s ease; }
.company-header-mode-option strong { color: var(--ink); font-size: .86rem; }
.company-header-mode-option small { font-size: .67rem; line-height: 1.5; }
.company-header-mode-option input:checked + span { color: var(--green-700); background: var(--green-50); border-color: #8bc5a5; box-shadow: 0 0 0 3px rgba(34,163,102,.08); }
.company-header-sample { display: grid; min-height: 155px; place-items: center; align-content: center; gap: 6px; margin-top: 12px; padding: 18px; overflow: hidden; background: white; border: 1px dashed #bdcec3; border-radius: 13px; text-align: center; }
.company-header-sample img { width: min(620px, 90%); max-height: 74px; object-fit: contain; }
.company-header-sample.is-full-header { min-height: 210px; }
.company-header-sample .company-full-header-sample { width: min(960px, 100%); max-height: 150px; object-position: center top; }
.company-header-sample h3 { max-width: 100%; margin: 0; line-height: 1; text-transform: uppercase; }
.company-header-sample > strong { color: var(--green-700); font-size: .78rem; }
.company-header-sample > p { max-width: 780px; margin: 0; color: var(--muted); font-size: .67rem; font-weight: 700; text-transform: uppercase; }
.document-type-tabs { display: flex; overflow-x: auto; gap: 7px; margin-bottom: 16px; padding-bottom: 4px; }
.document-type-tabs a { flex: 0 0 auto; padding: 9px 13px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: .7rem; font-weight: 750; }
.document-type-tabs a.active { color: white; background: var(--green-700); border-color: var(--green-700); }
.document-template-form { display: flex; flex-direction: column; gap: 16px; }
.template-defaults { padding: 0; }
.template-column-list, .template-note-list { display: flex; flex-direction: column; gap: 9px; }
.template-column-row { display: grid; grid-template-columns: 28px 95px minmax(180px,1fr) 100px 125px 112px; align-items: end; gap: 9px; padding: 10px; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; }
.template-column-row .field, .template-note-row .field { margin: 0; }
.template-column-row .field span, .template-note-row .field span { font-size: .58rem; }
.drag-handle { align-self: center; color: var(--muted); font-weight: 900; text-align: center; }
.column-actions { display: flex; align-self: center; gap: 4px; }
.template-note-row { display: grid; grid-template-columns: minmax(150px, .35fr) 1fr 40px; align-items: end; gap: 10px; padding: 10px; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; }
.field-grow { min-width: 0; }
.sticky-actions { position: sticky; bottom: 10px; z-index: 10; justify-content: flex-end; margin: 0; padding: 10px; background: rgba(243,246,244,.92); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(10px); }
.document-branding-heading { margin-top: 24px; }
.document-branding-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); padding: 0; }
.permission-item.is-locked { opacity: .72; }
.note-insert-action { align-self: end; }
.note-insert-action .btn { min-height: 43px; }
.line-custom { min-width: 135px; }

.print-page { --doc-primary: #2e5c92; --doc-secondary: #86b93b; --doc-header-font: Arial, sans-serif; --doc-body-font: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman No9 L", serif; --doc-number-font: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman No9 L", serif; --doc-name-size: 28pt; --doc-bg-opacity: 1; padding: 0; background: #e9eeeb; }
.print-page-pdf-preview { min-height: 100vh; overflow: hidden; background: #e9eeeb; }
.print-page-pdf-preview > .print-document, .print-page-pdf-preview > .print-pages { position: fixed; top: 0; left: -300vw; margin: 0; box-shadow: none; pointer-events: none; }
.pdf-preview-status { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; color: #183b2c; background: #e9eeeb; text-align: center; }
.pdf-preview-status strong { font-size: 1rem; }
.pdf-preview-status small { max-width: 360px; color: #617169; font-size: .72rem; line-height: 1.5; }
.pdf-preview-spinner { width: 38px; height: 38px; border: 4px solid #cbd8d1; border-top-color: var(--green-700); border-radius: 50%; animation: pdf-preview-spin .75s linear infinite; }
.pdf-preview-status[data-state="error"] .pdf-preview-spinner { display: none; }
.pdf-native-preview-page { width: 100%; height: 100vh; margin: 0; overflow: hidden; background: #e9eeeb; }
.pdf-native-preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #e9eeeb; }
@keyframes pdf-preview-spin { to { transform: rotate(360deg); } }
.pdf-generating .print-document { margin: 0; box-shadow: none; }
.print-toolbar { position: sticky; top: 0; z-index: 4; display: flex; justify-content: center; gap: 8px; padding: 12px; background: rgba(18,45,32,.92); }
.print-toolbar { flex-wrap: wrap; }
.pdf-share-panel { width: min(760px, calc(100% - 28px)); margin: 20px auto; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.pdf-share-panel h1 { margin: 0 0 8px; font-size: 1.2rem; overflow-wrap: anywhere; }
.pdf-share-panel p { font-size: .8rem; line-height: 1.6; }
.pdf-share-panel [data-pdf-share-status] { padding: 12px; background: #eff7fb; border-radius: 9px; }
.pdf-share-panel small { display: block; margin-top: 14px; color: var(--muted); font-size: .71rem; line-height: 1.6; }
.pdf-share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pdf-share-actions .btn { flex: 1 1 200px; justify-content: center; }
.print-document { position: relative; width: 210mm; min-height: 297mm; overflow: hidden; margin: 20px auto; padding: 3.5mm 5.5mm 5.5mm; background: white; box-shadow: 0 15px 50px rgba(0,0,0,.15); font-family: var(--doc-body-font); font-kerning: normal; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "kern" 1, "lnum" 1, "tnum" 1; }
.print-pages { width: 210mm; margin: 20px auto; }
.print-pages .print-document { margin: 0 auto 20px; }
.print-pages .print-document:last-child { margin-bottom: 0; }
.print-background { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: var(--doc-bg-opacity); object-fit: fill; pointer-events: none; }
.print-document-content { position: relative; z-index: 1; display: flex; height: 288mm; min-height: 288mm; flex-direction: column; }
.print-repeating-header, .print-flow-content { flex: 0 0 auto; min-width: 0; }
.print-flow-content { position: relative; }
.print-full-header { display: block; width: 100%; height: 44.25mm; overflow: hidden; }
.print-full-header-image { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.print-letterhead { display: grid; min-height: 39mm; grid-template-columns: 33mm minmax(0, 1fr) 21mm; align-items: start; column-gap: 1mm; }
.print-logo-slot, .print-qr-slot { display: grid; min-height: 21mm; place-items: start center; }
.print-company-logo { position: relative; z-index: 1; width: 33mm; height: 33mm; object-fit: contain; object-position: right top; transform: translateX(1mm); }
.print-company-lockup { display: flex; min-width: 0; flex-direction: column; align-items: center; color: var(--doc-primary); text-align: center; }
.print-company-lockup h1 { margin: 0; font-family: var(--doc-header-font); font-size: var(--doc-name-size); font-stretch: condensed; font-weight: 900; letter-spacing: -.045em; line-height: .96; text-transform: uppercase; }
.print-company-name-image { display: block; width: 100%; max-width: 100%; height: 23mm; margin: 0; object-fit: contain; object-position: left top; }
.print-company-lockup .print-company-legal-name { margin: .45mm 0 0; font-family: "Arial Narrow", "Liberation Sans Narrow", Arial, sans-serif; font-size: 8.3pt; font-weight: 850; letter-spacing: .075em; line-height: 1.02; text-transform: uppercase; }
.print-company-lockup .print-company-capital { display: inline-block; margin: 1.15mm 0 .65mm; padding-bottom: .55mm; font-family: var(--doc-header-font); font-size: 11pt; line-height: 1; border-bottom: 1.2px solid var(--doc-secondary); }
.print-company-lockup .print-company-activity { margin: 0; font-family: var(--doc-header-font); font-size: 8.2pt; font-weight: 700; line-height: 1.08; text-transform: uppercase; }
.print-qr { width: 21mm; height: 21mm; object-fit: contain; }
.print-brand-lines { display: grid; gap: .55mm; margin: 0 0 3mm 34mm; }
.print-brand-lines span:first-child { height: .9mm; background: var(--doc-primary); }
.print-brand-lines span:last-child { height: .8mm; background: var(--doc-secondary); }
.print-document-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0; margin: 1mm 0 5mm; }
.print-document-meta > table { width: 62%; justify-self: start; border-collapse: collapse; font-family: var(--doc-body-font); font-size: 7.15pt; text-align: center; }
.print-document-meta > table th, .print-document-meta > table td { padding: .65mm .8mm; border: .35mm solid #111; }
.print-document-meta > table th { color: white; background: var(--doc-primary); font-weight: 800; }
.print-party-modern { display: flex; justify-content: center; justify-self: center; width: 100%; min-width: 0; padding: 1mm 2mm 0; color: #0e2d59; font-family: var(--doc-body-font); }
.print-party-table { width: 100%; max-width: 88mm; table-layout: fixed; border-collapse: collapse; font-size: 9pt; font-weight: 700; line-height: 1.22; text-align: left; }
.print-party-table th, .print-party-table td { padding: .35mm 0; border: 0; background: transparent; color: inherit; font-weight: inherit; vertical-align: top; text-align: left; }
.print-party-table .print-party-label { width: 28mm; padding-right: 1.6mm; overflow-wrap: anywhere; }
.print-party-table .print-party-separator { width: 3mm; padding-right: 1.6mm; }
.print-party-table .print-party-value { overflow-wrap: anywhere; }
.print-party-table .print-party-name { text-transform: uppercase; }
.print-party-supplier { display: block; font-size: 8pt; text-align: center; }
.print-party-supplier small, .print-party-supplier strong { display: block; }
.print-party-supplier small { font-size: 7pt; font-weight: 800; }
.print-party-supplier strong { margin: 1mm 0; font-size: 10pt; text-transform: uppercase; }
.print-party-supplier p { margin: .5mm 0; }
.print-reference { margin: 0 0 3mm; padding: 2mm; background: rgba(46, 92, 146, .08); border-left: 1mm solid var(--doc-primary); font-size: 7.5pt; }
.print-section-title { margin: 0 0 1mm; font-family: var(--doc-body-font); font-size: 9pt; }
.print-table { width: 100%; border-collapse: collapse; font-family: var(--doc-body-font); font-size: 7.6pt; table-layout: fixed; }
.print-table th { padding: 1.5mm 1mm; color: white; background: var(--doc-primary); border: .35mm solid #111; font-weight: 800; text-align: center; vertical-align: middle; }
.print-table td { overflow-wrap: anywhere; padding: 1.2mm 1mm; border-right: .35mm solid #111; border-left: .35mm solid #111; line-height: 1.15; text-align: left; vertical-align: middle; }
.print-table td.print-align-center { text-align: center; }
.print-table td.print-align-right { text-align: right; }
.print-table td.print-align-left { text-align: left; }
.print-table tbody tr:last-child td { border-bottom: .35mm solid #111; }
.print-table thead { display: table-header-group; }
.print-table tr { break-inside: avoid; page-break-inside: avoid; }
.print-table .print-group-title { break-after: avoid; page-break-after: avoid; }
.print-table .print-group-title td { padding: 1.5mm 1mm; background: #edf3fa; color: var(--doc-primary); font-size: 9pt; font-weight: 700; border-top: .25mm solid var(--doc-primary); border-bottom: .25mm solid var(--doc-primary); text-align: left; }
.print-totals { width: var(--print-totals-width, 52.0833%); margin: 0 0 0 auto; font-family: var(--doc-body-font); }
.print-totals > div { display: grid; grid-template-columns: minmax(0, 1fr) var(--print-totals-value-width, 32%); padding: 0; border-right: .35mm solid #111; border-bottom: .35mm solid #111; border-left: .35mm solid #111; font-size: 7.8pt; }
.print-totals > div > span, .print-totals > div > strong { display: grid; min-width: 0; place-items: center; padding: 1.5mm 1mm; text-align: center; }
.print-totals > div > strong { border-left: .35mm solid #111; }
.print-totals > div:last-child { color: white; background: var(--doc-primary); font-size: 9pt; }
.print-amount-words { margin: 4mm 1mm 0; font-family: var(--doc-body-font); font-size: 7.5pt; line-height: 1.45; }
.print-notes { margin: 3mm 1mm 0; font-family: var(--doc-body-font); font-size: 7pt; line-height: 1.35; }
.print-notes p { margin: 1mm 0 0; white-space: pre-line; }
.print-validity { margin: 4mm 1mm; font-family: var(--doc-body-font); font-size: 7pt; font-style: italic; text-transform: uppercase; }
.print-approval { display: flex; min-height: 30mm; align-items: flex-end; justify-content: flex-end; gap: 7mm; margin: 4mm 2mm 0 auto; }
.print-approval figure { margin: 0; text-align: center; }
.print-approval img { width: 31mm; height: 25mm; object-fit: contain; }
.print-approval figcaption, .print-approval small { color: #536075; font-size: 6pt; }
.print-number, .print-document-meta td, .print-totals strong { font-family: var(--doc-number-font); font-kerning: normal; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "kern" 1, "lnum" 1, "tnum" 1; }
.print-number { white-space: nowrap; letter-spacing: .01em; }
.print-table .print-number[style] { white-space: normal; overflow-wrap: anywhere; }
.print-footer { position: relative; width: 100%; flex: 0 0 auto; margin: auto 0 0; padding: 0 8mm 2mm; color: var(--doc-primary); font-family: "Arial Narrow", "Liberation Sans Narrow", Arial, sans-serif; font-size: 6.65pt; font-weight: 700; font-style: normal; font-variant-numeric: lining-nums tabular-nums; letter-spacing: .01em; line-height: 1.12; text-align: center; text-transform: uppercase; break-inside: avoid; page-break-inside: avoid; }
.print-footer-frame { width: 100%; margin: 0; padding: 0; }
.print-footer.print-footer-minimal { min-height: 4.5mm; }
.print-footer-rule { display: grid; width: 100%; height: 1.25mm; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 1.2mm; margin: 0 0 1.2mm; overflow: hidden; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.print-footer-rule span { display: block; min-width: 0; background: var(--doc-primary); transform: skewX(-38deg); transform-origin: center; }
.print-footer p { display: block; width: 100%; margin: .5mm 0; padding: 0; overflow-wrap: normal; font: inherit; font-size: 6.65pt; line-height: 1.12; letter-spacing: .01em; text-align: center; }
.print-footer-address, .print-footer-contact, .print-footer-legal, .print-footer-bank { font-size: 6.65pt; }
/* Un seul flux typographique : html2canvas ne doit pas calculer deux
   lignes de base flex et deux métriques de graisse pour un même numéro. */
.print-footer-item { display: inline-block; max-width: 100%; white-space: normal; vertical-align: baseline; }
.print-footer-label, .print-footer-value { display: inline; font-family: inherit; font-size: 1em; font-weight: inherit; font-style: inherit; font-variant-numeric: inherit; line-height: inherit; vertical-align: baseline; }
.print-footer-label { margin-right: .35mm; white-space: nowrap; }
.print-footer-value { overflow-wrap: anywhere; }
.print-footer-email .print-footer-value { text-transform: lowercase; }
.print-footer-separator { padding: 0 .55mm; font-weight: inherit; }
.print-footer-custom { display: block !important; margin-bottom: 1.2mm !important; color: var(--doc-primary); font-size: 6.65pt; font-weight: inherit; line-height: 1.12; text-transform: uppercase; }
.print-page-number { position: absolute; right: .8mm; bottom: .15mm; min-width: 7mm; font-family: var(--doc-number-font); font-size: 6.8pt; font-weight: 800; line-height: 1; text-align: right; }
.print-page-number[hidden] { display: none; }
.pdf-generating .print-pages { margin: 0; }
.pdf-generating .print-pages .print-document { margin: 0; box-shadow: none; }

@media print {
    .app-sidebar, .topbar, .page-title, .document-actions-column, .print-toolbar, .pdf-share-panel, .document-actionbar { display: none !important; }
    .app-content { margin: 0; }
    .page-container { padding: 0; }
    .receipt-layout { display: block; }
    .receipt-paper { width: 80mm; margin: 0 auto; border: 0; box-shadow: none; }
    .print-page { background: white; }
    .print-pages { margin: 0; }
    .print-pages .print-document { margin: 0; break-after: page; page-break-after: always; }
    .print-pages .print-document:last-child { break-after: auto; page-break-after: auto; }
    .print-document { width: 210mm; min-height: 297mm; overflow: visible; margin: 0; padding-bottom: 5.5mm; box-shadow: none; }
    .print-background { position: fixed; }
    @page { size: A4; margin: 0; }
}

@media (min-width: 921px) {
    body.sidebar-collapsed .app-sidebar { width: var(--sidebar-compact); }
    body.sidebar-collapsed .app-content { margin-left: var(--sidebar-compact); }
    body.sidebar-collapsed .app-sidebar:is(:hover, :focus-within) { width: var(--sidebar); box-shadow: 12px 0 34px rgba(6, 29, 19, .24); }
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-brand { justify-content: center; padding-inline: 10px; }
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-brand > span:nth-child(2),
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-link > span,
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-group summary > span,
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-group-links,
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-user > span:nth-child(2),
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-user > a { display: none; }
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-nav { padding-inline: 10px; }
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-link,
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-group summary { justify-content: center; gap: 0; padding-inline: 8px; }
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-link svg,
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .nav-group summary svg { width: 22px; height: 22px; }
    body.sidebar-collapsed .app-sidebar:not(:hover):not(:focus-within) .sidebar-user { display: grid; grid-template-columns: 1fr; justify-items: center; margin-inline: 10px; padding: 9px; }
}

@media (max-width: 1180px) {
    :root { --sidebar: 245px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-analytics-grid { grid-template-columns: 1fr; }
    .dashboard-revenue-chart { grid-column: auto; }
    .dashboard-invoice-state .dashboard-donut-wrap { min-height: 0; grid-template-columns: minmax(150px, 210px) minmax(220px, 1fr); align-items: center; gap: 25px; }
    .dashboard-invoice-state .dashboard-donut { width: min(180px, 90%); }
    .dashboard-invoice-state .dashboard-donut-legend { margin-top: 0; }
    .permission-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-layout { grid-template-columns: minmax(0, 1fr) 360px; }
    .project-row { grid-template-columns: 90px 1fr 130px 110px; }
}

@media (max-width: 920px) {
    .app-sidebar { width: min(300px, 87vw); transform: translateX(-105%); transition: transform .22s ease; }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-close, .mobile-menu { display: inline-grid !important; }
    .sidebar-toggle { display: none !important; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; display: block; visibility: hidden; background: rgba(8,28,18,.45); opacity: 0; transition: .22s; }
    body.sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
    .app-content { margin-left: 0; }
    .topbar { padding: 0 20px; }
    .topbar-leading { flex: 1; }
    .topbar-context { min-width: 0; margin-right: auto; margin-left: 0; }
    .topbar-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-container { padding: 24px 20px 45px; }
    .document-view-grid, .project-detail-grid, .receipt-layout, .payroll-grid { grid-template-columns: 1fr; }
    .document-actions-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-layout { grid-template-columns: 1fr; align-items: stretch; }
    .pos-cart { position: relative; top: auto; height: auto; min-height: 500px; max-height: none; align-self: stretch; }
    .pos-cart-lines { min-height: 160px; }
    .pos-catalog { min-height: 540px; }
    .project-hero-grid { grid-template-columns: repeat(2, 1fr); }
    .project-row { grid-template-columns: 85px 1fr 110px; }
    .project-row > .badge { display: none; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .login-form-panel { min-height: 100vh; }
    .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 25px; }
    .mobile-brand .login-logo { width: 36px; height: 36px; }
    .template-column-row { display: flex; align-items: flex-end; flex-wrap: wrap; }
    .template-column-row > .field { flex: 1 1 145px; }
    .template-column-row > .checkbox-field { flex: 0 0 90px; }
    .document-productivity-toolbar { grid-template-columns: 1fr; align-items: stretch; }
    .document-productivity-toolbar .btn { justify-content: center; }
    .template-note-row { grid-template-columns: 1fr 42px; }
    .template-note-row > .field:first-child { grid-column: 1; }
    .template-note-row > .field-grow { grid-column: 1; }
    .template-note-row > .icon-button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

@media (min-width: 921px) and (max-height: 720px) {
    .pos-cart { height: calc(100dvh - 174px); min-height: 450px; max-height: calc(100dvh - 174px); }
    .pos-cart-header { padding-block: 10px; }
    .pos-client, .pos-payment, .pos-totals { padding: 6px 12px; }
    .pos-client .field select, .pos-payment .field input, .pos-payment .field select { min-height: 33px; }
    .pos-payment { gap: 5px 8px; }
    .pos-checkout > .btn { min-height: 42px; margin: 8px 12px 10px; width: calc(100% - 24px); }
}

.field-inline-action { align-self: flex-start; border: 0; background: transparent; color: var(--primary, #126b43); font: inherit; font-size: .78rem; font-weight: 800; padding: 3px 0; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.quick-client-dialog { width: min(720px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; border: 0; border-radius: 18px; padding: 0; box-shadow: 0 24px 80px #09281d55; }
.quick-client-dialog::backdrop { background: #071b1573; backdrop-filter: blur(3px); }
.quick-client-card { padding: 22px; }
.quick-client-card > .card-heading { flex-direction: row; align-items: center; gap: 12px; }
.quick-client-card > .card-heading > .icon-button { flex: 0 0 auto; }
.line-stock-impact { min-width: 105px; text-align: center; }
.line-stock-impact label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .72rem; font-weight: 750; white-space: nowrap; cursor: pointer; }
.document-lines .line-stock-impact input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--green-600); }
.line-stock-impact input:disabled + span { color: var(--muted); opacity: .55; }
.filter-number { width: 108px; }
.payment-entry { align-items: flex-start !important; gap: 8px; }
.payment-entry > div { display: grid; justify-items: end; gap: 6px; }
.payment-entry form { display: grid; gap: 5px; min-width: 148px; }
.payment-entry form select, .payment-entry form input { min-height: 34px; font-size: .75rem; }
.attachment-list { display: grid; gap: 8px; margin-top: 12px; }
.attachment-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border, #dce7e1); }
.attachment-list span { min-width: 0; display: grid; gap: 3px; }
.attachment-list a { word-break: break-word; }
.finance-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.finance-kpis article { display: grid; gap: 8px; min-height: 118px; align-content: center; }
.finance-kpis span { color: var(--muted, #66766e); font-size: .77rem; font-weight: 800; text-transform: uppercase; }
.finance-kpis strong { font-size: clamp(1.15rem, 2vw, 1.75rem); color: #126b43; }
.finance-bars { height: 260px; display: grid; grid-template-columns: repeat(12, minmax(18px, 1fr)); align-items: end; gap: 9px; padding: 28px 12px 0; border-bottom: 1px solid var(--border, #dce7e1); }
.finance-bars > div { height: 100%; display: grid; grid-template-rows: 1fr 24px; align-items: end; justify-items: center; }
.finance-bar { display: block; width: min(32px, 82%); min-height: 3px; background: linear-gradient(180deg, #1db77a, #126b43); border-radius: 7px 7px 2px 2px; }

@media (max-width: 900px) {
    .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .finance-kpis { grid-template-columns: 1fr; }
    .finance-bars { gap: 4px; padding-inline: 2px; }
    .topbar { height: 62px; padding: 0 12px; }
    .topbar-context .eyebrow, .topbar-user > span:last-child { display: none; }
    .page-container { padding: 18px 12px 38px; }
    .page-title { min-height: 0; flex-direction: column; gap: 13px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .metric-grid { grid-template-columns: 1fr; gap: 10px; }
    .metric-card { min-height: 100px; }
    .dashboard-kpi-grid { grid-template-columns: 1fr; gap: 11px; }
    .dashboard-kpi { min-height: 112px; padding-block: 18px; }
    .dashboard-analytics-grid { gap: 13px; }
    .dashboard-card-title { min-height: 68px; padding: 17px 16px 11px; }
    .dashboard-card-title > a { display: none; }
    .dashboard-invoice-state .dashboard-donut-wrap { display: grid; grid-template-columns: 1fr; gap: 3px; padding-inline: 16px; }
    .dashboard-invoice-state .dashboard-donut { width: min(170px, 67vw); }
    .dashboard-invoice-state .dashboard-donut-legend { margin-top: 16px; }
    .dashboard-bar-chart { min-height: 250px; padding-inline: 7px; }
    .dashboard-bar-plot { height: 225px; gap: 5px; padding-inline: 4px; }
    .dashboard-bar-item small { font-size: .52rem; }
    .dashboard-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; margin-top: 24px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-wide { grid-column: auto; }
    .project-row { grid-template-columns: 74px 1fr; gap: 9px; }
    .project-progress { grid-column: 2; }
    .form-grid { grid-template-columns: 1fr; }
    .company-header-mode-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .toolbar { align-items: stretch; }
    .toolbar > *, .search-field { width: 100%; min-width: 0; }
    .toolbar .inline-field { width: calc(50% - 5px); }
    .card-heading { flex-direction: column; }
    .card-heading > .button-row, .card-heading > .btn { width: 100%; }
    .card-heading > .button-row .btn { flex: 1; }
    .permission-groups, .document-branding-options { grid-template-columns: minmax(0, 1fr); padding: 10px; }
    .project-hero-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .document-actions-column { grid-template-columns: 1fr; }
    .document-preview-scroll { padding: 8px; }
    .document-preview-frame { height: 72vh; min-height: 560px; }
    .pos-header { align-items: flex-start; }
    .pos-session-stats > span { display: none; }
    .pos-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-product { min-height: 125px; }
    .pos-open { grid-template-columns: 1fr; justify-items: center; padding: 20px; }
    .pos-open-icon { margin-bottom: 15px; }
    .attendance-hero { align-items: flex-start; flex-direction: column; }
    .attendance-hero form, .attendance-hero .btn { width: 100%; }
    .audit-item { grid-template-columns: 10px 58px 1fr; }
    .audit-item > .badge { display: none; }
    .audit-item details { grid-column: 2 / -1; }
    .timeline-row { grid-template-columns: 80px 10px 1fr; }
    .timeline-row > .badge { display: none; }
    .login-form-panel { padding: 16px; }
    .login-form { padding: 25px 20px; border-radius: 17px; }
}

/* Photo facultative de la fiche produit : sans effet sur les autres modules. */
.product-photo-panel [hidden] { display: none !important; }
.product-photo-panel { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; padding: 20px; margin-bottom: 24px; border: 1px solid #dce7e1; border-radius: 16px; background: #f6faf8; }
.product-photo-preview { width: 100%; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 1px solid #dce7e1; border-radius: 12px; background: #fff; }
.product-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.product-photo-preview > span { display: grid; justify-items: center; gap: 10px; padding: 18px; color: #687e71; }
.product-photo-controls { min-width: 0; }
.product-photo-controls h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1.08rem; }
.product-photo-controls h2 small { padding: 4px 9px; border-radius: 20px; font-size: .7rem; font-weight: 600; background: #e6f1eb; color: #416553; }
.product-photo-controls > p { margin: 0 0 15px; color: #5d7366; font-size: .87rem; line-height: 1.5; }
.product-photo-controls .field { margin-bottom: 8px; }
.product-photo-controls input[type="file"] { max-width: 100%; min-width: 0; width: 100%; font-size: .85rem; padding: 9px; }
.product-photo-controls .product-photo-help { margin-bottom: 12px; font-size: .76rem; }
.product-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.product-photo-actions .btn { min-height: 44px; }
.product-photo-controls .product-photo-status { min-height: 1.5em; margin: 10px 0 0; color: #146c43; }
.product-photo-status[data-state="error"] { color: #b42328; }
@media (max-width: 600px) {
    .product-photo-panel { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 15px; }
    .product-photo-preview { width: 160px; max-width: 100%; justify-self: center; }
    .product-photo-actions { flex-direction: column; align-items: stretch; }
}
