/* Native UI subtrees own their styles, including portals and print hosts. */
@scope (:root:not([data-kms-ui="native"])) to ([data-kms-ui="native"]) {
/* Shared native-table layer. Spreadsheet engines retain their own DOM and editors. */
.kms-enhanced-table { border-collapse:collapse; border-spacing:0; }
.kms-enhanced-table > thead > tr > th {
 background:linear-gradient(180deg,#f1f5f9,#e2e8f0) !important; color:#1e293b !important;
 font-size:13px !important; font-weight:700 !important; border:1px solid #cbd5e1 !important; border-bottom:2px solid #94a3b8 !important;
 box-sizing:border-box;
}
.kms-enhanced-table > thead > tr > th:is(.h1,.h2,.h3,.kms-table-title,[data-kms-table-title]) {
 background:linear-gradient(135deg,#1e293b 0%,#1e3a8a 100%) !important; color:#f8fafc !important;
 font-size:20px !important; font-weight:800 !important; letter-spacing:6px !important; text-indent:6px;
 padding:14px 20px !important; border:1px solid #1e293b !important; border-bottom:3px solid #2563eb !important;
 text-align:center !important; line-height:1.35 !important;
}
.kms-enhanced-table > tbody > tr > td { border:1px solid #e2e8f0 !important; font-size:13px !important; vertical-align:middle !important; }
/* A layer gives all page-specific status, selection and employee highlight rules priority. */
@layer kms-table-tones {
 .kms-enhanced-table > tbody > tr > td:not([style*="color"]) { color:#1e293b; }
 .kms-enhanced-table > tbody > tr:nth-child(even):not([style*="background"]) > td:not([style*="background"]) { background:#f8fafc; }
 .kms-enhanced-table > tbody > tr:hover:not([style*="background"]) > td:not([style*="background"]) { background:#eff6ff; }
}
.kms-table-scroll { min-width:0; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.kms-table-scroll .kms-enhanced-table > thead > tr > th { position:sticky; top:var(--kms-header-top,0px); z-index:10; }
.kms-sortable-th { cursor:pointer; user-select:none; }
.kms-sort-indicator { display:inline-block; min-width:12px; margin-left:5px; color:#64748b; font-size:10px; opacity:.4; pointer-events:none; }
.kms-sortable-th:is(:hover,:focus-visible) .kms-sort-indicator { opacity:1; }
.kms-sortable-th[aria-sort]:not([aria-sort="none"]) .kms-sort-indicator { color:#2563eb; opacity:1; }
.kms-enhanced-table > thead > tr > th :is(.col_filter,.filter-icon,.rg-col-filter) {
 display:inline-flex !important; align-items:center !important; justify-content:center !important;
 width:16px !important; height:16px !important; min-width:16px !important; min-height:16px !important; max-height:16px !important;
 margin-left:3px !important; padding:0 !important;
 border:1px solid transparent !important; border-radius:3px !important;
 background:transparent !important; box-shadow:none !important;
 color:#64748b !important; font-size:10px !important; font-weight:600 !important; line-height:1 !important;
 vertical-align:middle !important; cursor:pointer !important; user-select:none !important;
 transition:background-color .15s ease,color .15s ease,border-color .15s ease;
}
.kms-enhanced-table > thead > tr > th :is(.col_filter,.filter-icon,.rg-col-filter):hover {
 background:rgba(37,99,235,.14) !important; color:#1d4ed8 !important; border-color:rgba(37,99,235,.28) !important;
}
.kms-enhanced-table > thead > tr > th :is(.col_filter,.filter-icon,.rg-col-filter).active {
 background:#2563eb !important; color:#fff !important; border-color:#1d4ed8 !important; font-weight:700 !important;
}
.kms-th-resizer { position:absolute; top:0; right:0; bottom:0; width:6px !important; z-index:15; cursor:col-resize; touch-action:none; user-select:none; }
.kms-th-resizer:is(:hover,:focus-visible),.kms-th-resizer.is-resizing { background:rgba(37,99,235,.18); box-shadow:inset -2px 0 #2563eb; outline:none; }
html.kms-column-resizing,html.kms-column-resizing * { cursor:col-resize !important; user-select:none !important; }
.kms-enhanced-table :is(td,th) > :is(input[data-kms-table-input],select[data-kms-table-input]) { max-width:100%; }
.kms-enhanced-table [data-kms-table-input] {
 height:28px !important; min-height:28px !important; max-height:28px !important; padding:0 8px !important;
 border:1px solid #cbd5e1 !important; border-radius:2px !important; box-sizing:border-box !important; background:#fff; color:#1e293b; font-size:13px;
}
.kms-enhanced-table textarea[data-kms-table-input] { height:auto !important; min-height:28px !important; max-height:none !important; padding:4px 8px !important; }
.kms-enhanced-table [data-kms-table-input]:focus { outline:none !important; border-color:#2563eb !important; box-shadow:0 0 0 2px rgba(37,99,235,.20) !important; background:#fff !important; }
.kms-enhanced-table .kms-cell-selected { background-color:rgba(37,99,235,.12) !important; box-shadow:inset 0 0 0 1px rgba(37,99,235,.45) !important; }
.kms-enhanced-table .kms-cell-pasted { animation:kms-pasted .7s ease-out; }
@keyframes kms-pasted { from { box-shadow:inset 0 0 0 2px #2563eb; } to { box-shadow:inset 0 0 0 2px transparent; } }
/* Engine-owned classes/tokens only; never set width/height/padding on floating editors. */
.handsontable th { background:linear-gradient(180deg,#f1f5f9,#e2e8f0) !important; color:#1e293b !important; border-color:#cbd5e1 !important; font-size:13px; font-weight:700; }
.handsontable .currentRow:not([style*="background"]) { background-color:#eff6ff; }
.handsontable .wtBorder.current { background-color:#2563eb !important; }
.handsontableInput:focus { outline:2px solid #2563eb; outline-offset:-2px; }
revo-grid { --rg-header-background:linear-gradient(180deg,#f1f5f9,#e2e8f0); --rg-header-color:#1e293b; --rg-border-color:#cbd5e1; --rg-selection-border-color:#2563eb; --rg-row-hover-background:#eff6ff; }
revo-grid revogr-header { background:linear-gradient(180deg,#f1f5f9,#e2e8f0); color:#1e293b; font-size:13px; font-weight:700; }
@media (max-width:768px) { .kms-table-scroll { max-width:100%; scrollbar-width:thin; } }
@media print {
 .kms-th-resizer,.kms-sort-indicator { display:none !important; }
 .kms-enhanced-table > thead > tr > th { position:static !important; }
 .kms-enhanced-table > thead > tr > th:is(.h1,.h2,.h3,.kms-table-title,[data-kms-table-title]) { background:#f1f5f9 !important; color:#0f172a !important; border:1px solid #94a3b8 !important; border-bottom:2px solid #1e293b !important; }
 .kms-cell-selected { background:transparent !important; box-shadow:none !important; }
}
@media (prefers-reduced-motion:reduce) { .kms-cell-pasted { animation:none; } }

}
