:root {
    --ink: #17243c;
    --muted: #6b7485;
    --line: #e8ecf2;
    --surface: #ffffff;
    --canvas: #f6f8fb;
    --blue: #2557d6;
    --blue-dark: #193e9c;
    --blue-pale: #eaf0ff;
    --green: #167a58;
    --green-pale: #e4f7f0;
    --amber: #b86d0e;
    --amber-pale: #fff3df;
    --red: #c53c4b;
    --red-pale: #ffeaee;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(23, 36, 60, .06);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; flex: 0 0 252px; background: #14213a; color: #dce5fa; display: flex; flex-direction: column; padding: 26px 16px 18px; position: fixed; inset: 0 auto 0 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; color: white; padding: 0 10px 28px; border-bottom: 1px solid rgba(255,255,255,.11); }
.brand img { width: 42px; height: 42px; object-fit: contain; object-position: center; background: #fff; border-radius: 10px; padding: 4px; }
.brand span { display: grid; line-height: 1.15; letter-spacing: .04em; }
.brand strong { font-size: 16px; }
.brand small { color: #aebdd9; font-size: 10px; letter-spacing: .04em; margin-top: 3px; }
.nav-menu { padding: 22px 0; }
.nav-heading { color: #8291ad; font-weight: 700; letter-spacing: .09em; font-size: 10px; margin: 16px 11px 8px; text-transform: uppercase; }
.nav-heading:first-child { margin-top: 0; }
.nav-link { display: flex; align-items: center; gap: 12px; border-radius: 8px; color: #c4d0e9; padding: 10px 11px; margin: 2px 0; font-weight: 550; transition: background .18s, color .18s; }
.nav-link:hover { background: rgba(255,255,255,.08); color: white; }
.nav-link.active { background: #2b57c4; color: white; box-shadow: 0 5px 14px rgba(0, 0, 0, .16); }
.nav-icon { width: 17px; color: inherit; font-size: 18px; text-align: center; line-height: 1; }
.sidebar-company { margin-top: auto; border-radius: 10px; background: rgba(255,255,255,.06); padding: 12px; display: grid; gap: 4px; font-size: 10px; color: #aebdd9; }
.sidebar-company strong { color: #e6edfc; font-size: 11px; }
.main-panel { min-width: 0; flex: 1; margin-left: 252px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 72px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.topbar-title { display: grid; line-height: 1.1; font-weight: 700; }
.topbar-title small, .user-menu small { font-weight: 400; color: var(--muted); margin-top: 4px; font-size: 11px; }
.user-menu { display: flex; align-items: center; gap: 9px; line-height: 1.05; }
.user-menu > div:not(.avatar), .user-name { display: grid; }
.user-name { color: var(--ink); }
.user-name:hover strong { color: var(--blue); }
.user-menu strong { font-size: 12px; }
.avatar { display: grid; place-items: center; height: 34px; width: 34px; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-size: 13px; font-weight: 800; }
.icon-button, .menu-button { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 7px; border-radius: 7px; }
.icon-button:hover, .menu-button:hover { background: var(--blue-pale); color: var(--blue); }
.menu-button { display: none; }
.content { width: 100%; max-width: 1500px; padding: 36px 34px 28px; margin: 0 auto; flex: 1; }
.app-footer { color: #8a93a2; border-top: 1px solid var(--line); padding: 15px 34px; font-size: 10px; display: flex; justify-content: space-between; gap: 15px; background: #fff; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { font-size: 28px; line-height: 1.12; letter-spacing: -.035em; margin: 4px 0 7px; }
.page-heading p { color: var(--muted); margin: 0; }
.eyebrow { display: block; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-actions, .empty-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.button { border: 1px solid transparent; border-radius: 8px; padding: 9px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; line-height: 1.2; transition: transform .14s, box-shadow .14s, background .14s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--blue); color: white; box-shadow: 0 5px 10px rgba(37,87,214,.16); }
.button-primary:hover { background: var(--blue-dark); color: white; }
.button-secondary { background: white; border-color: #dce3ef; color: #334156; }
.button-secondary:hover { background: #f8faff; border-color: #bcc9e3; color: var(--blue); }
.button-ghost { background: transparent; color: var(--muted); }
.button-ghost:hover { background: #edf1f7; color: var(--ink); }
.button-wide { width: 100%; padding: 12px 15px; }

.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 20px; display: flex; align-items: center; gap: 9px; font-weight: 550; }
.alert span { height: 20px; width: 20px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.alert-success { color: #126244; background: var(--green-pale); }
.alert-success span { background: #c8efdf; }
.alert-error { color: #a12d3d; background: var(--red-pale); }
.alert-error span { background: #fbcfd7; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; align-items: flex-start; gap: 14px; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.stat-icon.blue { background: var(--blue-pale); color: var(--blue); }.stat-icon.green { background: var(--green-pale); color: var(--green); }.stat-icon.violet { background: #f1ecff; color: #7653c8; }.stat-icon.amber { background: var(--amber-pale); color: var(--amber); }
.stat-card > div { display: grid; min-width: 0; }.stat-label { color: var(--muted); font-size: 11px; font-weight: 650; }.stat-card strong { font-size: 19px; letter-spacing: -.025em; margin: 3px 0 2px; white-space: nowrap; }.stat-card strong em { font-size: 10px; font-style: normal; color: var(--muted); letter-spacing: 0; }.stat-card small { font-size: 10px; color: #9aa3b2; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 20px; }
.recent-panel .responsive-table table { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 21px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }.panel-heading h2, .form-section-title h2, .payment-summary h2 { margin: 0 0 3px; font-size: 16px; letter-spacing: -.018em; }.panel-heading p, .form-section-title p { margin: 0; color: var(--muted); font-size: 12px; }.panel-heading > a { font-weight: 700; font-size: 12px; white-space: nowrap; }

.responsive-table { overflow-x: auto; }.responsive-table table { width: 100%; border-collapse: collapse; min-width: 650px; }.responsive-table th { color: #7c8799; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; padding: 0 10px 10px; white-space: nowrap; }.responsive-table th:first-child, .responsive-table td:first-child { padding-left: 0; }.responsive-table th:last-child, .responsive-table td:last-child { padding-right: 0; }.responsive-table td { padding: 12px 10px; color: #39465a; border-top: 1px solid #edf0f5; vertical-align: middle; font-size: 12px; }.responsive-table td strong { color: var(--ink); font-weight: 700; }.responsive-table td small, td small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }.align-right { text-align: right !important; }.document-number { color: var(--blue); font-weight: 800; }.table-action { font-size: 11px; padding: 3px 4px; font-weight: 700; background: none; border: 0; color: var(--blue); }.table-action.danger { color: var(--red); }.inline-form { display: inline; }.count-chip { display: inline-grid; place-items: center; min-width: 22px; height: 22px; color: var(--blue); background: var(--blue-pale); border-radius: 6px; font-weight: 800; }
.status { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }.status.success { background: var(--green-pale); color: var(--green); }.status.info { background: var(--blue-pale); color: var(--blue); }.status.warning { background: var(--amber-pale); color: var(--amber); }.status.danger { background: var(--red-pale); color: var(--red); }.status.neutral { background: #edf0f5; color: #667185; }
.stock-row { border-top: 1px solid #edf0f5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; }.stock-row:first-of-type { border-top: 0; }.stock-row strong { display: block; font-size: 12px; }.stock-row small { font-size: 10px; color: var(--muted); }.stock-pill { background: var(--green-pale); color: var(--green); border-radius: 7px; padding: 4px 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }.stock-pill.out { background: var(--amber-pale); color: var(--amber); }

.table-tools { display: flex; gap: 9px; align-items: center; margin-bottom: 20px; }.search-box { width: min(380px, 100%); position: relative; }.search-box span { position: absolute; left: 11px; top: 7px; color: #8c97a8; font-size: 18px; line-height: 1; }.search-box input { width: 100%; border: 1px solid #d9e0eb; background: #fff; border-radius: 8px; outline: none; padding: 9px 10px 9px 31px; }.table-tools select { max-width: 150px; }.text-link { font-size: 12px; font-weight: 700; padding: 7px; }.text-link:hover { text-decoration: underline; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 38px 20px; }.empty-state > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--blue-pale); color: var(--blue); font-size: 24px; font-weight: 800; margin-bottom: 11px; }.empty-state h2 { margin: 0 0 4px; font-size: 16px; }.empty-state p { margin: 0 0 16px; color: var(--muted); }.empty-state.compact { padding: 24px; }.empty-state.compact > span { width: 34px; height: 34px; font-size: 17px; margin-bottom: 7px; }.empty-state.compact h2 { font-size: 14px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 17px; margin-top: 4px; border-top: 1px solid #edf0f5; color: var(--muted); font-size: 11px; }.pagination a { color: var(--blue); font-weight: 800; }.page-disabled { color: #c0c6d0; }

.form-panel { padding: 26px; }.form-section-title { border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 20px; }.form-section-title.password-section { margin-top: 26px; }.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }.field-wide { grid-column: span 2; }.field label { color: #49566c; font-weight: 750; font-size: 12px; }.field input, .field select, .field textarea, .table-tools select { width: 100%; border: 1px solid #d9e0eb; background: #fff; border-radius: 8px; padding: 9px 10px; outline: none; color: var(--ink); transition: border .15s, box-shadow .15s; }.field textarea { resize: vertical; }.field input:focus, .field select:focus, .field textarea:focus, .table-tools select:focus, .search-box input:focus { border-color: #86a4f3; box-shadow: 0 0 0 3px rgba(37,87,214,.11); }.field .invalid { border-color: #dd7180; }.field-error { color: var(--red); font-size: 10px; font-weight: 650; }.field-hint { color: var(--muted); font-size: 10px; }.checkbox-field { justify-content: flex-end; }.checkbox-field label, .check-label { display: flex; align-items: center; gap: 7px; font-weight: 550; cursor: pointer; }.checkbox-field input, .check-label input { width: 16px; height: 16px; accent-color: var(--blue); }.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding-top: 22px; margin-top: 24px; border-top: 1px solid var(--line); }
.searchable-select { position: relative; width: 100%; }.native-searchable-select { position: absolute !important; height: 1px !important; width: 1px !important; min-width: 0 !important; opacity: 0 !important; overflow: hidden !important; pointer-events: none !important; }.searchable-select-control { display: flex; align-items: stretch; overflow: hidden; border: 1px solid #d9e0eb; border-radius: 8px; background: #fff; transition: border .15s, box-shadow .15s; }.searchable-select.is-open .searchable-select-control, .searchable-select-control:focus-within { border-color: #86a4f3; box-shadow: 0 0 0 3px rgba(37,87,214,.11); }.searchable-select-input, .line-table .searchable-select-input { min-width: 0 !important; width: 100% !important; border: 0 !important; border-radius: 0 !important; padding: 9px 10px !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; }.line-table .searchable-select-input { padding: 8px !important; }.searchable-select-toggle { flex: 0 0 35px; border: 0; border-left: 1px solid #e6ebf2; background: #fff; color: #65718a; font-size: 16px; line-height: 1; }.searchable-select-toggle:hover { color: var(--blue); background: #f7f9fe; }.searchable-select-menu { position: absolute; z-index: 35; top: calc(100% + 5px); left: 0; right: 0; max-height: 228px; overflow: auto; padding: 5px; border: 1px solid #d7dfec; border-radius: 9px; background: #fff; box-shadow: 0 12px 24px rgba(23, 36, 60, .16); }.searchable-select-option { width: 100%; border: 0; border-radius: 6px; background: transparent; color: #334156; padding: 8px 9px; text-align: left; font-size: 12px; line-height: 1.3; }.searchable-select-option:hover, .searchable-select-option:focus, .searchable-select-option.selected { background: var(--blue-pale); color: var(--blue); outline: 0; }.searchable-select-empty { color: var(--muted); margin: 0; padding: 10px 8px; font-size: 11px; text-align: center; }.user-cell { display: flex; align-items: center; gap: 9px; }.user-avatar { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 850; }.role-badge { display: inline-flex; border-radius: 20px; padding: 4px 8px; background: #edf0f5; color: #667185; font-size: 10px; font-weight: 800; }.role-badge.admin { background: #f1ecff; color: #7653c8; }
.category-badge { display: inline-flex; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 20px; padding: 4px 8px; background: #edf4ff; color: #4665ab; font-size: 10px; font-weight: 800; }

.report-page-heading { margin-bottom: 20px; }.report-filter { padding: 16px 20px; }.report-filter form { display: flex; align-items: end; gap: 11px; }.report-filter .field { max-width: 180px; }.report-period { color: var(--muted); font-size: 12px; margin: 15px 2px; }.report-period strong { color: var(--ink); }.report-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 23px; }.report-tabs a { border: 1px solid #dce4f1; border-radius: 20px; background: #fff; padding: 6px 11px; color: #536178; font-size: 11px; font-weight: 750; }.report-tabs a:hover { border-color: #97afe9; color: var(--blue); }.report-section { scroll-margin-top: 90px; margin-top: 33px; }.report-section:first-of-type { margin-top: 0; }.report-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }.report-section-heading h2 { margin: 4px 0; letter-spacing: -.025em; font-size: 21px; }.report-section-heading p { margin: 0; color: var(--muted); }.report-tag { display: inline-flex; align-items: center; border-radius: 20px; padding: 6px 10px; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 800; white-space: nowrap; }.report-tag.warning { background: var(--amber-pale); color: var(--amber); }.report-tag.success { background: var(--green-pale); color: var(--green); }.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }.report-kpis article { min-height: 116px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); display: grid; align-content: start; }.report-kpis article > span { color: var(--muted); font-size: 11px; font-weight: 700; }.report-kpis article > strong { margin: 5px 0 3px; color: var(--ink); font-size: 21px; letter-spacing: -.035em; white-space: nowrap; }.report-kpis article > small { color: #8a95a6; font-size: 10px; }.report-table-panel { padding: 21px; }.report-revenue-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, .72fr); gap: 15px; }.revenue-chart, .revenue-summary { min-height: 270px; }.bar-chart { display: grid; gap: 15px; }.bar-row { display: grid; grid-template-columns: 110px minmax(70px, 1fr) 125px; align-items: center; gap: 11px; }.bar-label { display: grid; }.bar-label strong { font-size: 11px; text-transform: capitalize; }.bar-label span { color: var(--muted); font-size: 10px; }.bar-track { height: 9px; overflow: hidden; border-radius: 12px; background: #edf1f7; }.bar-value { display: block; min-width: 6px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4174eb, #2355d5); }.bar-amount { color: #3e4b61; font-size: 11px; text-align: right; white-space: nowrap; }.revenue-summary { display: flex; flex-direction: column; }.revenue-summary h2 { margin: 5px 0; color: var(--blue); font-size: 24px; letter-spacing: -.04em; }.revenue-summary > p { color: var(--muted); font-size: 12px; margin: 0 0 auto; }.revenue-summary > div { display: flex; justify-content: space-between; border-top: 1px solid #e9edf3; padding: 9px 0 0; margin-top: 10px; color: var(--muted); font-size: 11px; }.revenue-summary > div strong { color: var(--ink); font-size: 12px; }.client-position-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }.table-empty { padding: 26px !important; color: var(--muted) !important; text-align: center; }
.report-tabs a.active { border-color: var(--blue); background: var(--blue); color: #fff; }.report-directory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1080px; }.report-directory-card { min-height: 192px; padding: 22px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); box-shadow: var(--shadow); transition: transform .16s, border-color .16s, box-shadow .16s; }.report-directory-card:hover { transform: translateY(-3px); border-color: #aec0ed; box-shadow: 0 15px 31px rgba(23,36,60,.1); }.report-directory-card h2 { margin: 4px 0; font-size: 18px; letter-spacing: -.025em; }.report-directory-card p { margin: 0; color: var(--muted); font-size: 12px; }.report-directory-card b { margin-top: auto; color: var(--blue); font-size: 12px; }.report-directory-icon { display: grid; place-items: center; height: 38px; width: 38px; border-radius: 10px; font-size: 20px; }.report-directory-icon.blue { background: var(--blue-pale); color: var(--blue); }.report-directory-icon.green { background: var(--green-pale); color: var(--green); }.report-directory-icon.violet { background: #f1ecff; color: #7653c8; }.report-directory-icon.amber { background: var(--amber-pale); color: var(--amber); }.report-filter .field.report-client-select { width: min(440px, 100%); max-width: 440px; }.report-subsection + .report-subsection { margin-top: 16px; }

.document-form { display: grid; gap: 18px; }.document-details { padding-bottom: 24px; }.document-lines-panel { padding: 22px; }.line-table { min-width: 850px !important; }.line-table th { padding-bottom: 8px !important; }.line-table td { padding: 8px 5px !important; }.line-table input, .line-table select { width: 100%; border: 1px solid #d9e0eb; background: white; border-radius: 7px; padding: 8px; min-width: 74px; outline: none; }.line-table select { min-width: 170px; }.line-table input:focus, .line-table select:focus { border-color: #86a4f3; }.line-table .field-error { position: absolute; }.line-total { font-weight: 800; color: var(--ink) !important; white-space: nowrap; }.remove-line { color: #a8b1bf; font-size: 23px; background: transparent; border: 0; line-height: 1; padding: 3px 5px; }.remove-line:hover { color: var(--red); }.document-totals { margin: 13px 0 0 auto; width: min(100%, 330px); padding-top: 12px; border-top: 1px solid var(--line); }.document-totals > div { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); font-size: 12px; }.document-totals strong { color: var(--ink); }.document-totals .grand-total { margin-top: 5px; padding: 10px 11px; background: var(--blue-pale); border-radius: 8px; color: var(--blue); font-weight: 800; }.document-totals .grand-total strong { color: var(--blue); font-size: 15px; }.document-actions { border-top: 0; padding-top: 0; margin-top: 0; }

.document-paper { position: relative; background: white; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); max-width: 960px; margin: 0 auto; padding: 36px 46px 25px; }.paper-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; padding-bottom: 18px; border-bottom: 3px solid var(--blue); }.paper-company { display: flex; align-items: center; gap: 16px; min-height: 96px; }.paper-company img { height: 96px; width: 152px; object-fit: contain; object-position: left center; }.paper-company strong { font-size: 16px; letter-spacing: .01em; }.paper-company p { color: #59667a; margin: 4px 0 0; font-size: 11px; max-width: 250px; }.paper-type { min-width: 210px; padding: 8px 0 0 18px; border-left: 1px solid #dce4f1; text-align: right; }.paper-type > span { display: block; color: var(--blue); letter-spacing: .15em; font-weight: 900; font-size: 11px; }.paper-type > strong { display: block; margin: 2px 0 10px; font-size: 21px; letter-spacing: .02em; }.paper-type dl { display: grid; gap: 3px; margin: 0; }.paper-type dl div { display: flex; justify-content: space-between; gap: 13px; font-size: 9px; }.paper-type dt { color: #7e899a; }.paper-type dd { margin: 0; color: #36445a; font-weight: 750; }.paper-client { width: 45%; min-width: 230px; margin: 20px 0; padding: 12px 15px; background: #f7f9fd; border-left: 3px solid var(--blue); }.paper-client span, .paper-note span { display: block; text-transform: uppercase; letter-spacing: .08em; color: #8792a6; font-size: 9px; font-weight: 800; margin-bottom: 4px; }.paper-client strong { font-size: 13px; }.paper-client p { color: #59667a; margin: 1px 0 0; font-size: 10px; }.paper-table { width: 100%; border-collapse: collapse; }.paper-table thead { display: table-header-group; }.paper-table tr { break-inside: avoid; page-break-inside: avoid; }.paper-table th { padding: 8px 10px; background: #182849; color: white; text-align: left; font-size: 9px; letter-spacing: .015em; }.paper-table th:not(:first-child), .paper-table td:not(:first-child) { text-align: right; }.paper-table td { border-bottom: 1px solid #e8edf4; padding: 8px 10px; font-size: 10px; }.paper-table td:first-child { width: 42%; }.paper-table small { display: block; color: var(--muted); font-size: 8px; margin-top: 1px; }.paper-summary { display: grid; grid-template-columns: 1fr 270px; gap: 28px; margin-top: 16px; break-inside: avoid; page-break-inside: avoid; }.paper-note { padding-top: 9px; color: #59667a; font-size: 10px; }.paper-note p { margin: 0; }.paper-totals > div { display: flex; justify-content: space-between; border-bottom: 1px solid #e8edf4; padding: 6px 0; font-size: 10px; }.paper-totals > div span { color: var(--muted); }.paper-totals .paper-grand-total { margin-top: 6px; border: 0; border-radius: 5px; background: var(--blue); color: white; padding: 9px 10px; font-weight: 800; font-size: 12px; }.paper-totals .paper-grand-total span { color: white; }.paper-footer { margin-top: 25px; padding-top: 10px; border-top: 1px solid #dce3ed; color: #687589; font-size: 8px; line-height: 1.45; text-align: center; break-inside: avoid; page-break-inside: avoid; }.paper-footer-company, .paper-footer-legal, .paper-footer-munidos { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 9px; }.paper-footer-company strong { color: #35445a; }.paper-footer-legal { margin-top: 2px; }.paper-footer-legal span:not(:last-child)::after { content: "·"; margin-left: 9px; color: #aeb7c5; }.paper-footer-munidos { align-items: center; margin-top: 4px; color: #7d8797; }.paper-footer-munidos a { color: #456cbb; text-decoration: none; }.paper-footer-munidos a + a::before { content: "·"; margin-right: 9px; color: #aeb7c5; }
.payment-summary { max-width: 960px; margin: 20px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }.payment-kpis { display: flex; gap: 18px; align-items: center; }.payment-kpis > div { display: grid; }.payment-kpis span { color: var(--muted); font-size: 10px; }.payment-kpis strong { margin-top: 2px; font-size: 13px; }.text-amber { color: var(--amber) !important; }.text-green { color: var(--green) !important; }

.open-invoices { margin-bottom: 20px; }.invoice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }.invoice-card { border: 1px solid #e0e6ef; border-radius: 10px; padding: 14px; color: var(--ink); display: grid; gap: 5px; transition: border .15s, transform .15s; }.invoice-card:hover { border-color: #9bb4ee; transform: translateY(-2px); }.invoice-card > span { color: var(--blue); font-size: 11px; font-weight: 800; }.invoice-card strong { font-size: 13px; }.invoice-card div { border-top: 1px solid #edf0f5; padding-top: 8px; margin-top: 3px; display: flex; justify-content: space-between; align-items: baseline; }.invoice-card small { color: var(--muted); }.invoice-card b { font-size: 12px; }.modal-backdrop { display: none; position: fixed; inset: 0; padding: 20px; background: rgba(13, 24, 44, .48); align-items: center; justify-content: center; z-index: 50; }.modal-backdrop.open { display: flex; }.modal { width: min(100%, 620px); max-height: calc(100vh - 40px); overflow: auto; position: relative; background: white; border-radius: 15px; padding: 27px; box-shadow: 0 18px 60px rgba(0,0,0,.23); }.modal h2 { margin: 4px 0 5px; font-size: 21px; }.modal > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }.modal-close { position: absolute; top: 11px; right: 13px; border: 0; background: transparent; font-size: 24px; color: var(--muted); }.modal-form .form-actions { margin-top: 20px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 14% 18%, #2d61df 0, #1d3f93 19%, transparent 43%), linear-gradient(130deg, #10203c, #1d3162); }.login-card { width: min(100%, 430px); background: white; padding: 34px; border-radius: 18px; box-shadow: 0 24px 65px rgba(0,0,0,.25); }.login-brand { display: flex; align-items: center; gap: 11px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }.login-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: #f2f5fb; padding: 4px; }.login-brand div { display: grid; line-height: 1.12; }.login-brand strong { font-size: 17px; letter-spacing: .04em; }.login-brand span { font-size: 11px; color: var(--muted); margin-top: 3px; }.login-intro { padding: 27px 0 20px; }.login-intro h1 { margin: 5px 0 5px; font-size: 25px; letter-spacing: -.03em; }.login-intro p { margin: 0; color: var(--muted); }.login-form { display: grid; gap: 7px; }.login-form label:not(.check-label) { color: #46536a; font-size: 12px; font-weight: 750; margin-top: 8px; }.login-form input:not([type=checkbox]) { border: 1px solid #d9e0eb; border-radius: 8px; padding: 10px; outline: none; }.login-form input:focus { border-color: #86a4f3; box-shadow: 0 0 0 3px rgba(37,87,214,.11); }.login-form .check-label { margin: 10px 0 11px; color: var(--muted); font-size: 12px; }.login-legal { text-align: center; color: #98a1b0; font-size: 10px; margin: 25px 0 0; }

code { color: #4e5d77; background: #f0f3f8; border-radius: 4px; padding: 3px 5px; font-size: 10px; font-weight: 750; }

@media (max-width: 1120px) { .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }.dashboard-grid { grid-template-columns: 1fr; }.sidebar { width: 224px; flex-basis: 224px; }.main-panel { margin-left: 224px; } }
@media (max-width: 980px) { .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }.report-revenue-grid { grid-template-columns: 1fr; }.revenue-chart, .revenue-summary { min-height: 0; } }
@media (max-width: 760px) { .sidebar { transform: translateX(-100%); transition: transform .2s; width: 260px; }.sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,.25); }.main-panel { margin-left: 0; }.menu-button { display: inline-flex; }.topbar { height: 64px; padding: 0 16px; }.topbar-title { display: none; }.topbar { justify-content: space-between; }.content { padding: 24px 16px; }.app-footer { padding: 13px 16px; flex-direction: column; }.app-footer span:last-child { display: none; }.page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 21px; }.page-heading h1 { font-size: 25px; }.page-actions { width: 100%; }.page-actions .button { flex: 1; }.stats-grid { grid-template-columns: 1fr; gap: 10px; }.stat-card { padding: 15px; }.panel, .form-panel { padding: 16px; }.table-tools { flex-wrap: wrap; }.table-tools .search-box { width: 100%; }.table-tools select { flex: 1; max-width: none; }.form-grid { grid-template-columns: 1fr; gap: 13px; }.field-wide { grid-column: auto; }.checkbox-field { justify-content: flex-start; }.document-paper { padding: 23px 18px; }.paper-header { gap: 12px; }.paper-company { min-height: 54px; gap: 8px; }.paper-company img { width: 74px; height: 54px; }.paper-company strong { font-size: 12px; }.paper-company p { font-size: 8px; }.paper-type { min-width: 122px; padding: 5px 0 0 9px; }.paper-type > span { font-size: 8px; }.paper-type strong { font-size: 13px; }.paper-type dl div { gap: 5px; font-size: 7px; }.paper-client { width: 100%; min-width: 0; }.paper-summary { grid-template-columns: 1fr; gap: 13px; }.paper-footer { font-size: 7px; }.payment-summary { align-items: flex-start; flex-direction: column; }.payment-kpis { width: 100%; flex-wrap: wrap; }.document-lines-panel { padding: 16px; }.document-lines-panel .panel-heading { align-items: stretch; flex-direction: column; }.document-lines-panel .panel-heading .button { width: 100%; }.form-actions { justify-content: stretch; }.form-actions .button { flex: 1; }.user-menu > div:not(.avatar) { display: none; }.modal { padding: 22px 18px; } }

/* Éléments réservés à l'impression : masqués à l'écran. */
.print-doc-header, .print-doc-footer { display: none; }
.paper-watermark { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.paper-watermark span { transform: rotate(-26deg); font-size: 70pt; font-weight: 900; letter-spacing: .14em; color: rgba(197, 60, 75, .13); white-space: nowrap; }
.paper-words { margin-top: 15px; padding: 10px 13px; background: #f7f9fd; border-left: 3px solid var(--blue); break-inside: avoid; page-break-inside: avoid; }
.paper-words span { display: block; text-transform: uppercase; letter-spacing: .08em; color: #8792a6; font-size: 9px; font-weight: 800; margin-bottom: 3px; }
.paper-words p { margin: 0; font-size: 10px; color: #2b3852; }
.paper-words p em { font-style: normal; font-weight: 750; }
.paper-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 18px; break-inside: avoid; page-break-inside: avoid; }
.paper-signature { border: 1px dashed #c3cddd; border-radius: 5px; min-height: 74px; padding: 7px 11px; color: #8792a6; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.paper-terms { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 13px; font-size: 9px; color: #59667a; }
.paper-terms b { color: #2b3852; }
.paper-client-site { margin-top: 5px !important; color: #2b3852 !important; }
.internal-note p { margin: 0; color: #59667a; font-size: 13px; line-height: 1.6; }

@media print {
    @page { size: A4 portrait; margin: 12mm 11mm 9mm; }
    @page wide { size: A4 landscape; margin: 9mm; }
    .print-landscape { page: wide; }

    html, body, .app-shell, .main-panel { min-height: 0 !important; height: auto !important; }
    body { background: white; color: #101a2c; font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .app-shell, .main-panel { display: block; }
    .main-panel { margin: 0; }
    .content { padding: 0; max-width: none; }
    a { color: inherit !important; text-decoration: none !important; }

    /* Chrome d'application et commandes : sans objet sur le papier. */
    .sidebar, .topbar, .app-footer, .no-print, .alert, .pagination, .table-tools, .report-tabs,
    .report-filter, .empty-actions, .page-heading, .panel-heading > a, .panel-heading p { display: none !important; }

    .print-doc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 9px; margin-bottom: 13px; border-bottom: 2.5px solid var(--blue); break-after: avoid; page-break-after: avoid; }
    .print-doc-identity { display: flex; align-items: center; gap: 12px; }
    .print-doc-identity img { width: 92px; height: 58px; object-fit: contain; object-position: left center; }
    .print-doc-identity div { display: grid; gap: 1px; }
    .print-doc-identity strong { font-size: 11pt; }
    .print-doc-identity span { color: #59667a; font-size: 7.5pt; }
    .print-doc-subject { text-align: right; display: grid; gap: 1px; min-width: 190px; }
    .print-doc-eyebrow { color: var(--blue); letter-spacing: .15em; font-weight: 900; font-size: 7.5pt; text-transform: uppercase; }
    .print-doc-subject strong { font-size: 14pt; line-height: 1.15; }
    .print-doc-subject span { color: #59667a; font-size: 7.5pt; }

    .print-doc-footer { display: block; margin-top: 14px; padding-top: 7px; border-top: 1px solid #dce3ed; color: #687589; font-size: 7pt; line-height: 1.5; text-align: center; break-inside: avoid; page-break-inside: avoid; }
    .print-doc-footer strong { color: #35445a; }

    /* Les panneaux deviennent de simples sections : ni ombre, ni cadre, ni fond. */
    .panel, .report-table-panel, .report-subsection { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0 0 11px; }
    .panel-heading { padding: 0 0 5px; margin: 0; border: 0; display: block; }
    .panel-heading h2 { font-size: 10.5pt; margin: 0; }
    /* Le défilement horizontal de l'écran n'a pas de sens sur le papier :
       la largeur minimale et les en-têtes insécables feraient déborder la page. */
    .responsive-table { overflow: visible !important; border: 0; }
    .responsive-table table { min-width: 0 !important; width: 100% !important; }
    .responsive-table th { white-space: normal !important; }

    table { width: 100%; border-collapse: collapse; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr { break-inside: avoid; page-break-inside: avoid; }
    th { background: #182849 !important; color: white !important; padding: 5px 5px; font-size: 7.5pt; text-align: left; font-weight: 700; }
    td { padding: 4px 5px; border-bottom: 1px solid #e1e7f0; font-size: 8pt; vertical-align: top; }
    table { table-layout: auto; }
    td small { font-size: 7pt; }
    tfoot th, tfoot td { background: #eef2f9 !important; color: #17243c !important; border-top: 1.6px solid #182849; border-bottom: 0; font-weight: 800; font-size: 8.5pt; }
    .align-right { text-align: right; }
    /* Colonnes de montants : alignées à droite et insécables, à partir du rang indiqué. */
    /* Alignées à droite, mais jamais insécables : un tableau plus large que la
       page serait tronqué à l'impression. */
    .numeric-from-2 :is(th, td):nth-child(n+2),
    .numeric-from-3 :is(th, td):nth-child(n+3),
    .numeric-from-4 :is(th, td):nth-child(n+4) { text-align: right; }

    .report-period { margin: 0 0 9px; font-size: 8.5pt; }
    .report-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 12px; break-inside: avoid; page-break-inside: avoid; }
    .report-kpis article { border: 1px solid #d8dfeb; border-radius: 5px; box-shadow: none; background: #fbfcfe !important; padding: 7px 9px; }
    .report-kpis article span { font-size: 7pt; }
    .report-kpis article strong { font-size: 12pt; }
    .report-kpis article small { font-size: 6.5pt; }
    .status { border: 1px solid currentColor; font-size: 7pt; padding: 1px 5px; }
    .empty-state { padding: 16px 0; }
    .empty-state span { display: none; }

    /* Facture, devis, achat : la feuille occupe toute la page. */
    .document-paper { min-height: 0; max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
    .paper-header { padding-top: 0; break-after: avoid; page-break-after: avoid; }
    .paper-table thead { display: table-header-group; }
    .paper-table th { padding: 6px 9px; }
    .paper-footer { margin-top: 18px; }
    .paper-watermark { display: block; }
    .payment-summary, .stock-panel { display: none !important; }
}
@media screen and (max-width: 760px) { .report-filter form { align-items: stretch; flex-direction: column; }.report-filter .field, .report-filter .field.report-client-select { max-width: none; width: 100%; }.report-filter .button { width: 100%; }.report-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }.report-kpis, .client-position-kpis, .report-directory-grid { grid-template-columns: 1fr; }.report-kpis article { min-height: 0; }.bar-row { grid-template-columns: 1fr; gap: 5px; }.bar-amount { text-align: left; }.report-tag { white-space: normal; } }
