:root {
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --border: #e5e7eb;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --sidebar: #111827;
    --sidebar-text: #e5e7eb;
    --radius: .75rem;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --content-max: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Segoe UI, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button,
.btn,
.header-action-btn,
.action-icon-btn,
.page-back,
.filter-chevron,
.period-preset,
.nav-toggle,
.nav-close {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(37, 99, 235, .18);
    touch-action: manipulation;
}
button svg,
.btn svg,
.header-action-btn svg,
.action-icon-btn svg,
.page-back svg,
.filter-chevron svg,
.period-preset svg,
a svg {
    pointer-events: none;
}

.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}
.sidebar-brand-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}
.brand {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .01em;
}
.sidebar-drawer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.sidebar nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar nav a {
    color: var(--sidebar-text);
    padding: .65rem .75rem;
    border-radius: .5rem;
    display: block;
    white-space: nowrap;
}
.sidebar nav a.active,
.sidebar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: .875rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.nav-toggle {
    display: none;
    position: fixed;
    top: .85rem;
    left: .85rem;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: var(--sidebar);
    color: var(--sidebar-text);
    border: 0;
    border-radius: .55rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    transition: background .15s ease, transform .15s ease;
}
.nav-toggle:hover { background: #1f2937; }
.nav-toggle-bar {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform .2s ease, opacity .2s ease, width .2s ease;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    flex-shrink: 0;
    background: rgba(255, 255, 255, .08);
    color: var(--sidebar-text);
    border: 0;
    border-radius: .45rem;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}
.nav-close:hover { background: rgba(255, 255, 255, .14); }

.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(17, 24, 39, .42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.nav-backdrop[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 1.25rem clamp(1rem, 2.5vw, 2rem) 2.5rem;
}
.page-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}
.page-header h1 {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    min-width: 0;
    flex: 1;
}
.page-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 .7rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
}
.page-back svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
    flex-shrink: 0;
}
.page-back:hover {
    background: #f9fafb;
    text-decoration: none;
    color: var(--text);
}
.page-back-label {
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
}
.page-header-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
}
.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    position: relative;
    overflow: hidden;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 .65rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
}
.header-action-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
    flex-shrink: 0;
}
.header-action-btn:hover {
    background: #f9fafb;
    text-decoration: none;
    color: var(--text);
}
.header-action-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.header-action-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.header-action-label {
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
}
.page-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    position: relative;
}
.btn-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    fill: currentColor;
}
.btn-icon-pdf {
    width: 1.15rem;
    height: 1.15rem;
}
.page-actions-bottom {
    display: none;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1rem, 2vw, 1.35rem);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; margin-bottom: .85rem; font-size: 1.05rem; }
.card-list-cta { margin-top: 1rem; }

.search-result-meta {
    margin: -.35rem 0 1rem;
}
.filter-form .filter-form-grid { margin-bottom: 0; }
.filter-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.filter-form-collapsible { padding: .85rem clamp(.85rem, 2vw, 1.15rem); }
.filter-primary {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.filter-search-field {
    margin: 0;
    font-weight: 400;
    flex: 1;
    min-width: 0;
}
.filter-search-field input {
    min-height: 2.65rem;
}
.filter-chevron,
.filter-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}
.filter-chevron svg,
.filter-icon-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
    pointer-events: none;
}
.filter-chevron svg {
    transition: transform .2s ease;
}
.filter-form-collapsible.is-expanded .filter-chevron svg {
    transform: rotate(180deg);
}
.filter-chevron:hover,
.filter-icon-btn:hover {
    background: #f9fafb;
}
.filter-submit-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.filter-submit-icon:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.filter-submit {
    min-height: 2.65rem;
    white-space: nowrap;
}
.filter-advanced {
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px solid var(--border);
}
.filter-advanced[hidden] {
    display: none !important;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .925rem;
    line-height: 1.2;
    text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #f9fafb; text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-block { width: 100%; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}
.form-grid > label,
.form-grid > .form-actions,
.form-grid > .alert {
    grid-column: span 6;
    min-width: 0;
}
.form-grid > label.full,
.form-grid > .full,
.form-grid > .form-actions.full,
.form-grid > .alert.full,
.form-grid > .span-12 { grid-column: span 12; }
.form-grid > .span-8 { grid-column: span 8; }
.form-grid > .span-4 { grid-column: span 4; }
.form-grid > .span-3 { grid-column: span 3; }

.form-grid label,
label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 600;
    min-width: 0;
}
input, select, textarea {
    width: 100%;
    max-width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    font: inherit;
    background: #fff;
    color: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(37, 99, 235, .25);
    border-color: var(--primary);
}
textarea { resize: vertical; min-height: 80px; }
.textarea-auto-resize {
    resize: none;
    overflow-y: hidden;
    min-height: 2.75rem;
    line-height: 1.45;
}
.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}
.form-actions.compact { margin-top: 0; }
.form-actions.sticky-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    padding: 1rem 0 .25rem;
    z-index: 5;
}
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.table.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table-responsive > .table.card {
    margin-bottom: 0;
}
.table th, .table td {
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    white-space: nowrap;
}
.table-nested { margin: .5rem 0; background: #fafafa; }
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -.25rem;
    padding: 0 .25rem;
}
.table-responsive .table { min-width: 640px; }
.table-responsive.table-stack .table { min-width: 0; }
.badge.quote-list-status-mobile { display: none; }
.actions { white-space: nowrap; }
.quote-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;
}
.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
    color: var(--text);
    flex-shrink: 0;
}
.action-icon-btn:hover {
    background: #f9fafb;
    text-decoration: none;
    color: var(--text);
}
.action-icon-btn svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}
.action-icon-btn-pdf svg {
    width: 1.1rem;
    height: 1.1rem;
}
.action-icon-btn-danger {
    color: var(--danger);
    border-color: #fecaca;
}
.action-icon-btn-danger:hover {
    background: #fef2f2;
    color: var(--danger);
}
.btn-danger-outline {
    color: var(--danger);
    border-color: #fecaca;
    background: #fff;
}
.btn-danger-outline:hover {
    background: #fef2f2;
    color: var(--danger);
    text-decoration: none;
}

.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #f3f4f6; color: #374151; }

.alert { padding: .75rem 1rem; border-radius: .5rem; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}
.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: .8rem; margin-bottom: .35rem; }
.kpi-value { font-size: clamp(1.1rem, 2.5vw, 1.35rem); font-weight: 700; word-break: break-word; }
.kpi-delta { font-size: .8rem; margin-top: .35rem; }
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.text-muted { color: var(--muted); }
.small { font-size: .8rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
}
.period-filter { display: flex; flex-direction: column; gap: .75rem; }
.filter-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
}
.period-preset {
    width: 100%;
    padding: .6rem .5rem;
    font-size: .875rem;
    line-height: 1.2;
    min-height: 2.65rem;
    white-space: nowrap;
}
.filter-custom {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: .5rem;
    align-items: end;
}
.filter-custom[hidden] {
    display: none !important;
}
.filter-custom label { min-width: 0; }
.filter-custom .period-apply {
    padding: .6rem 1rem;
    font-size: .875rem;
    line-height: 1.2;
    min-height: 2.65rem;
    white-space: nowrap;
}
.period-compare { margin: 0; }

.bar-chart { display: flex; flex-direction: column; gap: .75rem; }
.bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 140px) 1fr auto;
    gap: .75rem;
    align-items: center;
}
.bar { background: #eef2ff; border-radius: 999px; height: 10px; overflow: hidden; min-width: 0; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bar-cost i { background: var(--danger); }
.bar-margin i { background: var(--success); }

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1rem;
}
.report-card { display: flex; flex-direction: column; gap: .75rem; }
.report-count {
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
}

.materials-block {
    background: #f9fafb;
    border: 1px dashed var(--border);
    border-radius: .5rem;
    padding: .75rem;
    margin: .5rem 0;
}
.materials-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.materials-table-wrap .materials-table {
    width: 100%;
    table-layout: fixed;
}
.materials-table-wrap .materials-table th,
.materials-table-wrap .materials-table td {
    vertical-align: middle;
}
.materials-table-wrap .materials-table th:first-child,
.materials-table-wrap .materials-table td.mat-col-material {
    width: 46%;
}
.materials-table-wrap .materials-table th:nth-child(2),
.materials-table-wrap .materials-table td.mat-col-qty {
    width: 10%;
    min-width: 4.75rem;
}
.materials-table-wrap .materials-table th:nth-child(3),
.materials-table-wrap .materials-table td.mat-col-unit {
    width: 16%;
    min-width: 7.5rem;
}
.materials-table-wrap .materials-table th:nth-child(4),
.materials-table-wrap .materials-table td.mat-line-total-cell {
    width: 18%;
    min-width: 8.5rem;
    text-align: right;
    white-space: nowrap;
}
.materials-table-wrap .materials-table th:last-child,
.materials-table-wrap .materials-table td.mat-actions {
    width: 3rem;
    text-align: center;
    padding-left: .25rem;
    padding-right: .25rem;
}
.materials-table-wrap .materials-table th:nth-child(2),
.materials-table-wrap .materials-table th:nth-child(3),
.materials-table-wrap .materials-table th:nth-child(4) {
    text-align: right;
}
.materials-table-wrap .materials-table td input,
.materials-table-wrap .materials-table td select {
    width: 100%;
    min-width: 0;
}
.materials-table-wrap .materials-table .mat-col-qty input,
.materials-table-wrap .materials-table .mat-col-unit input,
.materials-table-wrap .materials-table .mat-line-total {
    font-variant-numeric: tabular-nums;
}
.materials-table-wrap .materials-table .mat-col-qty input,
.materials-table-wrap .materials-table .mat-col-unit input {
    text-align: right;
}
.materials-table-wrap .materials-table td.mat-line-total-cell .mat-line-total {
    font-weight: 600;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.materials-block .add-material {
    margin-top: .5rem;
}
.totals-box p { margin: .35rem 0; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }

.card-narrow { max-width: 720px; }
.card-lead { color: var(--muted); margin: 0 0 1rem; line-height: 1.5; }

.file-upload { position: relative; margin-bottom: 1rem; }
.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.file-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 9.5rem;
    padding: 1.25rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #f9fafb;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.file-upload-dropzone:hover,
.file-upload.is-dragover .file-upload-dropzone {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.file-upload.has-files .file-upload-dropzone {
    min-height: 6.5rem;
    padding: .85rem 1rem;
}
.file-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    margin-bottom: .15rem;
}
.file-upload-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: currentColor;
}
.file-upload-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
}
.file-upload-hint,
.file-upload-count {
    font-size: .8rem;
    color: var(--muted);
}
.file-upload-count {
    font-weight: 600;
    color: var(--primary);
}
.file-upload-list {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.file-upload-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
}
.file-upload-item-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .4rem;
    background: #fee2e2;
    position: relative;
}
.file-upload-item-icon::after {
    content: 'PDF';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .45rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #991b1b;
}
.file-upload-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.file-upload-name {
    font-size: .875rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-upload-size {
    font-size: .75rem;
    color: var(--muted);
}
.file-upload-remove {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: .4rem;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.file-upload-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

.quote-form .card + .card { margin-top: 0; }
.quote-form #items-table textarea,
.quote-form #items-table input,
.quote-form #items-table select,
.quote-form #collab-table textarea,
.quote-form #collab-table input,
.quote-form #collab-table select,
.quote-form #vehicle-table input,
.quote-form #vehicle-table select {
    min-width: 0;
}

.quote-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.25rem;
    align-items: start;
}
.quote-main { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.quote-aside { min-width: 0; }
.quote-section { margin-bottom: 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.section-head h2 { margin: 0; }
.section-hint {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 400;
}

.quote-items { display: flex; flex-direction: column; gap: 1rem; }
.quote-item {
    border: 1px solid var(--border);
    border-radius: .65rem;
    background: #fafbfc;
    padding: 1rem;
}
.quote-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .65rem;
    margin-bottom: .85rem;
}
.quote-item-head-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.quote-item-title { font-size: .95rem; }
.quote-item-money {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    font-size: .82rem;
    color: var(--muted);
}
.quote-item-money strong { color: var(--text); }
.quote-item-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: -.15rem -.15rem 0 0;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: .45rem;
    background: #fff;
    color: var(--danger);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.quote-item-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}
.quote-item-desc { margin-bottom: .75rem; }
.quote-item-desc-fr {
    margin-top: -.25rem;
    color: var(--muted);
    font-size: .84rem;
}
.quote-item-desc textarea,
.item-description,
.item-description-fr {
    white-space: pre-wrap;
    line-height: 1.45;
    min-height: 0;
    font-family: inherit;
}
.item-description-fr {
    background: #f9fafb;
}
.item-pricing { margin-bottom: .35rem; }
.item-pricing > label.field-pair {
    grid-column: span 6;
}

.quote-details {
    margin-top: .75rem;
    border: 1px dashed var(--border);
    border-radius: .5rem;
    background: #fff;
    padding: .35rem .75rem .75rem;
}
.quote-details > summary {
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    padding: .45rem 0;
    list-style: none;
}
.quote-details > summary::-webkit-details-marker { display: none; }
.quote-details > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: .4rem;
    transition: transform .15s ease;
}
.quote-details[open] > summary::before { transform: rotate(90deg); }
.quote-details-body { padding-top: .35rem; }

.quote-panel { padding: 0; overflow: hidden; }
.quote-panel > summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.quote-panel > summary::-webkit-details-marker { display: none; }
.quote-panel > summary .section-hint { display: block; margin-top: .2rem; }
.quote-panel > summary .btn {
    flex-shrink: 0;
}
.quote-panel > summary::after {
    content: '▸';
    color: var(--muted);
    transition: transform .15s ease;
}
.quote-panel[open] > summary::after { transform: rotate(90deg); }
.quote-panel-body { padding: 0 1.25rem 1.25rem; border-top: 1px solid var(--border); }

.sticky-summary { position: sticky; top: 1rem; }
.summary-divider { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.quote-summary h2 { margin-bottom: .75rem; }
.quote-summary h3 {
    margin: 0 0 .5rem;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.total-row {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0;
    font-size: .92rem;
}
.total-row-main {
    margin-top: .35rem;
    padding-top: .65rem;
    border-top: 1px solid var(--border);
    font-size: 1.05rem;
}
.vat-box {
    margin-top: .75rem;
    width: 100%;
}
.quote-summary .vat-box .table-compact {
    width: 100%;
    table-layout: fixed;
}
.quote-summary .vat-box .table-compact th,
.quote-summary .vat-box .table-compact td {
    padding: .4rem .5rem;
    font-size: .8rem;
    word-break: break-word;
}
.quote-summary .vat-box .table-compact th:nth-child(2),
.quote-summary .vat-box .table-compact th:nth-child(3),
.quote-summary .vat-box .table-compact td:nth-child(2),
.quote-summary .vat-box .table-compact td:nth-child(3) {
    text-align: right;
}
.quote-aside-actions {
    margin-top: 1.25rem;
    flex-direction: column;
    align-items: stretch;
}
.quote-aside-actions .btn { width: 100%; }

@media (max-width: 980px) {
    .quote-layout { grid-template-columns: 1fr; }
    .sticky-summary { position: static; }
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem;
}
.auth-card {
    background: #fff;
    padding: clamp(1.25rem, 4vw, 2rem);
    border-radius: var(--radius);
    width: min(420px, 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.auth-card h1 { margin: 0 0 .25rem; }
.auth-card form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

/* Devis document preview */
.document-preview { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.devis-doc { width: 100%; max-width: none; margin: 0 auto; font-size: .92rem; line-height: 1.45; }
.devis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.devis-header h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.meta-table td { padding: .15rem .75rem .15rem 0; }
.devis-parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.party-label { color: var(--muted); margin-bottom: .35rem; }
.products-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    table-layout: auto;
}
.products-table th,
.products-table td {
    border: 1px solid var(--border);
    padding: .5rem .6rem;
    vertical-align: top;
}
.products-table thead th {
    background: #f7f7f8;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}
.products-table .desc {
    width: 100%;
    min-width: min(100%, 12rem);
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}
.products-table th:not(:first-child),
.products-table td:not(.desc) {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.product-desc-intro {
    margin: 0;
    font-weight: 600;
}
.product-bullets {
    margin: .45rem 0 0;
    padding-left: 1.15rem;
}
.product-bullets li {
    margin: .2rem 0;
    padding-left: .15rem;
}
.item-comment { margin-top: 6px; font-size: 0.85em; color: #555; font-style: italic; }
.item-comment .product-desc-intro { font-weight: 500; }
.item-comment-label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}
.item-comment-label textarea { margin-top: 0.25rem; width: 100%; font-weight: 400; }
.devis-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}
.devis-totals table { width: 100%; }
.devis-totals td:last-child { text-align: right; }
.legal { font-size: .82rem; color: var(--muted); }
.signature-block { margin: 2rem 0; }
.signature-line { height: 80px; border-bottom: 1px solid #999; max-width: 320px; }
.payment-block table td { padding: .2rem .5rem .2rem 0; }
.devis-footer {
    margin-top: 2rem;
    font-size: .75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: .75rem;
}
.internal-summary { border-left: 4px solid var(--primary); }
.quote-view-layout { margin-bottom: 1rem; }

/* Stack complex tables as cards on small screens */
@media (max-width: 900px) {
    body.nav-open { overflow: hidden; }

    .app-shell { flex-direction: column; }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        gap: 5px;
    }
    body.nav-open .nav-toggle {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: max-content;
        min-width: 12.5rem;
        max-width: min(88vw, 19rem);
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        transform: translateX(-105%);
        transition: transform .28s ease;
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: none;
    }
    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 28px rgba(0, 0, 0, .22);
        pointer-events: auto;
    }

    .sidebar-drawer {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .sidebar-brand-row {
        margin-bottom: .85rem;
        padding-top: .15rem;
    }
    body.nav-open .nav-close {
        display: inline-flex;
    }

    .main-content { padding: 1rem 1rem 2rem; }
    .page-header {
        padding-left: 3.35rem;
    }
    .page-header h1 {
        padding-left: 0;
        margin-bottom: 0;
    }
    .page-header-with-actions {
        padding-right: 0;
    }
    .page-back-label,
    .header-action-label,
    .page-actions-quote .btn-label {
        position: absolute;
        left: 0;
        top: 0;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
        pointer-events: none;
    }
    .page-back {
        width: 2.35rem;
        padding: 0;
    }
    .header-action-btn {
        width: 2.35rem;
        padding: 0;
    }

    .form-grid > label,
    .form-grid > .form-actions,
    .form-grid > .alert,
    .form-grid > .span-8,
    .form-grid > .span-4,
    .form-grid > .span-3,
    .form-grid > .span-6:not(.field-pair),
    .form-grid > .span-12 {
        grid-column: span 12;
    }
    .form-grid > label.field-pair,
    .form-grid > .field-pair {
        grid-column: span 6;
    }
    .filter-form-actions .btn {
        width: 100%;
    }

    .bar-row {
        grid-template-columns: 1fr;
        gap: .35rem;
    }
    .bar-row strong { justify-self: start; }

    .table-stack thead { display: none; }
    .table-responsive.table-stack {
        margin: 0;
        padding: 0;
        overflow: visible;
        width: 100%;
        max-width: 100%;
    }
    .table-responsive.table-stack .table {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .table-stack,
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
        max-width: 100%;
    }
    .table-stack tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: .65rem;
        padding: .85rem;
        margin-bottom: .85rem;
        box-sizing: border-box;
    }
    .table-stack tr:last-child { margin-bottom: 0; }
    .table-stack td {
        border: 0;
        padding: .4rem 0;
        display: grid;
        grid-template-columns: minmax(96px, 34%) 1fr;
        gap: .65rem;
        align-items: start;
        box-sizing: border-box;
    }
    .table-stack td[colspan] {
        display: block;
        grid-template-columns: 1fr;
        text-align: center;
        color: var(--muted);
    }
    .table-stack td[colspan]::before { content: none; }
    .table-responsive.table-stack .table.card {
        background: transparent;
        border: 0;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }
    .table-stack-quotes .quote-list-status-desktop { display: none; }
    .table-stack-quotes .badge.quote-list-status-mobile { display: inline-block; }
    .table-stack-quotes .quote-list-head {
        display: grid;
        grid-template-columns: minmax(96px, 34%) 1fr auto;
        gap: .65rem;
        align-items: center;
        padding-top: 0;
    }
    .table-stack-quotes .quote-list-head::before {
        padding-top: 0;
    }
    .table-stack-quotes .quote-list-status-mobile {
        justify-self: end;
        white-space: nowrap;
    }
    .table-stack-quotes td[data-label="Projeto"] {
        word-break: break-word;
    }
    .table-stack-quotes .quote-list-actions {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: .4rem;
        grid-template-columns: unset;
        padding-top: .5rem;
        margin-top: .15rem;
        border-top: 1px dashed var(--border);
    }
    .table-stack-quotes .quote-list-actions::before {
        content: none;
    }
    .table-stack td.actions,
    .table-stack td.quote-list-actions {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: .4rem;
        grid-template-columns: unset;
        padding-top: .5rem;
        margin-top: .15rem;
        border-top: 1px dashed var(--border);
    }
    .table-stack td.actions::before,
    .table-stack td.quote-list-actions::before {
        content: none;
    }
    .table-stack td::before {
        content: attr(data-label);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        font-weight: 700;
        padding-top: .55rem;
    }
    .table-stack td:has(textarea) {
        grid-template-columns: 1fr;
    }
    .table-stack td:has(textarea)::before { padding-top: 0; margin-bottom: .25rem; }
    .table-stack #collab-table tr.collab-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: .55rem;
        position: relative;
        padding-right: .85rem;
    }
    .table-stack #collab-table td {
        display: block;
        padding: 0;
        grid-template-columns: unset;
    }
    .table-stack #collab-table td::before {
        padding-top: 0;
        margin-bottom: .25rem;
    }
    .table-stack #collab-table td.collab-actions {
        order: -1;
        position: static;
        display: flex;
        justify-content: flex-end;
        width: 100%;
        padding-bottom: .35rem;
        margin-bottom: .15rem;
        border-bottom: 1px dashed var(--border);
    }
    .table-stack #collab-table td.collab-actions::before { content: none; }
    .table-stack #collab-table td input,
    .table-stack #collab-table td select,
    .table-stack #collab-table td textarea {
        width: 100%;
    }
    .table-stack #vehicle-table tr.vehicle-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: .55rem;
        position: relative;
        padding-right: .85rem;
    }
    .table-stack #vehicle-table td {
        display: block;
        padding: 0;
        grid-template-columns: unset;
    }
    .table-stack #vehicle-table td::before {
        padding-top: 0;
        margin-bottom: .25rem;
    }
    .table-stack #vehicle-table td.vehicle-actions {
        order: -1;
        position: static;
        display: flex;
        justify-content: flex-end;
        width: 100%;
        padding-bottom: .35rem;
        margin-bottom: .15rem;
        border-bottom: 1px dashed var(--border);
    }
    .table-stack #vehicle-table td.vehicle-actions::before { content: none; }
    .table-stack #vehicle-table td input,
    .table-stack #vehicle-table td select {
        width: 100%;
    }
    .table-stack .item-row td:last-child,
    .table-stack tr td:last-child:has(.remove-item) {
        grid-template-columns: 1fr;
        justify-items: end;
    }
    .table-stack .item-row td:last-child::before,
    .table-stack tr td:last-child:has(.btn)::before { content: none; }

    .table-stack .materials-row {
        border-style: dashed;
        background: #f9fafb;
    }
    .table-stack .materials-row td {
        display: block;
        padding: 0;
    }
    .table-stack .materials-row td::before { content: none; }

    /* Materials: card layout on small screens */
    .materials-table-wrap.table-responsive {
        overflow: visible;
        margin: 0;
        padding: 0;
    }
    .materials-table-wrap .materials-table {
        min-width: 0;
        table-layout: auto;
    }
    .materials-table-wrap .materials-table th:first-child,
    .materials-table-wrap .materials-table td.mat-col-material,
    .materials-table-wrap .materials-table th:nth-child(2),
    .materials-table-wrap .materials-table td.mat-col-qty,
    .materials-table-wrap .materials-table th:nth-child(3),
    .materials-table-wrap .materials-table td.mat-col-unit,
    .materials-table-wrap .materials-table th:nth-child(4),
    .materials-table-wrap .materials-table td.mat-line-total-cell,
    .materials-table-wrap .materials-table th:last-child,
    .materials-table-wrap .materials-table td.mat-actions {
        width: auto;
        min-width: 0;
        text-align: left;
        white-space: normal;
    }
    .materials-table-wrap .materials-table th:nth-child(2),
    .materials-table-wrap .materials-table th:nth-child(3),
    .materials-table-wrap .materials-table th:nth-child(4) {
        text-align: left;
    }
    .materials-table-wrap .materials-table .mat-col-qty input,
    .materials-table-wrap .materials-table .mat-col-unit input {
        text-align: left;
    }
    .materials-table-wrap .materials-table thead {
        display: none;
    }
    .materials-table-wrap .materials-table,
    .materials-table-wrap .materials-table tbody {
        display: block;
        width: 100%;
    }
    .materials-table-wrap .materials-table tr.material-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: .55rem;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: .6rem;
        padding: .75rem;
        margin-bottom: .65rem;
    }
    .materials-table-wrap .materials-table tr.material-row:last-child {
        margin-bottom: 0;
    }
    .materials-table-wrap .materials-table td {
        display: block;
        border: 0;
        padding: 0;
    }
    .materials-table-wrap .materials-table td::before {
        content: attr(data-label);
        display: block;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        font-weight: 700;
        margin-bottom: .25rem;
    }
    .materials-table-wrap .materials-table td.mat-col-material {
        grid-column: 1;
    }
    .materials-table-wrap .materials-table td.mat-line-total-cell {
        grid-column: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        border-top: 1px dashed var(--border);
        margin-top: .15rem;
        padding-top: .55rem;
    }
    .materials-table-wrap .materials-table td.mat-line-total-cell::before {
        margin-bottom: 0;
    }
    .materials-table-wrap .materials-table td.mat-actions {
        order: -1;
        grid-column: 1;
        display: flex;
        justify-content: flex-end;
        padding-bottom: .35rem;
        margin-bottom: .15rem;
        border-bottom: 1px dashed var(--border);
    }
    .materials-table-wrap .materials-table td.mat-actions::before {
        content: none;
    }
    .materials-table-wrap .materials-table td input,
    .materials-table-wrap .materials-table td select {
        width: 100%;
    }
    .materials-block .add-material {
        width: 100%;
        margin-top: .75rem;
    }

    .quote-panel-add {
        width: 100%;
        margin-top: .75rem;
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }
    .quote-panel-add:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
        color: #fff;
        text-decoration: none;
    }

    /* View mode: produits grows with viewport; stack on narrow screens */
    .document-preview .products-table thead { display: none; }
    .document-preview .products-table,
    .document-preview .products-table tbody,
    .document-preview .products-table tr,
    .document-preview .products-table td {
        display: block;
        width: 100%;
    }
    .document-preview .products-table tr {
        border: 1px solid var(--border);
        border-radius: .65rem;
        margin-bottom: .85rem;
        overflow: hidden;
        background: #fff;
    }
    .document-preview .products-table td {
        border: 0;
        border-top: 1px solid var(--border);
        padding: .55rem .75rem;
        display: grid;
        grid-template-columns: minmax(7rem, 32%) 1fr;
        gap: .65rem;
        text-align: left !important;
        white-space: normal !important;
        width: 100% !important;
    }
    .document-preview .products-table td.desc {
        border-top: 0;
        grid-template-columns: 1fr;
        background: #fafafa;
    }
    .document-preview .products-table td::before {
        content: attr(data-label);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        font-weight: 700;
    }
    .document-preview .products-table td.desc::before {
        margin-bottom: .35rem;
    }

    .document-preview .devis-vat-table thead { display: none; }
    .document-preview .devis-vat-table,
    .document-preview .devis-vat-table tbody,
    .document-preview .devis-vat-table tr,
    .document-preview .devis-vat-table td {
        display: block;
        width: 100%;
    }
    .document-preview .devis-vat-table tr {
        border: 1px solid var(--border);
        border-radius: .65rem;
        margin-bottom: .85rem;
        overflow: hidden;
        background: #fff;
    }
    .document-preview .devis-vat-table tr:last-child { margin-bottom: 0; }
    .document-preview .devis-vat-table td {
        border: 0;
        border-top: 1px solid var(--border);
        padding: .55rem .75rem;
        display: grid;
        grid-template-columns: minmax(7rem, 38%) 1fr;
        gap: .65rem;
        align-items: start;
        text-align: left !important;
        white-space: normal !important;
    }
    .document-preview .devis-vat-table td:first-child { border-top: 0; }
    .document-preview .devis-vat-table td::before {
        content: attr(data-label);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        font-weight: 700;
    }

    .document-preview .devis-recap-table tr {
        display: grid;
        grid-template-columns: minmax(7rem, 1fr) auto;
        gap: .65rem;
        align-items: baseline;
        padding: .45rem 0;
        border-bottom: 1px solid var(--border);
    }
    .document-preview .devis-recap-table tr:last-child { border-bottom: 0; }
    .document-preview .devis-recap-table td {
        border: 0;
        padding: 0;
        text-align: left !important;
    }
    .document-preview .devis-recap-table td:last-child {
        text-align: right !important;
    }

    .quote-summary .vat-box .table-compact thead { display: none; }
    .quote-summary .vat-box .table-compact,
    .quote-summary .vat-box .table-compact tbody,
    .quote-summary .vat-box .table-compact tr,
    .quote-summary .vat-box .table-compact td {
        display: block;
        width: 100%;
    }
    .quote-summary .vat-box .table-compact tr {
        border: 1px solid var(--border);
        border-radius: .55rem;
        margin-bottom: .65rem;
        overflow: hidden;
    }
    .quote-summary .vat-box .table-compact tr:last-child { margin-bottom: 0; }
    .quote-summary .vat-box .table-compact td {
        border: 0;
        border-top: 1px solid var(--border);
        padding: .45rem .65rem;
        display: grid;
        grid-template-columns: minmax(5.5rem, 38%) 1fr;
        gap: .5rem;
        align-items: start;
        text-align: left !important;
    }
    .quote-summary .vat-box .table-compact td:first-child { border-top: 0; }
    .quote-summary .vat-box .table-compact td::before {
        content: attr(data-label);
        font-size: .68rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        font-weight: 700;
    }
    .quote-summary .vat-box .table-compact td:nth-child(2),
    .quote-summary .vat-box .table-compact td:nth-child(3) {
        text-align: left !important;
    }

    .filter-presets {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .4rem;
    }
    .period-preset {
        padding: .55rem .35rem;
        font-size: .78rem;
        min-height: 2.5rem;
    }
    .filter-custom {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
    .filter-custom .period-apply {
        grid-column: 1 / -1;
        width: 100%;
    }

    .page-actions-quote {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        gap: .5rem;
    }
    .page-actions-quote .btn-with-icon {
        width: auto;
        min-width: 2.35rem;
        padding: .45rem .55rem;
        gap: 0;
        position: relative;
        overflow: hidden;
    }
    .page-actions-quote .btn-icon {
        width: 1.15rem;
        height: 1.15rem;
    }
    .page-actions-quote .btn-icon-pdf {
        width: 1.25rem;
        height: 1.25rem;
    }
    .page-actions-bottom {
        display: flex;
        margin-top: .5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 560px) {
    .page-actions .btn,
    .form-actions .btn { flex: 1 1 auto; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-card { padding: .85rem; }
    .devis-header { flex-direction: column; }
}

@media print {
    .sidebar, .page-header, .page-actions, .quote-aside, .internal-summary, .nav-toggle, .nav-close, .nav-backdrop { display: none !important; }
    .main-content { padding: 0; }
    .card { box-shadow: none; border: 0; }
}
