/* nexus-grid widget — base styles
   ---------------------------------------------------------------------------
   Defensive baseline that works in both SAP GUI's MSHTML control and modern
   WebView2 / Edge. No position:sticky, no content-visibility, no flexbox in
   critical paths — pure absolute positioning instead. See nexus-grid/README.md
   for the rationale. */

html, body { margin: 0; padding: 0; height: 100%;
  font-family: "Segoe UI","Helvetica Neue",Arial,sans-serif; font-size: 13px; color: #1d2d3e;
  background: #f7f7f7; overflow: hidden; }

.page { position: absolute; left: 0; right: 0; top: 0; bottom: 0; padding: 14px 18px; }
h1 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: #0a2540; }
p.sub { margin: 0 0 10px; color: #5b6b7d; font-size: 12px; }

.toolbar { height: 32px; }
.toolbar input { padding: 6px 10px; font-size: 13px; min-width: 280px;
  border: 1px solid #d8dde2; border-radius: 4px; font-family: inherit;
  background: #ffffff; color: #1d2d3e; outline: none; }
.toolbar input:focus { border-color: #0a64d6; }
.toolbar .count { font-size: 12px; color: #5b6b7d; margin-left: 12px; }
.toolbar .count b { color: #0a2540; }
.toolbar button { padding: 5px 12px; font-size: 12px; margin-left: 8px;
  border: 1px solid #d8dde2; background: #ffffff; color: #1d2d3e;
  border-radius: 4px; cursor: pointer; font-family: inherit; }
.toolbar button:hover { background: #f0f4f8; border-color: #c0c8d0; }
.toolbar button.ico { color: #4b5b6e; }

/* Filter bar - holds dynamic filter field chips (added via Adapt Filters).
   Hidden when empty so it doesn't reserve vertical space. */
.filter-bar { padding: 6px 0 2px; display: block; line-height: 1; }
.ff { display: inline-block; vertical-align: top; margin: 0 8px 6px 0; font-size: 12px; }
.ff .ff-label { display: block; font-size: 10.5px; color: #6b7886;
  margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; }
.ff .ff-row { white-space: nowrap; }
.ff input { padding: 5px 8px; font-size: 12px; width: 220px;
  border: 1px solid #d8dde2; border-radius: 4px 0 0 4px;
  font-family: inherit; background: #ffffff; color: #1d2d3e;
  outline: none; vertical-align: middle; box-sizing: border-box; }
.ff input:focus { border-color: #0a64d6; position: relative; z-index: 1; }
.ff input.complex { background: #f0f4f8; color: #4b5b6e; font-style: italic; cursor: pointer; }
.ff .vh, .ff .ff-rm { padding: 5px 8px; font-size: 12px;
  border: 1px solid #d8dde2; background: #f7f9fb; color: #4b5b6e;
  cursor: pointer; font-family: inherit; vertical-align: middle;
  border-left: 0; line-height: 1; box-sizing: border-box; }
.ff .vh { border-radius: 0; min-width: 28px; }
.ff .ff-rm { border-radius: 0 4px 4px 0; min-width: 26px; }
.ff .vh:hover { background: #eef4fa; color: #0a64d6; }
.ff .ff-rm:hover { background: #fdecea; color: #c2331c; }

/* .shell top is overridden dynamically by JS layoutShell() based on filter bar height */
.shell { position: absolute; left: 18px; right: 18px; top: 96px; bottom: 60px;
  background: #ffffff; border: 1px solid #d8dde2; border-radius: 4px; overflow: hidden; }

/* Adapt Filters modal */
.adapt-modal-bd { position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 37, 64, 0.35); z-index: 200; }
.adapt-modal { position: fixed; top: 80px; left: 50%; margin-left: -180px;
  width: 360px; background: #ffffff; border: 1px solid #c0c8d0; border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3); z-index: 201;
  font-size: 12px; color: #1d2d3e; }
.adapt-modal .head { padding: 12px 16px 6px; font-weight: 600; font-size: 13px; color: #1d2d3e;
  border-bottom: 1px solid #eef2f5; }
.adapt-modal .body { padding: 8px 16px 12px; max-height: 380px; overflow-y: auto; }
.adapt-modal .body label { display: block; padding: 6px 0; cursor: pointer; font-size: 12.5px; }
.adapt-modal .body label input { margin-right: 8px; vertical-align: middle; }
.adapt-modal .buttons { padding: 8px 12px; text-align: right;
  border-top: 1px solid #eef2f5; background: #fafbfc; border-radius: 0 0 4px 4px; }
.adapt-modal .buttons button { padding: 5px 14px; font-size: 11.5px;
  border: 1px solid #d8dde2; background: #ffffff; color: #1d2d3e;
  border-radius: 3px; cursor: pointer; margin-left: 4px; font-family: inherit; }
.adapt-modal .buttons button:hover { background: #f0f4f8; }
.adapt-modal .buttons button.primary { background: #0a64d6; border-color: #0a64d6; color: #ffffff; }
.adapt-modal .buttons button.primary:hover { background: #094fbb; }

.thead { position: absolute; top: 0; left: 0; right: 0; height: 36px;
  background: #eef2f5; border-bottom: 1px solid #d8dde2;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #4b5b6e; white-space: nowrap; overflow: hidden;
  user-select: none; }
.thead .cell { display: inline-block; padding: 10px 28px 10px 12px; vertical-align: top;
  cursor: pointer; position: relative; }
.thead .cell:hover { background: #e0e6ec; }

.sort-arrow { color: #0a64d6; margin-left: 4px; font-size: 10px; }

.tbody { position: absolute; top: 36px; left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden; }
.spacer { width: 1px; }

.row { position: absolute; left: 0; right: 0; height: 30px;
  white-space: nowrap; border-bottom: 1px solid #eef2f5; overflow: hidden; }
.row:hover { background: #f5f9fc; }

.cell { display: inline-block; padding: 7px 12px; vertical-align: top;
  font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }

.col-key  { width: 220px; font-family: "Consolas","SF Mono",Menlo,monospace; font-size: 12px; color: #0a2540; }
.col-desc { width: 360px; }
.col-type { width: 80px; }
.col-unit { width: 60px; }
.col-date { width: 130px; text-align: right; font-family: "Consolas","SF Mono",Menlo,monospace; font-size: 12px; }

.foot { position: absolute; left: 18px; right: 18px; bottom: 14px; height: 40px;
  font-size: 11.5px; color: #4b5b6e; display: block; }
.foot .row1 { display: block; margin-bottom: 4px; }
.foot .row2 { display: block; color: #6b7886; font-size: 11px; }
.foot .pill { display: inline-block; background: #eef2f5; padding: 1px 8px;
  border-radius: 10px; margin-right: 6px; font-family: inherit; }
.foot .pill.act { background: #d4e5f7; color: #094fbb; font-weight: 600; }
.foot .pill.warn { background: #fff3cd; color: #856404; }
.foot .ms { color: #6b7886; font-family: "Consolas","SF Mono",Menlo,monospace;
  font-size: 10.5px; margin-left: 6px; }

/* Filter popup — Fiori-style two-tab dialog: Items + Define Conditions
   Created on demand by JS, attached to <body>. */
.col-popup { position: fixed; z-index: 100; background: #ffffff;
  border: 1px solid #c0c8d0; border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22); padding: 0;
  width: 480px; font-size: 12px; color: #1d2d3e; }
.col-popup .head { padding: 10px 12px 0; }
.col-popup .ttl { font-weight: 600; font-size: 12px; color: #1d2d3e;
  margin-bottom: 8px; display: block; }
.col-popup .ttl .col-name { color: #0a64d6; font-weight: 600; }

/* Tab strip */
.col-popup .tabs { border-bottom: 1px solid #d8dde2; margin: 0 12px; }
.col-popup .tab { display: inline-block; padding: 7px 14px 6px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: #4b5b6e; border-bottom: 2px solid transparent;
  margin-bottom: -1px; user-select: none; }
.col-popup .tab:hover { color: #1d2d3e; }
.col-popup .tab.active { color: #0a64d6; border-bottom-color: #0a64d6; }

/* Panels - one of these is visible at a time */
.col-popup .panel { padding: 10px 12px 0; display: none; min-height: 200px; }
.col-popup .panel.active { display: block; }

/* Items panel (kept from previous version, lightly tweaked) */
.col-popup .search { width: 100%; padding: 5px 8px; border: 1px solid #d8dde2;
  border-radius: 3px; font-size: 12px; box-sizing: border-box;
  margin-bottom: 6px; font-family: inherit; }
.col-popup .actions { display: block; margin-bottom: 6px; }
.col-popup .actions a { font-size: 11px; color: #0a64d6; cursor: pointer;
  margin-right: 12px; text-decoration: none; }
.col-popup .actions a:hover { text-decoration: underline; }
.col-popup .list { max-height: 220px; overflow-y: auto;
  border: 1px solid #eef2f5; border-radius: 3px; background: #fafbfc; }
.col-popup .item { display: block; padding: 3px 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-popup .item:hover { background: #eef4fa; }
.col-popup .item input { margin: 0 6px 0 0; vertical-align: middle; }
.col-popup .item .cnt { color: #8b95a0; font-size: 10.5px; margin-left: 4px; }

/* Conditions panel */
.col-popup .conds { max-height: 240px; overflow-y: auto; padding-right: 2px; }
.col-popup .cond { white-space: nowrap; margin-bottom: 6px; }
.col-popup .cond .seg { display: inline-block; border: 1px solid #d8dde2;
  border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 4px; }
.col-popup .cond .seg button { padding: 4px 9px; font-size: 11px;
  background: #ffffff; color: #4b5b6e; border: 0; cursor: pointer;
  font-family: inherit; }
.col-popup .cond .seg button + button { border-left: 1px solid #d8dde2; }
.col-popup .cond .seg button:hover { background: #f0f4f8; }
.col-popup .cond .seg button.on { background: #0a64d6; color: #ffffff; }
.col-popup .cond .seg button.on.excl { background: #c2331c; }
.col-popup .cond select, .col-popup .cond input.val {
  padding: 4px 6px; font-size: 12px; border: 1px solid #d8dde2;
  border-radius: 3px; font-family: inherit; vertical-align: middle;
  margin-right: 4px; background: #ffffff; color: #1d2d3e; box-sizing: border-box; }
.col-popup .cond select { min-width: 122px; }
.col-popup .cond input.val { width: 138px; }
.col-popup .cond input.val.two { width: 90px; }
.col-popup .cond .rm { padding: 4px 8px; font-size: 12px; line-height: 1;
  border: 1px solid #d8dde2; background: #ffffff; color: #6b7886;
  border-radius: 3px; cursor: pointer; font-family: inherit;
  vertical-align: middle; }
.col-popup .cond .rm:hover { background: #fdecea; border-color: #f5c2c0; color: #c2331c; }
.col-popup .conds-empty { color: #8b95a0; font-style: italic; padding: 6px 0; font-size: 11.5px; }
.col-popup .add-cond { margin-top: 4px; padding: 5px 10px; font-size: 11.5px;
  border: 1px dashed #c0c8d0; background: #f7f9fb; color: #0a64d6;
  border-radius: 3px; cursor: pointer; font-family: inherit; }
.col-popup .add-cond:hover { background: #eef4fa; border-style: solid; border-color: #0a64d6; }

/* Footer buttons */
.col-popup .buttons { margin-top: 10px; padding: 8px 12px; text-align: right;
  border-top: 1px solid #eef2f5; background: #fafbfc;
  border-radius: 0 0 4px 4px; }
.col-popup .buttons button { padding: 5px 14px; font-size: 11.5px;
  border: 1px solid #d8dde2; background: #ffffff; color: #1d2d3e;
  border-radius: 3px; cursor: pointer; margin-left: 4px; font-family: inherit; }
.col-popup .buttons button:hover { background: #f0f4f8; }
.col-popup .buttons button.primary { background: #0a64d6; border-color: #0a64d6; color: #ffffff; }
.col-popup .buttons button.primary:hover { background: #094fbb; }
.col-popup .buttons .lh { float: left; font-size: 11px; color: #6b7886; padding-top: 5px; }
