.custom-content { display:block; }
.custom-content h2 { margin:0 0 8px; }
.custom-content p { color:var(--muted); }
.custom-dialog-heading,.custom-actions,.custom-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }

.custom-actions button,.custom-filters button,.custom-pagination button,.custom-dialog-heading button,.custom-field-actions button { min-height:40px; padding:8px 16px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--ink); }
.custom-primary,#newRecord,#newModule { background:var(--green); color:white; border:0; border-radius:8px; min-height:42px; padding:10px 20px; }
.custom-filters { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0; }
.custom-filters label { flex:1 1 160px; }
.custom-filters input,.custom-filters select,dialog:not(.gdr-dialog) input:not([type="checkbox"]),dialog:not(.gdr-dialog) select,dialog:not(.gdr-dialog) textarea { display:block; width:100%; min-height:42px; padding:9px 10px; border:1px solid var(--line); border-radius:6px; background:white; color:var(--ink); margin-top:5px; }
.custom-link { color:var(--green); padding:12px 0; }
.custom-table-wrap { overflow:auto; padding:0; }
.custom-table-wrap table { width:100%; border-collapse:collapse; font-size:14px; }
.custom-table-wrap th,.custom-table-wrap td { padding:14px; text-align:left; min-width:110px; border-bottom:1px solid var(--line); white-space:pre-wrap; overflow-wrap:anywhere; max-width:300px; }
.custom-table-wrap th { background:#eaf2ee; }
.custom-table-wrap button { color:var(--green); background:transparent; border:0; text-decoration:underline; }
.custom-pagination { margin-top:16px; justify-content:flex-end; }
#customError,#moduleError,#recordError { color:#a62d2d; white-space:pre-wrap; }
dialog:not(.gdr-dialog) { width:min(800px,calc(100% - 24px)); max-height:90dvh; overflow:auto; border:1px solid var(--line); border-radius:14px; padding:24px; color:var(--ink); }
dialog:not(.gdr-dialog)::backdrop { background:#17352f70; }
dialog:not(.gdr-dialog) label { display:block; margin:12px 0; }
dialog:not(.gdr-dialog) fieldset { border:1px solid var(--line); border-radius:8px; margin:16px 0; }
dialog:not(.gdr-dialog) p { color:var(--muted); }
.custom-stations { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:4px 12px; }
.custom-checkbox,.custom-stations label { display:flex; align-items:center; gap:8px; }
.custom-checkbox input,.custom-stations input { flex:none; }
.custom-field-actions { display:flex; justify-content:flex-end; gap:8px; }
#recordDetail dl { display:grid; grid-template-columns:minmax(100px,1fr) 2fr; gap:12px; }
#recordDetail dt { color:var(--muted); }
#recordDetail dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
#customBoot { margin:40px; }
@media(max-width:650px) { dialog:not(.gdr-dialog) { padding:16px; } .custom-table-wrap td { min-width:100px; } }
.custom-content [hidden] { display:none!important; }
.custom-content > [role="tabpanel"] { min-width:0; }

.custom-config-info { display:grid; grid-template-columns:1fr 1fr 2fr; gap:18px; margin:24px 0; }
.custom-config-info dt { color:var(--muted); margin-bottom:8px; }
.custom-config-info dd { margin:0; overflow-wrap:anywhere; }
.custom-config .waste-summary-scroll td { white-space:pre-wrap; min-width:100px; overflow-wrap:anywhere; }
@media(max-width:800px) { .custom-config-info { grid-template-columns:1fr; } }

.custom-content .analytics-heading { margin-bottom:20px; }
.custom-content .analytics-heading h3 { margin:0; }
.custom-content .module-record-source-note { line-height:1.7; }
.custom-content .custom-filters input[name="q"] { min-width:160px; flex:1; min-height:38px; margin:0; }
.custom-content .custom-filters input[type="hidden"] { display:none; }
.custom-content .custom-table-wrap { border:1px solid var(--line); border-radius:12px; }
.custom-content .custom-config h3 { margin:0; }
.custom-content .analytics-metrics { grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); }
.custom-content .analytics-metrics article { min-width:0; }
@media(max-width:680px) {
  #customTabs button { min-width:0; flex:1 1 0; padding:0 6px; }
  .custom-content .analytics-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .custom-content .records-toolbar { align-items:stretch; }
  .custom-content .custom-filters { width:100%; }
}

.custom-fields-panel { border-top:1px solid var(--line); margin-top:28px; padding-top:24px; min-width:0; }
.custom-fields-panel > .custom-dialog-heading { align-items:flex-start; margin-bottom:20px; }
.custom-fields-panel > .custom-dialog-heading p { margin:8px 0 0; line-height:1.6; }
#customFieldsEditor { border:0; padding:0; margin:0; min-width:0; }
#customFieldsEditor > .custom-checkbox { margin-bottom:20px; }
.custom-fields-list { min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.custom-fields-table { width:100%; min-width:1120px; table-layout:fixed; border-collapse:collapse; font-size:var(--font-data-section-tab,13px); }
.custom-field-col-name { width:14%; }
.custom-field-col-type { width:10%; }
.custom-field-col-hint { width:19%; }
.custom-field-col-unit { width:7%; }
.custom-field-col-rules { width:21%; }
.custom-field-col-required { width:7%; }
.custom-field-col-enabled { width:10%; }
.custom-field-col-actions { width:12%; }
.custom-fields-table th,.custom-fields-table td { padding:10px 12px; border:0; text-align:left; vertical-align:middle; white-space:normal; }
.custom-fields-table th { background:#f3f7f5; color:#547169; font-weight:700; line-height:1.5; }
.custom-fields-table td { height:62px; }
.custom-fields-table .custom-field.is-disabled { background:#f2f5f3; }
.custom-fields-panel input:not([type="checkbox"]),.custom-fields-panel select,.custom-fields-panel textarea { display:block; width:100%; min-width:0; box-sizing:border-box; min-height:42px; padding:9px 12px; border:1px solid #cbded6; border-radius:9px; background:#fafcfb; color:var(--ink); margin:0; font:inherit; }
.custom-fields-panel textarea { line-height:1.6; resize:vertical; }
.custom-fields-panel input:disabled,.custom-fields-panel select:disabled,.custom-fields-panel textarea:disabled { background:#f3f6f4; color:#667c73; }
.custom-fields-panel input[type="checkbox"] { width:16px; height:16px; margin:0; padding:0; accent-color:var(--green); vertical-align:middle; }
.custom-fields-table .custom-field-choice { text-align:center; }
.custom-fields-table th:nth-child(6),.custom-fields-table th:nth-child(7) { text-align:center; }
.custom-field-status { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; color:#547169; white-space:nowrap; cursor:pointer; }
.custom-field-range { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.custom-field-range label { color:#547169; min-width:0; }
.custom-field-range input { margin-top:6px!important; }
.custom-field-na { color:var(--muted); }
.custom-fields-panel .custom-field-actions { gap:6px; justify-content:flex-start; }
.custom-fields-panel .custom-field-actions button { min-width:28px; padding:8px 6px; font:inherit; }
.custom-fields-panel .custom-field-delete { color:#995d55; border-color:transparent; background:transparent; white-space:nowrap; }
.custom-fields-scroll-note { display:none; }
#customFieldsStatus { min-height:1.5em; line-height:1.6; }
#customFieldsStatus.is-error { color:#a62d2d; }
.custom-fields-table .custom-fields-empty { padding:24px 12px; color:var(--muted); }
.custom-fields-panel .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(max-width:1120px) {
  .custom-fields-scroll-note { display:block; font-size:12px; }
}
@media(max-width:680px) {
  .custom-fields-panel > .custom-dialog-heading { align-items:stretch; }
  .custom-fields-panel .custom-actions { width:100%; }
  .custom-fields-panel .custom-actions button { flex:1 1 auto; }
}
.custom-fields-panel .custom-actions .custom-primary { background:var(--green); color:white; border-color:var(--green); }
.custom-fields-panel button:disabled { opacity:.55; cursor:not-allowed; }
