/* BA21 components. Page-specific files define business layout; visual rules live here. */
html body { font:14px/1.5 var(--font-body) !important; color:var(--foreground); background:var(--background); -webkit-font-smoothing:antialiased; }
html body *,html body *::before,html body *::after { box-sizing:border-box; }
html body :is(button,input,select,textarea) { font-family:var(--font-body) !important; }
html body :is(h1,.erp-ds-page-title) { margin:0 !important; font:600 26px/1.3 var(--font-display) !important; letter-spacing:-.035em !important; }
html body h2 { margin:0; font:600 17px/1.5 var(--font-display); letter-spacing:-.02em; }
html body h3 { font:600 15px/1.5 var(--font-display); }
html body :where(button,.erp-ds-button,.cms-link,.lg-actions>a) { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px !important; height:auto !important; padding:10px 14px !important; border:1px solid var(--border); border-radius:var(--radius-sm) !important; background:var(--card); color:var(--foreground); font-size:13px !important; font-weight:500 !important; line-height:20px !important; letter-spacing:0 !important; text-decoration:none; cursor:pointer; box-shadow:none; transition:background-color 120ms ease,border-color 120ms ease; }
html body :where(button,.erp-ds-button):hover:not(:disabled) { border-color:var(--muted-foreground); }
html body :where(button,.erp-ds-button):disabled { opacity:.45; cursor:not-allowed; }
html body :is(.lg-primary,.pm-primary,.primary,.erp-primary-action,.login-submit,.p-primary) { background:var(--primary); color:var(--primary-foreground); border-color:var(--primary); }
html body :is(.lg-primary,.pm-primary,.primary,.erp-primary-action,.login-submit,.p-primary):hover:not(:disabled) { background:var(--primary-hover); }
html body :is(button,input,select,textarea,a,[tabindex]):focus-visible { outline:2px solid var(--ring) !important; outline-offset:3px !important; }
html body :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]),select,textarea) { min-height:var(--field-height,44px) !important; height:auto !important; padding:12px 16px !important; border:1px solid var(--field-border,transparent) !important; border-radius:var(--radius-sm) !important; background:var(--field-background,var(--muted)) !important; color:var(--foreground) !important; font-size:14px !important; line-height:22px !important; box-shadow:none !important; max-width:100%; }
html body :is(input,select,textarea):focus { outline:2px solid var(--ring); outline-offset:2px; }
html body :is(input,select,textarea)[aria-invalid=true] { border-color:var(--destructive) !important; }
html body :is(input,select,textarea)[readonly] { color:var(--muted-foreground) !important; }
html body textarea { min-height:112px !important; resize:vertical; }
html body :is(input[type=checkbox],input[type=radio]) { width:18px; height:18px; accent-color:var(--primary); }
html body :is(.erp-ds-card,.lg-card,.production-card,.inventory-item-list,.dashboard-kpi,.dashboard-approvals,.cms-metrics>div,.login-card) { padding:var(--card-padding) !important; border:1px solid var(--border) !important; border-radius:var(--radius-xl) !important; background:var(--card); box-shadow:var(--shadow-sm) !important; min-width:0; }

html body :is(dialog,.original-dialog,.pm-panel) { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); padding:24px !important; border:1px solid var(--border); border-radius:var(--radius-xl); background:var(--card); color:var(--foreground); box-shadow:var(--shadow-popover); overflow:auto; }
html body dialog::backdrop { background:color-mix(in srgb,var(--foreground) 32%,transparent); }
html body .pm-panel { max-height:100dvh; border-radius:16px 0 0 16px; }
html body :is(.pm-fields,.recipe-fields,.original-dialog .form-grid) { gap:16px !important; }
html body :is(.pm-fields,.recipe-fields)>* { min-width:0; }
html body :is(.pm-fields,.recipe-fields) :is(input,select,textarea):not([type=checkbox]):not([type=radio]) { width:100%; min-width:0; }
html body :is(.lg-actions,.pm-panel footer,.recipe-footer,.toolbar) { gap:8px; flex-wrap:wrap; }
html body :is(.pm-workspace,#finance-workspace) { padding:0 !important; }
html body :is(.pm-heading,.lg-title,.dashboard-welcome,.ba21-page-heading) { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; margin:0 0 24px !important; padding:0 !important; }
html body main>.ba21-page-heading { margin:0 !important; }
html body :is(.pm-heading) h1 { margin:0 !important; }
html body :is(.pm-heading)>div>p { display:none; }
html body :is(.dashboard-kpis,.dashboard-work-grid,.finance-summary) { gap:var(--section-gap) !important; }
/* Data tables keep their columns; only their own container scrolls. */
html body :is(table,[role=table]) { width:100%; font-size:13px !important; line-height:20px; font-variant-numeric:tabular-nums; border-collapse:separate; border-spacing:0; background:var(--card); }
html body :is(th,td,[role=columnheader],[role=cell]) { padding:12px 12px !important; height:auto !important; border-bottom:1px solid var(--border); font-size:13px !important; line-height:20px !important; }
html body :is(th,[role=columnheader]) { background:var(--table-head) !important; color:var(--table-head-fg) !important; border-top:1px solid var(--table-head-line) !important; border-bottom:1px solid var(--table-head-line) !important; font-weight:500 !important; text-align:left; white-space:nowrap; }
html body tbody tr:last-child td { border-bottom:0; }
html body tbody tr:hover { background:var(--muted); }
html body .erp-ds-table-head { min-height:44px; height:auto !important; padding:12px 16px !important; border-radius:8px 8px 0 0 !important; background:var(--table-head) !important; border-bottom:1px solid var(--border); color:var(--muted-foreground); }
html body :is(.erp-ds-table-head,.erp-ds-table-head>*) { font-size:12px !important; line-height:20px !important; font-weight:500 !important; }
.ba21-data-scroll { overflow-x:auto !important; min-width:0; max-width:100%; overscroll-behavior-inline:contain; }
.ba21-data-scroll>:is(div,[role=row]):not(.erp-ds-table-head) { border-bottom:1px solid var(--border); }
html body :is(.inventory-pagination,.pm-pagination,.pager) { display:flex; justify-content:flex-end !important; align-items:center; gap:8px; }
html body :is(.inventory-pagination,.pager) button { min-width:40px; padding:8px !important; }
html body :is(.production-row,.dashboard-document) { padding:14px 16px !important; min-height:48px; font-size:13px !important; font-weight:400 !important; border-radius:0 !important; border-bottom:1px solid var(--border) !important; }
html body .pm-workspace td button { border:0 !important; padding:0 !important; min-height:32px !important; background:transparent !important; text-align:left; }
html body :is(.pm-empty,.lg-empty,.finance-empty) { padding:32px 16px !important; font-size:13px; color:var(--muted-foreground); }
html body :is(.erp-ds-search) { min-height:44px; height:auto !important; padding:0 12px; border:0 !important; border-radius:var(--radius-md) !important; background:var(--muted) !important; }
html body :is(.erp-ds-search) input { min-height:44px !important; padding:10px 0 !important; border:0 !important; background:transparent !important; width:100%; }
html body .erp-ds-search:focus-within { outline:2px solid var(--ring); outline-offset:2px; }
html body .erp-ds-search input:focus-visible { outline:none !important; }
html body :is(.erp-decoration,.erp-page-description,.ba21-decoration) { display:none !important; }
/* Navigation remains quiet; filled buttons identify primary business actions. */

html body .erp-command header small,html body .erp-quick header small,html body .erp-notification-panel header small { display:none; }
html body .erp-bottom-nav button { border:0; }
/* Overview metrics use a compact data strip rather than oversized tiles. */
html body .ba21-summary { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:16px !important; }
html body .ba21-summary>.erp-ds-card { padding:20px !important; min-height:112px !important; }
html body .ba21-summary>.erp-ds-card>div:first-child { font-size:12px !important; font-weight:500 !important; color:var(--muted-foreground) !important; letter-spacing:0 !important; }
html body .ba21-summary>.erp-ds-card>div:nth-child(2) { font-family:var(--font-body) !important; font-size:28px !important; line-height:36px; font-weight:600 !important; color:var(--foreground) !important; }
html body .ba21-master-detail { display:grid !important; grid-template-columns:minmax(0,1.6fr) minmax(300px,1fr) !important; gap:24px !important; align-items:start; }
html body .ba21-settings-layout { display:grid !important; grid-template-columns:220px minmax(0,1fr) !important; gap:24px !important; }
/* Dashboard */
html body #connected-dashboard { display:grid; gap:24px; }
html body #connected-dashboard .dashboard-welcome { margin:0 !important; }

html body .dashboard-footnote { display:none; }

/* Logistics / inventory */
html body .lg-entry-overview { grid-template-columns:minmax(0,1.65fr) minmax(240px,1fr); gap:24px; }
html body .lg-entry-overview>.lg-card { min-height:0; }

html body .lg-classic-top { grid-template-columns:minmax(230px,.9fr) minmax(240px,1.2fr) minmax(230px,1fr); gap:16px; }
html body .lg-classic-top>.lg-card { min-height:0; }
html body .lg-register-footer { border-top:1px solid var(--border); background:var(--card); padding:16px 0; }
html body .inventory-item-list { overflow:hidden; }

/* Finance / account settings / partner workspace */
html body .finance-summary { gap:16px; margin:24px 0; }
html body .finance-summary strong { font:600 28px/1.3 var(--font-body); }

html body .pm-filters { padding:20px !important; flex-wrap:wrap; gap:12px; }
html body .pm-filters input { flex:1 1 240px; }
html body .pm-pagination { padding:16px 20px; border-top:1px solid var(--border); }
html body :is(.ba21-master-detail,.ba21-settings-layout)>* { min-width:0; }
@media(max-width:1199px) { html body .lg-classic-top { grid-template-columns:repeat(2,minmax(0,1fr)); } html body .lg-classic-top>.lg-card:last-child { grid-column:1/-1; } html body .ba21-master-detail { grid-template-columns:minmax(0,1fr) !important; } html body .ba21-summary { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } html body .lg-entry-overview { grid-template-columns:1fr; } }
@media(max-width:1023px) {   html body .ba21-settings-layout { grid-template-columns:1fr !important; }  }
@media(max-width:767px) {
  :root { --card-padding:16px; --section-gap:16px; }
  html body :is(h1,.erp-ds-page-title) { font-size:23px !important; }
  html body :is(input,select,textarea) { font-size:16px !important; }
  html body :is(.pm-heading,.lg-title,.ba21-page-heading) { align-items:flex-start; gap:12px; margin-bottom:20px !important; }
  html body .ba21-page-heading>div:last-child { flex-wrap:wrap; }
  html body .ba21-summary { gap:12px !important; }
  html body .ba21-summary>.erp-ds-card { padding:16px !important; min-height:100px !important; }
  html body .ba21-summary>.erp-ds-card>div:nth-child(2) { font-size:24px !important; }
  html body .lg-classic-top { grid-template-columns:1fr; }
  html body .pm-filters { padding:16px !important; }
  html body .pm-filters select { flex:1 1 120px; }
  html body .pm-panel { width:100%; max-width:100%; border-radius:16px 16px 0 0; }
  html body .original-dialog :is(.form-grid,.permission-list,.detail-grid) { grid-template-columns:1fr; }
  html body .erp-bottom-nav :is(a,button) { min-height:52px !important; padding:4px !important; border:0; }
  html body .erp-bottom-nav button.is-current { background:var(--muted); color:var(--primary); }
  #original-notice:not(:empty),.erp-toast-region { bottom:calc(84px + env(safe-area-inset-bottom)); }
}
@media(max-width:374px) { html body .ba21-summary { grid-template-columns:1fr !important; } }
@media(prefers-reduced-motion:reduce) { html body button { transition:none; } }
@media print { :is([data-screen-label],[data-erp-shell="true"])>aside,:is([data-screen-label],[data-erp-shell="true"])>main>header,.erp-bottom-nav { display:none !important; } :is([data-screen-label],[data-erp-shell="true"]) { display:block !important; } }
/* Dense document-entry tables use compact controls, rather than full form fields. */

html body #erp-inbound-app .lg-entry-row :is(input,select) { min-height:36px !important; height:36px !important; padding:0 6px !important; font-size:13px !important; line-height:18px !important; }
/* Preserve numeric validation while hiding native increment/decrement controls. */
.lg-entry-row input[type=number]:is([data-key=packagingSpec],[data-key=qty],[data-key=quantity],[data-key=price]) { -moz-appearance:textfield; appearance:textfield; }
.lg-entry-row input[type=number]:is([data-key=packagingSpec],[data-key=qty],[data-key=quantity],[data-key=price])::-webkit-inner-spin-button,
.lg-entry-row input[type=number]:is([data-key=packagingSpec],[data-key=qty],[data-key=quantity],[data-key=price])::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
html body #erp-inbound-app .lg-entry-row button { min-height:32px !important; height:32px !important; min-width:28px; padding:4px !important; font-size:12px !important; line-height:18px !important; white-space:nowrap; }
html body #erp-inbound-app .lg-value-with-unit input { padding-right:32px !important; }
html body #erp-inbound-app .lg-value-with-unit.is-long input { padding-right:44px !important; }
html body #erp-inbound-app .lg-value-with-unit>span { white-space:nowrap; }
html body #erp-inbound-app .lg-item-input { display:flex; align-items:center; gap:6px; min-width:0; }
html body #erp-inbound-app .lg-item-input button { flex:0 0 32px; }
html body .lg-entry-item-panel { border-radius:0 !important; }

html body #erp-inbound-app .lg-register-footer button { white-space:nowrap; }

html body #erp-inbound-app .lg-doc { border-radius:0 !important; }
html body .lg-upload-options { display:grid; gap:12px; margin-top:20px; }
html body .lg-upload-options button { text-align:left; border-radius:var(--radius-md) !important; }
html body .lg-upload-options small { display:block; font-size:12px; color:var(--muted-foreground); margin-top:4px; }

/* Mobile page adapters: preserve readable columns and stack master/detail workspaces. */
html body .ba21-data-scroll>.erp-ds-table-head { min-width:560px; }
html body .ba21-data-scroll>div:has(>div:nth-child(4)) { min-width:560px; }

@media(max-width:767px) {
  html body .ba21-master-detail { grid-template-columns:minmax(0,1fr) !important; gap:20px !important; }
  html body .ba21-master-detail>* { min-width:0 !important; width:100% !important; }
  
  html body .ba21-calendar-days { gap:3px !important; }
  html body .ba21-calendar-day { min-height:68px !important; height:68px !important; padding:4px !important; border-radius:8px !important; overflow:hidden; }
  html body .ba21-calendar-day>div:last-child { margin-top:3px !important; }
  html body .ba21-calendar-day>div:last-child>div { padding:2px !important; }
  html body .cms-table,html body .cms-table tbody,html body .cms-table tr { display:block; width:100%; }
  html body .cms-table thead { display:none; }
  html body .cms-table tr { padding:12px 0; border-bottom:1px solid var(--border); }
  html body .cms-table td { display:grid; grid-template-columns:90px minmax(0,1fr); gap:12px; text-align:right !important; padding:8px 0 !important; border:0; width:100% !important; overflow-wrap:anywhere; }
  html body .cms-table td::before { content:attr(data-label); text-align:left; color:var(--muted-foreground); }
  html body .cms-table td>* { justify-self:end; }
  html body .cms-table td button { padding:0 !important; border:0; background:transparent; min-height:24px !important; text-align:right; }
  html body .cms-filters { gap:10px; }
  html body .cms-filters>* { flex:1 1 120px; min-width:0 !important; }
  html body .cms-filters>input { flex-basis:100%; }
}
/* Readable controls for pages rendered by the connected server. */
html body .cms-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
html body .cms-filters>input { flex:1 1 220px; width:auto !important; }
html body #erp-inbound-app>.lg-card+.lg-card { margin-top:20px; }
html body .ba21-account-item { border-radius:8px !important; padding:12px !important; background:transparent !important; color:var(--foreground) !important; border:1px solid transparent; }
html body .ba21-account-item[style*="background: var(--foreground)"] { background:var(--muted) !important; border-color:var(--border); }
html body .ba21-account-item>* { color:var(--foreground) !important; }
html body .ba21-column-row { min-width:640px; }
@media(max-width:767px) {
 html body .cms-filters>input { flex:1 1 100%; width:100% !important; }
 
 
 
 
 html body .colscroll:has(.ba21-account-item) { max-height:240px !important; }
}
/* Partner portal: same surface hierarchy with its dedicated order navigation. */
html body.partner-login-page { background:var(--background); }
html body .partner-login-shell { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:100dvh; gap:24px; padding:40px 20px; }
html body .partner-login-brand { width:min(100%,440px); padding:0; background:transparent; border:0; color:var(--foreground); }
html body .partner-login-brand>div,html body .partner-feature-list,html body .partner-kicker { display:none; }
html body .partner-brand img { width:88px; }
html body .partner-login-card { width:min(100%,440px); padding:28px; background:var(--card); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow-sm); }
html body #partner-app { background:var(--background); max-width:960px; }
html body .p-header { background:var(--card); padding:20px 24px; }
html body .p-account { padding:14px 24px; background:var(--card); color:var(--muted-foreground); border-bottom:1px solid var(--border); }
html body .p-main { padding:24px 24px calc(168px + env(safe-area-inset-bottom)); }
html body :is(.p-product,.p-history) { background:var(--card); padding:20px; border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow-sm); margin-bottom:12px; }
html body :is(.p-delivery,.p-filter,.p-note) { background:var(--card); padding:20px; border:1px solid var(--border); border-radius:16px; margin-bottom:16px; }
html body .p-list-count { padding:8px 0 16px; border:0; }
html body .p-bottom,html body .p-nav { width:min(100%,960px); }
html body .p-stepper button { min-width:40px; padding:8px !important; border:0; }
html body .p-stepper input { width:54px; padding:8px 4px !important; }
@media(max-width:767px) { html body .p-main { padding-inline:16px; } html body .p-header { padding:16px; } html body .p-product-top h2 { font-size:16px; } }
/* Touch targets and wrapping for the template runtime's div-based controls. */
html body .ba21-compact-control { min-height:36px !important; height:auto !important; white-space:nowrap; flex-shrink:0; border-radius:var(--radius-sm) !important; }
html body .ba21-control-group { display:flex !important; flex-wrap:wrap !important; align-items:center; gap:6px !important; height:auto !important; }
html body .lg-register-footer { left:calc(var(--erp-sidebar-width) + 32px); right:32px; width:auto; padding:16px 20px; }
@media(min-width:768px) and (max-width:1023px) { html body .lg-register-footer { left:calc(var(--erp-sidebar-width) + 20px); right:20px; } }
@media(max-width:767px) {
 html body .ba21-compact-control { min-height:44px !important; }
 html body .lg-register-footer { left:16px; right:16px; bottom:calc(65px + env(safe-area-inset-bottom)); padding:12px 16px; gap:10px; }
 html body .lg-register-footer>.lg-totals { margin-left:auto; gap:12px; }
 html body .lg-register-footer>[data-action=confirm] { width:100%; }
 html body .lg-editor:has(.lg-register-footer) { margin-bottom:240px; }
}
.ba21-today { font-size:13px; color:var(--muted-foreground); font-weight:400; }
/* Panels grow with their data instead of reserving decorative empty space. */

html body .ba21-chart-tab { white-space:nowrap; flex-shrink:0; padding:8px 10px !important; }
html body :has(>.ba21-chart-tab) { flex-wrap:wrap; justify-content:flex-start; }
@media(max-width:767px) {
 html body #erp-inbound-app .cms-filters>input { flex:1 1 100% !important; width:100% !important; min-width:0 !important; }
 html body .ba21-master-detail>.erp-ds-card:first-child>div:first-child:has(.ba21-chart-tab) { flex-wrap:wrap; gap:12px !important; }
}
/* Dashboard: vertical calendar beside the operational work queue. */
html body #connected-dashboard .dashboard-board { display:grid; grid-template-columns:minmax(340px,2fr) minmax(0,3fr); align-items:start; gap:24px; }
html body #connected-dashboard .dashboard-right { display:grid; gap:24px; min-width:0; }
html body #connected-dashboard .dashboard-operations { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }

.dashboard-operation-card { display:flex; flex-direction:column; min-width:0; padding:20px; border:1px solid var(--border); border-radius:var(--radius-xl); background:var(--card); box-shadow:var(--shadow-sm); }
.dashboard-operation-card>header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.dashboard-operation-card>header>span,.dashboard-operation-metrics>div>span,.dashboard-production-count>span { color:var(--muted-foreground); font-size:12px; }
.dashboard-operation-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:24px 0 16px; }
.dashboard-operation-metrics strong,.dashboard-production-count strong { display:block; font-size:28px; line-height:1.3; font-weight:600; font-variant-numeric:tabular-nums; }
.dashboard-operation-metrics strong small,.dashboard-production-count strong small { margin-left:4px; font-size:12px; font-weight:400; color:var(--muted-foreground); }
.dashboard-production-count { display:flex; align-items:baseline; gap:12px; margin:24px 0 16px; }
.dashboard-operation-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--border); color:var(--foreground); text-decoration:none; }
.dashboard-operation-row>div { min-width:0; }
.dashboard-operation-row strong { display:block; font-size:13px; font-weight:500; overflow-wrap:anywhere; }
.dashboard-operation-row small { display:block; margin-top:4px; font-size:11px; color:var(--muted-foreground); }
.dashboard-operation-row>span { flex-shrink:0; padding:4px 6px; font-size:11px; background:var(--muted); border-radius:4px; }
.dashboard-operation-row:hover strong { text-decoration:underline; }
.dashboard-operation-empty { padding:12px 0; margin:0; font-size:12px; line-height:1.7; color:var(--muted-foreground); }
.dashboard-operation-card>footer { display:flex; flex-wrap:wrap; gap:16px; margin-top:auto; padding-top:16px; }
.dashboard-operation-card>footer>a { font-size:12px; color:var(--foreground); text-decoration:none; padding-block:8px; }
@media(max-width:1199px) { html body #connected-dashboard .dashboard-board { grid-template-columns:minmax(0,1fr); }  }
@media(max-width:767px) { html body #connected-dashboard .dashboard-board,html body #connected-dashboard .dashboard-right { gap:20px; } html body #connected-dashboard .dashboard-operations { grid-template-columns:minmax(0,1fr); gap:16px; } }
/* Month arrows flank the label; category tabs occupy the calendar header's right edge. */

html body #connected-dashboard .dashboard-month-switch { display:flex; align-items:center; gap:8px; flex-shrink:0; }
html body #connected-dashboard .dashboard-month-switch>button { min-width:28px; width:28px; min-height:36px !important; height:36px !important; padding:0 !important; background:transparent; }

html body #connected-dashboard .dashboard-month-switch [data-year] { font-size:11px; color:var(--muted-foreground); }

/* White-surface fields follow the reference: outlined, 50px tall, 4px corners. */
html body :is(.erp-ds-card,.lg-card,.production-card,.inventory-item-list,.login-card,.partner-login-card,.p-delivery,.p-filter,.p-note,.p-product,.p-history,dialog,.original-dialog,.pm-panel) {
  --field-background:var(--muted); --field-border:transparent; --field-height:50px;
}
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea) {
  transition:border-color 120ms ease,background-color 120ms ease; caret-color:var(--primary);
}
html body :is(input,select,textarea)::placeholder { color:var(--muted-foreground); opacity:.65; }
html body :is(input,select,textarea):not(:disabled):not([readonly]):hover { background:var(--accent) !important; border-color:transparent !important; }
html body :is(input,select,textarea):not(:disabled):focus {
  border-color:var(--primary) !important; outline:1px solid var(--primary) !important; outline-offset:-1px !important;
}
html body :is(input,select,textarea):disabled { background:var(--card) !important; border-color:var(--border) !important; color:var(--inverse-muted) !important; opacity:1; cursor:not-allowed; }
html body :is(input,select,textarea)[data-state=success][data-state] { border-color:var(--success) !important; outline-color:var(--success) !important; }
html body :is(input,select,textarea)[data-state=warning][data-state] { border-color:var(--warning) !important; outline-color:var(--warning) !important; }
html body :is(input,select,textarea):is([aria-invalid=true],[data-state=error]):is([aria-invalid],[data-state]) { border-color:var(--destructive) !important; outline-color:var(--destructive) !important; }
html body .ba21-field-message { margin:6px 0 0; font-size:12px; line-height:18px; }
html body .ba21-field-message[data-state=success] { color:var(--success); }
html body .ba21-field-message[data-state=warning] { color:var(--warning); }
html body .ba21-field-message[data-state=error] { color:var(--destructive); }
html body :is(.erp-ds-search) { min-height:var(--field-height,44px); border:1px solid var(--field-border,transparent) !important; border-radius:var(--radius-sm) !important; background:var(--field-background,var(--muted)) !important; }
html body :is(.erp-ds-search):hover { background:var(--accent) !important; border-color:transparent !important; }
html body :is(.erp-ds-search):focus-within { border-color:var(--primary) !important; outline:1px solid var(--primary) !important; outline-offset:-1px !important; }
html body :is(.erp-ds-search) input:focus { outline:none !important; }

/* Calendar agenda uses the shared data-table structure. */

html body #connected-dashboard .dashboard-schedule-table { min-width:360px; }
html body #connected-dashboard .dashboard-data-table :is(th,td) { padding:12px 8px !important; vertical-align:middle; }
html body #connected-dashboard .dashboard-data-table th { white-space:nowrap; font-size:12px !important; }
html body #connected-dashboard .dashboard-data-table td:first-child { white-space:nowrap; font-size:11px !important; font-variant-numeric:tabular-nums; }
html body #connected-dashboard .dashboard-schedule-table td:nth-child(3) { width:100%; min-width:90px; overflow-wrap:anywhere; }
html body #connected-dashboard .dashboard-data-table a { color:var(--foreground); text-decoration:none; font-weight:500; }
html body #connected-dashboard .dashboard-data-table a:hover { text-decoration:underline; }
.dashboard-schedule-tag { display:inline-block; white-space:nowrap; padding:3px 6px; border-radius:4px; background:var(--muted); font-size:11px; }
.dashboard-avatar-group { display:flex; align-items:center; width:max-content; padding-left:4px; }
.dashboard-avatar { display:inline-flex; flex-shrink:0; align-items:center; justify-content:center; width:24px; height:24px; margin-left:-4px; border:2px solid var(--card); border-radius:50%; background:var(--secondary); color:var(--foreground); font-size:9px; font-weight:500; }
.dashboard-avatar-more { background:var(--primary); color:var(--primary-foreground); }
.dashboard-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
/* Tables meet the card edges; spacing belongs to headings, filters and cells. */
html body :is(.erp-ds-card,.lg-card,.production-card):has(table,.ba21-data-scroll,.erp-ds-table-head) { padding:0 !important; overflow:hidden; }
html body :is(.erp-ds-card,.lg-card,.production-card):has(table,.ba21-data-scroll,.erp-ds-table-head)>:not(table):not(.ba21-data-scroll):not(.erp-ds-table-head):not(:has(table,.ba21-data-scroll,.erp-ds-table-head)) { margin:0 !important; padding:var(--card-padding) !important; }
html body :is(.erp-ds-card,.lg-card,.production-card) :is(div,section):has(table,.ba21-data-scroll,.erp-ds-table-head) { padding:0 !important; margin:0 !important; min-width:0; }
html body :is(.erp-ds-card,.lg-card,.production-card) :is(table,.ba21-data-scroll) { margin:0 !important; border-radius:0 !important; }
html body .erp-ds-table-head { border-radius:0 !important; }
/* The calendar remains inset; its table reaches all three lower card edges. */

html body :is(.dashboard-approvals) { padding:0 !important; overflow:hidden; }
html body :is(.dashboard-approval-head) { padding:var(--card-padding); margin:0; }
html body .dashboard-document-head { border-radius:0; padding-inline:16px; }
/* Full-width table backgrounds, with content aligned to the card heading. */
html body table tr>:is(th,td):first-child,
html body #connected-dashboard .dashboard-data-table tr>:is(th,td):first-child { padding-left:var(--card-padding) !important; }
html body table tr>:is(th,td):last-child,
html body #connected-dashboard .dashboard-data-table tr>:is(th,td):last-child { padding-right:var(--card-padding) !important; }
html body :is(.erp-ds-table-head,.ba21-column-row,.dashboard-document-head,.dashboard-document),
html body .ba21-data-scroll>[role=row] { padding-inline:var(--card-padding) !important; }
/* Dashboard cards share one header inset and edge-to-edge data region. */
html body #connected-dashboard :is(.dashboard-approvals) { padding:0 !important; }
html body #connected-dashboard :is(.dashboard-approval-head) { padding:var(--card-padding) !important; margin:0 !important; }

html body #connected-dashboard .dashboard-approval-head p { margin:8px 0 0; }

/* Calendar year and month share one line. */

html body #connected-dashboard .dashboard-month-switch [data-year] { order:-1; }
/* Every table card reserves a consistent footer for pagination. */
html body :is(.inventory-pagination,.pm-pagination,.pager,.lg-pages) {
  min-height:76px; padding:16px var(--card-padding) !important; margin:0 !important;
  align-items:center; border-top:1px solid var(--border); background:var(--card);
}
html body #connected-dashboard :is(.dashboard-approvals)::after {
  content:""; display:block; flex-shrink:0; height:76px; width:100%;
  border-top:1px solid var(--border); background:var(--card);
}
/* Nested table cards own their footer instead of duplicating it on the parent. */
html body :is(.erp-ds-card,.lg-card,.production-card):has(:is(.erp-ds-card,.lg-card,.production-card) table)::after { display:none; }

@media(max-width:767px) {
 html body :is(.inventory-pagination,.pm-pagination,.pager,.lg-pages) { min-height:68px; padding-block:12px !important; }
 html body #connected-dashboard :is(.dashboard-approvals)::after { height:68px; }
}

html body #connected-dashboard .dashboard-table-scroll { overflow-x:auto; }
html body #connected-dashboard .dashboard-approval-table td:nth-child(2) { width:100%; overflow-wrap:anywhere; }
html body #connected-dashboard .dashboard-approval-table :is(td,th):last-child { white-space:nowrap; }
.dashboard-requester { display:block; margin-top:4px; color:var(--muted-foreground); font-size:11px; }
/* Paired vertical work cards: cooperation left, approvals right. */

/* Cooperation shares the schedule/approval table and pagination footer. */

html body #connected-dashboard .dashboard-cooperation-table td:nth-child(2) { width:100%; overflow-wrap:anywhere; }
html body #connected-dashboard .dashboard-cooperation-table :is(td,th):last-child { white-space:nowrap; }

/* Shared card header: 40px content row plus the common card inset. */
html body #connected-dashboard :is(.dashboard-approval-head) {
  display:flex; flex-direction:row; align-items:center; justify-content:space-between;
  min-height:calc(40px + 2 * var(--card-padding)); gap:12px;
}

/* Month title and category tabs share the card header; arrows flank the calendar. */

html body #connected-dashboard .dashboard-month-heading { white-space:nowrap; font:600 17px/1.5 var(--font-display); }

html body #connected-dashboard .dashboard-calendar-prev { left:6px; }
html body #connected-dashboard .dashboard-calendar-next { right:6px; }
/* Six fixed weeks, including adjacent-month dates. */

/* Inventory adapters use the same card, field and table tokens. */

html body .inventory-page .inventory-metrics>div:first-child { background:var(--muted) !important; color:var(--foreground); }
html body .inventory-page .inventory-metrics>div:first-child :is(div,span) { color:var(--foreground) !important; font-family:var(--font-body) !important; }
html body .inventory-page .inventory-empty-icon { display:none; }
html body .inventory-page .inventory-empty { padding:var(--card-padding) !important; }
html body .inventory-page .inventory-form-dialog { --field-background:var(--muted); --field-border:transparent; --field-height:50px; }
html body .inventory-page .inventory-warehouse-filter { min-height:50px !important; height:50px !important; border-radius:var(--radius-sm) !important; }

.inventory-tax-tag { display:inline-block; padding:3px 6px; border-radius:4px; background:var(--muted); color:var(--muted-foreground); font-size:11px; }
/* Inventory overview: code, name, weight and warehouses with current stock. */

/* Inventory master/detail workspace: list 60%, detail 40% on wide screens. */
html body .inventory-page .inventory-workspace { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--section-gap); align-items:start; min-width:0; }
html body .inventory-page .inventory-workspace>section { min-width:0; margin:0; }
@media(min-width:1200px) {
 html body .inventory-page .inventory-workspace { grid-template-columns:minmax(0,3fr) minmax(0,2fr); }
 html body .inventory-page .inventory-workspace .inventory-empty { min-height:300px; display:flex; flex-direction:column; justify-content:center; }
 
}

/* Inventory card/table typography and header alignment follow the common standard. */

/* Standard data rows match the inventory detail's 60px rhythm. */
html body table tbody tr { height:var(--table-row-height) !important; }

html body .ba21-data-scroll>[role=row] { min-height:var(--table-row-height) !important; }
/* Inbound registration follows the shared card/table standard. */
html body #erp-inbound-app .lg-card h2 { font:600 17px/1.5 var(--font-display); letter-spacing:-.02em; }
/* Non-dashboard cards reserve one control-height row for every header.
   Titles therefore stay aligned whether the header has actions or not. */
html body :is(.erp-ds-card,.lg-card,.production-card)>
  :is(header,.lg-heading):not(#connected-dashboard *) {
  min-height:44px;
  align-items:center;
}
html body #erp-inbound-app .lg-card>.lg-heading { min-height:44px; align-items:center; }

html body #erp-inbound-app .lg-register-footer { padding:16px var(--card-padding) !important; }
@media(max-width:767px) {
 html body #erp-inbound-app .lg-register-footer { padding:12px var(--card-padding) !important; }
}

/* Stacked entry forms must grow with their controls instead of keeping a table-row height. */

/* Finance workspace uses shared surface, field, typography and spacing tokens. */
html body #finance-workspace { min-width:0; }
html body #finance-workspace .finance-summary { grid-template-columns:repeat(4,minmax(0,1fr)); margin:0 0 var(--section-gap); }
html body #finance-workspace .finance-summary strong { margin-top:12px; font-variant-numeric:tabular-nums; }

html body #finance-workspace .finance-amount { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
html body #finance-workspace .finance-status { font-size:12px; color:var(--muted-foreground); }
html body #finance-workspace .finance-edit-cell { min-width:220px; }
html body #finance-workspace .finance-edit-cell :is(input,select) { width:100%; min-height:36px !important; padding:6px 10px !important; margin:3px 0; font-size:12px !important; }
html body #finance-workspace .finance-edit-cell button { min-height:32px !important; padding:4px 10px !important; margin:4px 6px 0 0; font-size:12px !important; }
html body #finance-workspace .finance-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:280px; padding:48px 24px !important; }
html body #finance-workspace .finance-empty h2 { color:var(--foreground); font-size:16px; }
html body #finance-workspace .finance-empty p { max-width:400px; line-height:1.7; margin:10px 0 0; }
html body #finance-workspace .finance-error:empty { display:none; }
html body #finance-workspace .finance-error:not(:empty) { margin:0; padding:12px var(--card-padding); }

html body #finance-workspace .finance-footnote { margin:16px 0 0; font-size:12px; line-height:1.6; }

@media(max-width:640px) {
 html body #finance-workspace .finance-summary { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px !important; }
 
 
 
 
}

html body #finance-workspace [hidden] { display:none !important; }
html body .finance-section-tabs { display:flex; gap:8px; margin-bottom:24px; }
html body .finance-section-tabs button[aria-pressed=true] { background:var(--primary); color:var(--primary-foreground); }
html body .debt-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,3fr); gap:var(--section-gap); align-items:start; }

html body .debt-detail { display:grid; gap:var(--section-gap); min-width:0; }
html body .debt-scroll { overflow:auto; }
html body .debt-money { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
html body .debt-selected td { background:var(--secondary); }
html body .debt-partners button { background:transparent; border:0; padding:0 !important; text-align:left; }
html body .debt-partners td { font-size:12px; }

html body .debt-code { display:block; color:var(--muted-foreground); margin-top:4px; }
@media(max-width:1000px){html body .debt-layout { grid-template-columns:1fr; }}

html body #finance-workspace .finance-summary:has(>.erp-card:nth-child(3):last-child) { grid-template-columns:repeat(3,minmax(0,1fr)); }
html body #finance-workspace .finance-section-tabs button[aria-pressed=true] { background:var(--primary) !important; color:var(--primary-foreground) !important; }

html body #finance-workspace .debt-partners button { border:0 !important; background:transparent !important; }
@media(max-width:640px){html body #finance-workspace .finance-summary:has(>.erp-card:nth-child(3):last-child) { grid-template-columns:1fr; }}
html body .inventory-page .inventory-filters{align-items:end}
html body table tr>:is(th,td):last-child:not(:first-child) { padding-right:var(--card-padding) !important; }
/* Inventory item list: even column spacing, warehouse column no longer glued to the weight column. */

/* Pagination: one centered design for every table footer. */
html body :is(.inventory-pagination,.pm-pagination,.lg-pages,.pager) { display:flex !important; justify-content:center !important; align-items:center !important; gap:6px !important; }
html body .inventory-pagination nav { display:flex; align-items:center; justify-content:center; gap:6px; }
html body :is(.inventory-pagination,.pm-pagination,.lg-pages,.pager) button { display:inline-flex !important; align-items:center; justify-content:center; min-width:36px !important; width:auto !important; height:36px !important; min-height:36px !important; padding:0 12px !important; border:1px solid var(--border) !important; border-radius:var(--radius-sm) !important; background:var(--card) !important; color:var(--foreground) !important; font-size:13px !important; font-weight:500 !important; line-height:1 !important; cursor:pointer; }
html body :is(.inventory-pagination,.pm-pagination,.lg-pages,.pager) button:hover:not(:disabled) { background:var(--muted) !important; }
html body :is(.inventory-pagination,.pm-pagination,.lg-pages,.pager) button[aria-current=page] { background:var(--primary) !important; border-color:var(--primary) !important; color:var(--card) !important; }
html body :is(.inventory-pagination,.pm-pagination,.lg-pages,.pager) button:disabled { opacity:.4; cursor:default; }
html body :is(.pm-pagination,.lg-pages,.pager) > span { min-width:64px; padding:0 8px; text-align:center; font-size:13px; color:var(--muted-foreground); font-variant-numeric:tabular-nums; }

html body .inventory-page .inventory-check-cell { display:flex; align-items:center; font-weight:400; }
html body .inventory-page .inventory-check { display:inline-block; width:16px; height:16px; border:1.5px solid var(--border); border-radius:4px; background:var(--card); cursor:pointer; position:relative; flex:none; }
html body .inventory-page .inventory-check[aria-checked=true] { background:var(--primary); border-color:var(--primary); }
html body .inventory-page .inventory-check[aria-checked=true]::after { content:""; position:absolute; left:4px; top:1px; width:4px; height:8px; border:solid var(--card); border-width:0 2px 2px 0; transform:rotate(45deg); }
html body .inventory-page .inventory-check:focus-visible { outline:2px solid var(--ring); outline-offset:2px; }

/* Inventory list: left-aligned names, sortable headers, narrow screens drop code/stock/warehouse. */

/* Inventory list header rule, and narrow-screen layout for list and detail cards. */

@media (max-width:768px) {
  
  
  html body .inventory-page .inventory-check-cell { display:flex; align-items:center; font-weight:400; width:28px; }
  
  
  
}

/* Desktop item list: one shared set of column tracks sized to the widest cell, so every row stays on one line. */

/* Standard card header: the card itself has no padding; the header carries the card padding and the body is inset below it. */
html body #erp-inbound-app :is(.lg-entry-date-card,.lg-entry-info-card) { padding:0 !important; }

html body #erp-inbound-app :is(.lg-entry-date-card,.lg-entry-info-card)>:last-child { margin-bottom:var(--card-padding); }

/* UNIFIED CARD HEADER: add class "erp-card-header" to the header row of any card (never on dashboard cards)
   One 44px content row inside the card padding: title (17px) on the left, actions on the right. */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) { box-sizing:border-box; display:flex; align-items:center; justify-content:flex-start; gap:16px; flex-wrap:nowrap; height:auto; margin:0 !important; padding:var(--card-padding) !important; min-height:calc(44px + 2 * var(--card-padding)) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(h1,h2,h3) { margin:0; font:600 17px/1.5 var(--font-display); letter-spacing:-.02em; white-space:nowrap; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>div:first-child:not([class]) { display:flex; align-items:center; align-content:center; gap:10px; min-width:0; flex-wrap:wrap; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) p { margin:0; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>:first-child { margin-right:auto; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>*:not([hidden]) { min-height:44px; display:flex; align-items:center; align-content:center; box-sizing:border-box; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>div:first-child:not([class]) { align-items:center; align-content:center; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tabs *) { box-sizing:border-box; height:44px !important; min-height:44px !important; max-height:44px !important; line-height:1.2; }

/* Header elements. Buttons: normal / primary / danger / disabled. */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *) { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:0 12px !important; border:1px solid transparent !important; border-radius:var(--radius-pill) !important; background:var(--muted) !important; color:var(--foreground) !important; font:600 13px/1 var(--font-body) !important; white-space:nowrap; cursor:pointer; box-shadow:none !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *):hover:not(:disabled):not([aria-disabled=true]) { background:var(--accent) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *):is(.primary,.pm-primary,.lg-primary,.recipe-primary,.erp-btn-primary) { background:var(--primary) !important; border-color:var(--primary) !important; color:var(--primary-foreground) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *):is(.primary,.pm-primary,.lg-primary,.recipe-primary,.erp-btn-primary):hover:not(:disabled):not([aria-disabled=true]) { background:var(--primary-hover) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *):is(.danger,.erp-btn-danger,[data-delete]) { background:var(--destructive-solid) !important; border-color:var(--destructive-solid) !important; color:var(--primary-foreground) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *):is(.danger,.erp-btn-danger,[data-delete]):hover:not(:disabled):not([aria-disabled=true]) { background:var(--destructive-solid-hover) !important; border-color:var(--destructive-solid-hover) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *):is(:disabled,[aria-disabled=true]) { opacity:1; background:var(--card) !important; border-color:var(--disabled) !important; color:var(--disabled) !important; cursor:not-allowed; }
/* Secondary label (row count): sits right next to the title, e.g. "총 0건". */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) .erp-card-count { color:var(--muted-foreground); font:400 13px/1.5 var(--font-body); white-space:nowrap; padding:0; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>:first-child:has(+.erp-card-count) { margin-right:0; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>.erp-card-count { margin-right:auto; }
/* Badge */
.erp-badge,html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(.erp-badge,.production-storage-badge,.pm-badge) { display:inline-flex; align-items:center; padding:4px 10px; border-radius:var(--radius-md); background:var(--muted); color:var(--muted-foreground); font-size:12px; font-weight:600; line-height:1.4; white-space:nowrap; }
/* Sorting tabs: same height as buttons, pressed tab is filled like the order list tabs. */
/* Tabs: outline buttons joined into one group (shared 1px borders, only the outer corners rounded). Selected tab is filled. */
.erp-tabs { display:inline-flex; flex-wrap:nowrap; align-items:stretch; isolation:isolate; height:44px; }
.erp-tabs small { margin-left:6px; }
.erp-tabs:not(:last-child) { margin-right:0; }
.erp-tabs :is(button,.erp-tab) { position:relative; display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; height:100% !important; min-height:0 !important; margin:0; padding:0 14px; border:1px solid transparent; border-radius:0 !important; background:var(--muted); color:var(--primary); font:600 13px/1 var(--font-body); font-weight:600 !important; white-space:nowrap; cursor:pointer; }
.erp-tabs :is(button,.erp-tab)+:is(button,.erp-tab) { margin-left:0; box-shadow:inset 1px 0 0 var(--card); }
.erp-tabs :is(button,.erp-tab):first-child { border-top-left-radius:var(--radius-pill) !important; border-bottom-left-radius:var(--radius-pill) !important; }
.erp-tabs :is(button,.erp-tab):last-child { border-top-right-radius:var(--radius-pill) !important; border-bottom-right-radius:var(--radius-pill) !important; }
.erp-tabs :is(button,.erp-tab):hover:not(:disabled):not([aria-pressed=true]):not([aria-selected=true]):not(.is-active) { background:var(--accent); border-color:transparent; }
.erp-tabs :is(button,.erp-tab):focus-visible { z-index:2; }
.erp-tabs :is(button,.erp-tab):is([aria-pressed=true],[aria-selected=true],.is-active) { z-index:1; background:var(--primary); border-color:var(--primary); color:var(--primary-foreground); }

@media(max-width:720px) {
  html body .erp-card-header.erp-card-header:not(#connected-dashboard *) { flex-wrap:wrap; }
}

/* Select: custom chevron so it sits 12px from the right edge instead of touching it. */
html body select:not([multiple]):not([size]) { -webkit-appearance:none; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23111111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important; background-repeat:no-repeat !important; background-position:right 12px center !important; background-size:16px 16px !important; padding-right:36px !important; }
html body select:not([multiple]):not([size]):disabled { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23757575' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important; }

/* Dropdown list: where the browser supports customizable selects, the open list is styled (black hover row, white text). Other browsers keep the system list. */
@supports (appearance: base-select) {
  html body select:not([multiple]):not([size]), html body select:not([multiple]):not([size])::picker(select) { appearance:base-select; }
  html body select:not([multiple]):not([size]) { background-image:none !important; padding-right:12px !important; align-items:center; justify-content:space-between; }
  html body select:not([multiple]):not([size])::picker-icon { content:''; width:16px; height:16px; flex:none; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23111111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") center/16px 16px no-repeat; transition:none; }
  html body select:not([multiple]):not([size]):disabled::picker-icon { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23757575' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); }
  html body select:not([multiple]):not([size])::picker(select) { box-sizing:border-box; margin-top:4px; padding:4px; border:1px solid var(--input); border-radius:var(--radius-sm); background:var(--card); box-shadow:var(--shadow-popover); }
  html body select:not([multiple]):not([size]) option { display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:2px; background:transparent; color:var(--foreground); font-size:14px; line-height:22px; cursor:pointer; }
  html body select:not([multiple]):not([size]) option:is(:hover,:focus-visible,:active) { background:var(--primary); color:var(--primary-foreground); }
  html body select:not([multiple]):not([size]) option:checked { font-weight:600; }
  html body select:not([multiple]):not([size]) option:disabled { color:var(--inverse-muted); cursor:not-allowed; }
  html body select:not([multiple]):not([size]) option:disabled:hover { background:transparent; color:var(--inverse-muted); }
}

/* Header button icons: the name comes from data-icon (set automatically from the label by erp-shell.js). */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon]:not([data-icon=none])::before { content:""; flex:none; width:16px; height:16px; background-color:currentColor; -webkit-mask:var(--btn-icon) center/16px 16px no-repeat; mask:var(--btn-icon) center/16px 16px no-repeat; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=plus] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M5%2012h14M12%205v14%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=trash] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M3%206h18M19%206l-1%2014a2%202%200%200%201-2%202H8a2%202%200%200%201-2-2L5%206M8%206V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2M10%2011v6M14%2011v6%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=pencil] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M17%203a2.85%202.83%200%201%201%204%204L7.5%2020.5%202%2022l1.5-5.5Z%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=download] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M21%2015v4a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-4M7%2010l5%205%205-5M12%2015V3%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=upload] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M21%2015v4a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-4M17%208l-5-5-5%205M12%203v12%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=printer] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M6%209V2h12v7M6%2018H4a2%202%200%200%201-2-2v-5a2%202%200%200%201%202-2h16a2%202%200%200%201%202%202v5a2%202%200%200%201-2%202h-2M6%2014h12v8H6z%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=check] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M20%206%209%2017l-5-5%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=search] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle%20cx%3D%2711%27%20cy%3D%2711%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27m21%2021-4.3-4.3%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=refresh] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M3%2012a9%209%200%200%201%209-9%209.75%209.75%200%200%201%206.74%202.74L21%208M21%203v5h-5M21%2012a9%209%200%200%201-9%209%209.75%209.75%200%200%201-6.74-2.74L3%2016M8%2016H3v5%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=send] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27m22%202-7%2020-4-9-9-4Z%27%2F%3E%3Cpath%20d%3D%27M22%202%2011%2013%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=key] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle%20cx%3D%277.5%27%20cy%3D%2715.5%27%20r%3D%275.5%27%2F%3E%3Cpath%20d%3D%27m21%202-9.6%209.6M15.5%207.5l3%203L22%207l-3-3%27%2F%3E%3C/svg%3E"); }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=x] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath%20d%3D%27M18%206%206%2018M6%206l12%2012%27%2F%3E%3C/svg%3E"); }

/* Card sorting area (search + filters) under the card header: card padding on every side, default 44px controls. */
.erp-card-sorting { box-sizing:border-box; display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0; padding:var(--card-padding); }
html body .erp-card-sorting.erp-card-sorting:not(#connected-dashboard *) { padding:var(--card-padding) !important; }
.erp-card-sorting > :is(.erp-ds-search,input) { flex:1 1 240px !important; min-width:0; }
.erp-card-sorting > select { flex:0 1 140px; width:140px; }
html body .erp-card-sorting :is(input:not([type=checkbox]):not([type=radio]),select,.erp-ds-search) { box-sizing:border-box; height:44px !important; min-height:44px !important; max-height:44px !important; }
html body .erp-card-sorting :is(input:not([type=checkbox]):not([type=radio]),select) { padding-block:0 !important; padding-inline:16px !important; font-size:14px !important; line-height:normal !important; }
html body .erp-card-sorting select { padding-inline:16px 12px !important; }
html body .erp-card-sorting .erp-ds-search { padding:0 16px !important; }
html body .erp-card-sorting .erp-ds-search input:not([type=checkbox]):not([type=radio]) { height:100% !important; min-height:0 !important; padding:0 !important; border:0 !important; }
@media(max-width:600px) { .erp-card-sorting > .erp-ds-search { flex-basis:100%; } .erp-card-sorting > select { flex:1 1 90px; width:0; } }

/* Collapsible sorting row: header "filter" button (with applied-filter count) opens / closes it. */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[data-icon=filter] { --btn-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon%20points%3D%2722%203%202%203%2010%2012.46%2010%2019%2014%2021%2014%2012.46%2022%203%27%2F%3E%3C/svg%3E"); }
.erp-card-sorting[hidden] { display:none; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button])[aria-expanded=true]:not(:disabled) { background:var(--accent) !important; }
.erp-filter-count { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--brand-secondary); color:var(--brand-secondary-foreground); font-size:11px; font-weight:600; line-height:1; }
.erp-filter-count[hidden] { display:none; }
/* Buttons inside the sorting row (e.g. reset) look like the header's normal button. */
html body .erp-card-sorting button { box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; height:44px; min-height:44px; padding:0 12px; border:1px solid transparent; border-radius:var(--radius-pill) !important; background:var(--muted); color:var(--foreground); font:600 13px/1 var(--font-body); white-space:nowrap; cursor:pointer; }
html body .erp-card-sorting button:hover { background:var(--accent); }
html body .erp-card-sorting button[hidden] { display:none; }

/* Filter toggle: a light "view setting" button (not an action). Light border, black on hover, gray when open, black border + count when filters are applied. */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *).erp-filter-toggle { margin-left:6px; border-color:var(--border) !important; height:36px !important; min-height:36px !important; max-height:36px !important; padding:0 10px !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *).erp-filter-toggle:hover:not(:disabled) { border-color:var(--primary) !important; background:var(--card) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *).erp-filter-toggle[aria-expanded=true]:not(:disabled) { background:var(--accent) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *).erp-filter-toggle[data-active=true] { border-color:var(--primary) !important; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *).erp-filter-toggle::after { content:""; flex:none; width:16px; height:16px; background-color:currentColor; -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/16px 16px no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/16px 16px no-repeat; transition:transform 120ms ease; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(button,[role=button]):not(.erp-tab):not(.erp-tabs *).erp-filter-toggle[aria-expanded=true]::after { transform:rotate(180deg); }

/* Card table: a 1px line on top of the table separates it from the header / sorting area above (not drawn when the table is the first thing in the card). */

/* Dashboard keeps its own table header look (the shared table-head tokens do not apply here). */
html body #connected-dashboard :is(th,[role=columnheader]) { background:var(--muted) !important; color:var(--muted-foreground) !important; border-top:0 !important; border-bottom:1px solid var(--border) !important; }

/* Cards have no outline: the white surface against the page background is enough. Dashboard widgets keep theirs. */
html body :is(.erp-ds-card,.lg-card,.production-card,.inventory-item-list,.cms-metrics>div):not(#connected-dashboard *) { border:0 !important; }

/* Tables have no lines. The table itself is inset 24px from the card's left and right edges, so row backgrounds (selected, hover) never touch the card edge. Dashboard tables are left alone. */
html body table:not(#connected-dashboard *):not(#connected-dashboard *) :is(thead,tbody,tfoot,tr,th,td) { border:0 !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *):not(.erp-card-table>table) { box-sizing:border-box; margin-left:24px !important; margin-right:24px !important; width:calc(100% - 48px) !important; }
/* Tables inside a scrolling wrapper: the wrapper carries the 24px so it stays after horizontal scrolling. */
html body .erp-card-table:has(>table):not(#connected-dashboard *):not(#connected-dashboard *) { box-sizing:border-box; padding-left:24px !important; padding-right:24px !important; }
html body .ba21-data-scroll:not(#connected-dashboard *):not(#connected-dashboard *)>:is(div,[role=row]),
html body :is(.erp-ds-table-head,.ba21-column-row,.inventory-column-head,.production-row,.production-material-row):not(#connected-dashboard *):not(#connected-dashboard *) { box-sizing:border-box; border-top:0 !important; border-bottom:0 !important; margin-left:24px !important; margin-right:24px !important; width:calc(100% - 48px) !important; min-width:0; }
.erp-card-table { overflow-x:auto; }

/* Tables use the card radius so row backgrounds (selected, hover) round off with the card. */
html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *) { border-radius:var(--radius-xl); }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) { border-collapse:separate; border-spacing:0; border-radius:var(--radius-xl) !important; overflow:hidden; }

/* Table footer (div-based tables): lives inside .erp-card-table as its last child, same surface as the table header. For a <table> the footer is its <tfoot> row instead. Pagination is only ever placed in a table footer. */
html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *)>.erp-table-footer { box-sizing:border-box; min-height:68px; padding:12px 24px !important; margin:0 24px !important; border:0 !important; border-radius:0 !important; background:var(--table-foot) !important; display:flex; align-items:center; justify-content:center; gap:8px; }

/* Row separator: a thin line in --table-line between body rows (none under the last row). */
html body table:not(#connected-dashboard *):not(#connected-dashboard *) tbody tr:not(:last-child)>:is(td,th) { border-bottom:1px solid var(--table-line) !important; }
html body .ba21-data-scroll:not(#connected-dashboard *):not(#connected-dashboard *)>:is(div,[role=row]):not(.erp-ds-table-head):not(:last-child),
html body :is(.production-row,.production-material-row):not(#connected-dashboard *):not(#connected-dashboard *):not(:last-child) { border-bottom:1px solid var(--table-line) !important; }
html body .erp-table-footer :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) { min-height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important; width:auto; }

/* Table footer row (<tfoot>): same cell layout as the .erp-table-footer bar. */
html body table:not(#connected-dashboard *):not(#connected-dashboard *) tfoot tr[data-table-footer] td { box-sizing:border-box; height:68px !important; padding:12px 24px !important; background:var(--table-foot) !important; text-align:center; vertical-align:middle; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) tfoot tr[data-table-footer]:not([data-footer-keep]) td:empty { padding:0 !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) tfoot tr[data-table-footer] { height:68px !important; }
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) { min-height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important; width:auto; justify-content:center; }

/* Table card: 24px above and below the table as well (sides come from the rules above). */
html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *) { box-sizing:border-box; padding-top:24px !important; padding-bottom:24px !important; }

/* Body rows sit on --table-row (page background). Low specificity on purpose so hover and selected styles still win. */
html body :where(table:not(#connected-dashboard *)) tbody tr { background:var(--table-row); }
html body :where(.ba21-data-scroll:not(#connected-dashboard *))>:is(div,[role=row]):not(.erp-ds-table-head) { background:var(--table-row); }

/* Space between header buttons is 16px, also when they are grouped in a wrapper (tabs stay joined). */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) :is(div,span,nav):has(>button~button):not(.erp-tabs) { gap:16px !important; }

/* ERP CARD: one container. Its direct sections are .erp-card-header, .erp-card-sorting and .erp-card-table (the table footer lives inside the table). The card itself has no padding; each section brings its own 24px. Other content blocks get the 24px card padding. */
html body .erp-card:not(#connected-dashboard *):not(#connected-dashboard *) { box-sizing:border-box; display:flex; flex-direction:column; gap:var(--card-padding); min-width:0; margin:0; padding:var(--card-padding) 0 !important; border:0 !important; border-radius:var(--radius-xl) !important; background:var(--card); box-shadow:var(--shadow-sm) !important; overflow:hidden; }
html body .erp-card:not(#connected-dashboard *):not(#connected-dashboard *)>:not(.erp-card-header):not(.erp-card-sorting):not(.erp-card-table):not(.erp-table-footer):not(table) { box-sizing:border-box; margin:0; padding:0 var(--card-padding); }

/* Cards stacked on one page keep a 16px gap (the card rule resets margins to 0). */
html body .pm-workspace>.erp-card:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { margin-top:16px !important; }

/* The table footer is optional: an empty one takes no space. */
html body .erp-table-footer:empty:not([data-footer-keep]), html body table tfoot tr[data-table-footer]:not([data-footer-keep]):has(>td:empty) { display:none !important; }

/* CARD SPACING: the card owns the vertical rhythm (padding on top/bottom + a gap between sections). Sections only carry their 24px sides. */
html body .erp-card:not(#connected-dashboard *):not(#connected-dashboard *)>.erp-card-header.erp-card-header:not(#connected-dashboard *) { padding:0 var(--card-padding) !important; min-height:44px !important; }
html body .erp-card:not(#connected-dashboard *):not(#connected-dashboard *)>.erp-card-sorting:not(#connected-dashboard *):not(#connected-dashboard *) { padding:0 var(--card-padding) !important; }
html body .erp-card:not(#connected-dashboard *):not(#connected-dashboard *)>.erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { padding-top:0 !important; padding-bottom:0 !important; }

/* DASHBOARD CALENDAR: round outlined days, hatched days of other months, lime selected day. Tabs and month arrows keep their existing look. */
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-week { color:var(--foreground); font-size:12px; font-weight:500; margin-bottom:8px; }
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-days { gap:4px !important; margin-top:0; }
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-days button { box-sizing:border-box; width:100% !important; max-width:40px; height:auto !important; min-height:0 !important; aspect-ratio:1 / 1; margin-inline:auto; padding:0 !important; border:1px solid var(--border) !important; border-radius:50% !important; background:var(--card) !important; color:var(--foreground); font-size:12px !important; font-weight:500; opacity:1 !important; }
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-days button:hover { border-color:var(--primary) !important; }
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-days button.is-holiday { color:var(--destructive); }
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-days button.is-outside { border-color:var(--border) !important; color:var(--muted-foreground); background:repeating-linear-gradient(135deg, var(--accent) 0 2px, var(--card) 2px 6px) !important; }
html body #connected-dashboard .dashboard-widget-schedule .dashboard-calendar-days button.is-selected { background:var(--brand-secondary) !important; border-color:var(--brand-secondary) !important; color:var(--brand-secondary-foreground); font-weight:700 !important; }

/* Inventory item list follows the table standard: header = --table-head with --table-head-fg text, rows on --table-row with --table-line separators, rounded 16px at the top (header) and bottom (last row / footer). */

html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *)>.erp-table-footer { border-radius:0 0 var(--radius-xl) var(--radius-xl) !important; }

/* Table footer buttons (pagination): 36px pills. Normal = white with a light outline, hover = grey + dark outline, current page = primary fill, disabled = --disabled colors. */
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) { gap:8px !important; }
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) button { box-sizing:border-box; min-width:36px !important; height:36px !important; min-height:36px !important; padding:0 14px !important; border:1px solid var(--input) !important; border-radius:var(--radius-pill) !important; background:var(--card) !important; color:var(--foreground) !important; font:600 13px/1 var(--font-body) !important; opacity:1 !important; }
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) button:hover:not(:disabled):not([aria-current=page]) { background:var(--accent) !important; border-color:var(--primary) !important; }
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) button[aria-current=page] { background:var(--primary) !important; border-color:var(--primary) !important; color:var(--primary-foreground) !important; }
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager) button:disabled { border-color:var(--border) !important; color:var(--disabled) !important; cursor:not-allowed; }
html body :is(td,.erp-table-footer) :is(.pm-pagination,.inventory-pagination,.lg-pages,.pager)>span { font:600 13px/1 var(--font-body); color:var(--muted-foreground); min-width:48px; text-align:center; }

/* Fields are fully rounded like buttons (textarea keeps a soft 16px corner so multi-line text is not clipped). */
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]),select:not([multiple]):not([size])):not(.erp-ds-search *) { border-radius:var(--radius-pill) !important; padding-left:20px !important; }
html body .erp-ds-search.erp-ds-search, html body .erp-card-sorting .erp-ds-search.erp-ds-search { border-radius:var(--radius-pill) !important; padding-left:20px !important; }
html body .erp-ds-search.erp-ds-search input { border-radius:var(--radius-pill) !important; padding-left:0 !important; }
html body textarea { border-radius:var(--radius-xl) !important; }
html body select:not([multiple]):not([size])::picker(select) { border-radius:var(--radius-lg); }

/* Every plain button is a pill too (same as header buttons, tabs, fields). Rows, cells, cards and dashboard widgets that happen to be <button> elements keep their shape. */
html body button:not(#connected-dashboard *):not(.erp-tabs *):not([class*="row"]):not([class*="cell"]):not([class*="card"]):not([class*="item"]):not([class*="tile"]):not([class*="day"]):not([role=tab]) { border-radius:var(--radius-pill) !important; }

/* Dense fields inside table cells (36px): 16px left padding so the text clears the pill's curve. */
html body :is(td,th) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]),select:not([multiple]):not([size])):not(.erp-ds-search *) { padding-left:16px !important; }

/* TABLE ROWS ARE ONE LINE. No title + sub-code stacks and no wrapped text: a <small> after a title sits on the same line, and cells never wrap (wide tables scroll inside the table area). */
html body table:not(#connected-dashboard *):not(#connected-dashboard *) :is(td,th) { white-space:nowrap !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) td small { display:inline !important; margin:0 0 0 8px !important; font-size:12px; color:var(--muted-foreground); }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) td>:is(div,p,span):not(:only-child) { display:inline; }

/* Table body rows get a 1px outline on their left and right edges (--table-line), so the white rows read as one box between the grey header and footer. */
html body table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) tbody tr>:first-child { border-left:1px solid var(--table-line) !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) tbody tr>:last-child { border-right:1px solid var(--table-line) !important; }
html body :is(.production-row,.production-material-row,.ba21-data-scroll>:is(div,[role=row]):not(.erp-ds-table-head)):not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { border-left:1px solid var(--table-line) !important; border-right:1px solid var(--table-line) !important; }

/* TABLE FIT: no horizontal scrollbar. Fixed columns are as wide as their content; flex columns share the rest and are cut with an ellipsis when it is not enough. */
html body table:not(#connected-dashboard *):not(#connected-dashboard *) { table-layout:auto; min-width:0 !important; }
html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *) { overflow-x:hidden; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) :is(td,th)[data-fit=fixed] { width:1%; white-space:nowrap !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) :is(td,th)[data-fit=flex] { max-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *) td[data-fit=flex]>button { display:inline-block !important; max-width:75%; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
html body table[data-tight]:not(#connected-dashboard *):not(#connected-dashboard *) :is(td,th) { width:auto; max-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap !important; }

/* BADGE: one style for every badge/tag/status chip, in the brand colors (light lime fill, dark green text, pill). */
html body :is(.erp-badge,.pm-badge,.production-storage-badge,.oh-status,.inventory-tag,.inventory-tax-tag):not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { display:inline-flex !important; align-items:center; box-sizing:border-box; min-height:0; padding:3px 10px !important; border:0 !important; border-radius:var(--radius-pill) !important; background:var(--brand-secondary-subtle) !important; color:var(--primary) !important; font:600 12px/1.4 var(--font-body) !important; white-space:nowrap; }
/* Badge colors: same shape, colors only from the brand palette. Default = light lime. */
html body :is(.erp-badge,.pm-badge,.production-storage-badge,.oh-status,.inventory-tag,.inventory-tax-tag):is(.is-lime,.is-edited):not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { background:var(--brand-secondary) !important; color:var(--brand-secondary-foreground) !important; }
html body :is(.erp-badge,.pm-badge,.production-storage-badge,.oh-status,.inventory-tag,.inventory-tax-tag):is(.is-dark,.is-deleted):not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { background:var(--primary) !important; color:var(--primary-foreground) !important; }
html body :is(.erp-badge,.pm-badge,.production-storage-badge,.oh-status,.inventory-tag,.inventory-tax-tag).is-green:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { background:var(--primary-hover) !important; color:var(--primary-foreground) !important; }
html body :is(.erp-badge,.pm-badge,.production-storage-badge,.oh-status,.inventory-tag,.inventory-tax-tag).is-olive:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { background:var(--brand-secondary-text) !important; color:var(--primary-foreground) !important; }

/* Highlight card: the one accent card of a row (e.g. the key total) in the primary brand color. */
html body .erp-card.erp-card-highlight:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) { position:relative; background:var(--primary); color:var(--primary-foreground); }

/* Header action group: buttons sit on the right edge of any card header. */
html body .erp-card-header .erp-card-actions { display:flex; align-items:center; gap:8px; margin-left:auto; flex-wrap:nowrap; }

/* ERP GRID TABLE: the standard for tables that cannot be a real <table> (dc templates cannot repeat rows inside <tbody>). It looks and behaves like the base table: same head/row/footer surfaces, 1px --table-line separators and row edges, one-line cells, 24px first/last cell inset. Markup:
   <div class="erp-card-table erp-grid-table" style="--erp-grid-cols: max-content minmax(90px,1fr) max-content">
     <div class="erp-grid-head"><div>..</div>..</div>
     <div class="erp-grid-row"><div>..</div>..</div>   (or <button class="erp-grid-row">)
     <div class="erp-table-footer">..</div>             (optional, last child)
   One shared column template, so every row lines up and stays on one line. Cell modifiers: .is-right (numbers), .is-flex (the column that takes the leftover width and is cut with an ellipsis). */
html body .erp-grid-table { display:grid; grid-template-columns:var(--erp-grid-cols); column-gap:12px; align-content:start; overflow-x:auto; }
html body .erp-grid-table>:is(.erp-grid-head,.erp-grid-row) { grid-column:1 / -1; display:grid; grid-template-columns:subgrid; column-gap:inherit; align-items:center; box-sizing:border-box; width:auto; min-height:var(--table-row-height) !important; margin:0 24px; padding:0 !important; border:0; border-bottom:1px solid var(--table-line); border-radius:0; background:var(--table-row); color:var(--foreground); font:400 13px/20px var(--font-body); text-align:left; }
html body .erp-grid-table>.erp-grid-head { min-height:44px !important; border-bottom:0; border-radius:var(--radius-xl) var(--radius-xl) 0 0; background:var(--table-head); color:var(--table-head-fg); font-size:12px; font-weight:500; }
html body .erp-grid-table>.erp-grid-row { border-left:1px solid var(--table-line); border-right:1px solid var(--table-line); }
html body .erp-grid-table>.erp-grid-row:last-child { border-bottom:0; border-radius:0 0 var(--radius-xl) var(--radius-xl); }
html body .erp-grid-table>.erp-grid-row:is(button,[onclick],[tabindex]) { cursor:pointer; }
html body .erp-grid-table>.erp-grid-row[aria-pressed=true] { background:var(--brand-secondary-subtle); box-shadow:inset 3px 0 var(--primary); }
html body .erp-grid-table>:is(.erp-grid-head,.erp-grid-row)>* { min-width:0; white-space:nowrap; font-variant-numeric:tabular-nums; }
html body .erp-grid-table>:is(.erp-grid-head,.erp-grid-row)>:first-child { padding-left:var(--card-padding); }
html body .erp-grid-table>:is(.erp-grid-head,.erp-grid-row)>:last-child { padding-right:var(--card-padding); }
html body .erp-grid-table>:is(.erp-grid-head,.erp-grid-row)>.is-right { text-align:right; }
html body .erp-grid-table>:is(.erp-grid-head,.erp-grid-row)>.is-flex { overflow:hidden; text-overflow:ellipsis; }
html body .erp-grid-table small { display:inline; margin-left:8px; font-size:12px; color:var(--muted-foreground); }
html body .erp-grid-table>:is(.erp-grid-empty,.erp-table-footer) { grid-column:1 / -1; }
html body .erp-grid-table>.erp-grid-empty { margin:0 24px; padding:52px 24px; border:1px solid var(--table-line); border-top:0; background:var(--table-row); text-align:center; font-size:13px; color:var(--muted-foreground); }

/* Table footer without pagination: the band only closes the table (surface + rounded bottom), so it is reduced to a 24px strip. With pagination it keeps the full 68px. */
html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *)>.erp-table-footer:not(:has(nav,.pm-pagination,.inventory-pagination,.lg-pages,.pager)) { min-height:24px !important; padding-block:0 !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) tfoot tr[data-table-footer]:not(:has(nav,.pm-pagination,.inventory-pagination,.lg-pages,.pager)) { height:24px !important; }
html body table:not(#connected-dashboard *):not(#connected-dashboard *):not(#connected-dashboard *) tfoot tr[data-table-footer]:not(:has(nav,.pm-pagination,.inventory-pagination,.lg-pages,.pager)) td { height:24px !important; padding-block:0 !important; }

/* Card header in a narrow card: the title keeps its own line and the action buttons wrap below it instead of squeezing the title. */
html body .erp-card-header.erp-card-header:not(#connected-dashboard *) { flex-wrap:wrap; row-gap:12px; }
html body .erp-card-header.erp-card-header:not(#connected-dashboard *)>.erp-card-actions { flex-wrap:wrap; }

/* A table always fills its card table area; the footer strip and header/row surfaces then span the full inset width. */
html body .erp-card-table:not(#connected-dashboard *):not(#connected-dashboard *)>table:not(#connected-dashboard *) { width:100% !important; }

/* INPUT TABLE (.erp-card-table.erp-table-inputs): a table whose cells hold fields. Space between columns is reduced to 8px (4px per cell side); the first and last cell keep the 24px table inset. Fields fill their cell, so column width is set by the header/content, not by the field. */
html body .erp-card-table.erp-table-inputs>table :is(th,td) { padding-inline:4px !important; }
html body .erp-card-table.erp-table-inputs>table tr>:first-child { padding-left:var(--card-padding) !important; }
html body .erp-card-table.erp-table-inputs>table tr>:last-child { padding-right:var(--card-padding) !important; }
html body .erp-card-table.erp-table-inputs>table td :is(input:not([type=checkbox]):not([type=radio]),select) { box-sizing:border-box; width:100% !important; min-width:88px !important; }
html body .erp-card-table.erp-table-inputs>table td .lg-item-input { min-width:150px !important; }
html body .erp-card-table.erp-table-inputs>table td .lg-item-input input { flex:1 1 auto; width:auto !important; min-width:110px !important; }
html body .erp-card-table.erp-table-inputs:not(#connected-dashboard *):not(#connected-dashboard *) { overflow-x:auto !important; }

/* Search suggestions open below their field, so the table area they sit in must not clip them. */
html body .erp-card-table.lg-day-ledger:not(#connected-dashboard *):not(#connected-dashboard *) { overflow:visible !important; }
html body .erp-card-table.lg-day-ledger>table.erp-entry-partners:not(#connected-dashboard *):not(#connected-dashboard *), html body .erp-card-table.lg-day-ledger>table.erp-entry-partners :is(tr,td).lg-partner-add-row, html body .erp-card-table.lg-day-ledger>table.erp-entry-partners .lg-partner-add-row>td { overflow:visible !important; max-width:none !important; }
html body .erp-card.lg-entry-partner-card:not(#connected-dashboard *):not(#connected-dashboard *) { overflow:visible !important; }
html body .erp-card.lg-entry-partner-card #lg-partner-results { z-index:30; }
/* Rows of an input table do not highlight on hover: the grey hover would blend into the grey fields. */
html body .erp-card-table.erp-table-inputs>table tbody tr:hover { background:transparent; }
/* The partner table area shows its suggestions outside the box (overflow visible), so it no longer clips: the table's own corners carry the 16px radius. */
html body table.erp-entry-partners thead th:first-child { border-top-left-radius:var(--radius-xl); }
html body table.erp-entry-partners thead th:last-child { border-top-right-radius:var(--radius-xl); }
html body table.erp-entry-partners tfoot td:first-child { border-bottom-left-radius:var(--radius-xl); border-bottom-right-radius:var(--radius-xl); }
html body .erp-card-table.erp-table-inputs>table td[data-label="품목명"] :is(input:not([type=checkbox]):not([type=radio])) { min-width:150px !important; }

/* Labelled controls inside a card filter row (e.g. date ranges) sit on one line. */
html body .erp-card-sorting label { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted-foreground); white-space:nowrap; }
html body .erp-card-sorting label input[type=date] { width:150px; flex:0 0 auto; }
/* KPI cards of the finance / ledger pages: small label over a large value. */
html body #finance-workspace .finance-summary>.erp-card>span { font-size:13px; color:var(--muted-foreground); }
html body #finance-workspace .finance-footnote { margin-top:0; font-size:12px; line-height:1.6; color:var(--muted-foreground); }
html body .finance-summary { display:grid; }

/* Schedule page: month calendar card + selected-day card side by side. */
html body .schedule-layout { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:var(--section-gap); align-items:start; }
@media(max-width:1000px) { html body .schedule-layout { grid-template-columns:minmax(0,1fr); } }
html body .schedule-error:empty { display:none; }
html body .schedule-day-list { display:flex; flex-direction:column; gap:8px; }
html body .erp-card-table.erp-table-inputs>table td :is(input:not([type=checkbox]):not([type=radio]),select) { height:36px !important; min-height:36px !important; }

/* Production request: list and work order side by side, 1/2 each. */
.production-request-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--section-gap); align-items:start; }
.production-request-layout > .erp-card, .production-request-layout > sc-if > .erp-card { min-width:0; overflow-wrap:anywhere; }
@media (max-width: 1000px) { .production-request-layout { grid-template-columns:minmax(0,1fr); } }

/* Sales status: vendor list on the left; owner receivables and the selected vendor's orders stacked on the right. */
html body .sales-status-layout { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:var(--section-gap); align-items:start; }
html body .sales-status-layout > .erp-card, html body .sales-status-side > .erp-card { min-width:0; }
html body .sales-status-side { display:flex; flex-direction:column; gap:var(--section-gap); min-width:0; }
html body .sales-due { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
html body .sales-due strong { font:600 28px/1.3 var(--font-body); font-variant-numeric:tabular-nums; }
html body .sales-due small { flex-basis:100%; font-size:12px; color:var(--muted-foreground); }
@media(max-width:1000px) { html body .sales-status-layout { grid-template-columns:minmax(0,1fr); } }
