/* Shared personal form layout editor 280. */
.form-layout-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; font-size: 12px; }
.form-layout-tools button { font-size: 12px; padding: 5px 8px; }
.form-layout-tools input { width: 160px; padding: 5px 7px; }
.form-layout-note { font-size: 12px; color: var(--ink); flex-basis: 100%; }
.form-layout-note:empty { display: none; }
.form-layout-custom { display: block !important; }
.form-layout-section { margin: 8px 0 12px; }
.form-layout-section > h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.form-layout-section > input { max-width: 240px; margin-bottom: 6px; font-weight: 700; }
.form-layout-grid { display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr)) !important; gap: 8px; }
.form-layout-grid > .form-field { min-width: 0; }
.form-layout-grid .form-field :is(input:not([type=checkbox]):not([type=range]), select, textarea) { max-width: 100%; box-sizing: border-box; }
.form-layout-field[data-layout-hidden] { display: none; }
.form-layout-editing .form-layout-field[data-layout-hidden]:not([hidden]) { display: block; opacity: .65; }
.form-layout-editing .form-layout-field { position: relative; outline: 1px dashed #818cf8; padding: 5px 10px 5px 5px; }
.form-layout-editing .form-field > :not(.form-layout-handlebar):not(.form-layout-resize) { pointer-events: none; }
.form-layout-handlebar { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-bottom: 5px; font-size: 11px; }
.form-layout-handlebar button { padding: 2px 5px; font-size: 12px; }
.form-layout-handlebar [draggable] { cursor: grab; }
.form-layout-handlebar input[type=range] { width: 75px; min-width: 40px; padding: 0; }
.form-layout-handlebar select { width: 100%; font-size: 11px !important; min-height: 23px !important; padding: 2px !important; }
.form-layout-handlebar label { display: inline-flex !important; align-items: center; gap: 3px; font-size: 11px; }
.form-layout-handlebar input[type=checkbox] { width: 13px; height: 13px; }
.form-layout-resize { position: absolute; right: 0; top: 30px; bottom: 0; width: 7px; padding: 0; border: 0; border-radius: 3px; background: #818cf8; cursor: ew-resize; touch-action: none; }
@media print { .form-layout-tools, .form-layout-handlebar, .form-layout-resize { display: none !important; } }

.form-layout-field[data-layout-hidden].invalid:not([hidden]) { display: block; }

/* Direct edge resize 281: broad handle, compact per-field controls. */
.form-layout-editing .form-layout-field { padding-right: 16px; }
.form-layout-handlebar > :not(.form-layout-grip):not(.form-layout-width):not(.form-layout-settings-button):not(.form-layout-fine) { display: none !important; }
.form-layout-settings .form-layout-handlebar > :not(.form-layout-grip):not(.form-layout-width):not(.form-layout-settings-button):not(.form-layout-fine) { display: revert !important; }
.form-layout-handlebar { justify-content: flex-start; min-height: 24px; }
.form-layout-width { font-size: 11px; color: var(--ink); }
.form-layout-settings-button { margin-left: auto; }
.form-layout-resize { top: 0; bottom: 0; right: 0; width: 14px; min-width: 14px; background: transparent; border-radius: 3px; transform: none !important; }
.form-layout-resize::after { content: ''; position: absolute; right: 4px; top: 5px; bottom: 5px; width: 4px; border-radius: 3px; background: #818cf8; }
.form-layout-resize:hover, .form-layout-resize:focus-visible { background: #818cf840; outline: 2px solid #a5b4fc; }
.form-layout-resize:active { background: #818cf875; }

/* Personal layout follows the chosen field sequence, including customer name. */
.erp-form.form-layout-custom .form-layout-grid > .form-field { order: 0 !important; }

/* Centered window resizing and Excel-like column boundaries. */
.modal-overlay.size-window-overlay { align-items: center !important; justify-content: center !important; }
.modal-overlay .modal-panel.size-window { position: relative; flex: none; box-sizing: border-box; max-width: calc(100vw - 32px) !important; max-height: calc(100dvh - 32px) !important; transform: none !important; transition: none !important; }
.size-window-handle { position: absolute; z-index: 8; padding: 0; margin: 0; border: 0; background: transparent; touch-action: none; }
.size-window-right { right: 0; top: 20px; bottom: 20px; width: 10px; cursor: ew-resize; }
.size-window-bottom { bottom: 0; left: 20px; right: 20px; height: 10px; cursor: ns-resize; }
.size-window-corner { bottom: 0; right: 0; width: 20px; height: 20px; cursor: nwse-resize; background: linear-gradient(135deg,transparent 50%,#818cf8 52%,transparent 62%,#818cf8 65%,transparent 75%); }
.size-window-handle:hover, .size-window-handle:focus-visible { background-color: #818cf855; outline: 1px solid #818cf8; }
.size-column-heading { position: relative; }
.size-column-handle { position: absolute; top: 0; bottom: 0; right: -3px; width: 9px; padding: 0; border: 0; margin: 0; background: transparent; z-index: 4; cursor: col-resize; touch-action: none; border-radius: 0; }
.size-column-handle:hover, .size-column-handle:focus-visible { background: #818cf8aa; }
.size-table { table-layout: fixed !important; max-width: none !important; min-width: 0 !important; }
.size-table :is(td,th) { box-sizing: border-box; min-width: 0 !important; overflow: hidden; overflow-wrap: anywhere; }
.size-table th.size-column-heading { overflow: visible; }
@media print { .size-window-handle,.size-column-handle { display: none !important; } }

.customer-list-compact .list table.size-table :is(th,td) { min-width: 0 !important; max-width: none; white-space: normal; }
.customer-list-compact .list table.size-table td { width: auto !important; }

/* Designer 284: one-percent sizing, readable typography, explicit groups/fields. */
.form-layout-grid { grid-template-columns: repeat(100,minmax(0,1fr)) !important; column-gap: 0; row-gap: 8px; }
.form-layout-grid > .form-field { margin-right: 8px; }
.form-layout-custom .form-layout-grid > .form-field :is(input:not([type=checkbox]):not([type=range]),textarea,select) { font-size: var(--layout-font,15px) !important; }
.form-layout-custom .form-layout-grid > .form-field > label, .form-layout-custom .form-layout-grid > .form-field > label :is(div,span), .form-layout-section > h4 { font-size: var(--layout-heading,17px) !important; font-weight: 700; }
.form-layout-handlebar > .form-layout-fine { display: inline-flex !important; flex-direction: column; gap: 0; }
.form-layout-fine button { font-size: 9px; line-height: 10px; padding: 0 3px; min-height: 10px; }
.form-layout-section-heading { display: flex; gap: 6px; align-items: center; padding-bottom: 6px; }
.form-layout-section-heading > input { font-weight: 700; min-width: 0; max-width: 240px; }
.form-layout-tools label { display: inline-flex; align-items: center; gap: 4px; }
.form-layout-tools input[type=number] { width: 60px; }
.layout-field-dialog { background: var(--panel); color: var(--ink); border: 1px solid #818cf8; border-radius: 14px; width: min(460px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow:auto; padding:20px; }
.layout-field-dialog::backdrop { background:#0009; }
.layout-field-dialog > label { display: grid; gap: 4px; margin-bottom: 10px; }
.layout-field-dialog > label[hidden] { display:none; }
.layout-field-dialog input[type=checkbox] { width:20px; }
.layout-field-dialog .row { flex-wrap: wrap; gap: 8px; }
.layout-field-sample { padding:10px; border:1px dashed #818cf8; margin:10px 0; }

/*303 Personal column filters; unrelated entry forms are not selected. */
.cf-heading{display:flex;align-items:center;justify-content:space-between;gap:5px}.cf-heading>span{min-width:0;overflow-wrap:anywhere}.cf-heading>button{padding:2px 6px;flex:none;min-height:26px;font-size:12px}.list th.cf-active,th.cf-active{background:#7f1d1d!important;color:#fff!important}
.cf-summary{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:10px 0;font-size:12px}.cf-summary button,.cf-summary select{padding:5px 8px;font-size:12px}.cf-summary .cf-tag{border-color:#818cf8;background:#312e81;color:#fff}.cf-total{font-weight:700;font-variant-numeric:tabular-nums}
.cf-overlay.modal-overlay.visible{position:fixed;inset:0;display:grid;place-items:center;background:#0009;z-index:12000;padding:14px}.cf-dialog{width:min(620px,100%);max-height:90vh;overflow:auto;border:1px solid var(--border,#64748b);border-radius:14px;padding:20px;background:var(--panel,#0f172a);color:var(--ink,#e2e8f0);box-shadow:0 18px 60px #0009}.cf-dialog header{display:flex;align-items:center;gap:8px}.cf-dialog h2{font-size:20px;margin:0;flex:1}.cf-dialog header button{width:36px;height:36px;padding:0;flex:none}.cf-dialog [hidden]{display:none!important}.cf-field{display:flex;flex-direction:column;gap:6px;margin:14px 0}.cf-field input,.cf-field select{width:100%}.cf-pair{display:flex;gap:10px}.cf-pair>*{flex:1;min-width:0}.cf-buttons{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:15px}.cf-choices{max-height:190px;overflow:auto;border:1px solid var(--border,#64748b);border-radius:7px;padding:6px}.cf-choices label{display:flex;align-items:center;gap:8px;padding:5px}.cf-choices input{width:auto}.cf-error{color:#ef4444;min-height:20px}.cf-print-frame{position:fixed;width:1px;height:1px;bottom:0;left:0;border:0}
@media(max-width:480px){.cf-dialog{padding:14px}.cf-dialog h2{font-size:17px}.cf-summary{gap:5px}.cf-pair{flex-wrap:wrap}.cf-pair>*{flex-basis:100%}}@media print{.cf-summary button,.cf-summary select,.cf-heading button,.cf-overlay{display:none!important}}

.cf-overlay.modal-overlay.visible{grid-template-columns:minmax(0,1fr)}
.cf-dialog>.cf-buttons:last-child{position:sticky;bottom:0;background:var(--panel,#0f172a);padding:10px 0 4px}


/* Maintenance adapters: retain record sections and responsive field widths. */
.nilo-record-form .form-layout-grid > .form-field{order:0!important;width:auto;max-width:none;min-width:0}
.nilo-record-form.form-layout-custom .form-layout-host{grid-column:1/-1}
.nilo-record-form.form-layout-custom .form-layout-host~*{grid-column:1/-1}
.form-layout-grid label{display:block}.form-layout-grid .form-field>label{margin-bottom:5px}
.form-layout-tools{grid-column:1/-1}.form-layout-grid input[type=checkbox]{width:auto!important}
.form-layout-custom .form-layout-grid .row{flex-wrap:wrap}.form-layout-editing .form-layout-handlebar button{min-height:24px}
.nilo-generic-list .list{overflow:auto;max-width:100%}.nilo-generic-list table{border-collapse:collapse;width:100%}
.nilo-generic-list thead th{position:sticky;top:0;z-index:2;background:var(--panel);border-bottom:2px solid var(--line)}
.nilo-generic-list tbody tr:nth-child(even){background:color-mix(in srgb,var(--panel) 93%,var(--ink))}
.cf-field input[type=text]{box-sizing:border-box}.cf-heading{white-space:normal}.cf-summary[aria-busy=true]{opacity:.7}
@media(max-width:600px){.nilo-record-form:not(.form-layout-editing) .form-layout-grid>.form-field{grid-column:1/-1!important;margin-right:0}.form-layout-tools{gap:5px}.form-layout-tools button{flex:1 1 auto}.nilo-generic-list table{display:table!important}.nilo-generic-list tr{display:table-row!important}.nilo-generic-list td,.nilo-generic-list th{display:table-cell!important;min-width:100px}.nilo-generic-list td:before{display:none!important}}
/* Readable column headings on narrow screens; scroll horizontally instead of compressing letters. */
.nilo-generic-list .list table:not(.size-table){min-width:1100px}
.nilo-generic-list .list th{min-width:120px;max-width:280px;vertical-align:bottom}
.nilo-generic-list .list th[data-col=sku],.nilo-generic-list .list th[data-col=code]{min-width:150px}
.nilo-generic-list .cf-heading>span{overflow-wrap:normal;word-break:normal}
.nilo-generic-list .list td{white-space:normal;overflow-wrap:anywhere}

.form-layout-custom .form-layout-grid>label.form-field>[data-layout-label]{font-size:var(--layout-heading,17px);font-weight:700}

/* Copy review uses text and outlines as well as color. */
.machine-copy-review{outline:2px solid #dc2626;outline-offset:2px;border-radius:6px;padding:8px!important}
.machine-copy-review input,.machine-copy-review select,.machine-copy-review textarea{border-color:#dc2626!important}
.machine-copy-review-label{display:none;font-size:.85em;font-weight:700;color:#ef4444}
.machine-copy-review .machine-copy-review-label{display:block}
.machine-copy-hint{grid-column:1/-1;border-left:4px solid #dc2626;padding:8px 12px}

/* Controlled import: readable fields and actions on narrow screens. */
.nilo-import{display:grid;gap:12px;min-width:0}.nilo-import>p{margin:0;overflow-wrap:anywhere}.nilo-import-field{display:grid;gap:5px}.nilo-import-field input{box-sizing:border-box;width:100%;padding:10px 12px;background:#0b1220;color:#e2e8f0;border:1px solid #334155;border-radius:10px;font:inherit}.nilo-import-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.nilo-import-actions>span{overflow-wrap:anywhere;min-width:0}.nilo-import .table-container{min-width:0}.nilo-import table{min-width:100%;white-space:normal}

/* Route windows use the same dark fields as the record forms. */
[data-route-form] input[type=time]{box-sizing:border-box;width:100%;background:#0b1220;color:#e2e8f0;border:1px solid #334155;border-radius:10px;padding:10px 12px;font:inherit;color-scheme:dark}
