/* GSE & Fuel Asset PMCS — Assets surface.
   Reuses the shared .modal / .field / .btn / .attach-* / .att classes from
   styles.css + inventory.css; this file adds the asset board + detail/edit bits. */

.gse-soon {
  margin: 24px auto;
  max-width: 640px;
  padding: 28px 32px;
  text-align: center;
  color: #6b6b6b;
  background: #fafafa;
  border: 1px dashed #d8d8d8;
  border-radius: 14px;
  line-height: 1.6;
}
.gse-soon em { color: #B79B58; font-style: normal; font-weight: 600; }

/* ─── Toolbar ──────────────────────────────────────────────────────────────── */
.gse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.gse-segs { display: flex; flex-wrap: wrap; gap: 6px; }
.gse-seg {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #555;
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .12s ease;
}
.gse-seg:hover { border-color: #c8c8c8; }
.gse-seg.active { background: #1c1c1c; border-color: #1c1c1c; color: #fff; }

/* ─── Board ────────────────────────────────────────────────────────────────── */
.gse-feed { display: flex; flex-direction: column; gap: 8px; }

.gse-status-head {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #8a8a8a;
}
.gse-status-head:first-child { margin-top: 0; }
.gse-status-n {
  font-size: 11px; color: #fff; background: #b9b9b9;
  border-radius: 999px; padding: 1px 7px;
}
.gse-status-head.gse-st-inop .gse-status-n { background: #B42318; }
.gse-status-head.gse-st-maint .gse-status-n { background: #E5A000; }
.gse-status-head.gse-st-squawks .gse-status-n { background: #7a9a3a; }
.gse-status-head.gse-st-ok .gse-status-n { background: #3a8a55; }

.gse-row {
  display: flex; align-items: center;
  background: #fff;
  border: 1px solid #ececec;
  border-left: 3px solid #d8d8d8;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.gse-row:hover { border-color: #d0d0d0; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.gse-row-main { flex: 1; min-width: 0; }
.gse-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gse-name { font-weight: 600; color: #1c1c1c; }
.gse-row-sub { margin-top: 3px; font-size: 12.5px; color: #888; }

/* Status pills */
.gse-status-pill {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.gse-st-ok      { background: #e8f3ec; color: #2f6b45; }
.gse-st-squawks { background: #eef3e2; color: #5d7327; }
.gse-st-maint   { background: #fdf3df; color: #8a6300; }
.gse-st-inop    { background: #fbe9e7; color: #97271c; }

.gse-tag.overdue {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: #fbe9e7; color: #97271c;
}

/* Left-border accent by group status (set on the row via its group) */
.gse-status-head.gse-st-inop    ~ .gse-row { border-left-color: #d8d8d8; }

/* ─── Detail modal ─────────────────────────────────────────────────────────── */
.gse-detail-dialog, .gse-edit-dialog { max-width: 720px; width: 92vw; }
/* Never taller than the viewport; scroll the history/fields inside instead of
   spilling the actions off-screen on short displays. */
.gse-detail-dialog { max-height: 88vh; overflow-y: auto; }
.gse-detail-actions { display: flex; align-items: center; gap: 10px; }
.gse-detail-spacer { flex: 1; }

.gse-detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 10px 18px; margin: 8px 0 4px;
}
.gse-detail-cell { display: flex; flex-direction: column; gap: 2px; }
.gse-detail-k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #9a9a9a; }
.gse-detail-v { font-size: 14px; color: #222; }
.gse-detail-note { margin: 10px 0; }
.gse-detail-note .gse-detail-k { display: block; margin-bottom: 4px; }
.gse-detail-note p { margin: 0; font-size: 13.5px; color: #333; line-height: 1.5; }

/* Regulatory grid */
.gse-reg { margin-top: 16px; }
.gse-reg-head, .gse-history-head {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #8a8a8a; margin-bottom: 8px;
}
.gse-reg-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  border-left: 3px solid #e0e0e0;
  background: #fafafa;
  margin-bottom: 6px;
}
.gse-reg-row.gse-reg-overdue { border-left-color: #B42318; background: #fcf0ee; }
.gse-reg-row.gse-reg-soon    { border-left-color: #E5A000; background: #fdf8ec; }
.gse-reg-row.gse-reg-ok      { border-left-color: #3a8a55; }
.gse-reg-label { font-size: 13px; color: #333; }
.gse-reg-date  { font-size: 13px; color: #555; font-variant-numeric: tabular-nums; }
.gse-reg-state { font-size: 12px; color: #888; white-space: nowrap; }
.gse-reg-overdue .gse-reg-state { color: #97271c; font-weight: 600; }
.gse-reg-soon .gse-reg-state    { color: #8a6300; font-weight: 600; }
.gse-files { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* History */
.gse-history { margin-top: 18px; }
.gse-ev { padding: 8px 0; border-top: 1px solid #f0f0f0; }
.gse-ev-top { display: flex; justify-content: space-between; gap: 10px; }
.gse-ev-who { font-size: 13px; font-weight: 600; color: #333; }
.gse-ev-when { font-size: 12px; color: #aaa; }
.gse-ev-body { font-size: 13px; color: #555; margin-top: 2px; }
.gse-ev-chg { color: #444; }

/* ─── Edit modal ───────────────────────────────────────────────────────────── */
.gse-edit-dialog { max-height: 88vh; overflow-y: auto; }
.gse-form-section {
  margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #8a8a8a; border-bottom: 1px solid #eee; padding-bottom: 4px;
}
.gse-form-section:first-of-type { margin-top: 4px; }
.gse-form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px 16px;
}
.gse-form-grid .field-wide { grid-column: 1 / -1; }

.gse-reg-edit { display: flex; flex-direction: column; gap: 10px; }
.gse-reg-edit-row {
  display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 12px 16px; align-items: end;
}
.gse-file-field .attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }

/* ─── Squawks ──────────────────────────────────────────────────────────────── */
.gse-seg-n { font-size: 11px; opacity: .7; margin-left: 2px; }
.gse-tag.parts { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f6; color: #46506b; }
.gse-sq-photo { font-size: 12px; }

.gse-status-head.gse-sq-needs    .gse-status-n { background: #B42318; }
.gse-status-head.gse-sq-hold     .gse-status-n { background: #b06a8a; }
.gse-status-head.gse-sq-review   .gse-status-n { background: #E5A000; }
.gse-status-head.gse-sq-maint    .gse-status-n { background: #c89000; }
.gse-status-head.gse-sq-postmaint .gse-status-n { background: #3f6fb0; }
.gse-status-head.gse-sq-done     .gse-status-n { background: #3a8a55; }

/* Radio groups (replicable / urgent / operable) */
.gse-radio { display: flex; flex-wrap: wrap; gap: 14px; }
.gse-radio label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #333; cursor: pointer; }

/* Admin manage grid in the squawk detail */
.gse-manage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px 16px; }

/* Open-squawks list embedded in the asset detail */
.gse-asset-squawks { margin-top: 16px; }
.gse-asset-squawk {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin-bottom: 5px;
  border-radius: 8px; background: #fcf0ee; border-left: 3px solid #B42318; cursor: pointer;
  font-size: 13px; color: #333;
}
.gse-asset-squawk .gse-as-status { margin-left: auto; font-size: 11px; color: #97271c; font-weight: 600; }

/* ─── PMCS ─────────────────────────────────────────────────────────────────── */
.gse-pmcs-toolbar { flex-wrap: wrap; row-gap: 8px; }
.gse-tag.howto { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f6; color: #46506b; }
/* reuse inventory's .inv-confirm button + .urg-* row borders (inventory.css) */
.gse-row.urg-overdue { border-left-color: #B42318; }
.gse-row.urg-soon { border-left-color: #E5A000; }
.gse-row.urg-paused { border-left-color: #c3c3c8; opacity: 0.72; }
.gse-row .inv-confirm { margin-right: 12px; }
.gse-tag.paused { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eceaf0; color: #5d5870; }

.gse-howto { font-size: 14px; line-height: 1.6; color: #333; }
.gse-howto p { margin: 0 0 10px; }
.gse-howto-empty { color: #9a9a9a; font-style: italic; }
.gse-media { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.gse-media-video { max-width: 280px; max-height: 200px; border-radius: 8px; background: #000; }
.gse-ev-note { margin-top: 3px; font-size: 12.5px; color: #666; }
.inv-ev-badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.inv-ev-badge.ontime { background: #e8f3ec; color: #2f6b45; }
.inv-ev-badge.late { background: #fbe9e7; color: #97271c; }

/* ─── Analytics (uses analytics.css for tabs/picker/summary/report-table) ────── */
/* summary-bar and the report tables get a little breathing room inside the GSE
   panel; the heavy lifting is analytics.css. */
#gse-an-body .summary-bar { margin-bottom: 18px; }
.gse-an-stack > * + * { margin-top: 20px; }
.gse-an-sub {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted, #575760); margin: 22px 0 10px;
}
.gse-an-cap {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-faint, #888); margin: 0 0 8px;
}

/* ─── Sub-tabs (the GSE tab's own nav, inside the dashboard or standalone) ───── */
.gse-subtabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #ececec;
}
.gse-subtab {
  border: none; background: none; color: #777;
  padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.gse-subtab:hover { background: #f4f4f4; color: #333; }
.gse-subtab.active { background: #1c1c1c; color: #fff; }
.gse-subpanel.hidden { display: none; }

/* ─── Kanban ───────────────────────────────────────────────────────────────── */
.gse-feed.gse-kanban {
  display: flex; flex-direction: row; gap: 12px;
  overflow-x: auto; padding-bottom: 8px; align-items: flex-start;
}
.gse-kan-col {
  flex: 0 0 268px; min-width: 268px;
  background: #f7f7f7; border: 1px solid #ececec; border-radius: 12px; padding: 8px;
}
.gse-kan-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #555;
  padding: 4px 6px 8px; border-bottom: 2px solid transparent;
}
.gse-kan-head.gse-st-inop, .gse-kan-head.gse-sq-needs { border-bottom-color: #B42318; }
.gse-kan-head.gse-st-maint, .gse-kan-head.gse-sq-review, .gse-kan-head.gse-sq-postmaint { border-bottom-color: #E5A000; }
.gse-kan-head.gse-st-squawks, .gse-kan-head.gse-sq-hold { border-bottom-color: #b06a8a; }
.gse-kan-head.gse-st-ok, .gse-kan-head.gse-sq-done { border-bottom-color: #3a8a55; }
.gse-kan-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; padding: 6px 2px; border-radius: 8px; transition: background .12s; }
.gse-kan-cards.drop-over { background: #efe6cf; outline: 2px dashed #B79B58; }
.gse-kan-card {
  background: #fff; border: 1px solid #e7e7e7; border-radius: 9px; padding: 10px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.gse-kan-card[draggable="true"] { cursor: grab; }
.gse-kan-card.dragging { opacity: .4; }
.gse-kan-card:hover { border-color: #d2d2d2; }
.gse-kan-title { font-size: 13.5px; font-weight: 600; color: #1c1c1c; }
.gse-kan-meta { font-size: 12px; color: #888; margin-top: 3px; }
.gse-kan-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Cards take the tint of their status column (assets + squawks). */
.gse-kan-col.gse-st-ok      .gse-kan-card { background: #f0f8f3; border-color: #d4e8dd; }
.gse-kan-col.gse-st-squawks .gse-kan-card { background: #eef3e2; border-color: #dde6c8; }
.gse-kan-col.gse-st-maint   .gse-kan-card { background: #fdf8ec; border-color: #efe1c2; }
.gse-kan-col.gse-st-inop    .gse-kan-card { background: #fcf0ee; border-color: #f0d6d2; }
.gse-kan-col.gse-sq-needs    .gse-kan-card { background: #fcf0ee; border-color: #f0d6d2; }
.gse-kan-col.gse-sq-hold     .gse-kan-card { background: #f8eef3; border-color: #ecd9e4; }
.gse-kan-col.gse-sq-review   .gse-kan-card { background: #fdf8ec; border-color: #efe1c2; }
.gse-kan-col.gse-sq-maint    .gse-kan-card { background: #fdf6e3; border-color: #ecdcb4; }
.gse-kan-col.gse-sq-postmaint .gse-kan-card { background: #eef2f9; border-color: #d6e0f0; }
.gse-kan-col.gse-sq-done     .gse-kan-card { background: #f0f8f3; border-color: #d4e8dd; }
/* Faint matching wash on the column body too. */
.gse-kan-col.gse-st-inop, .gse-kan-col.gse-sq-needs { background: #fbf5f4; }
.gse-kan-col.gse-st-maint, .gse-kan-col.gse-sq-review, .gse-kan-col.gse-sq-maint { background: #fcf9f1; }
.gse-kan-col.gse-st-squawks { background: #f6f8ef; }
.gse-kan-col.gse-st-ok, .gse-kan-col.gse-sq-done { background: #f3f8f5; }
.gse-kan-col.gse-sq-hold { background: #f9f3f6; }
.gse-kan-col.gse-sq-postmaint { background: #f3f6fb; }

.gse-toggle { font-size: 13px; color: #555; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.gse-spacer { flex: 1; }

/* ─── Combobox (type-to-search single select) ────────────────────────────────── */
.combobox { position: relative; }
.combobox-input { width: 100%; }
.combobox-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 60;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid #dcdcdc; border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 240px; overflow-y: auto;
}
.combobox-option { padding: 7px 10px; border-radius: 7px; font-size: 14px; color: #333; cursor: pointer; }
.combobox-option.active, .combobox-option:hover { background: #f0ead7; color: #1c1c1c; }
.combobox-empty { padding: 7px 10px; font-size: 13px; color: #9a9a9a; }

/* ─── Inspection rating colors (detail) ──────────────────────────────────────── */
.gse-reg-row.gse-rate-sat   { border-left-color: #3a8a55; background: #f0f8f3; }
.gse-reg-row.gse-rate-marg  { border-left-color: #E5A000; background: #fdf8ec; }
.gse-reg-row.gse-rate-unsat { border-left-color: #B42318; background: #fcf0ee; }
.gse-rate-sat   .gse-reg-state { color: #2f6b45; font-weight: 600; }
.gse-rate-marg  .gse-reg-state { color: #8a6300; font-weight: 600; }
.gse-rate-unsat .gse-reg-state { color: #97271c; font-weight: 700; }
.gse-reg-note { grid-column: 1 / -1; font-size: 12px; color: #777; margin-top: 3px; }
.gse-insp-comment { margin-top: 6px; }

@media (max-width: 640px) {
  .gse-reg-edit-row { grid-template-columns: 1fr; }
  .gse-reg-row { grid-template-columns: 1fr auto; }
  .gse-reg-state { grid-column: 2; }
  .gse-an-cols { grid-template-columns: 1fr; }
}
