/* User-requested density. Duralux source remains immutable. */
body.duralux-native.crm-compact{--crm-space:18px;--crm-row-space:10px;--crm-section-gap:16px}
body.duralux-native.crm-compact .main-content{padding:var(--crm-space)}
body.duralux-native.crm-compact .main-content .main-content{padding:0}
body.duralux-native.crm-compact .nxl-header.topbar{height:64px;min-height:64px;padding:8px var(--crm-space)}
body.duralux-native.crm-compact .nxl-navigation .navbar-wrapper .m-header{height:64px;min-height:64px;padding:12px 24px}
body.duralux-native.crm-compact .nxl-container .nxl-content .page-header{min-height:64px;padding:12px var(--crm-space);gap:12px}
body.duralux-native.crm-compact .page-header-title{padding-right:14px}body.duralux-native.crm-compact .page-header h1{font-size:16px}
body.duralux-native.crm-compact .card{margin-bottom:var(--crm-section-gap)}body.duralux-native.crm-compact .card-body{padding:var(--crm-space)}body.duralux-native.crm-compact .card-header{padding:14px var(--crm-space)}
body.duralux-native.crm-compact .purchased-table-toolbar{padding:14px var(--crm-space);gap:12px}
body.duralux-native.crm-compact .purchased-list-table thead th{padding:12px var(--crm-space);font-size:12px}
body.duralux-native.crm-compact .purchased-list-table tbody td{padding:var(--crm-row-space) var(--crm-space);font-size:13px}
body.duralux-native.crm-compact .crm-field{margin:6px 0;gap:4px}body.duralux-native.crm-compact .crm-fieldset{padding:12px;margin-bottom:10px}
body.duralux-native.crm-compact .form-control,body.duralux-native.crm-compact .form-select{font-size:13px;min-height:38px;padding:8px 12px}
body.duralux-native.crm-compact .btn{font-size:12px;min-height:38px}body.duralux-native.crm-compact .action-icon{min-width:40px;min-height:40px}
body.duralux-native.crm-compact .nxl-navigation .navbar-content .nxl-navbar>.nxl-item>a.nxl-link{padding:10px 16px;margin:2px 12px;font-size:13px;min-height:42px}
body.duralux-native.crm-compact .nxl-caption{padding:14px 28px 6px}body.duralux-native.crm-compact .sidebar-projects{padding:14px 28px}
body.duralux-native.crm-compact .customer-profile-info>div{padding:8px 0}body.duralux-native.crm-compact .customers-nav-tabs .nav-link{padding:14px 12px;min-height:48px}
body.duralux-native.crm-compact .tab-pane .master-info>div{padding:8px 0}body.duralux-native.crm-compact .customer-profile-counts>div{padding:10px}
body.duralux-native.crm-compact .customer-links{margin:12px var(--crm-space) 0}
body.duralux-native .crm-tag-popover{position:fixed;inset:auto;margin:0;width:min(344px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;box-shadow:0 10px 32px #283c5030;border:1px solid var(--line);z-index:1200}
body.duralux-native .tag-cell-control{display:flex;gap:6px;flex-wrap:wrap;min-width:130px;width:100%;max-width:300px;justify-content:flex-start;text-align:left;background:#fff;color:#283c50}
body.duralux-native .tag-editor-chips{display:flex;gap:6px;flex-wrap:wrap}body.duralux-native .tag-editor-chips .badge{display:flex;align-items:center;gap:4px;font-size:12px}body.duralux-native .tag-editor-chips .btn{min-width:32px;min-height:32px;padding:0}
body.duralux-native tr[data-tag-editing=true]{outline:2px solid #3454d1;outline-offset:-2px}
body.duralux-native .crm-status{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;border:1px solid var(--line);border-radius:4px;padding:7px 10px;background:#fff;color:#283c50;font-size:12px;line-height:1.4}body.duralux-native .crm-status:before{content:'';width:6px;height:6px;border-radius:50%;background:var(--status-dot,#3454d1);flex-shrink:0}
@media(min-width:2000px){body.duralux-native.crm-compact{--crm-space:22px;--crm-row-space:11px}}
@media(max-width:700px){body.duralux-native.crm-compact{--crm-space:14px;--crm-row-space:10px}body.duralux-native.crm-compact .nxl-header.topbar{height:auto}body.duralux-native.crm-compact .form-control,body.duralux-native.crm-compact .form-select{font-size:16px;min-height:40px}body.duralux-native.crm-compact .btn{min-height:40px}body.duralux-native.crm-compact .nxl-container .nxl-content .page-header{padding:12px 14px}body.duralux-native .tag-cell-control{min-width:130px}}
body.duralux-native .crm-metric-icon svg{width:24px;height:24px}body.duralux-native .crm-metric-progress{width:100%;height:4px;accent-color:#3454d1}body.duralux-native .crm-dashboard .home-daily-grid{padding:0 14px}body.duralux-native .crm-dashboard .home-daily-grid .card{border:0;box-shadow:none}body.duralux-native .crm-lead-tabs{background:white;border-bottom:1px solid var(--line);padding:0 18px}body.duralux-native .crm-lead-tabs .nav-link{min-height:48px}body.duralux-native .crm-lead-view .lead-info .row,body.duralux-native .crm-lead-view .general-info .row{margin-bottom:14px}body.duralux-native .auth-minimal-wrapper .minimal-card-wrapper{width:min(480px,94vw)}body.duralux-native .auth-minimal-wrapper .card-body{padding:32px}body.duralux-native .auth-minimal-wrapper .card{margin-top:24px}
body.duralux-native .document-period-controls{display:flex;gap:12px;flex-wrap:wrap;align-items:end;padding:12px 18px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}body.duralux-native .document-period-controls .crm-field{min-width:155px;margin:0}body.duralux-native .document-period-controls p:empty{display:none}body.duralux-native #documentSearch{height:40px;min-height:40px;max-height:40px}body.duralux-native .document-list-toolbar{align-items:end}body.duralux-native .document-list-toolbar .crm-field{margin:0}body.duralux-native .crm-invoice-view .card-header{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}body.duralux-native .crm-invoice-view .document-detail-toolbar{margin:0;padding:0}body.duralux-native .purchased-editor-frame{padding:0}body.duralux-native .purchased-editor-frame .doc-paper{padding:18px}body.duralux-native .purchased-editor-frame [data-invoice-editor-side] .doc-totals{display:block}body.duralux-native #documentForm.show-pdf-preview .crm-invoice-editor-side{display:none}body.duralux-native .conversion-dialog progress{width:100%}
body.duralux-native.crm-compact #documentForm{max-width:none;width:100%}body.duralux-native [data-feature-body]>.panel-body{padding:0}body.duralux-native .crm-lead-view .main-content{padding:var(--crm-space)}
body.duralux-native .crm-feature-content{padding:0;border:0;margin:0}body.duralux-native .crm-feature-frame:has(>[data-feature-body]>.crm-feature-content[hidden]){display:none}body.duralux-native .focus-task-table th:first-child{width:64px;white-space:nowrap}
body.duralux-native .info-help{display:inline-flex;position:relative;vertical-align:middle}body.duralux-native .info-help .info-button{min-width:32px;min-height:32px;padding:0;border:1px solid var(--line);border-radius:50%;background:#fff;color:#53647a}body.duralux-native .info-help [role=tooltip]{display:none;position:absolute;top:calc(100% + 8px);left:0;width:280px;max-width:calc(100vw - 32px);padding:12px;background:#283c50;color:white;border-radius:5px;z-index:150;font-size:12px;line-height:1.6;white-space:normal;font-weight:400}body.duralux-native .info-help:not([data-dismissed=true]):hover [role=tooltip],body.duralux-native .info-help:not([data-dismissed=true]):focus-within [role=tooltip],body.duralux-native .info-help[data-open=true] [role=tooltip]{display:block}
body.duralux-native .crm-invoice-editor-side>.card{height:auto;min-height:0}body.duralux-native [data-invoice-editor-side] .doc-totals>.card-body{display:block}body.duralux-native [data-invoice-editor-side] h3{font-size:15px}body.duralux-native [data-invoice-editor-side] #documentProfit{margin-top:16px}body.duralux-native.crm-compact .line-movers .btn,body.duralux-native.crm-compact .line-delete{min-width:32px;min-height:32px;padding:4px}body.duralux-native.crm-compact .info-button{min-width:30px;min-height:30px;padding:0}

/* Invoice structure follows purchased invoice-view/create; compact business spacing. */
body.duralux-native .crm-invoice-view .invoice-container{max-width:1140px;margin-inline:auto}
body.duralux-native .crm-invoice-view .py-sm-5{padding-block:20px}
body.duralux-native .crm-invoice-view .card-header{gap:12px;flex-wrap:wrap}
body.duralux-native .crm-invoice-view [data-invoice-outputs]{display:block;padding-bottom:18px}
body.duralux-native .crm-prewrap{white-space:pre-wrap;overflow-wrap:anywhere}
body.duralux-native .crm-original-editor{display:block;padding:0;border:0;background:transparent;max-width:none}
body.duralux-native .crm-invoice-editor .main-content{padding:0}
body.duralux-native .crm-invoice-editor [data-invoice-editor-info] .doc-info,body.duralux-native .crm-invoice-editor .doc-subject{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
body.duralux-native .crm-invoice-editor .doc-info h3,body.duralux-native .crm-invoice-editor .doc-subject h3{grid-column:1/-1}
body.duralux-native .crm-invoice-editor .doc-lines{padding:0}
body.duralux-native .crm-invoice-editor [data-invoice-editor-extra]>*{margin-bottom:12px}
@media(max-width:767px){body.duralux-native .crm-invoice-editor [data-invoice-editor-info] .doc-info,body.duralux-native .crm-invoice-editor .doc-subject{grid-template-columns:1fr}body.duralux-native .crm-invoice-view .card-header{align-items:flex-start}}

body.duralux-native .crm-invoice-view .document-detail-toolbar .action-icon{border-radius:50%;width:38px;height:38px;min-width:38px;padding:8px}
body.duralux-native .crm-invoice-view .document-detail-toolbar .action-icon span{display:none}
body.duralux-native .crm-invoice-view iframe{width:100%;min-height:620px}
body.duralux-native .crm-invoice-editor .doc-issuer,body.duralux-native .crm-invoice-editor .doc-recipient{display:block}
body.duralux-native .crm-invoice-editor .doc-issuer>label,body.duralux-native .crm-invoice-editor .doc-recipient>label{display:block;margin-bottom:10px}
body.duralux-native .crm-invoice-editor .recipient-address-fields{display:block}
body.duralux-native .crm-invoice-editor .doc-info>label,body.duralux-native .crm-invoice-editor .doc-subject>label{min-width:0}

body.duralux-native .crm-sales-mail h2{font-size:16px;margin-bottom:16px}
body.duralux-native .crm-sales-mail label:has(>input[type=checkbox]){display:flex;align-items:center;gap:8px;margin-block:12px}
body.duralux-native .crm-sales-mail input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:none;margin:0}
body.duralux-native .crm-sales-mail .crm-feature-frame:has(>#salesMailCompose[hidden]),body.duralux-native .crm-sales-mail .crm-feature-frame:has(>[data-feature-body]>#salesMailCompose[hidden]){display:none}

body.duralux-native .crm-settings{gap:16px;align-items:flex-start;min-height:0}
body.duralux-native .crm-settings .content-sidebar{position:static;width:220px;min-width:220px;height:auto;flex:none;transform:none;visibility:visible}
body.duralux-native .crm-settings .content-area{margin:0;min-width:0;width:0;flex:1;height:auto;overflow:visible}
body.duralux-native .crm-settings .content-area-body{padding:0}
body.duralux-native .crm-settings .content-area-header{position:static;min-height:65px;padding:12px 18px;margin-bottom:12px}
body.duralux-native .crm-settings .content-sidebar-header{position:static;min-height:65px;padding:18px}
body.duralux-native .crm-settings .nav-link{white-space:normal;width:100%;text-align:left}
body.duralux-native .crm-settings .settings-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}
body.duralux-native .conversion-choice{max-width:440px}
@media(max-width:767px){body.duralux-native .crm-settings{flex-direction:column}body.duralux-native .crm-settings .content-sidebar,body.duralux-native .crm-settings .content-area{width:100%;min-width:0}body.duralux-native .crm-settings .settings-fields{grid-template-columns:1fr}body.duralux-native .crm-settings .content-sidebar-body{padding:0}}

body.duralux-native .crm-settings .content-sidebar{min-height:0}
body.duralux-native .crm-settings [data-category]{border:0;background:transparent;padding:12px 16px}
body.duralux-native .crm-settings [data-category].active{background:#eef1ff;color:#3454d1}

/* Navigation dimensions: avoid Bootstrap .nav shrink-to-content and button intrinsic widths. */
body.duralux-native .nxl-navigation .workspace-nav{display:block;width:100%}
body.duralux-native .nxl-navigation .nxl-navbar{width:100%;min-width:0}
body.duralux-native .nxl-navigation .nxl-navbar>.nxl-item>.nxl-link{display:flex;align-items:center;gap:12px;width:calc(100% - 24px);margin:3px 12px;box-sizing:border-box}
body.duralux-native .nxl-navigation .settings-menu-toggle{border:0;background:transparent;color:inherit;text-align:left;padding:12px 18px;font-size:13px;font-weight:600;border-radius:4px}
body.duralux-native .nxl-navigation .settings-menu-toggle .nxl-arrow{margin-left:auto}
body.duralux-native .nxl-navigation #settingsSubmenu:not([hidden]){display:block}
body.duralux-native .nxl-navigation #settingsSubmenu .nxl-link{display:flex;gap:10px;padding:10px 18px 10px 42px;white-space:normal;line-height:1.5}
body.duralux-native .nxl-navigation #settingsSubmenu .nxl-link.active{background:#eef0fb;color:#3454d1}
body.duralux-native .customers-nav-tabs .nav-item{flex:1 1 90px;min-width:0}
body.duralux-native .customers-nav-tabs .nav-link{width:100%;text-align:center;white-space:nowrap;height:100%;border-bottom:3px solid transparent}
body.duralux-native .crm-settings .nxl-content-sidebar-item .nav-link{display:flex;align-items:center;gap:12px}
body.duralux-native .crm-settings .nxl-content-sidebar-item .nav-link span{min-width:0}
body.duralux-native .document-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;white-space:nowrap}
body.duralux-native .document-row-actions .avatar-text{width:40px;height:40px;min-width:40px;padding:0;color:#283c50;background:#fff;font-size:16px}
body.duralux-native .nxl-navigation .settings-menu-toggle:focus-visible,body.duralux-native .document-row-actions .avatar-text:focus-visible{outline:2px solid #3454d1;outline-offset:2px}
@media(max-width:700px){body.duralux-native .customers-nav-tabs .nav-item{flex:1 1 90px}body.duralux-native .crm-settings .content-sidebar-body .nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}body.duralux-native .crm-settings [data-category]{padding:10px;font-size:12px}}

body.duralux-native .nxl-navigation #settingsSubmenu{margin:0;padding:0;width:100%;min-width:0}
body.duralux-native .nxl-navigation #settingsSubmenu .nxl-link{width:calc(100% - 24px);margin:3px 12px;padding:10px 12px 10px 30px;box-sizing:border-box}

/* Override the full-viewport app-sidebar dimensions only inside routed settings pages. */
body.duralux-native .nxl-container .nxl-content .main-content.crm-settings .content-sidebar{height:auto;min-height:0;width:260px;min-width:260px;max-width:260px}
body.duralux-native .nxl-container .nxl-content .main-content.crm-settings .content-area{height:auto;min-height:0;width:0;min-width:0}
body.duralux-native .nxl-container .document-row-actions .avatar-text.avatar-md{width:40px;height:40px;min-height:40px;max-height:40px;flex:0 0 40px}
@media(max-width:767px){body.duralux-native .nxl-container .nxl-content .main-content.crm-settings .content-sidebar,body.duralux-native .nxl-container .nxl-content .main-content.crm-settings .content-area{width:100%;min-width:0;max-width:none;height:auto}body.duralux-native .customers-nav-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Document editor: keep Duralux heading/actions in the card's normal flow. */
body.duralux-native .nxl-container .nxl-content #documentForm{margin:0;padding:0;border:0;background:transparent;box-shadow:none}
body.duralux-native .nxl-container .nxl-content #documentForm .crm-invoice-editor.main-content{padding:0;min-height:0}
body.duralux-native #documentForm .document-editor-header{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 18px;background:#fff}
body.duralux-native #documentForm .document-editor-header>h2{margin:0;font-size:16px;line-height:1.5;flex:1 0 160px}
body.duralux-native #documentForm .document-editor-toolbar{position:static;inset:auto;margin:0;padding:0;z-index:auto;display:flex;align-items:center;flex-wrap:wrap;gap:8px;background:transparent;border:0;box-shadow:none}
body.duralux-native #documentForm .document-editor-feedback{flex:0 0 100%;min-width:0}
body.duralux-native #documentForm .document-editor-feedback:has(>p:empty):not(:has(>p:not(:empty))){display:none}
body.duralux-native #documentForm .document-editor-feedback p:not(:empty),body.duralux-native #pdfIssueError:not(:empty){margin:0;padding:12px;border:1px solid #f0b9b9;border-radius:4px;background:#fff1f1;color:#9a2222;white-space:normal}
body.duralux-native #documentForm .doc-format-bar{margin:0 0 16px;padding:0;grid-template-columns:minmax(100px,1fr) minmax(160px,2fr)}
body.duralux-native #documentForm [data-invoice-editor-parties]{align-items:flex-start}
body.duralux-native #documentForm [data-invoice-editor-parties]>.col-xl-5{flex:0 0 50%;width:50%;max-width:50%;min-width:0;margin:0}
body.duralux-native #documentForm .doc-recipient h3,body.duralux-native #documentForm .doc-issuer h3{margin:0 0 12px;font-size:14px}
@media(max-width:767px){body.duralux-native #documentForm .document-editor-header{padding:14px}body.duralux-native #documentForm .document-editor-toolbar{width:100%}body.duralux-native #documentForm [data-invoice-editor-parties]>.col-xl-5{flex-basis:100%;width:100%;max-width:100%;margin-bottom:18px}body.duralux-native #documentForm .doc-format-bar{grid-template-columns:1fr}}
/* Document mail uses native cards; keep review controls in normal flow. */
body.duralux-native #mailReview,body.duralux-native #mailChoose{display:block}
body.duralux-native #documentMail label:has(>input[type=checkbox]){display:flex;align-items:center;gap:8px;margin-block:12px}
body.duralux-native #documentMail input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:none;margin:0}
body.duralux-native #documentMail .btn{margin-right:6px;margin-bottom:8px}
body.duralux-native #documentMail [data-address]{min-width:190px}
body.duralux-native #documentMail p,body.duralux-native #documentMail li{overflow-wrap:anywhere}
body.duralux-native #documentMail label:has(>input[type=checkbox]){flex-direction:row;justify-content:flex-start;text-align:left}
body.duralux-native #mailReview>button,body.duralux-native #mailChoose>button{display:inline-flex}
