/* Shared controls also cover dynamically inserted forms and nested field groups. */
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) :where(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]),select,textarea){
  box-sizing:border-box;min-width:0;max-width:100%;min-height:44px;
  border-width:1px!important;border-style:solid!important;border-color:var(--admin-border,color-mix(in srgb,var(--theme-font,#24364c) 18%,var(--theme-background,#fff)))!important;
  border-radius:11px!important;padding:10px 12px;
  background:var(--theme-background,#fff)!important;color:var(--theme-font,#24364c)!important;
  font-family:var(--theme-font-family,system-ui,sans-serif)!important;font-size:14px!important;font-weight:400;line-height:1.5;
}
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) :is(input,textarea)::placeholder{
  font-family:inherit;font-size:13px!important;font-weight:400;line-height:inherit;opacity:1;color:var(--admin-muted,#718078);
}
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) textarea{min-height:96px;resize:vertical}
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) :is(input,select,textarea):focus-visible{
  outline:2px solid color-mix(in srgb,var(--theme-button,#26735d) 45%,transparent);outline-offset:2px;
}
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) :is(input,textarea)[readonly]{background:var(--admin-soft,#f1f5f3)!important}
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) :is(input,select,textarea):disabled{cursor:not-allowed}
/* Search wrappers provide the border; the inner textbox stays on the same surface. */
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) .search-field{min-width:0;border:1px solid var(--admin-border,#d6dfdb);border-radius:11px;overflow:hidden;background:var(--theme-background,#fff)!important}
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) .search-field input{border:0!important;background:transparent!important;box-shadow:none!important;min-width:0;flex:1;border-radius:0!important}

/* Keep dynamically added fields inside their cards, including long labels. */
html body :is(.inventory-config,.inventory-raw-purchase,.inventory-manual-materials,.jasa-activity-body,.jasa-project-payroll-label,.attendance-location-disclosure){min-width:0;box-sizing:border-box;overflow-wrap:anywhere}
html body :is(.inventory-config,.inventory-raw-purchase,.jasa-activity-body,.attendance-location-disclosure) label:has(> :is(input:not([type=checkbox]):not([type=radio]),select,textarea)),
html body :is(.inventory-manual-materials,.jasa-project-payroll-label){display:grid;gap:8px;min-width:0;font-size:13px;font-weight:600;line-height:1.5;margin:0}
html body :is(.inventory-config,.inventory-raw-purchase,.inventory-manual-materials,.jasa-activity-body,.jasa-project-payroll-label,.attendance-location-disclosure) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box}
html body :is(.inventory-config,.inventory-raw-purchase,.jasa-activity-body,.jasa-project-payroll-label,.attendance-location-disclosure) label>small{font-size:12px;font-weight:400;line-height:1.6;color:var(--admin-muted,#718078)}
html body .inventory-manual-materials,html body .jasa-project-payroll-label{grid-column:1/-1}
html body .inventory-config{margin:18px 0;padding:18px;border-color:var(--admin-border,#d6dfdb);background:var(--admin-surface,var(--theme-background,#fff))}
html body .inventory-config h3{line-height:1.4;margin-bottom:8px}
html body .inventory-config>[data-config-intro]{margin:0 0 16px}
html body .inventory-config [data-config-status]:empty{display:none}
html body :is(.inventory-config,.inventory-raw-purchase) :is(.inventory-grid,.inventory-add){align-items:start}
html body .inventory-add{align-items:stretch}
html body :is(.inventory-unit-row,.inventory-recipe-row){align-items:end;gap:12px}
html body .inventory-recipe-row>div{align-self:center;min-width:0}
html body .inventory-recipe-row label>small{margin:0}
html body .inventory-purchase-line header{margin-bottom:16px;align-items:start}
html body .inventory-purchase-line header>div{min-width:0;display:grid;gap:5px}
html body .inventory-purchase-line header small{margin:0}
html body .inventory-purchase-line>.inventory-grid{margin:0 0 16px}
html body .inventory-conversion{line-height:1.65;border:1px solid var(--admin-border,#d6dfdb)}
html body .inventory-raw-purchase .section-card{padding:20px}
html body .inventory-raw-purchase .form-actions{margin-top:16px;gap:10px}
html body :is(.inventory-config,.inventory-raw-purchase,.jasa-activity-dialog,.attendance-location-actions) :is(.filter-button,.reset-button){
  box-sizing:border-box;min-width:0;min-height:44px;border:1px solid var(--admin-border,#d6dfdb);border-radius:11px!important;padding:10px 14px;font:inherit;font-size:13px!important;font-weight:600;line-height:1.4;white-space:normal;
}
html body :is(.inventory-config,.inventory-raw-purchase,.jasa-activity-dialog) .filter-button{background:var(--theme-button,#26735d)!important;color:var(--theme-button-text,#fff)!important;border-color:var(--theme-button,#26735d)!important}
html body :is(.inventory-config,.inventory-raw-purchase,.jasa-activity-dialog) .reset-button{background:var(--admin-soft,var(--theme-background,#fff))!important;color:var(--theme-font,#24364c)!important}
html body :is(.inventory-unit-row,.inventory-recipe-row)>.reset-button,html body .inventory-purchase-line header>.reset-button{flex:none;align-self:end;width:44px;height:44px;padding:0!important}
html body .inventory-purchase-line header>.reset-button{align-self:start}

/* A manual-material form is a direct child of details, rather than a fields grid. */
html body .jasa-activity-section>form{margin:0;padding:0 16px 16px;display:grid;gap:14px}
html body .jasa-activity-section>[data-manual-list]:empty{display:none}
html body .jasa-activity-section>[data-manual-list]{padding-bottom:16px}
html body .jasa-activity-body form>[type=submit]{justify-self:stretch;width:100%;margin-top:4px}
html body .jasa-activity-row>div:last-child{flex-shrink:0;max-width:48%}
html body .jasa-activity-row b{white-space:normal;overflow-wrap:anywhere}
html body .jasa-worker-check>input{flex:none}
html body .attendance-location-disclosure>label{margin:14px 0}
html body .attendance-location-actions{gap:10px}

@media(max-width:700px){
  /* A readable editable font also avoids automatic zoom on iOS. */
  html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) :where(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]),select,textarea){font-size:16px!important}
  html body .inventory-config,html body .inventory-raw-purchase .section-card{padding:16px}
  html body .inventory-config .inventory-grid{gap:14px}
  html body .inventory-raw-purchase .form-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
  html body .inventory-raw-purchase .form-actions>button{width:100%;height:auto;min-height:46px}
  html body .jasa-activity-section>form{padding:0 13px 13px}
}
@media(max-width:480px){
  html body .inventory-raw-purchase .inventory-grid,html body .inventory-config>.inventory-grid{grid-template-columns:minmax(0,1fr)}
  html body .inventory-config [data-config-fields]>.inventory-grid{grid-template-columns:minmax(0,1fr)}
  html body :is(.inventory-unit-row,.inventory-recipe-row){gap:8px;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px}
  html body :is(.inventory-unit-row,.inventory-recipe-row) label{font-size:12px}
}

html body :is(.inventory-config,.inventory-raw-purchase,.jasa-activity-body,.inventory-manual-materials,.attendance-location-disclosure,.jasa-project-payroll-label) [hidden],html body .inventory-manual-materials[hidden]{display:none!important}

/* Keep one frame around search boxes even alongside the shared input rules. */
html body :is(#adminView,dialog.detail-dialog,dialog.checkout-pos-dialog) .search-field :where(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):not([type=button]):not([type=submit])){
  border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;
}
html body #adminView .panel>.section-intro{gap:16px;flex-wrap:wrap}
html body #adminView .panel>.section-intro>div{min-width:0}
html body #adminView .panel>.section-intro :is(.intro-actions,.card-actions){display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-width:0}
html body #adminView .admin-list-container>.toolbar{gap:12px;min-width:0;max-width:100%;box-sizing:border-box}
html body #adminView .admin-list-container .search-field{min-width:0;box-sizing:border-box}
html body #adminView .panel :is(.card-heading,.toolbar,.date-filter,.report-filter)>label{min-width:0}
html body #adminView .panel .table-wrap{max-width:100%;min-width:0;box-sizing:border-box;overscroll-behavior-x:contain}
html body #adminView .list-scroll-hint{margin:8px 0 10px;font-size:12px;font-weight:400;line-height:1.5;text-align:right;color:var(--admin-muted,#718078)}
html body #adminView .list-scroll-hint[hidden]{display:none!important}
html body #adminView .table-wrap:focus-visible{outline:2px solid color-mix(in srgb,var(--theme-button,#26735d) 40%,transparent);outline-offset:2px}
@media(min-width:701px){
  html body #adminView table.admin-data-list{table-layout:auto!important}
  html body #adminView table.admin-data-list :is(th,td).row-number{width:44px!important;min-width:44px!important;max-width:56px!important;white-space:nowrap!important;text-align:center!important}
  html body #adminView table.admin-data-list :is(th,td)[data-column-kind=money]{white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;text-align:right!important;min-width:100px;font-variant-numeric:tabular-nums}
  html body #adminView table.admin-data-list :is(th,td)[data-column-kind=quantity]{white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;text-align:right!important;min-width:48px}
  html body #adminView table.admin-data-list :is(th,td)[data-column-kind=code]{min-width:120px;word-break:normal!important;overflow-wrap:anywhere}
  html body #adminView table.admin-data-list :is(th,td)[data-column-kind=date]{white-space:nowrap!important;min-width:100px}
  html body #adminView #productRows td[data-product-field=name]{min-width:160px;max-width:300px;overflow-wrap:break-word;word-break:normal}
  html body #adminView table.admin-data-list td.list-status-cell :is(.status,.status-badge){width:auto!important;min-width:80px!important;max-width:160px;padding-inline:12px!important}
  html body :is(#adminView,dialog) .row-actions,
  html body #adminView #productsPanel #productRows .product-mobile-expanded .row-actions,
  html body #adminView #salesRows .sales-report-actions .row-actions{width:max-content!important;max-width:280px!important;min-width:0!important;gap:6px!important;justify-content:flex-start!important}
  html body :is(#adminView,dialog) .row-actions>:is(button,a):not([hidden]),
  html body #adminView #productsPanel #productRows .product-mobile-expanded .row-actions>:is(button,a):not([hidden]),
  html body #adminView #salesRows .sales-report-actions .row-actions>:is(button,a):not([hidden]){flex:0 0 88px!important;width:88px!important;min-width:88px!important;max-width:88px!important;height:36px!important;min-height:36px!important;padding:6px 8px!important;border-radius:10px!important;font-size:12px!important;line-height:1.3!important}
  html body #adminView #productsPanel .scan-toolbar{display:grid!important;grid-template-columns:minmax(240px,1fr) minmax(180px,240px) auto;align-items:end!important;gap:12px!important}
  html body #adminView #productsPanel .scan-toolbar>.search-field{grid-column:auto;width:100%;min-height:44px!important;height:44px!important;margin:0}
  html body #adminView #productsPanel .scan-toolbar>.scanner-field{margin:0;display:grid;gap:7px;min-width:0}
  html body #adminView #productsPanel .scan-toolbar>.camera-scan-button{min-height:44px!important;height:44px!important;min-width:120px;padding:10px 16px!important;margin:0}
}
@media(min-width:701px) and (max-width:1100px){
  html body #adminView #productsPanel .scan-toolbar{grid-template-columns:minmax(0,1fr) auto}
  html body #adminView #productsPanel .scan-toolbar>.search-field{grid-column:1/-1}
}
