/* Application workspace. Screen-only rules preserve the statutory print formats. */
@media screen {
 :root { --canvas:#f3f6f8; --line:#dfe6eb; --muted:#607181; --radius:12px; --shadow:0 4px 18px rgba(18,43,62,.06); }
 body { font-size:1rem; line-height:1.5; }
 .ui-icon { width:20px; height:20px; flex:0 0 20px; vertical-align:middle; }
 .small,.field label,.field-hint,.form-note,.entity-list span,.validation-list li { font-size:.875rem; }
 .muted { color:var(--muted); }
 h1,h2,h3,h4 { letter-spacing:-.025em; }
 .app-shell { grid-template-columns:240px minmax(0,1fr); }
 .sidebar { padding:24px 14px 18px; background:#0d263a; }
 .sidebar .brand { padding:0 10px 24px; }
 .brand-mark { width:40px; height:40px; border-radius:9px; box-shadow:none; background:#0c8b73; letter-spacing:-.05em; }
 .brand-copy span { font-size:.75rem; }
 .nav { gap:8px; margin-top:24px; }
 .nav-area-button { gap:10px; min-height:46px; padding:10px; font-size:.875rem; font-weight:600; border-radius:8px; line-height:1.35; }
 .nav-area-button.active { background:#19394d; box-shadow:none; }
 .nav-area-button.active .nav-icon { color:#6fd5be; }
 .nav-children { padding:4px 0 8px 31px; gap:3px; }
 .nav-subbutton { min-height:38px; font-size:.875rem; line-height:1.4; border-radius:6px; padding:8px 10px; color:#b2c6d3; }
 .nav-subbutton.active { background:#154c4d; color:#ddfff5; box-shadow:inset 2px 0 #45c6a6; }
 .sidebar-footer { padding:16px 8px 0; }
 .environment-pill { font-size:.75rem; margin-bottom:8px; }
 .environment-pill i { box-shadow:none; width:6px; height:6px; }
 .sidebar-footer .nav-button { padding:8px 0; font-size:.875rem; }
 .sidebar-scrim { display:none; }
 .topbar { min-height:78px; padding:12px 30px; gap:20px; background:#fff; backdrop-filter:none; }
 .company-context { min-width:0; max-width:360px; }
 .topbar-label { display:block; font-size:.75rem; line-height:1.2; color:var(--muted); margin-bottom:5px; font-weight:500; }
 .company-select { min-width:0; max-width:100%; min-height:40px; font-size:.875rem; border-radius:7px; }
 .company-context .company-select { width:100%; min-height:30px; border:0; padding:0 22px 0 0; background:transparent; font-size:.9375rem; font-weight:700; }
 .period-context { margin:0; gap:0; flex-shrink:0; }
 .period-context input { padding:0; min-height:30px; border:0; border-radius:3px; font-size:.875rem; }
 .period-context input:focus { box-shadow:none; outline:2px solid #2da28b; outline-offset:3px; }
 .user-chip { padding-left:20px; border-left:1px solid var(--line); }
 .user-chip span { display:none; }
 .avatar { width:36px; height:36px; background:#e8eff3; font-size:.875rem; }
 .content { max-width:1640px; margin:0 auto; padding:28px 30px 48px; }
 .breadcrumb { font-size:.75rem; margin-bottom:10px; }
 .breadcrumb strong { font-weight:500; color:var(--muted); }
 .page-head { align-items:center; margin-bottom:24px; gap:16px; }
 .page-head > div:first-child { min-width:0; }
 .page-head h1 { font-size:1.875rem; line-height:1.25; margin-bottom:6px; font-weight:800; }
 .page-head p { font-size:.875rem; max-width:760px; line-height:1.6; }
 .page-actions { flex-shrink:0; gap:8px; }
 .btn { min-height:40px; border-radius:7px; padding:9px 14px; font-weight:600; font-size:.875rem; box-shadow:none; }
 .btn:hover { transform:none; }
 .btn-primary { background:#087f6b; box-shadow:none; }
 .btn-primary:hover { background:#066956; }
 .btn-secondary { color:#264a5e; background:#fff; border:1px solid #cbd8e1; }
 .btn-secondary:hover,.btn-ghost:hover { background:#f0f5f7; border-color:#a8bccb; }
 .btn:disabled { cursor:not-allowed; opacity:.55; }
 .icon-btn { min-height:40px; width:40px; border-radius:7px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
 .mobile-toggle { display:none; }
 .card,.table-card,.report-card,.access-toolbar,.automation-card { border-radius:12px; box-shadow:none; }
 .card-head { padding:18px 20px; border-bottom:1px solid #e8edf1; flex-wrap:wrap; }
 .card-head h3 { font-size:1rem; line-height:1.4; font-weight:700; }
 .card-caption { margin:4px 0 0; font-size:.8125rem; color:var(--muted); line-height:1.5; }
 .card-body { padding:20px; }
 .kpi-grid { gap:14px; margin-bottom:22px; }
 .kpi { min-height:130px; padding:20px; border-radius:10px; box-shadow:none; }
 .kpi::after { display:none; }
 .kpi-label { font-size:.875rem; margin-bottom:12px; font-weight:500; }
 .kpi strong { font-size:1.65rem; line-height:1.25; margin-bottom:8px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
 .kpi small { font-size:.8125rem; }
 .tabs { gap:0; padding:0 2px; border-bottom:1px solid #d5dfe6; margin-bottom:24px; border-radius:0; scrollbar-width:thin; }
 .tab { min-height:44px; padding:10px 16px; border:0; border-bottom:2px solid transparent; background:transparent; border-radius:0; color:var(--muted); font-size:.875rem; font-weight:500; }
 .tab:hover { color:#184459; background:#edf3f5; }
 .tab.active { border-color:#087f6b; color:#086652; background:transparent; font-weight:700; }
 .report-toolbar,.access-toolbar { padding:16px 18px; border-radius:9px; font-size:.875rem; }
 .table-tools { padding:16px 18px; gap:10px; background:#fff; }
 .search-input { min-width:0; min-height:42px; width:100%; max-width:420px; padding:10px 12px; border-radius:7px; font-size:.875rem; background:#f9fbfc; }
 .table-tools select { min-height:42px; font-size:.875rem; }
 .operational-table { max-height:640px; scrollbar-width:thin; scrollbar-color:#b8c7d2 transparent; }
 .operational-table table { font-size:.875rem; line-height:1.5; }
 .operational-table th { position:sticky; top:0; z-index:2; padding:12px 16px; color:#607181; background:#f6f8fa; font-size:.8125rem; text-transform:none; letter-spacing:0; font-weight:600; border-bottom:1px solid #dce5ec; }
 .operational-table td { padding:13px 16px; border-top:1px solid #eaf0f3; }
 .operational-table tbody tr:hover { background:#f5f9fa; }
 .operational-table .amount,.numeric-heading { text-align:right; }
 .operational-table small { font-size:.75rem; line-height:1.5; }
 .operational-table .mono { font-size:.8125rem; }
 .operational-table .inline-actions { margin:0; flex-wrap:wrap; }
 .operational-table .inline-actions .btn { min-height:36px; font-size:.875rem; padding:6px 10px; }
 .row-actions-menu { min-width:116px; font-size:.875rem; }
 .row-actions-menu summary { display:flex; align-items:center; justify-content:center; gap:6px; min-height:36px; padding:6px 9px; list-style:none; cursor:pointer; border:1px solid #d7e1e8; border-radius:6px; background:#fff; color:#365368; }
 .row-actions-menu summary::-webkit-details-marker { display:none; }
 .row-actions-menu .inline-actions { margin-top:8px; flex-direction:column; align-items:stretch; }
 .row-actions-menu[open] summary { border-color:#087f6b; color:#086652; }
 .row-actions-menu .btn { justify-content:flex-start; text-align:left; }
 .badge { font-size:.8125rem; line-height:1.4; font-weight:600; border-radius:5px; padding:4px 8px; }
 .badge.ok { color:#14664f; background:#e4f4ed; }
 .badge.expense { color:#9a3746; background:#fbecee; }
 .badge.purchase { color:#886115; background:#fbf2dd; }
 .badge.sale { color:#286383; background:#eaf3f9; }
 .badge.closed { color:#556978; background:#edf1f4; }
 .field { min-width:0; gap:6px; margin-bottom:18px; }
 .field label { font-weight:600; line-height:1.5; }
 .field input,.field select,.field textarea { min-width:0; max-width:100%; min-height:44px; padding:10px 12px; font-size:1rem; border-radius:7px; border-color:#c8d5df; }
 .field input:focus,.field select:focus,.field textarea:focus { border-color:#0a8f75; box-shadow:0 0 0 3px #e0f3ee; }
 .field input:disabled,.field select:disabled { color:#627482; background:#f0f4f6; }
 .field-hint { font-size:.8125rem; line-height:1.5; }
 .modal-backdrop { background:rgba(9,29,45,.54); backdrop-filter:blur(2px); }
 .modal { width:min(900px,100%); max-height:calc(100dvh - 40px); border-radius:14px; box-shadow:0 20px 70px rgba(8,28,42,.2); }
 .modal.small-modal { width:min(560px,100%); }
 .modal:focus { outline:0; }
 .modal-open { overflow:hidden; }
 .modal-head { padding:18px 24px; align-items:flex-start; }
 .modal-head h2 { font-size:1.25rem; line-height:1.5; }
 .modal-body { background:#fafcfd; padding:24px; }
 .modal-footer { position:sticky; bottom:0; z-index:3; flex-wrap:wrap; padding:16px 24px; background:#fff; box-shadow:0 -4px 14px rgba(18,43,62,.04); }
 .form-section { margin:0 0 24px; padding:16px 18px 0; border:1px solid #dbe5ec; border-radius:9px; background:#fff; min-width:0; }
 .form-section legend { padding:0 8px; color:#254b60; font-size:.9375rem; font-weight:700; }
 .form-section legend span { display:inline-block; margin-right:8px; font-size:.75rem; font-weight:500; color:#728996; font-variant-numeric:tabular-nums; }
 .form-section .form-grid { gap:0 18px; }
 .form-section .field:last-child { margin-bottom:18px; }
 .allocation-panel,.document-lines-panel,.statutory-calculation,.check-list { border-radius:9px; box-shadow:none; }
 .document-lines-panel { padding:18px; background:#fff; }
 .document-line { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; padding:18px 0; }
 .document-line .field:nth-child(1),.document-line .field:nth-child(2) { grid-column:span 2; }
 .document-line .line-remove { grid-column:4; justify-self:end; }
 .allocation-head span,.line-stock-hint,.form-note { font-size:.875rem; line-height:1.5; }
 .setup-callout { padding:10px 14px; margin-bottom:20px; border:1px solid #d9e6ee; background:#edf5f9; color:#4b697d; border-radius:7px; font-size:.8125rem; align-items:center; }
 .setup-callout > div { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 10px; }
 .setup-callout strong { margin:0; color:#285671; font-weight:600; }
 .setup-callout .ui-icon { width:18px; height:18px; }
 .license-callout { border-radius:8px; }
 .empty-state { padding:44px 24px; font-size:.875rem; }
 .empty-state strong { font-size:1rem; }
 .auth-card { box-shadow:0 12px 36px rgba(20,47,72,.06); border-radius:14px; }
 .auth-hero::after { display:none; }
 .auth-message h1 { line-height:1.08; letter-spacing:-.04em; }
 .auth-points span { border-radius:7px; }
 .auth-card .field { margin-bottom:20px; }
 .auth-panel { background:#f5f8fa; }
 .toast { font-size:.875rem; }
 /* The first screen separates current balances from the selected accounting period. */
 .overview-context { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:12px; font-size:.8125rem; color:var(--muted); }
 .overview-context > span:first-child { text-transform:capitalize; color:#375367; font-weight:600; }
 .overview-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
 .overview-metric { min-width:0; display:flex; flex-direction:column; padding:19px 18px 16px; border:1px solid var(--line); border-radius:10px; background:#fff; }
 .overview-metric-label { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; min-height:40px; color:#5d7282; font-size:.875rem; line-height:1.4; }
 .overview-metric-label .ui-icon { color:#86a0af; width:18px; height:18px; flex-basis:18px; }
 .overview-metric > strong { font-family:Manrope,sans-serif; font-size:clamp(1.35rem,2.05vw,1.85rem); letter-spacing:-.04em; line-height:1.25; margin:10px 0 18px; font-variant-numeric:tabular-nums; color:#15394e; overflow-wrap:anywhere; }
 .overview-metric-bottom { display:flex; flex-direction:column; gap:10px; margin-top:auto; font-size:.75rem; color:#627785; }
 .overview-metric-bottom > span { min-height:18px; }
 .overview-metric-bottom button { width:fit-content; border:0; padding:0; color:#086a56; background:transparent; text-decoration:underline; text-underline-offset:3px; font-size:.8125rem; font-weight:600; }
 .overview-metric-primary { background:#123d4a; border-color:#123d4a; }
 .overview-metric-primary > strong { color:#fff; }
 .overview-metric-primary .overview-metric-label,.overview-metric-primary .overview-metric-bottom { color:#c0d9dd; }
 .overview-metric-primary .ui-icon,.overview-metric-primary .overview-metric-bottom button { color:#82ddc5; }
 .overview-metric-negative > strong { color:#b4384e; }
 .overview-main { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr); gap:20px; }
 .overview-activity,.overview-priorities { min-width:0; }
 .overview-activity .card-head { align-items:flex-start; gap:12px; }
 .legend { font-size:.75rem; flex-wrap:wrap; gap:10px; line-height:1.5; }
 .activity-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:20px; border-bottom:1px solid #edf1f4; }
 .activity-summary div { display:flex; flex-direction:column; gap:6px; min-width:0; }
 .activity-summary span { font-size:.8125rem; color:var(--muted); }
 .activity-summary strong { font-size:1.0625rem; color:#1d4357; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
 .chart-period { margin:0; color:var(--muted); font-size:.75rem; }
 .overview-chart { padding:16px 20px 20px; }
 .chart { height:155px; gap:12px; background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#edf1f5 calc(25% - 1px),#edf1f5 25%); }
 .bar-group { border-bottom:1px solid #d5e0e8; gap:5px; }
 .bar { border-radius:3px 3px 0 0; background:#2f667d; }
 .bar.expense { background:#70b4a7; opacity:1; }
 .legend i { background:#2f667d; }
 .legend i.green { background:#70b4a7; }
 .chart-labels span { font-size:.75rem; text-transform:capitalize; }
 .priority-list { padding:0 18px; }
 .priority-item { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:9px; width:100%; padding:19px 0; border:0; border-bottom:1px solid #e8edf1; color:var(--ink); background:transparent; text-align:left; }
 .priority-item:last-child { border-bottom:0; }
 .priority-item:hover { background:#f7fafb; }
 .priority-icon { color:#ac7a20; }
 .priority-item strong { display:block; font-weight:600; font-size:.875rem; }
 .priority-item small { display:block; margin-top:4px; color:var(--muted); font-size:.75rem; line-height:1.5; }
 .priority-item b { font-size:.875rem; font-weight:600; font-variant-numeric:tabular-nums; text-align:right; }
 .priority-empty { display:flex; flex-direction:column; align-items:flex-start; padding:26px 2px; }
 .priority-empty > .ui-icon { color:#188a71; margin-bottom:16px; }
 .priority-empty > strong { font-size:.9375rem; }
 .priority-empty p { font-size:.875rem; color:var(--muted); margin:8px 0 18px; }
 .overview-shortcuts { display:flex; flex-wrap:wrap; gap:0; padding:12px 0; margin:14px 0; }
 .overview-shortcuts button { display:flex; align-items:center; gap:8px; min-height:42px; padding:8px 14px; border:0; background:transparent; color:#36576c; font-weight:500; font-size:.875rem; border-radius:7px; }
 .overview-shortcuts button:first-child { padding-left:0; }
 .overview-shortcuts button:hover { background:#e5eeef; }
 .overview-shortcuts .ui-icon { width:18px; height:18px; }
 .overview-recent .operational-table { max-height:none; }
 .overview-recent .card-head { padding:16px 20px; }
 .overview .card { overflow:hidden; }
 .financial-report .statement-tabs { margin-bottom:0; }
 .financial-paper { box-shadow:0 2px 9px rgba(20,47,72,.04); }
}
@media screen and (max-width:1200px) {
 .content { padding:24px; }
 .topbar { padding:12px 24px; }
 .page-head { align-items:flex-start; flex-wrap:wrap; }
 .overview-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .overview-metric-label { min-height:0; }
 .overview-metric > strong { font-size:1.7rem; }
 .overview-metric-bottom { flex-direction:row; justify-content:space-between; align-items:baseline; flex-wrap:wrap; }
 .overview-main { grid-template-columns:minmax(0,1.35fr) minmax(250px,1fr); }
 .activity-summary { gap:12px; padding:16px; }
 .activity-summary strong { font-size:.9375rem; }
 .priority-item { grid-template-columns:24px minmax(0,1fr); }
 .priority-item b { grid-column:2; text-align:left; }
}
@media screen and (max-width:1000px) {
 .overview-main { grid-template-columns:1fr; }
 .priority-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:22px; }
 .priority-empty { grid-column:1/-1; }
 .priority-item:nth-last-child(-n+2) { border-bottom:0; }
}
@media screen and (max-width:840px) {
 .app-shell { grid-template-columns:1fr; }
 .sidebar { width:min(290px,85vw); padding-top:22px; }
 .sidebar.open + .sidebar-scrim { display:block; position:fixed; inset:0; z-index:19; border:0; background:rgba(8,27,41,.46); }
 .mobile-toggle { display:inline-flex; }
 .topbar { gap:14px; min-height:72px; padding:10px 20px; }
 .company-context { flex:1; max-width:none; }
 .topbar-spacer { display:none; }
 .user-chip { display:none; }
 .content { padding:24px 20px 98px; }
 .mobile-bottom-nav { box-shadow:0 -1px 10px rgba(20,47,72,.045); }
 .mobile-bottom-nav button { font-size:.75rem; font-weight:600; }
 .mobile-bottom-nav .ui-icon { width:20px; height:20px; }
 .mobile-bottom-nav button.active { border-radius:7px; background:#edf7f3; color:#087f6b; }
 .toast-region { bottom:90px; }
}
@media screen and (max-width:620px) {
 .content { padding:20px 16px 98px; }
 .topbar { padding:10px 14px; gap:10px; flex-wrap:wrap; }
 .company-context { flex:1; min-width:150px; }
 .company-context .company-select { font-size:.875rem; }
 .period-context { margin-left:auto; }
 .topbar-label { font-size:.75rem; }
 .period-context input { width:145px; font-size:.875rem; }
 .topbar .mobile-toggle { width:36px; min-height:36px; }
 .page-head { display:flex; gap:16px; margin-bottom:20px; }
 .page-head h1 { font-size:1.55rem; }
 .page-head p { font-size:.875rem; }
 .page-actions { width:100%; }
 .page-actions .btn { flex:1; min-width:0; }
 .overview-context { align-items:flex-start; flex-direction:column; gap:3px; margin-bottom:14px; }
 .overview-metrics { gap:10px; margin-bottom:18px; }
 .overview-metric { padding:15px 12px; }
 .overview-metric-label { font-size:.875rem; min-height:40px; gap:5px; }
 .overview-metric-label .ui-icon { display:none; }
 .overview-metric > strong { font-size:1.35rem; margin:8px 0 12px; letter-spacing:-.025em; }
 .overview-metric-bottom { flex-direction:column; align-items:flex-start; gap:10px; }
 .overview-metric-bottom > span { min-height:36px; }
 .overview-metric-bottom button { font-size:.875rem; min-height:28px; }
 .overview-main { gap:18px; }
 .card-head { padding:16px; }
 .card-body { padding:16px; }
 .activity-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
 .activity-summary > div:last-child { grid-column:1/-1; flex-direction:row; justify-content:space-between; align-items:center; border-top:1px solid var(--line); padding-top:12px; }
 .overview-chart { padding:14px 16px 18px; }
 .overview-shortcuts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; margin:12px 0; }
 .overview-shortcuts button,.overview-shortcuts button:first-child { padding:8px; font-size:.875rem; }
 .priority-list { display:block; padding:0 16px; }
 .priority-item { grid-template-columns:24px minmax(0,1fr) auto; }
 .priority-item b { grid-column:auto; text-align:right; }
 .priority-item:nth-last-child(2) { border-bottom:1px solid #e8edf1; }
 .operational-table table { min-width:620px; }
 .table-tools { padding:14px; align-items:stretch; }
 .search-input { flex-basis:100%; max-width:none; }
 .table-tools > select { flex:1; min-width:0!important; }
 .table-tools > .small { align-self:center; }
 .tab { padding:10px 13px; }
 .tabs { flex-wrap:nowrap; }
 .form-grid,.form-grid.three,.document-line { grid-template-columns:1fr; }
 .form-grid .span-2,.form-grid .span-3 { grid-column:1; }
 .document-line .field:nth-child(1),.document-line .field:nth-child(2),.document-line .line-remove { grid-column:1; }
 .document-line .line-remove { justify-self:end; }
 .modal-backdrop { padding:10px; }
 .modal { width:100%; max-height:calc(100dvh - 20px); border-radius:12px; }
 .modal-head { padding:16px; gap:12px; }
 .modal-head h2 { font-size:1.1rem; }
 .modal-body { padding:18px 14px; }
 .modal-footer { gap:8px; padding:12px 14px max(12px,env(safe-area-inset-bottom)); }
 .modal-footer .btn { flex:1; padding:10px; }
 .modal-footer .btn-primary { flex-basis:100%; order:-1; }
 .form-section { padding:12px 12px 0; margin-bottom:20px; }
 .form-section legend { font-size:.875rem; }
 .setup-callout { align-items:flex-start; }
 .auth-hero { min-height:300px; padding:28px 24px; }
 .auth-message h1 { font-size:2.5rem; margin-top:30px; }
 .auth-points { margin-top:20px; gap:8px; }
 .auth-card { padding:28px 22px; }
}
@media screen and (max-width:360px) {
 .overview-metrics { grid-template-columns:1fr; }
 .overview-metric-label { min-height:0; }
 .overview-metric-bottom > span { min-height:0; }
 .overview-metric > strong { font-size:1.7rem; }
 .priority-item { grid-template-columns:24px minmax(0,1fr); }
 .priority-item b { grid-column:2; text-align:left; }
}
@media (prefers-reduced-motion:reduce) {
 *,*::before,*::after { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
}
@media print { .sidebar-scrim { display:none!important; } }
/* Supplier JSON review uses the same compact surfaces as the accounting forms. */
@media screen {
  .dte-import-card {border:1px solid var(--border,#dce4e9);border-radius:10px;margin:18px 0;background:#fff;padding:16px;min-width:0}
  .dte-import-card.has-error {border-color:#e2b2ab}
  .dte-import-card header {display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
  .dte-import-card header strong {overflow-wrap:anywhere}
  .dte-import-card summary {cursor:pointer;font-weight:600;padding:16px 0;font-size:1rem}
  .dte-import-summary {display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:12px 0 20px}
  .dte-import-summary>div {display:grid;gap:4px;overflow-wrap:anywhere}
  .dte-import-summary span,.dte-import-summary small {font-size:.875rem;color:#526575}
  .dte-import-totals {max-width:500px;margin:16px 0 16px auto}
  .dte-import-totals>div {display:flex;gap:20px;justify-content:space-between;padding:7px 0}
  .dte-import-totals dd {margin:0;white-space:nowrap;font-variant-numeric:tabular-nums}
  .dte-import-total {border-top:2px solid #173b51;font-weight:700;font-size:1.125rem}
  .dte-import-options {margin:18px 0 0;padding:16px 0 0;border:0;border-top:1px solid #dce4e9}
  .dte-import-options legend {font-weight:700;padding-right:12px}
  .dte-import-review {margin-top:20px;align-items:flex-start}
  .dte-import-error {color:#9c2d24;font-size:1rem;margin:12px 0}
  #purchase-import-message {font-weight:600;overflow-wrap:anywhere}
  @media(max-width:620px){.dte-import-summary{grid-template-columns:1fr}.dte-import-card{padding:12px}.dte-import-card header{flex-direction:column}.dte-import-options{grid-template-columns:1fr}.dte-import-options .span-3{grid-column:auto}}
}

/* Sale and fiscal document share one dialog, with the existing invoice locked after saving. */
.sale-dte-panel{margin:20px 0;padding:20px;border:1px solid var(--line,#d8e4e7);border-radius:12px;background:var(--surface,#fff)}
.sale-dte-panel h3{margin:0 0 16px}.sale-dte-panel details{margin:14px 0}.sale-dte-panel summary{cursor:pointer;font-weight:600;padding:8px 0}.sale-dte-panel .validation-box{margin:14px 0}.sale-dte-result{overflow-wrap:anywhere}.sale-dte-result p{margin:8px 0}.sale-dte-panel .inline-actions{flex-wrap:wrap;gap:8px}
#commercial-document-form .modal-footer{flex-wrap:wrap}
@media(max-width:680px){.sale-dte-panel{padding:14px}#commercial-document-form .modal-footer .btn{flex:1 1 160px}}
#commercial-document-form [hidden]{display:none!important}
.sales-tabs{flex-wrap:wrap}

  .journal-editor-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:12px; align-items:center; margin:18px 0; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:#fff; }
  .journal-editor-summary > div { display:grid; gap:3px; }
  .journal-editor-summary span:not(.badge) { color:var(--muted); font-size:.8rem; }
  .journal-editor-summary strong { font-variant-numeric:tabular-nums; }
  .journal-editor-table { margin-bottom:14px; }
  .journal-editor-table table { min-width:820px; }
  .journal-editor-table th:nth-child(1) { min-width:240px; }
  .journal-editor-table th:nth-child(2) { min-width:210px; }
  .journal-editor-table th:nth-child(3),.journal-editor-table th:nth-child(4) { min-width:125px; }
  .journal-editor-table input,.journal-editor-table select { width:100%; min-width:0; }
  .journal-editor-table input[type="number"] { text-align:right; font-variant-numeric:tabular-nums; }
  @media(max-width:620px){.journal-editor-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.journal-editor-summary>.badge{justify-self:start}}