:root {
  --dark-blue: #04273f;
  --teal: #4ca092;
  --bright-blue: #27aae1;
  --chalk: #cee1ea;
  --black: #231f20;
  --white: #ffffff;
  --bright-green: #8dc63f;
  --dark-green: #09382b;
  --purple: #5a3795;
  --mauve: #95a2d2;
  --pale-blue: #80c0e9;
  --danger: #a02b2b;
  --warning: #8a6600;
  --ok: #177245;
  --border: #e4e4e7;
  --card: #ffffff;
  --text: #231f20;
  --muted: #71717a;
  --shadow: 0 14px 32px rgba(4, 39, 63, 0.14);
  --radius: 8px;
  font-family: Inter, "Inter Fallback", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(140deg, #f7fbfd 0%, #eef6fa 52%, #ffffff 100%);
  color: var(--black);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
}
.auth-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
}
.brand-block { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.brand-mark { width: 54px; height: 64px; }
.brand-word { letter-spacing: 0.18em; font-weight: 700; color: var(--dark-blue); font-size: 19px; }
.strapline { color: var(--teal); font-size: 13px; margin-top: 4px; }
.auth-hero {
  position: relative;
  background: var(--dark-blue);
  overflow: hidden;
  color: white;
  padding: 64px;
  display: flex;
  align-items: flex-end;
}
.auth-hero::before, .brand-top::after, .pattern-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(30deg, transparent 46%, rgba(39,170,225,.8) 47%, rgba(39,170,225,.8) 53%, transparent 54%),
    linear-gradient(150deg, transparent 46%, rgba(141,198,63,.75) 47%, rgba(141,198,63,.75) 53%, transparent 54%);
  background-size: 34px 58px;
}
.auth-hero > div { position: relative; max-width: 720px; }
h1 { color: var(--dark-blue); font-size: clamp(30px, 4vw, 52px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.03em; }
.auth-hero h1 { color: white; }
p { line-height: 1.5; }
.card {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(4,39,63,0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.form-row { display: grid; gap: 8px; margin-bottom: 14px; }
label { font-weight: 700; color: var(--dark-blue); font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #b9d3df;
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
  color: var(--black);
}
textarea { min-height: 92px; resize: vertical; }

.datetime-picker-wrap {
  position: relative;
  width: 100%;
}
.datetime-picker-wrap .datetime-text-input {
  width: 100%;
  cursor: pointer;
}
.datetime-native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--dark-blue);
  color: white;
  font-weight: 700;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.btn.secondary { background: var(--chalk); color: var(--dark-blue); }
.btn.ghost { background: transparent; color: var(--dark-blue); border: 1px solid #bad5e0; }
.btn.warn { background: var(--warning); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 11px; font-size: 13px; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--dark-blue);
  color: white;
  padding: 22px;
  position: static;
  top: auto;
  min-height: 100vh;
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.sidebar .brand-word { color: white; }
.sidebar .strapline { color: var(--pale-blue); }
.project-chip {
  background: rgba(255,255,255,0.08);
  padding: 9px 10px;
  border-radius: 12px;
  margin: 10px 0;
}
.project-chip select { margin-top: 6px; background: white; }
.project-chip-static span {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  line-height: 1.3;
}
.project-chip-static span:empty::before {
  content: 'No plant/project selected';
}
.nav { display: grid; align-content: start; grid-auto-rows: max-content; gap: 3px; margin-top: 10px; }
.nav button {
  text-align: left;
  color: rgba(255,255,255,0.78);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,0.12); color: white; }
.content { padding: 28px; }
.brand-top {
  position: relative;
  overflow: hidden;
  background: var(--dark-blue);
  color: white;
  padding: 26px;
  border-radius: 24px;
  margin-bottom: 22px;
}
.brand-top > * { position: relative; }
.brand-top h1 { color: white; margin-bottom: 8px; }
.toolbar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: grid; gap: 5px; }
.kpi b { color: var(--dark-blue); font-size: 28px; }
.kpi span { color: #577382; font-size: 13px; }

/* Compact KPI tiles */
.grid.kpi-grid,
.grid:has(> .card.kpi) {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)) !important;
}
.card.kpi {
  min-width: 0 !important;
}
.card.kpi b {
  font-size: 26px;
}
.card.kpi span {
  line-height: 1.25;
}
@media (max-width: 720px) {
  .grid.kpi-grid,
  .grid:has(> .card.kpi) {
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)) !important;
  }
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { border: 1px solid #bad5e0; background: white; color: var(--dark-blue); border-radius: 999px; padding: 9px 13px; font-weight: 700; }
.tabs button.active { background: var(--dark-blue); color: white; border-color: var(--dark-blue); }
.table-wrap { overflow: auto; border: 1px solid #d8e7ee; border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 12px; border-bottom: 1px solid #e6f0f4; text-align: left; vertical-align: top; }
th { color: var(--dark-blue); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f5fafc; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--chalk); color: var(--dark-blue); }
.badge.ok { background: #d9f1e6; color: var(--ok); }
.badge.warn { background: #fff2cc; color: var(--warning); }
.badge.danger { background: #f7d8d8; color: var(--danger); }
.section-title { color: var(--dark-blue); margin: 0 0 12px; }
.muted { color: #66808d; }
.reading-card { display: grid; gap: 8px; border-left: 5px solid var(--bright-blue); }
.process-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.process-area { position: relative; padding-top: 18px; }
.hex-icon {
  width: 38px;
  height: 42px;
  background: var(--dark-blue);
  color: white;
  clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 10px;
}
.field-list { display: grid; gap: 10px; }
.field-item { display: grid; grid-template-columns: 1fr 120px 80px 42px; gap: 8px; align-items: center; }
.qlik-frame { width: 100%; height: 70vh; border: 1px solid #d8e7ee; border-radius: 18px; background: white; }
.empty { padding: 28px; text-align: center; color: #66808d; border: 1px dashed #b9d3df; border-radius: 16px; background: #f8fbfd; }
#toast { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 10; }
.toast { background: var(--dark-blue); color: white; border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow); }
.footer-note { margin-top: 22px; color: #7690a0; font-size: 12px; }
@media (max-width: 920px) {
  .auth-shell, .app-shell, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .sidebar { position: static; height: auto; }
  .content { padding: 18px; }
  .field-item { grid-template-columns: 1fr; }
}

/* Engineurs SHIFT brand revision */
.brand-block {
  align-items: center;
  gap: 16px;
  margin-bottom: 34px;
}
.engineurs-logo {
  width: 118px;
  min-width: 118px;
  height: auto;
  display: block;
}
.brand-block-dark .engineurs-logo {
  width: 126px;
  min-width: 126px;
}
.shift-product-lockup {
  border-left: 1px solid rgba(4,39,63,0.18);
  padding-left: 16px;
  display: grid;
  gap: 3px;
}
.brand-block-dark .shift-product-lockup {
  border-left-color: rgba(255,255,255,0.28);
}
.shift-product-lockup span,
.product-nameplate span,
.shift-brand-strip span {
  letter-spacing: 0.24em;
  font-weight: 800;
  color: var(--dark-blue);
  font-size: 22px;
}
.brand-block-dark .shift-product-lockup span,
.product-nameplate span,
.shift-brand-strip span { color: var(--white); }
.shift-product-lockup small,
.product-nameplate small {
  color: var(--teal);
  line-height: 1.25;
  max-width: 190px;
  display: block;
}
.brand-block-dark .shift-product-lockup small,
.product-nameplate small { color: var(--pale-blue); }
.product-nameplate {
  display: none;
}
.shift-brand-strip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  margin-bottom: 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
}
.shift-brand-strip span {
  font-size: 13px;
}
.shift-brand-strip strong {
  color: var(--chalk);
  font-size: 13px;
  font-weight: 600;
}
.auth-panel .engineurs-logo {
  width: 132px;
  min-width: 132px;
}
.auth-hero::after {
  content: "SHIFT";
  position: absolute;
  right: 52px;
  top: 46px;
  color: rgba(255,255,255,0.10);
  font-size: clamp(72px, 13vw, 190px);
  font-weight: 800;
  letter-spacing: 0.18em;
}
@media (max-width: 920px) {
  .engineurs-logo { width: 104px; min-width: 104px; }
  .shift-product-lockup span { font-size: 18px; }
  .shift-brand-strip { display: grid; border-radius: 16px; }
}

/* v0.3 SharePoint brand backgrounds and admin forms */
:root {
  --sp-pattern-colour: url("https://engineurs.sharepoint.com/sites/Engineurs693/Shared%20Documents/General/06%20-%20Branding/Background%20Patterns/Background_Pattern_Colour.png?web=1");
  --sp-pattern-blue: url("https://engineurs.sharepoint.com/sites/Engineurs693/Shared%20Documents/General/06%20-%20Branding/Background%20Patterns/Background_Pattern_Blue.png?web=1");
  --sp-banner-no-text: url("https://engineurs.sharepoint.com/sites/Engineurs693/Shared%20Documents/General/06%20-%20Branding/LinkedIn%20Banner/engineurs_banner_no_text.jpg?web=1");
}
body {
  background-image:
    linear-gradient(140deg, rgba(247,251,253,.96) 0%, rgba(238,246,250,.94) 52%, rgba(255,255,255,.96) 100%),
    var(--sp-pattern-colour);
  background-size: cover, 760px auto;
  background-attachment: fixed, fixed;
}
.sharepoint-banner {
  background-image:
    linear-gradient(180deg, rgba(4,39,63,.18), rgba(4,39,63,.86)),
    var(--sp-banner-no-text),
    var(--sp-pattern-blue);
  background-size: cover, cover, 520px auto;
  background-position: center, center, center;
}
.auth-hero::before,
.brand-top::after,
.pattern-card::before {
  background-image: var(--sp-pattern-colour);
  background-size: cover;
  background-position: center;
  opacity: .20;
}
.brand-top {
  background-image:
    linear-gradient(135deg, rgba(4,39,63,.96), rgba(4,39,63,.88)),
    var(--sp-banner-no-text);
  background-size: cover;
  background-position: center;
}
.pattern-card {
  position: relative;
  overflow: hidden;
  background: var(--dark-blue);
  color: white;
}
.pattern-card > * { position: relative; }
.pattern-card h2 { color: white; margin: 0 0 8px; }
.pattern-card p { color: var(--chalk); margin: 0; }
.admin-grid { display: grid; gap: 16px; }
.admin-hero-card { min-height: 132px; display: flex; flex-direction: column; justify-content: flex-end; }
.inline-form {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}
.inline-form .form-row { margin-bottom: 0; }
.help-text { display: block; color: #66808d; font-size: 12px; margin-top: 5px; }
select[multiple] { min-height: 96px; }
td input, td select { min-width: 150px; }
@media (max-width: 920px) {
  .inline-form { grid-template-columns: 1fr; }
}

/* v0.4 issue register and date formatting updates */
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.issues-table table { min-width: 1880px; }
.issues-table textarea { min-width: 230px; min-height: 72px; }
.issues-table input, .issues-table select { min-width: 160px; }
.issues-table .text-cell { min-width: 260px; max-width: 420px; white-space: pre-wrap; }
@media (max-width: 1100px) {
  .grid.four, .grid.five, .grid.seven { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid.four, .grid.five, .grid.seven { grid-template-columns: 1fr; }
}

/* v0.5 interface fixes */
.engineurs-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
  overflow: visible;
}
.brand-block:not(.brand-block-dark) .engineurs-logo-frame {
  width: 132px;
  min-width: 132px;
}
.brand-block-dark .engineurs-logo-frame {
  width: 118px;
  min-width: 118px;
}
.brand-block:not(.brand-block-dark) .engineurs-logo {
  width: 132px;
  min-width: 132px;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.brand-block-dark .engineurs-logo {
  width: 118px;
  min-width: 118px;
  height: auto;
  object-fit: contain;
  object-position: center;
}
.shift-brand-strip {
  gap: 0;
  margin-bottom: 12px;
}
.shift-brand-strip strong { display: none; }
.checkselect {
  position: relative;
  width: 100%;
}
.checkselect-button {
  width: 100%;
  border: 1px solid #b9d3df;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--black);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}
.checkselect-button b {
  color: var(--dark-blue);
  font-size: 12px;
}
.checkselect-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 280px;
  overflow: auto;
  background: white;
  border: 1px solid #b9d3df;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
}
.checkselect.open .checkselect-menu { display: grid; gap: 4px; }
.checkselect-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--black);
  padding: 8px;
  border-radius: 10px;
}
.checkselect-menu label:hover { background: #f5fafc; }
.checkselect-menu input {
  width: auto;
  accent-color: var(--dark-blue);
}
td .checkselect { min-width: 230px; }
.trend-card { position: relative; }
#trendCanvas {
  width: 100%;
  height: 560px;
  display: block;
  background: #fff;
  border: 1px solid #d8e7ee;
  border-radius: 16px;
  cursor: crosshair;
}
#trendSettingsRows input[type="color"] {
  min-width: 74px;
  height: 42px;
  padding: 3px;
}
#trendSettingsRows input[name="weight"] { min-width: 86px; }

/* v0.6 layout and logo fixes */
.content {
  padding: 28px;
  display: flex;
  justify-content: center;
}
.page-frame {
  width: min(100%, 1560px);
}
.brand-top {
  width: 100%;
  box-sizing: border-box;
}
.brand-block {
  display: flex;
}
.engineurs-logo-frame {
  width: auto !important;
  min-width: 0 !important;
  height: auto;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0;
  line-height: 0;
}
.brand-block:not(.brand-block-dark) .engineurs-logo,
.brand-block-dark .engineurs-logo,
.engineurs-logo {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px;
  height: auto !important;
  display: block;
  object-fit: contain;
  object-position: center center;
}
.auth-panel .engineurs-logo {
  width: 124px !important;
  min-width: 124px !important;
  max-width: 124px;
}
.sidebar .brand-block {
  align-items: center;
  margin-bottom: 14px;
}
.sidebar .shift-product-lockup span {
  font-size: 19px;
}
@media (max-width: 920px) {
  .content { padding: 18px; display: block; }
  .page-frame { width: 100%; }
}

/* v0.7 page width, issues layout, and SVG logo fixes */
.app-shell,
.content,
.page-frame,
.card,
.grid,
.table-wrap {
  min-width: 0;
}
.content {
  width: 100%;
  overflow-x: hidden;
}
.page-frame {
  max-width: 1560px;
  margin: 0 auto;
}
.brand-top,
.issues-page,
.issues-register-card,
.issues-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.issues-page {
  display: grid;
  gap: 16px;
}
.issues-page .brand-top {
  margin-bottom: 6px;
}
.issues-register-card {
  padding: 0;
  overflow: hidden;
}
.issues-table {
  overflow-x: auto;
  border: 0;
  border-radius: 0;
}
.issues-table table {
  width: max-content;
  min-width: 100%;
}
.issues-table th,
.issues-table td {
  max-width: 280px;
}
.issues-table .text-cell {
  min-width: 220px;
  max-width: 320px;
}
.issues-table textarea {
  min-width: 210px;
  max-width: 260px;
}
.issues-table input,
.issues-table select {
  min-width: 145px;
}
.engineurs-logo-frame {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 126px !important;
  min-width: 126px !important;
  height: 136px !important;
  overflow: visible !important;
}
.engineurs-logo {
  display: block !important;
  width: 118px !important;
  max-width: 118px !important;
  min-width: 118px !important;
  height: auto !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.brand-block:not(.brand-block-dark) .engineurs-logo-frame {
  height: 132px !important;
}
.brand-block-dark .engineurs-logo-frame {
  height: 122px !important;
}
.auth-panel .engineurs-logo-frame {
  width: 142px !important;
  min-width: 142px !important;
  height: 150px !important;
}
.auth-panel .engineurs-logo {
  width: 136px !important;
  min-width: 136px !important;
  max-width: 136px !important;
}
@media (max-width: 920px) {
  .issues-table th,
  .issues-table td {
    max-width: 240px;
  }
}

/* v0.8 mandatory fields, clean banners, and trend configuration */
.required-mark {
  color: #b00020;
  font-weight: 800;
  margin-left: 4px;
}
.brand-top.clean-banner {
  background-image:
    linear-gradient(135deg, rgba(4,39,63,.88), rgba(4,39,63,.74)),
    var(--sp-banner-no-text) !important;
  background-size: cover !important;
  background-position: center !important;
}
.brand-top.clean-banner::after,
.brand-top::after {
  display: none !important;
  content: none !important;
}
.shift-brand-strip {
  display: none !important;
}
.collapsible-config {
  margin-top: 0;
}
.collapsible-config summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--dark-blue);
  font-weight: 800;
}
.collapsible-config summary::-webkit-details-marker {
  display: none;
}
.collapsible-config summary::after {
  content: "Expand";
  color: var(--dark-blue);
  background: var(--chalk);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
}
.collapsible-config[open] summary::after {
  content: "Collapse";
}
.collapsible-config summary small {
  display: block;
  color: #66808d;
  font-weight: 500;
  margin-top: 4px;
}
.collapsible-config .config-grid {
  margin-top: 10px;
}
#trendCanvas {
  height: 600px;
}


/* v0.9 SHIFT logo replacement */
.brand-block {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  margin-bottom: 28px !important;
}
.shift-logo-frame,
.engineurs-logo-frame.shift-logo-frame,
.brand-block:not(.brand-block-dark) .shift-logo-frame,
.brand-block-dark .shift-logo-frame,
.auth-panel .shift-logo-frame {
  width: 230px !important;
  min-width: 230px !important;
  max-width: 230px !important;
  height: 108px !important;
  padding: 12px 16px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  background: var(--dark-blue) !important;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}
.shift-logo-img,
.engineurs-logo.shift-logo-img,
.brand-block:not(.brand-block-dark) .shift-logo-img,
.brand-block-dark .shift-logo-img,
.auth-panel .shift-logo-img {
  width: 198px !important;
  min-width: 198px !important;
  max-width: 198px !important;
  height: auto !important;
  display: block !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.sidebar .shift-logo-frame {
  width: 214px !important;
  min-width: 214px !important;
  max-width: 214px !important;
  height: 100px !important;
  padding: 10px 12px !important;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
}
.sidebar .shift-logo-img {
  width: 186px !important;
  min-width: 186px !important;
  max-width: 186px !important;
}
.auth-panel .brand-block {
  margin-bottom: 22px !important;
}
.shift-product-lockup {
  display: none !important;
}
@media (max-width: 920px) {
  .shift-logo-frame,
  .engineurs-logo-frame.shift-logo-frame {
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
    height: 98px !important;
  }
  .shift-logo-img,
  .engineurs-logo.shift-logo-img {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
  }
}


/* v1.0 logo, acronym, and strict page alignment */
:root {
  --page-max-width: 1280px;
}
.content {
  width: 100% !important;
  padding: 28px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  overflow-x: hidden !important;
}
.page-frame {
  width: 100% !important;
  max-width: var(--page-max-width) !important;
  margin: 0 auto !important;
  min-width: 0 !important;
}
.brand-top,
.tabs,
.admin-tabs,
.admin-tab-panel,
.admin-grid,
.card,
.table-wrap,
.grid,
.toolbar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
.admin-tab-panel {
  display: block !important;
}
.table-wrap {
  overflow-x: auto !important;
}
.issues-table {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
}
.issues-table table {
  width: max-content !important;
  min-width: 1880px !important;
  max-width: none !important;
}
.brand-block {
  display: grid !important;
  grid-template-columns: auto !important;
  align-items: start !important;
  justify-content: start !important;
  justify-items: start !important;
  gap: 8px !important;
  margin-bottom: 28px !important;
}
.shift-logo-frame,
.engineurs-logo-frame.shift-logo-frame,
.brand-block:not(.brand-block-dark) .shift-logo-frame,
.brand-block-dark .shift-logo-frame,
.auth-panel .shift-logo-frame,
.sidebar .shift-logo-frame {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  line-height: 0 !important;
}
.shift-logo-img,
.engineurs-logo.shift-logo-img,
.brand-block:not(.brand-block-dark) .shift-logo-img,
.brand-block-dark .shift-logo-img,
.auth-panel .shift-logo-img,
.sidebar .shift-logo-img {
  width: 228px !important;
  min-width: 228px !important;
  max-width: 228px !important;
  height: auto !important;
  display: block !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.sidebar .shift-logo-img {
  width: 218px !important;
  min-width: 218px !important;
  max-width: 218px !important;
}
.auth-panel .shift-logo-img {
  width: 252px !important;
  min-width: 252px !important;
  max-width: 252px !important;
}
.shift-acronym {
  display: block !important;
  color: var(--dark-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.25;
  max-width: 280px;
}
.brand-block-dark .shift-acronym,
.sidebar .shift-acronym {
  color: var(--pale-blue);
  max-width: 230px;
}
.auth-panel .shift-acronym {
  color: var(--teal);
  max-width: 320px;
}
.product-nameplate {
  display: none !important;
}
.brand-top.clean-banner {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.grid.two,
.grid.three,
.grid.four {
  width: 100% !important;
}
@media (max-width: 920px) {
  .content { padding: 18px !important; display: block !important; }
  .page-frame { max-width: 100% !important; }
  .auth-panel .shift-logo-img,
  .shift-logo-img,
  .engineurs-logo.shift-logo-img,
  .sidebar .shift-logo-img {
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
  }
}

/* v1.1 full-width layout alignment */
:root {
  --page-max-width: none;
  --page-gutter: 16px;
}
.content {
  width: 100% !important;
  max-width: none !important;
  padding: var(--page-gutter) !important;
  display: block !important;
  justify-content: initial !important;
  align-items: initial !important;
  overflow-x: hidden !important;
}
.page-frame {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.brand-top,
.tabs,
.admin-tabs,
.admin-tab-panel,
.admin-grid,
.card,
.table-wrap,
.grid,
.toolbar,
.issues-page,
.trend-card,
.qlik-frame {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.brand-top {
  margin-top: 0 !important;
}
.admin-tab-panel,
.admin-grid,
.issues-page {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.grid.seven {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}
.admin-tabs {
  display: flex !important;
  justify-content: flex-start !important;
}
.issues-register-card,
.issues-table,
.issues-table table {
  max-width: 100% !important;
}
.issues-table table {
  width: max-content !important;
  min-width: 1880px !important;
}
@media (max-width: 1100px) {
  .grid.three,
  .grid.four,
  .grid.seven {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 920px) {
  :root { --page-gutter: 12px; }
  .content {
    padding: var(--page-gutter) !important;
    display: block !important;
  }
  .grid.two,
  .grid.three,
  .grid.four,
  .grid.seven {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* v1.2 compact readings entry */
.readings-compact-card {
  padding: 0;
  overflow: hidden;
}
.readings-compact-header,
.reading-compact-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) minmax(72px, .4fr) minmax(64px, .35fr) minmax(64px, .35fr) minmax(88px, .48fr) minmax(150px, .9fr) minmax(145px, .8fr) minmax(70px, .35fr) minmax(170px, .9fr) minmax(135px, .85fr);
  gap: 8px;
  align-items: center;
}
.readings-compact-header {
  padding: 10px 12px;
  background: #f5fafc;
  color: var(--dark-blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #d8e7ee;
}
.readings-compact-list {
  display: grid;
}
.reading-compact-row {
  padding: 8px 12px;
  border-bottom: 1px solid #e6f0f4;
  background: rgba(255,255,255,.98);
}
.reading-compact-row:last-child {
  border-bottom: 0;
}
.reading-compact-row:hover {
  background: #f8fbfd;
}
.reading-tag,
.reading-frequency,
.reading-status,
.reading-latest {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.reading-tag strong {
  color: var(--dark-blue);
}
.reading-tag span,
.reading-frequency span,
.reading-latest span {
  color: #66808d;
  font-size: 12px;
  line-height: 1.25;
}
.reading-latest strong {
  color: var(--dark-blue);
  font-size: 13px;
}
.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}
.input-with-unit span {
  color: #55717d;
  font-size: 12px;
  white-space: nowrap;
  min-width: 34px;
}
.compact-field {
  margin-bottom: 0;
  gap: 4px;
}
.compact-field label {
  font-size: 11px;
}
.compact-field input {
  padding: 8px 9px;
  border-radius: 10px;
}
.reading-note input {
  min-width: 0;
}
@media (max-width: 1250px) {
  .readings-compact-card {
    overflow-x: auto;
  }
  .readings-compact-header,
  .reading-compact-row {
    min-width: 1240px;
  }
}
@media (max-width: 920px) {
  .readings-compact-header {
    display: none;
  }
  .readings-compact-card {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .reading-compact-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    border: 1px solid #d8e7ee;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
  }
}

/* v1.3 stable vertical scrollbar gutter
   Keep page horizontal positioning consistent when pages become long enough to scroll. */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
body {
  width: 100%;
}

.admin-subsection {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(4, 39, 63, 0.12);
}
.admin-subsection h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--dark-blue);
}
.form-fields-table table {
  min-width: 1100px;
}
.form-fields-table input,
.form-fields-table select {
  width: 100%;
  min-width: 140px;
}
.form-fields-table td {
  vertical-align: top;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
}
.checkbox-inline input {
  width: auto;
  min-width: 0;
}
.filterable-table th {
  white-space: nowrap;
}
.filterable-table th .column-title {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 28px);
  vertical-align: middle;
}
.column-filter-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border: 1px solid #bad5e0;
  border-radius: 999px;
  background: #fff;
  color: var(--dark-blue);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.column-filter-button svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.column-filter-button.active {
  background: var(--dark-blue);
  border-color: var(--dark-blue);
  color: #fff;
}

.filterable-table th.column-filter-active {
  background: inherit;
  box-shadow: none;
}
.filterable-table td.column-filter-active-cell {
  background: inherit;
}
.column-filter-menu {
  position: fixed;
  z-index: 50;
  max-height: min(520px, calc(100vh - 32px));
  overflow: auto;
  padding: 12px;
  border: 1px solid #bad5e0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.column-filter-menu-title {
  color: var(--dark-blue);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 10px;
}
.column-filter-field {
  display: grid;
  gap: 5px;
  color: #577382;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}
.column-filter-field input,
.column-filter-date-row input {
  width: 100%;
  border: 1px solid #d8e7ee;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  background: #fff;
}
.column-filter-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.column-filter-date-row label {
  display: grid;
  gap: 5px;
  color: #577382;
  font-size: 12px;
  font-weight: 700;
}
.column-filter-select-row,
.column-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 10px 0;
}
.column-filter-options {
  display: grid;
  gap: 5px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e6f0f4;
  border-radius: 10px;
  padding: 6px;
  background: #f8fbfd;
}
.column-filter-options label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--black);
}
.column-filter-options label:hover {
  background: #eef7fb;
}
.column-filter-options input {
  width: auto;
  min-width: 0;
  margin-top: 2px;
}
.shift-select-row {
  max-width: 520px;
  margin-bottom: 18px;
}

/* v1.7 Microsoft SSO login styling */
.login-sso-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 52vw) minmax(380px, 48vw);
  background: #ffffff;
}
.login-visual-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #ffffff;
  background-color: #04273f;
  background-image:
    radial-gradient(circle at 30% 28%, rgba(39, 170, 225, .10), transparent 34%),
    linear-gradient(90deg, rgba(4, 39, 63, .99) 0%, rgba(4, 39, 63, .96) 55%, rgba(4, 39, 63, .99) 100%);
  padding: 44px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/assets/login-background-pattern-blue.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  opacity: .32;
  filter: saturate(.85) brightness(.72);
  pointer-events: none;
}
.login-visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 39, 63, .10) 0%, rgba(4, 39, 63, .18) 44%, rgba(4, 39, 63, .54) 100%),
    linear-gradient(90deg, rgba(4, 39, 63, .08) 0%, rgba(4, 39, 63, .24) 100%);
  pointer-events: none;
}
.login-brand-top,
.login-hero-copy,
.login-copyright {
  position: relative;
  z-index: 2;
}
.login-brand-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 176px;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(5, 45, 77, .88);
  box-shadow: 0 0 24px rgba(39, 170, 225, .18);
}
.login-brand-top img {
  width: 136px;
  height: auto;
  display: block;
}
.login-hero-copy {
  max-width: 520px;
  margin-bottom: 23vh;
}
.login-product-logo {
  width: 188px;
  height: auto;
  display: block;
  margin-bottom: 12px;
}
.login-acronym-line {
  display: inline-flex;
  align-items: center;
  max-width: 430px;
  margin: 0 0 18px;
  padding: 7px 12px;
  border: 1px solid rgba(128,192,233,.20);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.login-hero-copy h1 {
  margin: 0 0 26px;
  color: #ffffff;
  font-size: clamp(40px, 4.8vw, 74px);
  line-height: .94;
  letter-spacing: -0.055em;
}
.login-hero-copy h1 span {
  color: #27aae1;
  background: linear-gradient(90deg, #7d66ff 0%, #27aae1 46%, #4ca092 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-hero-copy p {
  max-width: 445px;
  margin: 0 0 22px;
  color: rgba(255,255,255,.58);
  font-size: 15px;
  line-height: 1.55;
}
.login-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 440px;
}
.login-feature-pills span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 15px;
  color: rgba(255,255,255,.46);
  border: 1px solid rgba(128,192,233,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  font-size: 12px;
  font-weight: 700;
}
.login-copyright {
  color: rgba(255,255,255,.38);
  font-size: 12px;
}
.login-access-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 44px;
  background: #ffffff;
}
.login-card-sso {
  width: 100%;
  max-width: 390px;
}
.login-card-sso h2 {
  margin: 0 0 10px;
  color: #0b1627;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.login-card-sso > p {
  margin: 0 0 22px;
  color: #7a8391;
  font-size: 13px;
}
.microsoft-sso-btn {
  width: 100%;
  height: 48px;
  border: 1px solid #d7dce3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(12, 22, 39, .06);
  color: #1f2937;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
}
.microsoft-sso-btn:hover {
  border-color: #b9c4d0;
  box-shadow: 0 6px 18px rgba(12, 22, 39, .10);
}
.microsoft-icon {
  width: 16px;
  height: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}
.microsoft-icon i:nth-child(1) { background: #f25022; }
.microsoft-icon i:nth-child(2) { background: #7fba00; }
.microsoft-icon i:nth-child(3) { background: #00a4ef; }
.microsoft-icon i:nth-child(4) { background: #ffb900; }
.sso-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
  color: #c5cbd3;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sso-divider::before,
.sso-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #edf0f3;
}
.sso-note {
  max-width: 340px;
  margin: 0 auto 22px !important;
  text-align: center;
  color: #858d99 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
.auth-error {
  margin: 0 0 14px;
  padding: 11px 12px;
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.35;
}
.dev-login-details {
  margin-top: 10px;
  border-top: 1px solid #edf0f3;
  padding-top: 16px;
}
.dev-login-details summary {
  cursor: pointer;
  color: #7a8391;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.compact-login-card {
  margin-top: 14px;
  box-shadow: none;
  border-radius: 12px;
}
@media (max-width: 980px) {
  .login-sso-shell {
    grid-template-columns: 1fr;
  }
  .login-visual-panel {
    min-height: 420px;
    padding: 32px;
  }
  .login-hero-copy {
    margin: 56px 0 64px;
  }
  .login-access-panel {
    min-height: auto;
    padding: 38px 24px 56px;
  }
}

/* v2.2 navigation and HSE forms */
.nav-section-label {
  margin: 10px 10px 2px;
  color: rgba(255,255,255,0.48);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav button.project-selection-nav {
  background: transparent;
  color: #ffffff;
  border: 0;
}
.nav button.project-selection-nav.active,
.nav button.project-selection-nav:hover {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}

.microsoft-form-frame {
  width: 100%;
  min-height: 78vh;
  border: 1px solid #d8e7ee;
  border-radius: 18px;
  background: white;
}

/* v2.9 timezone clock */
.sidebar-clock {
  margin-top: 14px;
  padding: 10px 10px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.72);
  font-size: 12px;
  display: grid;
  gap: 8px;
}
.sidebar-clock strong {
  display: block;
  color: rgba(255,255,255,0.48);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.sidebar-clock span {
  color: rgba(255,255,255,0.88);
  font-variant-numeric: tabular-nums;
}


/* v3.0 sidebar scroll and compact navigation */
.app-shell { align-items: stretch; }
.sidebar {
  position: static !important;
  top: auto !important;
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
  padding: 18px !important;
}
.sidebar .brand-block { margin-bottom: 14px !important; }
.project-chip { padding: 9px 10px !important; margin: 10px 0 !important; border-radius: 12px !important; }
.project-chip select { margin-top: 6px !important; }
.nav { gap: 3px !important; margin-top: 10px !important; }
.nav button { padding: 7px 10px !important; border-radius: 10px !important; line-height: 1.18; }
.nav-section-label { margin: 10px 10px 2px !important; font-size: 10px !important; }
.nav button.project-selection-nav { margin-top: 2px !important; }
.nav button.platform-admin-nav { margin-top: 10px !important; }
.sidebar-clock { margin-top: 14px !important; padding: 10px 10px 0 !important; gap: 5px !important; font-size: 11px !important; }
.sidebar-clock strong { font-size: 9px !important; margin-bottom: 1px !important; }
.sidebar-clock div { line-height: 1.25; }
@media (max-width: 920px) {
  .sidebar { min-height: auto !important; }
}

.entry-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.summary-row {
  display: grid;
  grid-template-columns: minmax(160px, 42%) minmax(0, 1fr);
  gap: 8px 16px;
  padding: 9px 12px;
}
.summary-row:nth-child(even) {
  background: #f8fafc;
}
.summary-row + .summary-row {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.summary-row strong,
.summary-row-label {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}
.summary-row span,
.summary-row-value {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.handover-summary-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin: 0;
}
.handover-summary-meta > * { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .entry-summary-grid { grid-template-columns: 1fr; gap: 0; }
  .summary-row { grid-template-columns: 1fr; gap: 3px; padding: 9px 10px; }
  .summary-row strong, .summary-row span { display: block; }
  .handover-summary-meta { display: grid; gap: 3px; }
}


/* v3.4 reduced corner radius
   Standardises the app to a squarer, tighter visual style. */
:root {
  --radius: 8px;
}
.card,
.table-wrap,
.empty,
.toast,
.project-chip,
.brand-top,
.qlik-frame,
.microsoft-form-frame,
.checkselect-button,
.checkselect-menu,
.checkselect-menu label,
.readings-compact-card,
.reading-compact-row,
.compact-login-card,
.auth-error,
.login-brand-top,
.microsoft-sso-btn,
#trendCanvas {
  border-radius: 8px !important;
}
input,
select,
textarea,
.nav button,
.tabs button,
.btn,
.btn.small,
.badge,
.login-feature-pills span,
.collapsible-config summary::after,
.shift-logo-frame,
.engineurs-logo-frame.shift-logo-frame,
.brand-block:not(.brand-block-dark) .shift-logo-frame,
.brand-block-dark .shift-logo-frame,
.auth-panel .shift-logo-frame {
  border-radius: 6px !important;
}
.hex-icon {
  border-radius: 0 !important;
}

/* v4.0 British English capitalisation pass: apply title-style capitalisation to UI chrome while preserving user data fields. */
.nav button,
.product-nameplate small,
.project-chip strong,
.sidebar-user-card .sidebar-user-role,
.sidebar-clock,
.btn,
.section-title,
.card > h2,
.card > h3,
.brand-top h1,
.form-row > label,
table th,
.kpi span,
.badge,
.empty,
.login-card-sso h2,
.login-feature-pills span,
.checkselect-button {
  text-transform: capitalize;
}

/* v4.1 sidebar user summary and tag register editing */
.sidebar-user-card {
  margin-top: 10px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.84);
  font-size: 12px;
  line-height: 1.35;
}
.sidebar-user-card strong,
.sidebar-user-card span {
  display: block;
  overflow-wrap: anywhere;
}
.sidebar-user-card strong { color: #fff; font-size: 13px; margin-bottom: 2px; }
.sidebar-user-card .sidebar-user-role { color: var(--pale-blue); font-weight: 700; margin-top: 3px; }
.qlik-only-frame { width: 100%; }
.tag-register-table input,
.tag-register-table select {
  min-width: 110px;
  padding: 7px 8px;
}
.tag-register-table .tag-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 150px;
}
.tag-register-table .filter-row input { min-width: 80px; }

.history-edit-field {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 1fr);
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}
.history-edit-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark-blue);
}
.history-edit-field input,
.history-edit-field select,
.history-edit-field textarea,
.history-log-table input,
.history-log-table select,
.history-log-table textarea,
.history-reading-table input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}
.history-edit-field textarea {
  min-height: 58px;
}
.history-readonly-values {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--text);
}
.history-log-table .checkselect {
  min-width: 220px;
}
.history-log-table td:last-child,
.history-reading-table td:last-child {
  white-space: nowrap;
}
.history-log-table .btn,
.history-reading-table .btn {
  margin: 2px 4px 2px 0;
}

/* v4.3 compact history and shift log modal */
.compact-history-table table th,
.compact-history-table table td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}
.actions-cell {
  white-space: nowrap;
}
.actions-cell .btn {
  margin-right: 6px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 39, 63, 0.62);
}
.modal-card {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid rgba(4, 39, 63, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(4, 39, 63, 0.28);
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #04273f, #09382b);
  color: #ffffff;
}
.modal-header h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.modal-header p {
  margin: 0;
  color: rgba(255,255,255,0.78);
  font-size: 0.86rem;
}
.icon-btn {
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-card form {
  padding: 20px;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.modal-field label {
  font-weight: 700;
  color: #04273f;
  font-size: 0.82rem;
}
.modal-field textarea {
  min-height: 88px;
}
.readonly-value {
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #d8e7ee;
  border-radius: var(--radius-sm);
  background: #f7fbfd;
  color: #04273f;
  white-space: pre-wrap;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #e4eef3;
}
@media (max-width: 780px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal-card {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

/* v5.2 reliable external embeds */
.trusted-embed {
  width: 100%;
  display: grid;
  gap: 10px;
}
.trusted-embed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e7ee;
  border-radius: var(--radius-sm, 6px);
  background: #f8fbfd;
}
.trusted-embed-toolbar strong,
.trusted-embed-toolbar span {
  display: block;
}
.trusted-embed-toolbar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.trusted-embed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.trusted-embed-frame-wrap {
  width: 100%;
}
@media (max-width: 760px) {
  .trusted-embed-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .trusted-embed-actions {
    justify-content: flex-start;
  }
}

/* v5.8 tag process limits */
.limit-alert {
  color: #b00020 !important;
  font-weight: 800 !important;
}
.reading-limit {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.reading-limit span {
  color: #55717d;
  font-size: 12px;
  line-height: 1.25;
}
.tag-register-table input[name="absoluteMin"],
.tag-register-table input[name="absoluteMax"],
.tag-register-table input[name="processMin"],
.tag-register-table input[name="processMax"] {
  min-width: 90px;
}
.tag-register-table input[name="sourcePath"] {
  display: block;
  margin-top: 6px;
  min-width: 160px;
}

/* v5.7 overview process snapshot tag limit display */
.process-map {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.process-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.process-area-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.process-area-heading .hex-icon {
  flex: 0 0 auto;
}
.process-area h3 {
  margin: 0;
  color: var(--dark-blue);
  min-width: 0;
  line-height: 1.2;
}
.snapshot-tag-row {
  border: 1px solid #dceaf0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fbfd;
  display: grid;
  gap: 4px;
}
.snapshot-tag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.snapshot-tag-head strong {
  color: var(--dark-blue);
  font-size: 13px;
}
.snapshot-tag-name {
  color: #55717d;
  font-size: 12px;
  line-height: 1.2;
}
.snapshot-tag-value {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  color: #23343b;
}
.snapshot-tag-value span {
  color: #66808d;
  font-size: 11px;
  white-space: nowrap;
}
.snapshot-limit-visual {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}
.snapshot-limit-bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9f1e6, #cfe8f3);
  border: 1px solid #bdd6df;
}
.snapshot-limit-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 13px;
  border-radius: 999px;
  background: var(--dark-blue);
  transform: translateX(-50%);
}

.snapshot-process-limit-marker {
  position: absolute;
  top: 1px;
  width: 2px;
  height: 5px;
  border-radius: 999px;
  background: #b00020;
  transform: translateX(-50%);
  z-index: 2;
}
.snapshot-process-limit-marker.process-min {
  background: #b00020;
}
.snapshot-process-limit-marker.process-max {
  background: #b00020;
}
.snapshot-limit-visual.outside .snapshot-limit-bar {
  background: #f7d8d8;
  border-color: #e4a6a6;
}
.snapshot-limit-visual.outside .snapshot-limit-marker {
  background: #b00020;
}
.snapshot-limit-scale {
  display: flex;
  justify-content: space-between;
  color: #66808d;
  font-size: 10px;
  line-height: 1.2;
}
.snapshot-empty-line {
  min-height: 11px;
}


/* Compact permissions matrix */
.compact-admin-grid { gap: 10px; }
.compact-hero-card { padding: 14px 16px; }
.compact-hero-card h2 { margin: 0 0 4px; font-size: 20px; }
.compact-hero-card p { margin: 0; font-size: 13px; }
.compact-matrix-card { padding: 12px; }
.compact-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.compact-section-header .section-title { margin: 0 8px 0 0; font-size: 18px; }
.compact-section-header span { color: #66808d; font-size: 12px; font-weight: 700; }
.permissions-matrix { border-radius: 8px; }
.permissions-compact-table { font-size: 13px; table-layout: fixed; }
.permissions-compact-table th { font-size: 12px; }
.permissions-compact-table th,
.permissions-compact-table td { padding: 5px 7px; vertical-align: middle; }
.permissions-compact-table th:first-child,
.permissions-compact-table td:first-child { width: 34%; }
.permissions-compact-table th:not(:first-child),
.permissions-compact-table td:not(:first-child) { width: 16.5%; text-align: center; }
.permission-area { color: var(--dark-blue); font-weight: 700; line-height: 1.2; }
.permission-cell { line-height: 1.15; white-space: nowrap; }
.permission-mark {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.permission-cell.allowed .permission-mark { background: #e7f6ef; color: #087a4a; border: 1px solid #b8dfca; }
.permission-cell.denied .permission-mark { background: #fbe7e7; color: #b42318; border: 1px solid #f0b8b8; }
.permission-cell small {
  display: block;
  margin-top: 3px;
  color: #66808d;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.1;
  white-space: normal;
}
.compact-matrix-card .footer-note { margin-top: 8px; font-size: 13px; }

/* Email settings parent switch notice */
.settings-alert {
  border: 1px solid #b9d3df;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: grid;
  gap: 4px;
  background: #f8fbfd;
  color: var(--dark-blue);
}
.settings-alert strong {
  font-size: 13px;
}
.settings-alert span {
  color: #55717d;
  font-size: 13px;
  line-height: 1.4;
}
.settings-alert.warning {
  border-color: #e3c55f;
  background: #fff8df;
}
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  background: #eef4f7;
  color: #667d88;
}

/* Permissions matrix, compact layout with full wording */
.permissions-compact-table .permission-cell .badge {
  padding: 2px 6px;
  min-width: 26px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
}
.permissions-compact-table .permission-cell small {
  font-size: 11px;
  line-height: 1.12;
  font-weight: 400;
}
.permissions-compact-table .permission-area {
  font-size: 13px;
}
.permissions-compact-table th:first-child {
  font-size: 12px;
}

/* v5.9 log page clarity and table header casing */
.log-form-card .section-title {
  margin-bottom: 16px;
}
.log-field-row {
  gap: 7px;
}
.log-field-row > label {
  display: block;
  width: 100%;
  background: #f5fafc;
  border: 1px solid #d8e7ee;
  border-left: 5px solid var(--bright-blue);
  color: var(--dark-blue);
  padding: 7px 10px;
  margin-bottom: 1px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase !important;
}
.readings-compact-header span:nth-child(7),
.reading-value-field {
  border-left: 2px solid #b9d3df;
  padding-left: 12px;
}
.readings-compact-header,
.readings-compact-header span,
table th {
  text-transform: uppercase !important;
}

/* Report prompt fallback modal */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.report-prompt-modal {
  width: min(1120px, calc(100vw - 48px));
}
.report-prompt-body {
  padding: 20px;
}
.report-prompt-text {
  width: 100%;
  min-height: 58vh;
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre;
}
.report-prompt-settings-text {
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.readings-compact-header:has(span:nth-child(7):last-child),
.reading-compact-row.readonly-row {
  grid-template-columns: minmax(160px, 1.3fr) minmax(72px, .4fr) minmax(64px, .35fr) minmax(64px, .35fr) minmax(88px, .48fr) minmax(150px, .9fr) minmax(90px, .45fr);
}
.reading-compact-row.readonly-row .reading-readonly-note {
  border-left: 2px solid #b9d3df;
  padding-left: 12px;
}
.bypass-overdue-row td {
  background: #fff6f6;
}
.duration-overdue {
  color: var(--danger);
  font-weight: 800;
}
.duration-overdue .help-text {
  color: var(--danger);
  font-weight: 700;
}



.overview-main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.overview-left-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
.overview-flex-card {
  min-height: 0;
}
.process-snapshot-card {
  align-self: start;
}
.standing-instructions-text { white-space: pre-wrap; line-height: 1.45; color: var(--ink); }
.standing-instructions-input { width: 100%; min-height: 160px; resize: vertical; }

.external-status-list { display: grid; gap: 10px; margin-top: 10px; }
.external-status-row { border: 1px solid #d9e3ec; border-radius: 12px; padding: 12px; background: #f8fbfd; display: grid; gap: 4px; }
.external-status-row strong { color: #04273f; }
.external-status-row span { color: #516172; }
.external-status-row.ok { border-color: #bfe5cf; background: #f2fbf5; }
.external-status-row.warning { border-color: #f1d28b; background: #fff8e8; }
.external-status-row.error { border-color: #f0b6b6; background: #fff2f2; }
.external-status-row.pending { border-color: #c8d8e7; background: #f4f8fc; }
.page-toolbar { margin: 0 0 14px; justify-content: flex-end; }

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  background: #d6e1e6;
  color: #7f949e;
  opacity: 0.75;
}
.card.kpi.ok { border-left: 5px solid var(--ok); }
.card.kpi.warn { border-left: 5px solid var(--warning); background: #fffaf0; }
.card.kpi.danger { border-left: 5px solid var(--danger); background: #fff5f5; }
.card.kpi.warn b { color: var(--warning); }
.card.kpi.danger b { color: var(--danger); }
.archived-row { opacity: 0.7; background: #f6f8f9; }
.archived-row td { color: #60717a; }
.actions-cell .btn + .btn { margin-left: 6px; }

/* v4.6 permit register width and desktop floating menu */
.permits-page,
.permits-page .toolbar,
.permits-page .issues-register-card,
.permits-page .permit-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
.permits-page .permit-table {
  overflow-x: auto !important;
}
.permits-page .permit-table table {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
}
.permits-page .permit-table th,
.permits-page .permit-table td {
  max-width: none !important;
}
.permits-page .permit-table .text-cell {
  min-width: 180px;
  max-width: none !important;
}
@media (min-width: 921px) {
  .app-shell {
    align-items: start !important;
  }
  .sidebar {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    align-self: start !important;
  }
  .sidebar .brand-block,
  .sidebar .shift-logo-frame {
    flex-shrink: 0;
  }
}
@media (max-width: 920px) {
  .sidebar {
    position: static !important;
    top: auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Compact user identity rows */
.inline-email {
  color: #66808d;
  font-size: 12px;
  margin-left: 8px;
  white-space: nowrap;
}

.project-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.project-select-card {
  appearance: none;
  border: 1px solid rgba(4, 39, 63, 0.12);
  border-left: 5px solid var(--bright-blue);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.project-select-card strong {
  color: var(--deep-blue);
  font-size: 18px;
}
.project-select-card span {
  color: var(--slate);
  font-size: 13px;
}
.project-select-card:hover,
.project-select-card:focus {
  border-color: var(--bright-blue);
  outline: none;
}

.reading-oos-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-weight: 800;
  color: var(--dark-blue);
  white-space: nowrap;
}
.reading-oos-field input {
  width: 18px;
  height: 18px;
}
.standing-instructions-card { align-self: start; }
.standing-instructions-card.compact { padding: 14px; }
.standing-instructions-card .compact-toolbar { margin-bottom: 8px; gap: 8px; }
.standing-instructions-list { display: flex; flex-direction: column; gap: 6px; }
.standing-instruction-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.standing-instruction-item.compact { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.standing-instruction-main { min-width: 0; flex: 1; }
.standing-instruction-body { white-space: pre-wrap; line-height: 1.35; color: var(--ink); }
.standing-instruction-meta { margin-top: 4px; color: var(--muted); font-size: 11px; }
.standing-instruction-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.standing-instruction-item.compact .standing-instruction-actions { margin-top: 0; flex: 0 0 auto; gap: 6px; }

.clickable-overview-row {
  cursor: pointer;
}
.clickable-overview-row:hover td {
  background: rgba(39, 170, 225, 0.08);
}

/* Wider action columns for register tables with edit, archive, delete controls */
.isolations-register-table th:last-child,
.isolations-register-table td:last-child,
.bypasses-register-table th:last-child,
.bypasses-register-table td:last-child {
  min-width: 260px;
  width: 260px;
  white-space: nowrap;
}
.register-actions-cell {
  white-space: nowrap;
}
.register-actions-cell .btn {
  display: inline-flex;
  margin: 2px 4px 2px 0;
}

/* Logs page layout */
.history-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.history-section-tabs {
  margin-bottom: 0;
}
.history-tab-panel {
  overflow: visible;
}
.history-tab-panel .filterable-table thead th,
.history-tab-panel .filterable-table thead tr:first-child th {
  position: relative;
  top: auto;
  z-index: auto;
}
.history-tab-panel .actions-cell {
  min-width: 240px;
  white-space: nowrap;
}
.field-readings-history-table .actions-cell {
  min-width: 250px;
}
@media (max-width: 920px) {
  .history-section-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .history-section-tabs button {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}


.table-pagination { display: flex; box-sizing: border-box; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; width: 100%; max-width: 100%; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 400; }
.table-pagination-size, .table-pagination-size label { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.table-pagination-size select { width: auto; min-width: 0; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; background: var(--card); color: var(--text); font: inherit; }
.table-pagination-nav { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.table-pagination-nav input { width: 56px; min-width: 0; height: 32px; padding: 0 8px; border-radius: 6px; text-align: center; font-size: 12px; }
.table-pagination-nav [data-pagination-pages] { margin-right: 8px; }
.app-shell .table-pagination-nav .btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); }
.table-pagination-nav .btn svg { width: 16px; height: 16px; }
.table-pagination-nav .btn:disabled { opacity: .5; pointer-events: none; }
@media (max-width: 640px) { .table-pagination { flex-wrap: wrap; } .table-pagination-nav { margin-left: auto; } }

/* Filter menu visual refinement and resizable table columns */
.filterable-table th,
.table-wrap table th {
  position: relative;
}
.filterable-table th .column-title {
  max-width: calc(100% - 34px);
}
.column-filter-button {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dark-blue);
  box-shadow: none;
  padding: 0;
}
.column-filter-button:hover,
.column-filter-button:focus {
  background: rgba(39, 170, 225, 0.10);
  outline: 1px solid rgba(39, 170, 225, 0.28);
  outline-offset: -1px;
}
.column-filter-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.column-filter-button.active {
  background: transparent;
  border-color: transparent;
  color: var(--sky-blue);
}
.column-filter-menu input::placeholder {
  font-weight: 400;
}
.column-filter-field input,
.column-filter-date-row input {
  font-weight: 400;
}
.column-filter-options label,
.column-filter-options label span {
  font-weight: 400;
}
.column-filter-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 0;
  flex: 0 0 16px;
}
.column-filter-menu input[type="checkbox"] {
  box-sizing: border-box;
}
.resizable-table {
  table-layout: auto;
}
.column-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 3;
}
.column-resize-handle::after {
  content: '';
  position: absolute;
  top: 25%;
  right: 3px;
  width: 1px;
  height: 50%;
  background: transparent;
}
.column-resize-handle:hover::after,
.column-resizing .column-resize-handle::after {
  background: #bad5e0;
}
.column-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
.column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* v6.4 layout refinements */
.operating-time-page .operating-time-table-wrap {
  overflow-x: hidden !important;
}
.operating-time-page .operating-time-table-wrap table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
.operating-time-page .operating-time-table-wrap th,
.operating-time-page .operating-time-table-wrap td {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.operating-time-page .operating-periods-table th:nth-child(4),
.operating-time-page .operating-periods-table td:nth-child(4) {
  width: 130px;
}
.operating-time-page .operating-events-table th:last-child,
.operating-time-page .operating-events-table td:last-child {
  width: 230px;
}
.log-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}
.log-entry-grid .log-grid-full {
  grid-column: 1 / -1;
}
.log-entry-grid .form-row {
  min-width: 0;
}
.log-form-card .button-row .btn {
  margin-top: 0;
  align-self: center;
}
.compact-entry-form .entry-form-grid {
  align-items: start;
}
.compact-entry-form .span-2 {
  grid-column: span 2;
}
.compact-entry-form .span-3 {
  grid-column: 1 / -1;
}
.compact-entry-form textarea {
  min-height: 76px;
}
.isolations-page .issues-table table.resizable-table,
.bypasses-page .issues-table table.resizable-table {
  table-layout: fixed !important;
}
.resizable-table {
  table-layout: fixed !important;
}
.resizable-table th,
.resizable-table td {
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .compact-entry-form .span-2,
  .compact-entry-form .span-3 {
    grid-column: 1 / -1;
  }
}
@media (max-width: 920px) {
  .log-entry-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .operating-time-page .operating-time-table-wrap {
    overflow-x: auto !important;
  }
  .operating-time-page .operating-time-table-wrap table {
    min-width: 680px !important;
  }
}


/* v6.5 table overflow refinement */
.table-wrap {
  overflow-x: hidden !important;
  overflow-y: visible;
}
.table-wrap.needs-x-scroll {
  overflow-x: auto !important;
}
.table-wrap:not(.needs-x-scroll) table {
  max-width: 100%;
}
.table-wrap:not(.needs-x-scroll) table.resizable-table {
  width: 100% !important;
}
.table-wrap:not(.needs-x-scroll).issues-table table,
.table-wrap:not(.needs-x-scroll).permit-table table,
.table-wrap:not(.needs-x-scroll).tag-register-table table,
.table-wrap:not(.needs-x-scroll).form-fields-table table,
.table-wrap:not(.needs-x-scroll).permissions-matrix table {
  min-width: 0 !important;
  width: 100% !important;
}
@media (max-width: 920px) {
  .table-wrap.needs-x-scroll {
    overflow-x: auto !important;
  }
}

/* v6.6 overview table overflow correction */
.overview-table-wrap {
  overflow-x: hidden !important;
}
.overview-table-wrap.needs-x-scroll {
  overflow-x: auto !important;
}
.overview-table-wrap:not(.needs-x-scroll) table,
.overview-table-wrap:not(.needs-x-scroll) table.resizable-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.overview-table-wrap:not(.needs-x-scroll) th,
.overview-table-wrap:not(.needs-x-scroll) td {
  min-width: 0 !important;
}


/* v6.7 table wrapping, filter spacing, and resize handle corrections */
.filterable-table th,
.table-wrap table th,
.filterable-table td,
.table-wrap table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.filterable-table th,
.table-wrap table th {
  line-height: 1.2;
  vertical-align: top;
}
.filterable-table th:not([data-filter-disabled="true"]) {
  padding-right: 42px;
}
.filterable-table th .column-title,
.table-wrap table th .column-title {
  display: block;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
  padding-right: 0;
}
.filterable-table th .column-filter-button {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  margin-left: 0;
  z-index: 3;
}
.column-resize-handle {
  right: 0;
  width: 10px;
  z-index: 4;
}
.column-resize-handle:hover,
.column-resizing .column-resize-handle {
  background: rgba(39, 170, 225, 0.18);
}
.isolations-register-table.resizable-table {
  table-layout: fixed !important;
}
.isolations-register-table th,
.isolations-register-table td {
  min-width: 72px;
}
.isolations-register-table th:last-child,
.isolations-register-table td:last-child,
.bypasses-register-table th:last-child,
.bypasses-register-table td:last-child {
  overflow-wrap: normal;
  word-break: normal;
}

/* v6.8 section card and Field Readings table layout */
.history-table-card,
.readings-entry-card {
  margin-top: 16px;
}
.history-table-card .toolbar,
.readings-entry-card .toolbar {
  margin-top: 0;
}
.field-readings-entry-table-wrap {
  margin-top: 8px;
}
.field-readings-entry-table th,
.field-readings-entry-table td {
  vertical-align: middle;
}
.field-readings-entry-table input,
.field-readings-entry-table select,
.field-readings-entry-table textarea {
  min-width: 0;
}
.field-readings-entry-table .input-with-unit {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.field-readings-entry-table .input-with-unit span {
  color: #66808d;
  font-size: 12px;
  white-space: nowrap;
}
.field-readings-entry-table .reading-value-entry + .btn,
.field-readings-entry-table .input-with-unit + .btn {
  margin-top: 6px;
}
.field-readings-entry-table .reading-oos-field {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}
.field-readings-entry-table .reading-oos-field input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.field-readings-entry-table .datetime-picker-wrap {
  min-width: 150px;
}
.field-readings-entry-table .reading-tag strong,
.field-readings-entry-table .reading-tag span {
  display: block;
}
.field-readings-entry-table .reading-tag span {
  color: #66808d;
  font-size: 12px;
}
@media (max-width: 760px) {
  .field-readings-entry-table .input-with-unit {
    grid-template-columns: minmax(78px, 1fr) auto;
  }
  .field-readings-entry-table .datetime-picker-wrap {
    min-width: 130px;
  }
}

/* v6.9 register cards and compact overview controls */
.section-register-card {
  margin-top: 16px;
  padding: 18px;
  overflow: visible;
}
.section-register-card > .toolbar {
  margin-top: 0;
  margin-bottom: 16px;
}
.section-register-card .table-wrap {
  margin-top: 0;
}
.section-register-card .empty {
  margin-top: 8px;
}
.standing-instructions-card .compact-toolbar .button-row {
  margin-top: 0;
  gap: 6px;
}
.standing-instructions-card .compact-toolbar .btn {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.15;
  min-height: 30px;
}

/* Register table border alignment and Isolation Register resize override */
.section-register-card .table-wrap.issues-table {
  border: 1px solid #d8e7ee !important;
  border-radius: var(--radius) !important;
  overflow-x: hidden !important;
  overflow-y: visible;
}
.section-register-card .table-wrap.issues-table.needs-x-scroll {
  overflow-x: auto !important;
}
.section-register-card .table-wrap.issues-table table {
  border-radius: 0;
}
.isolations-register-table.resizable-table {
  width: auto;
}
.isolations-register-table.resizable-table colgroup col {
  min-width: 56px;
}

/* Shift Log submit confirmation checklist */
.shift-submit-checklist-modal {
  max-width: 680px;
  padding: 24px;
}
.shift-submit-checklist-modal .modal-header {
  align-items: flex-start;
  gap: 16px;
}
.shift-submit-checklist-modal .modal-header h2 {
  margin: 0 0 6px;
}
.shift-submit-checklist-modal .modal-header p {
  margin: 0;
  line-height: 1.45;
}
.shift-submit-checklist {
  display: grid;
  gap: 10px;
  margin: 18px 0 14px;
}
.shift-submit-checklist-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d8e7ee;
  border-radius: var(--radius-sm);
  background: #f7fbfd;
  color: var(--dark-blue);
  font-weight: 700;
}
.shift-submit-checklist-item input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.shift-submit-note {
  margin: 12px 0 0;
  line-height: 1.45;
}
@media (max-width: 640px) {
  .shift-submit-checklist-modal .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .shift-submit-checklist-modal .modal-actions .btn {
    width: 100%;
  }
}

/* v6.13 table sort controls */
.filterable-table th:not([data-filter-disabled="true"]) {
  padding-right: 76px;
}
.column-header-actions {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transform: translateY(-50%);
  z-index: 3;
}
.filterable-table th .column-filter-button {
  position: static;
  top: auto;
  right: auto;
  transform: none;
}
.column-sort-button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dark-blue);
  box-shadow: none;
  padding: 0;
  cursor: pointer;
}
.column-sort-button:hover,
.column-sort-button:focus {
  background: rgba(39, 170, 225, 0.10);
  outline: 1px solid rgba(39, 170, 225, 0.28);
  outline-offset: -1px;
}
.column-sort-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.column-sort-button.active {
  color: var(--sky-blue);
}
.column-sort-button[data-sort-dir="asc"] svg path:nth-child(3),
.column-sort-button[data-sort-dir="desc"] svg path:nth-child(1) {
  opacity: 0.25;
}
.column-sort-button[data-sort-dir="asc"] svg path:nth-child(2) {
  transform-origin: center;
}
@media (max-width: 720px) {
  .filterable-table th:not([data-filter-disabled="true"]) {
    padding-right: 70px;
  }
  .column-header-actions {
    right: 8px;
  }
}

.project-logo-dropzone {
  display: flex;
  min-height: 76px;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #b9d3df;
  border-radius: 8px;
  background: rgb(206 225 234 / 18%);
  color: var(--dark-blue);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.project-logo-dropzone:hover,
.project-logo-dropzone:focus-visible {
  border-color: #80a8ba;
  background: rgb(206 225 234 / 34%);
  outline: none;
}
.project-logo-dropzone:focus-visible {
  box-shadow: 0 0 0 3px rgb(39 170 225 / 22%);
}
.project-logo-dropzone.is-drag-active {
  border-color: var(--bright-blue);
  background: rgb(39 170 225 / 10%);
}
.project-logo-dropzone-preview {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d5e5ec;
  border-radius: 8px;
  background: #fff;
  color: #66808d;
}
.project-logo-dropzone-preview svg {
  width: 20px;
  height: 20px;
}
.project-logo-dropzone-preview img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
}
.project-logo-dropzone-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.project-logo-dropzone-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-logo-dropzone-copy small {
  color: #66808d;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}
.project-logo-clear {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #66808d;
  font-size: 22px;
  place-items: center;
}
.project-logo-clear:hover,
.project-logo-clear:focus-visible {
  background: rgb(4 39 63 / 8%);
  color: var(--dark-blue);
  outline: none;
}
.project-logo-clear[hidden] {
  display: none;
}

.project-user-modal {
  width: min(820px, calc(100vw - 48px));
}
.project-user-picker {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 0;
  border: 0;
}
.project-user-picker legend {
  margin-bottom: 8px;
  color: var(--dark-blue);
  font-size: 13px;
  font-weight: 700;
}
.project-user-options {
  display: grid;
  max-height: min(390px, 54vh);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
}
.project-user-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d5e5ec;
  border-radius: 8px;
  background: #f8fbfd;
  cursor: pointer;
}
.project-user-option:hover {
  border-color: #9bbdcb;
  background: #f0f7fa;
}
.project-user-option:has(input:checked) {
  border-color: var(--bright-blue);
  background: rgb(39 170 225 / 9%);
}
.project-user-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
  accent-color: var(--dark-blue);
}
.project-user-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.project-user-option strong,
.project-user-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-user-option strong {
  font-size: 14px;
  font-weight: 600;
}
.project-user-option small,
.project-user-empty {
  color: #66808d;
  font-size: 12px;
  font-weight: 400;
}

/* Pulse-aligned Safety Observation layout. */
.hse-pulse-layout {
  display: grid;
  width: min(100%, 1024px);
  margin: 0 auto;
  gap: 20px;
}
.hse-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hse-page-heading h1 {
  margin: 0;
  color: var(--dark-blue);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.02em;
}
.hse-page-heading .hse-pending-pill {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}
.hse-pending-pill { font-family: inherit; cursor: pointer; }
.hse-pending-pill:disabled { cursor: default; opacity: 1; }
.hse-pending-pill:focus-visible { outline: 2px solid var(--dark-blue); outline-offset: 3px; }
.hse-pulse-layout .hse-report-form {
  gap: 20px;
}
.hse-pulse-layout .log-entry-grid {
  gap: 24px 20px;
}
.hse-form-field {
  margin-bottom: 0;
  display: grid;
  min-width: 0;
  gap: 8px;
}
.hse-form-field-wide {
  grid-column: 1 / -1;
}
.hse-location-field { margin: 0; padding: 0; border: 0; }
.hse-location-field > legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 500; line-height: 20px; }
.hse-location-options { display: flex; gap: 4px; }
.hse-location-choice { position: relative; flex: 1; cursor: pointer; }
.hse-location-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hse-location-choice span { display: flex; justify-content: center; align-items: center; min-height: 34px; padding: 6px 12px; font-size: 12px; font-weight: 400; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); }
.hse-location-choice input:checked + span { background: #04273f; border-color: #04273f; color: white; }
.hse-location-choice input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.hse-form-field > label {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
}
.hse-form-field > :is(input, select) {
  min-height: 40px;
}
.hse-form-field > textarea {
  min-height: 118px;
}
.hse-form-field .field-help-text {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}
.hse-evidence-heading { margin: 0 0 16px; color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.hse-save-surface {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}
.hse-save-surface .hse-save-button {
  margin: 0;
}
html.dark .hse-page-heading h1 {
  color: var(--chalk);
}
@media (max-width: 640px) {
  .hse-pulse-layout { gap: 12px; }
  .hse-page-heading { align-items: center; }
  .hse-page-heading h1 { font-size: 21px; line-height: 28px; }
  .hse-pulse-layout .log-entry-grid { gap: 24px; }
  .hse-save-surface { padding-top: 16px; }
  .hse-save-surface .hse-save-button { width: auto; }
}
.project-user-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed #b9d3df;
  border-radius: 8px;
  text-align: center;
}
.report-setting-source.is-unavailable {
  opacity: 0.56;
}
.report-setting-source.is-unavailable input,
.report-setting-source.is-unavailable button {
  cursor: not-allowed;
}
.checkselect.is-disabled .checkselect-button {
  background: #f1f5f7;
  color: #748792;
}
@media (max-width: 640px) {
  .project-user-modal { width: calc(100vw - 24px); }
  .project-user-options { grid-template-columns: 1fr; }
  .project-logo-dropzone { align-items: flex-start; }
}
@media (min-width: 641px) and (max-width: 780px) {
  .project-user-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* v6.21 Tag register inline editing refinements */
.tag-register-table table th,
.tag-register-table table td {
  padding: 4px 6px;
  vertical-align: middle;
}
.tag-register-table input,
.tag-register-table select {
  padding: 4px 6px;
  min-height: 30px;
  font-size: inherit;
  line-height: 1.2;
}
.tag-register-table .btn.small {
  padding: 4px 8px;
  min-height: 30px;
  font-size: inherit;
}
.tag-register-table .tag-actions {
  gap: 4px;
}

/* Authentication expiry prompt */
.auth-expired-backdrop {
  z-index: 1400;
}
.auth-expired-card {
  width: min(620px, calc(100vw - 48px));
}
.auth-expired-body {
  padding: 20px 22px 8px;
  color: var(--black);
  line-height: 1.55;
}
.auth-expired-body p {
  margin: 0 0 12px;
}
.auth-expired-actions {
  padding: 0 22px 22px;
  justify-content: flex-end;
}

/* Active table filter visibility, clean icon-only treatment */
.filterable-table th.column-filter-active,
.table-wrap table.filterable-table th.column-filter-active {
  background: inherit !important;
  color: inherit !important;
  box-shadow: none !important;
}
.filterable-table th.column-filter-active .column-title,
.table-wrap table.filterable-table th.column-filter-active .column-title {
  color: inherit !important;
  font-weight: inherit;
}
.filterable-table th.column-filter-active .column-title::before,
.table-wrap table.filterable-table th.column-filter-active .column-title::before,
.filterable-table th.column-filter-active .column-title::after,
.table-wrap table.filterable-table th.column-filter-active .column-title::after {
  content: none !important;
  display: none !important;
}
.filterable-table th.column-filter-active .column-filter-button.active,
.table-wrap table.filterable-table th.column-filter-active .column-filter-button.active {
  background: var(--dark-blue) !important;
  color: #ffffff !important;
  border: 1px solid var(--dark-blue) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(4, 39, 63, 0.18) !important;
  border-radius: 6px;
}
.filterable-table th.column-filter-active .column-filter-button.active svg,
.table-wrap table.filterable-table th.column-filter-active .column-filter-button.active svg {
  color: #ffffff !important;
  stroke: currentColor;
}
.filterable-table td.column-filter-active-cell,
.table-wrap table.filterable-table td.column-filter-active-cell,
.filterable-table tbody tr:hover td.column-filter-active-cell,
.table-wrap table.filterable-table tbody tr:hover td.column-filter-active-cell {
  background: inherit !important;
  box-shadow: none !important;
}


/* Shift Log History search */
.history-log-tools {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.history-search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.history-search-field input[type="search"] {
  width: min(280px, 42vw);
  min-width: 180px;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid #bad5e0;
  border-radius: 10px;
  background: #fff;
  color: var(--black);
  font: inherit;
}
.history-search-field input[type="search"]:focus {
  outline: 2px solid rgba(4, 39, 63, 0.18);
  border-color: var(--dark-blue);
}
@media (max-width: 720px) {
  .history-search-field {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }
  .history-search-field input[type="search"] {
    width: 100%;
  }
}

/* Unsaved data indication */
.unsaved-data-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}
.unsaved-data-indicator svg { width: 14px; height: 14px; color: var(--warning); flex-shrink: 0; }
.unsaved-data-indicator[hidden] {
  display: none !important;
}
.unsaved-navigation-backdrop {
  z-index: 1450;
}
.unsaved-navigation-card {
  width: min(560px, calc(100vw - 48px));
}
.unsaved-navigation-body {
  padding: 20px 22px 8px;
  color: var(--black);
  line-height: 1.55;
}
.unsaved-navigation-body p {
  margin: 0 0 12px;
}
.unsaved-navigation-actions {
  padding: 0 22px 22px;
  justify-content: flex-end;
}
.help-list {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.help-list code {
  color: var(--ink);
  background: rgba(4, 39, 63, 0.06);
  border-radius: 4px;
  padding: 1px 4px;
}
.kpi-expression-feedback {
  margin-top: 8px;
}
.kpi-expression-preview {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chalk);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.kpi-expression-feedback.ok .kpi-expression-preview {
  border-color: rgba(31, 122, 78, 0.35);
  background: #f2fbf6;
}
.kpi-expression-feedback.error .kpi-expression-preview {
  border-color: rgba(177, 50, 50, 0.45);
  background: #fff5f5;
}
.kpi-expression-valid {
  border-color: rgba(31, 122, 78, 0.55) !important;
}
.kpi-expression-invalid {
  border-color: rgba(177, 50, 50, 0.75) !important;
  box-shadow: 0 0 0 2px rgba(177, 50, 50, 0.08);
}
.kpi-token {
  border-radius: 4px;
  padding: 1px 2px;
}
.kpi-token-tag {
  background: #dff3e8;
  color: #155f3a;
  font-weight: 700;
}
.kpi-token-function {
  color: var(--dark-blue);
  font-weight: 700;
}
.kpi-token-operator {
  color: var(--ink);
}
.kpi-token-error {
  background: #ffdada;
  color: #8f1f1f;
  border-bottom: 2px solid #b13232;
  font-weight: 700;
}
.kpi-expression-placeholder {
  color: var(--muted);
}
.kpi-token-paren {
  display: inline-block;
  min-width: 1.05em;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  margin: 0 1px;
}
.kpi-paren-depth-0 { background: #e8f1fb; color: #123f66; border-color: #a9c7e6; }
.kpi-paren-depth-1 { background: #eef7ec; color: #1c5d32; border-color: #afd2a7; }
.kpi-paren-depth-2 { background: #f3eefb; color: #4c3578; border-color: #c8b9e3; }
.kpi-paren-depth-3 { background: #fcefee; color: #7b2b2b; border-color: #e1b2ae; }
.kpi-paren-depth-4 { background: #eef8f7; color: #145c61; border-color: #a6d4d2; }
.kpi-paren-depth-5 { background: #f4f2e8; color: #5a5020; border-color: #d1c99f; }
.kpi-paren-active {
  box-shadow: 0 0 0 2px rgba(4, 39, 63, 0.24);
  outline: 2px solid var(--dark-blue);
  outline-offset: 1px;
}
.kpi-paren-unmatched {
  box-shadow: 0 0 0 2px rgba(177, 50, 50, 0.14);
}

.kpi-add-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.kpi-add-grid .form-row {
  margin-bottom: 0;
  align-content: start;
}
.kpi-add-grid input,
.kpi-add-grid select,
.kpi-add-grid textarea {
  min-height: 39px;
}
.kpi-notes-row,
.kpi-calculation-row {
  grid-column: 1 / -1;
}
.kpi-notes-row textarea {
  min-height: 88px;
}
.kpi-calculation-row textarea {
  min-height: 148px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.help-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.help-card p {
  margin-top: 0;
}
.help-steps {
  margin: 8px 0 0 20px;
  padding: 0;
}
.help-steps li {
  margin: 8px 0;
}
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .kpi-add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kpi-add-grid { grid-template-columns: 1fr; }
}


/* Trend Builder launch affordances */
.trend-launch-card,
.trend-launch-row {
  cursor: pointer;
}
.trend-launch-card {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.trend-launch-card:hover,
.trend-launch-card:focus-visible,
.trend-launch-row:hover,
.trend-launch-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(39, 170, 225, 0.22);
}
.trend-launch-card:hover,
.trend-launch-card:focus-visible {
  border-color: var(--bright-blue);
  transform: translateY(-1px);
}
.trend-launch-row:hover td,
.trend-launch-row:focus-visible td {
  background: #f4faff;
}

.overview-launch-kpi {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.overview-launch-kpi:hover,
.overview-launch-kpi:focus-visible {
  transform: translateY(-1px);
  border-color: var(--brand-blue, #0b3a5b);
  box-shadow: 0 10px 24px rgba(4, 39, 63, 0.12);
  outline: none;
}

/* Progressive Web App install prompt */
.pwa-notice-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  max-width: calc(100vw - 32px);
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: Inter, "Inter Fallback", Arial, sans-serif;
}
.pwa-install-card {
  padding: 12px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  background: #ffffff;
  color: #09090b;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  font-size: 14px;
  line-height: 20px;
}
.pwa-install-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pwa-install-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #04273f;
}
.pwa-install-copy { min-width: 0; }
.pwa-install-card strong {
  display: block;
  color: #09090b;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.pwa-install-card p {
  margin: 0;
  color: #71717a;
  font-size: 12px;
  line-height: 16px;
}
.pwa-ios-hint {
  display: flex;
  align-items: center;
  margin-top: 4px !important;
  gap: 4px;
}
.pwa-ios-hint svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.pwa-install-button {
  display: inline-flex;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  transition: color .15s, background-color .15s, border-color .15s;
}
.pwa-install-button.primary {
  border: 1px solid #04273f;
  background: #04273f;
  color: #ffffff;
}
.pwa-install-button.primary:hover { background: rgb(4 39 63 / .9); }
.pwa-install-button.outline {
  border: 1px solid #e7e5e4;
  background: #fafaf9;
  color: #09090b;
}
.pwa-install-button.outline:hover { background: #f5f5f4; }
.pwa-install-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px #04273f;
}

.hse-report-form { display: grid; gap: 20px; }
.hse-report-form .log-form-card { margin: 0; }
.hse-save-button { justify-self: end; margin: -4px 0 0; }
.safety-evidence { overflow: hidden; padding: 0; }
.safety-evidence-content { display: grid; gap: 16px; }
.safety-evidence-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.safety-file-button { justify-content: center; min-width: 0; position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; padding: 8px 12px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500; line-height: 20px; }
.safety-file-button.primary { background: #04273f; color: #fff; }
.safety-file-button.primary:hover { background: #0b3a59; }
.safety-file-button.outline { border-color: var(--border); background: var(--card); color: var(--text); }
.safety-file-button.outline:hover { background: #f4f4f5; }
.safety-file-button:focus-within { outline: 2px solid #0b5e8e; outline-offset: 2px; }
.safety-file-button input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.safety-file-button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.safety-evidence-list:empty { display: none; }
.safety-evidence-group { display: grid; gap: 8px; }
.safety-evidence-group h3 { margin: 0; color: #04273f; font-size: 14px; font-weight: 600; }
.safety-evidence-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.safety-evidence-photo { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--card); text-align: left; }
.safety-evidence-photo-preview { position: relative; background: #0f2234; }
.safety-evidence-photo-preview img { display: block; width: 100%; height: 176px; object-fit: contain; }
.safety-evidence-photo p { overflow: hidden; margin: 0; padding: 12px; color: #4d4e53; font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.safety-evidence-remove-photo { position: absolute; top: 8px; right: 8px; display: grid; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: rgba(220, 38, 38, .9); color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .22); cursor: pointer; place-items: center; }
.safety-evidence-remove-photo:hover { background: #ef4444; }
.safety-evidence-remove-photo svg, .safety-evidence-remove-file svg { width: 16px; height: 16px; }
.safety-evidence-attachments { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.safety-evidence-attachments li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.safety-evidence-attachments li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.safety-evidence-attachments small { color: var(--muted); font-size: inherit; }
.safety-evidence-remove-file { display: grid; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; place-items: center; }
.safety-evidence-remove-file:hover { background: #f5f5f4; color: oklch(57.7% 0.245 27.325); }
@media (max-width: 640px) {
  .hse-report-form { gap: 12px; }
  .hse-report-form .log-entry-grid { gap: 24px; }
  .hse-report-form .log-field-row { gap: 6px; }
  .hse-report-form .log-field-row > label {
    padding: 6px 8px;
    border-left-width: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: 0;
    text-transform: none !important;
  }
  .hse-report-form textarea { min-height: 118px; }
  .safety-evidence-actions { align-items: stretch; }
  .safety-evidence-photo-grid { grid-template-columns: 1fr; }
}
.offline-inline-warning.ready { border-color: #b7d5c4; background: #eef8f2; color: #245f3b; }

.connection-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 8px;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
}
.connection-status small {
  grid-column: 2 / 4;
  color: rgba(255,255,255,0.72);
  font-size: 11px;
  line-height: 1.25;
}
.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}
.connection-status.offline .connection-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.connection-status.syncing .connection-dot { background: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.2); }
.connection-queue {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.16);
}
.offline-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,0.24);
  background: #fff1f2;
  color: #7f1d1d;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.offline-banner.pending {
  border-color: rgba(37,99,235,0.22);
  background: #eff6ff;
  color: #1e3a8a;
}
.offline-banner strong { font-weight: 800; }
.offline-banner span { font-size: 13px; }
tr .badge.pending-sync,
.badge.pending-sync {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}
.connection-conflict-btn {
  grid-column: 2 / 4;
  justify-self: start;
  color: #fecaca;
  font-size: 12px;
  padding: 0;
}
.offline-inline-warning {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 13px;
}
.sync-conflict-modal .table-wrap {
  max-height: 360px;
  overflow: auto;
}

/* Sidebar remains independently scrollable without showing browser scrollbars. */
.sidebar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
@media (min-width: 921px) {
  .sidebar {
    overflow-y: auto !important;
  }
}


button.is-submitting,
input[type=submit].is-submitting {
  cursor: not-allowed;
  opacity: 0.72;
}
form[data-submitting="true"] {
  position: relative;
}
.shift-submit-attachment {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0 0;
  background: var(--surface-muted);
}
.shift-submit-attachment label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
.shift-submit-attachment input[type="file"] {
  display: block;
  width: 100%;
}
.shift-submit-attachment .muted {
  margin: 8px 0 0;
  line-height: 1.45;
}

/* Overview KPI carousel and value wrapping */
.overview-kpi-carousel {
  overflow: hidden;
  width: 100%;
  margin-bottom: 36px;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.overview-kpi-carousel.is-dragging {
  cursor: grabbing;
}
.overview-kpi-grid {
  display: flex !important;
  gap: 16px;
  overflow: visible;
  padding-bottom: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  will-change: transform;
}
.overview-kpi-grid::-webkit-scrollbar {
  display: none;
}
.overview-kpi-grid.is-auto-carousel-track {
  width: max-content;
  transform: translate3d(0, 0, 0);
}

.overview-kpi-grid > .card.kpi {
  flex: 0 0 clamp(180px, 18vw, 240px);
  min-width: 180px !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 128px;
}
.overview-kpi-grid > .card.kpi span {
  overflow-wrap: anywhere;
  word-break: normal;
}
.overview-kpi-grid > .card.kpi b {
  margin-top: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.08;
}
.overview-kpi-grid > .card.kpi small {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (prefers-reduced-motion: reduce) {
  .overview-kpi-grid.is-auto-carousel-track {
    transform: none;
  }
}

/* Pulse-aligned application header, theme control, and table action icons. */
.app-topbar {
  display: flex !important;
  width: 100%;
  height: 63px;
  min-height: 63px;
  margin: 0 !important;
  padding: 0 16px !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 95%);
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.app-topbar-breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 6px; font-size: 14px; }
.app-topbar-breadcrumbs button { overflow: hidden; max-width: 240px; padding: 0; border: 0; background: transparent; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.app-topbar-breadcrumbs button:hover { color: #04273f; }
.app-topbar-breadcrumbs span { overflow: hidden; max-width: 280px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.app-topbar-breadcrumbs .current { color: var(--text); font-weight: 500; }
.app-topbar-breadcrumbs > svg { width: 14px; height: 14px; flex: 0 0 14px; color: rgb(113 113 122 / 50%); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle-button { display: grid; width: 34px; height: 34px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); place-items: center; transition: color .15s ease, background .15s ease; }
.theme-toggle-button:hover, .theme-toggle-button:focus-visible { background: #f4f4f5; color: #2563eb; outline: none; }
.theme-toggle-button svg { width: 18px; height: 18px; }
.header-user-trigger { min-height: 0; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: right; transition: background .15s ease; }
.header-user-trigger:hover, .header-user-trigger:focus-visible { background: #f4f4f5; outline: none; box-shadow: 0 0 0 2px #a1a1aa; }
.header-user-copy { display: none; min-width: 0; justify-items: end; gap: 0; }
.header-user-copy strong { max-width: 240px; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.header-user-copy small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.25; }
.header-user-avatar { width: 32px; height: 32px; flex: 0 0 32px; background: #04273f; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0; box-shadow: none; }
.header-user-popover { top: 100%; right: 0; z-index: 1450; width: 208px; margin-top: 8px; padding: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%); }
.header-user-popover-summary { display: block; padding: 6px 8px; }
.header-user-popover-summary strong { display: block; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.header-user-popover-summary span { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.header-user-menu-separator { height: 1px; margin: 4px -4px; background: var(--border); }
.header-user-menu-item { display: flex; width: 100%; align-items: center; padding: 6px 8px; border: 0; border-radius: 2px; background: transparent; color: var(--text); font-size: 14px; font-weight: 400; line-height: 20px; text-align: left; outline: none; }
.header-user-menu-item:hover, .header-user-menu-item:focus { background: #f5f5f4; }
.header-user-menu-item svg { width: 16px; height: 16px; flex: 0 0 16px; margin-right: 8px; }
.header-signout-button { color: oklch(57.7% 0.245 27.325); }
.header-signout-button:hover, .header-signout-button:focus { background: #f5f5f4; color: oklch(57.7% 0.245 27.325); }
@media (min-width: 1024px) { .header-user-menu-desktop .header-user-copy { display: grid; } }

.table-action-icon { display: inline-grid; width: 34px; height: 34px; margin: 1px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; place-items: center; vertical-align: middle; }
.table-action-icon svg { width: 18px; height: 18px; }
.table-action-icon.edit { color: rgb(82 82 91 / 80%); }
.table-action-icon.edit:hover, .table-action-icon.edit:focus-visible { background: #f4f4f5; color: #18181b; }
.table-action-icon.archive { color: #059669; }
.table-action-icon.archive:hover, .table-action-icon.archive:focus-visible { background: #d1fae5; color: #047857; }
.table-action-icon.delete { color: #dc2626; }
.table-action-icon.delete:hover, .table-action-icon.delete:focus-visible { background: #fee2e2; color: #b91c1c; }
.actions-cell, .tag-actions { white-space: nowrap; }

html.dark {
  color-scheme: dark;
  --border: #31404c;
  --card: #182129;
  --text: #f2f7fb;
  --muted: #c1cdd8;
  --black: #f2f7fb;
  --white: #182129;
  --shadow: 0 14px 32px rgb(0 0 0 / 28%);
}
html.dark body { background: #0f171e; color: var(--text); }
html.dark .content {
  background-color: #071b2c;
  background-image:
    linear-gradient(140deg, rgb(7 27 44 / 68%), rgb(7 27 44 / 74%)),
    url('/assets/Background_Pattern_Chalk_Layered.svg');
}
html.dark .page-frame { background: transparent; }
html.dark .app-topbar, html.dark .mobile-topbar { border-color: var(--border); background: rgb(24 33 41 / 95%); }
html.dark .card, html.dark .modal-card, html.dark .checkselect-panel, html.dark .column-filter-menu { border-color: var(--border); background: var(--card); color: var(--text); }
html.dark h1:not(.brand-top h1), html.dark h2, html.dark h3, html.dark h4, html.dark label, html.dark .section-title, html.dark .kpi b { color: var(--text); }
html.dark input, html.dark select, html.dark textarea, html.dark .readonly-value { border-color: #40515f; background: #0f171e; color: var(--text); }
html.dark input::placeholder, html.dark textarea::placeholder { color: #8fa1ae; }
html.dark table, html.dark th, html.dark td { border-color: var(--border); color: var(--text); }
html.dark thead, html.dark th { background: #22303a; }
html.dark tbody tr:nth-child(even) { background: rgb(34 48 58 / 42%); }
html.dark .muted, html.dark .help-text, html.dark .footer-note, html.dark .field-help-text { color: var(--muted); }
html.dark .app-topbar-breadcrumbs button:hover { color: #cee1ea; }
html.dark .theme-toggle-button:hover, html.dark .theme-toggle-button:focus-visible, html.dark .header-user-trigger:hover, html.dark .header-user-trigger:focus-visible, html.dark .header-user-menu-item:hover, html.dark .header-user-menu-item:focus, html.dark .safety-file-button.outline:hover, html.dark .safety-evidence-remove-file:hover { background: #22303a; }
html.dark .theme-toggle-button:hover, html.dark .theme-toggle-button:focus-visible { color: #60a5fa; }
html.dark .table-action-icon.edit { color: rgb(193 205 216 / 80%); }
html.dark .table-action-icon.edit:hover, html.dark .table-action-icon.edit:focus-visible { background: #27272a; color: #f4f4f5; }
html.dark .table-action-icon.archive:hover, html.dark .table-action-icon.archive:focus-visible { background: rgb(6 78 59 / 40%); color: #34d399; }
html.dark .table-action-icon.delete:hover, html.dark .table-action-icon.delete:focus-visible { background: rgb(127 29 29 / 40%); color: #f87171; }
html.dark .safety-evidence-group h3 { color: #f2f7fb; }
html.dark .safety-evidence-photo p { color: #c1cdd8; }
html.dark .project-logo-dropzone,
html.dark .project-user-option { border-color: #40515f; background: rgb(34 48 58 / 46%); color: var(--text); }
html.dark .project-logo-dropzone:hover,
html.dark .project-logo-dropzone:focus-visible,
html.dark .project-user-option:hover { border-color: #66808d; background: #22303a; }
html.dark .project-logo-dropzone.is-drag-active,
html.dark .project-user-option:has(input:checked) { border-color: #60a5fa; background: rgb(96 165 250 / 12%); }
html.dark .project-logo-dropzone-preview { border-color: #40515f; background: #0f171e; color: var(--muted); }
html.dark .project-logo-dropzone-copy small,
html.dark .project-user-option small,
html.dark .project-user-empty { color: var(--muted); }
html.dark .project-logo-clear { color: var(--muted); }
html.dark .project-logo-clear:hover,
html.dark .project-logo-clear:focus-visible { background: #22303a; color: var(--text); }
html.dark .project-user-picker legend { color: var(--text); }
html.dark .page-loading-screen { background-color: #0f171e; }

@media (max-width: 920px) {
  .app-topbar { display: none !important; }
  .mobile-topbar { position: sticky; top: 0; z-index: 30; display: flex; width: 100%; height: 48px; min-height: 48px; padding: 0 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 95%); backdrop-filter: blur(4px); }
  .mobile-topbar-left { display: flex; align-items: center; gap: 12px; }
  .mobile-menu-button { display: flex; width: 32px; height: 32px; margin-left: -6px; padding: 6px; border: 0; border-radius: 6px; background: transparent; flex-direction: column; justify-content: center; gap: 4px; }
  .mobile-menu-button:hover, .mobile-menu-button:focus-visible { background: #f4f4f5; outline: none; }
  html.dark .mobile-menu-button:hover, html.dark .mobile-menu-button:focus-visible { background: #22303a; }
  .mobile-menu-button span { display: block; width: 20px; height: 2px; border-radius: 999px; background: var(--muted); }
  .mobile-topbar-logo { display: flex; padding: 0; border: 0; background: transparent; align-items: center; }
  .mobile-topbar-logo img { display: block; width: auto; height: 24px; max-width: 110px; object-fit: contain; }
  .mobile-topbar .header-actions { gap: 4px; }
  .header-user-menu-mobile .header-user-trigger { min-height: 0; padding: 4px; border-radius: 999px; }
  .header-user-menu-mobile .header-user-avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 12px; }
  .header-user-menu-mobile .header-user-copy { display: none; }
  .header-user-menu-mobile .header-user-popover { right: 0; }
}

/* Pulse-aligned public landing page */
.landing-shell {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 94% -8%, rgba(0, 82, 204, .16), transparent 30%),
    radial-gradient(circle at -5% 102%, rgba(77, 154, 255, .1), transparent 24%),
    #0a1628;
  color: #fff;
}
.landing-shell::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='60' viewBox='0 0 52 60'%3E%3Cpath d='M26 0L52 15L26 30L0 15Z' fill='none' stroke='%234d9aff' stroke-opacity='.25' stroke-width='.7'/%3E%3Cpath d='M0 15L26 30L26 60L0 45Z' fill='none' stroke='%234d9aff' stroke-opacity='.18' stroke-width='.7'/%3E%3Cpath d='M52 15L26 30L26 60L52 45Z' fill='none' stroke='%234d9aff' stroke-opacity='.13' stroke-width='.7'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 52px 60px;
  content: "";
}
.landing-shell::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 20%, rgba(10, 22, 40, .6) 65%, rgba(10, 22, 40, .92) 100%);
  content: "";
}
.landing-header,
.landing-hero,
.landing-footer {
  position: relative;
  z-index: 2;
}
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 36px;
}
.landing-header > img {
  display: block;
  width: 140px;
  height: auto;
  object-fit: contain;
}
.landing-sign-in {
  min-height: 38px;
  padding: 7px 18px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  text-transform: none;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.landing-sign-in:hover {
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .1);
  transform: translateY(-1px);
}
.landing-sign-in:focus-visible,
.landing-cta:focus-visible {
  outline: 3px solid rgba(77, 154, 255, .48);
  outline-offset: 3px;
}
.landing-hero {
  display: flex;
  width: 100%;
  max-width: 760px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 40px 24px 54px;
  text-align: center;
}
.landing-product {
  margin-bottom: 30px;
}
.landing-product .login-logo-glow img {
  width: 150px;
}
.landing-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.7rem, 4.3vw, 4rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.05;
  text-transform: none;
}
.landing-hero > p {
  max-width: 560px;
  margin: 26px auto 0;
  color: rgba(154, 177, 192, .72);
  font-size: 1rem;
  line-height: 1.65;
}
.landing-feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}
.landing-feature-pills span {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: rgba(154, 177, 192, .56);
  font-size: .78rem;
  line-height: 1;
}
.landing-cta {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 38px;
  padding: 11px 28px;
  border: 1px solid #0052cc;
  border-radius: 11px;
  background: #0052cc;
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 82, 204, .26);
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  text-transform: none;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.landing-cta:hover {
  border-color: #0047b3;
  background: #0047b3;
  box-shadow: 0 13px 30px rgba(0, 82, 204, .34);
  transform: translateY(-1px);
}
.landing-cta:active {
  transform: scale(.98);
}
.landing-cta svg {
  width: 16px;
  height: 16px;
}
.landing-footer {
  padding: 20px 36px 24px;
  color: rgba(154, 177, 192, .58);
  font-size: .7rem;
  text-align: center;
}
@media (max-width: 640px) {
  .landing-header {
    padding: 20px 22px;
  }
  .landing-header > img {
    width: 116px;
  }
  .landing-sign-in {
    min-height: 36px;
    padding: 6px 14px;
    font-size: .78rem;
  }
  .landing-hero {
    padding: 30px 22px 42px;
  }
  .landing-product {
    margin-bottom: 26px;
  }
  .landing-product .login-logo-glow img {
    width: 132px;
  }
  .landing-hero h1 {
    font-size: clamp(2.25rem, 11vw, 3rem);
  }
  .landing-hero > p {
    margin-top: 22px;
    font-size: .9rem;
  }
  .landing-feature-pills {
    gap: 8px;
    margin-top: 26px;
  }
  .landing-feature-pills span {
    padding: 6px 10px;
    font-size: .69rem;
  }
  .landing-cta {
    margin-top: 32px;
  }
  .landing-footer {
    padding: 18px 22px 22px;
  }
}
@media (max-height: 720px) {
  .landing-header {
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .landing-hero {
    padding-top: 20px;
    padding-bottom: 28px;
  }
  .landing-product {
    margin-bottom: 20px;
  }
  .landing-hero > p {
    margin-top: 18px;
  }
  .landing-feature-pills {
    margin-top: 20px;
  }
  .landing-cta {
    margin-top: 24px;
  }
}

/* Project selection and overview carousel refinements */
.plant-select-hero h1 {
  text-transform: none !important;
}
.overview-kpi-carousel,
.overview-kpi-carousel.is-auto-carousel,
.overview-kpi-carousel::before,
.overview-kpi-carousel::after,
.overview-kpi-grid,
.overview-kpi-grid.is-auto-carousel-track {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}
.overview-kpi-carousel {
  border: 0 !important;
}

/* Remove carousel gap shading and tile shadow bleed */
.overview-kpi-carousel,
.overview-kpi-carousel.is-auto-carousel,
.overview-kpi-grid,
.overview-kpi-grid.is-auto-carousel-track {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
}
.overview-kpi-carousel::before,
.overview-kpi-carousel::after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}
.overview-kpi-grid > .card.kpi {
  box-shadow: none !important;
}

/* Form configuration dropdown options editor */
.dropdown-options-editor.is-hidden {
  display: none !important;
}
.dropdown-options-editor {
  gap: 8px;
}
.dropdown-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dropdown-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.dropdown-option-row input {
  min-width: 0;
}
@media (max-width: 640px) {
  .dropdown-option-row {
    grid-template-columns: 1fr;
  }
}

/* Field help text shown between form label and entry control */
.field-help-text {
  margin: 2px 0 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-line;
}

/* Field Readings page compact table and limit-breach styling */
.field-readings-entry-table-wrap,
.history-reading-table {
  margin-top: 6px;
}
.field-readings-entry-table,
.field-readings-history-table {
  font-size: 12px;
}
.field-readings-entry-table th,
.field-readings-entry-table td,
.field-readings-history-table th,
.field-readings-history-table td {
  padding: 6px 8px;
  line-height: 1.25;
  vertical-align: middle;
}
.field-readings-entry-table .column-header-actions,
.field-readings-history-table .column-header-actions {
  gap: 2px;
}
.field-readings-entry-table .column-sort-button,
.field-readings-entry-table .column-filter-button,
.field-readings-history-table .column-sort-button,
.field-readings-history-table .column-filter-button {
  width: 18px;
  height: 18px;
  margin-left: 3px;
}
.field-readings-entry-table .column-sort-button svg,
.field-readings-entry-table .column-filter-button svg,
.field-readings-history-table .column-sort-button svg,
.field-readings-history-table .column-filter-button svg {
  width: 10px;
  height: 10px;
}
.field-readings-entry-table input,
.field-readings-entry-table select,
.field-readings-entry-table textarea,
.history-reading-table input,
.history-reading-table select,
.history-reading-table textarea {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 12px;
}
.field-readings-entry-table .input-with-unit {
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 4px;
}
.field-readings-entry-table .input-with-unit + .btn,
.field-readings-entry-table .reading-value-entry + .btn {
  margin-top: 4px;
}
.field-readings-entry-table .reading-tag strong,
.field-readings-history-table td strong {
  font-size: 12px;
}
.field-readings-entry-table .reading-tag span,
.field-readings-history-table .muted {
  font-size: 11px;
}
.field-readings-history-table .actions-cell .btn,
.field-readings-entry-table .btn {
  padding: 5px 8px;
  font-size: 11px;
}
.field-readings-history-table tbody tr.process-limit-breach-row > td {
  background: #fde2e2;
  color: #611515;
}
.field-readings-history-table tbody tr.process-limit-breach-row:hover > td {
  background: #fbd0d0;
}
.field-readings-history-table tbody tr.process-limit-breach-row .muted,
.field-readings-history-table tbody tr.process-limit-breach-row .help-text {
  color: #7b2525;
}
.field-readings-history-table tbody tr.process-limit-breach-row .limit-alert {
  color: #7f1d1d;
}

/* Touch-friendly date/time picker */
.datetime-picker-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
}
.datetime-picker-wrap .datetime-text-input {
  cursor: pointer;
  background: var(--card);
}
.datetime-picker-button {
  border: 1px solid #b9d3df;
  border-radius: 10px;
  background: #f7fbfd;
  color: var(--dark-blue);
  min-width: 42px;
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}
.datetime-picker-button:hover,
.datetime-picker-button:focus {
  background: #eaf5f9;
  outline: none;
}
.datetime-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 39, 63, 0.44);
}
.datetime-modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(4, 39, 63, 0.28);
  padding: 20px;
}
.datetime-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.datetime-modal-header h2 {
  margin: 0 0 4px;
  color: var(--dark-blue);
  font-size: 20px;
}
.datetime-modal-header p {
  margin: 0;
  color: #5e7380;
  font-size: 13px;
}
.datetime-modal-preview {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(17, 112, 142, 0.18);
  border-radius: 14px;
  background: #f7fbfd;
  color: var(--dark-blue);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}
.datetime-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.datetime-modal-grid input[type="date"],
.datetime-modal-grid input[type="time"] {
  min-height: 48px;
  font-size: 17px;
}
.datetime-modal-shortcuts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
@media (max-width: 560px) {
  .datetime-modal-card { padding: 16px; border-radius: 18px; }
  .datetime-modal-grid { grid-template-columns: 1fr; }
  .datetime-modal-grid input[type="date"],
  .datetime-modal-grid input[type="time"] { min-height: 52px; }
}


/* v7.0 responsive off-canvas navigation, mobile table scrolling, and login alignment */
.content,
.page-frame {
  min-width: 0;
}
.mobile-topbar,
.mobile-nav-backdrop,
.mobile-sidebar-close,
.desktop-sidebar-reopen {
  display: none;
}
.sidebar-action-row {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
  margin: -8px -8px 4px;
}
.sidebar-toggle-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 25px;
  line-height: 1;
}
.sidebar-toggle-button:hover,
.sidebar-toggle-button:focus {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

@media (min-width: 921px) {
  .app-shell {
    grid-template-columns: 224px minmax(0, 1fr) !important;
    transition: grid-template-columns 180ms ease;
  }
  .app-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) !important;
  }
  .app-shell .sidebar {
    width: 224px;
    padding: 0 8px 8px !important;
    transform: translateX(0);
    opacity: 1;
    transition: transform 180ms ease, opacity 160ms ease;
  }
  .app-shell.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
  }
  .desktop-sidebar-reopen.visible {
    position: fixed;
    left: 0;
    top: 50%;
    z-index: 1150;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 42px;
    min-height: 76px;
    padding: 8px 5px;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: #04273f;
    color: #fff;
    box-shadow: 0 8px 24px rgba(4, 39, 63, 0.25);
  }
  .desktop-sidebar-reopen span {
    font-size: 24px;
    line-height: 1;
  }
  .desktop-sidebar-reopen small {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
}

/* Match the 07-July login palette and primary action treatment. */
.login-visual-panel {
  background-color: #0a1628;
  background-image:
    radial-gradient(circle at 28% 30%, rgba(77, 154, 255, .14), transparent 36%),
    linear-gradient(90deg, rgba(10, 22, 40, .99) 0%, rgba(10, 22, 40, .96) 56%, rgba(10, 22, 40, .99) 100%);
}
.login-visual-panel::before {
  opacity: .22;
  filter: saturate(.72) brightness(.58);
}
.login-visual-panel::after {
  background:
    radial-gradient(ellipse at 30% 50%, transparent 20%, rgba(10, 22, 40, .58) 67%, rgba(10, 22, 40, .92) 100%),
    linear-gradient(180deg, rgba(10, 22, 40, .04) 0%, rgba(10, 22, 40, .22) 100%);
}
.login-brand-top {
  background: #0d1f3c;
  box-shadow: 0 0 28px rgba(77, 154, 255, .22);
}
.microsoft-sso-btn {
  height: 48px;
  border: 1px solid #04273f;
  border-radius: 12px;
  background: #04273f;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(4, 39, 63, .18);
  font-size: 15px;
  font-weight: 300;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 100ms ease;
}
.microsoft-button-label {
  font-weight: 300;
}
.microsoft-sso-btn:hover,
.microsoft-sso-btn:focus {
  border-color: #0b3a59;
  background: #0b3a59;
  color: #ffffff;
  box-shadow: 0 7px 18px rgba(4, 39, 63, .22);
  outline: none;
}
.microsoft-sso-btn:active {
  transform: scale(.985);
}

@media (max-width: 920px) {
  body {
    overflow-x: hidden;
  }
  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block !important;
    min-width: 0;
  }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1200;
    height: 52px;
    display: grid;
    grid-template-columns: 38px auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(4, 39, 63, 0.12);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(4, 39, 63, 0.08);
  }
  .mobile-topbar img {
    width: 82px;
    height: auto;
    display: block;
  }
  .mobile-topbar-project {
    min-width: 0;
    overflow: hidden;
    color: #607680;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-menu-button {
    width: 34px;
    height: 34px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
  }
  .mobile-menu-button:hover,
  .mobile-menu-button:focus {
    background: #eef5f8;
    outline: none;
  }
  .mobile-menu-button span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #425a67;
  }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  .mobile-nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1300;
    width: min(84vw, 320px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 16px 18px 22px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-104%);
    opacity: 1;
    pointer-events: auto;
    box-shadow: 18px 0 44px rgba(4, 39, 63, .30);
    transition: transform 190ms ease;
  }
  .sidebar.mobile-open,
  .app-shell.sidebar-collapsed .sidebar.mobile-open {
    transform: translateX(0);
  }
  .desktop-sidebar-collapse,
  .desktop-sidebar-reopen {
    display: none !important;
  }
  .mobile-sidebar-close {
    display: inline-flex;
  }
  .content {
    width: 100%;
    min-width: 0;
    padding: 14px 12px 24px !important;
  }
  .page-frame,
  .card,
  .toolbar,
  .admin-grid,
  .grid {
    min-width: 0;
    max-width: 100%;
  }
  .grid.two,
  .grid.three,
  .admin-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .brand-top {
    padding: 20px 18px;
    border-radius: 16px;
  }
  .brand-top h1 {
    font-size: clamp(28px, 9vw, 38px);
  }

  /* Keep table columns at usable widths and scroll the table instead of compressing rows. */
  .table-wrap,
  .overview-table-wrap,
  .issues-table,
  .permit-table,
  .tag-register-table,
  .form-fields-table,
  .permissions-matrix,
  .operating-time-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    padding-bottom: 4px;
  }
  .table-wrap table,
  .overview-table-wrap table,
  .issues-table table,
  .permit-table table,
  .tag-register-table table,
  .form-fields-table table,
  .permissions-matrix table,
  .operating-time-table-wrap table,
  table.resizable-table,
  .operating-time-page .operating-time-table-wrap table {
    width: auto !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
  }
  .table-wrap th,
  .table-wrap td,
  .overview-table-wrap th,
  .overview-table-wrap td,
  .filterable-table th,
  .filterable-table td,
  .issues-table th,
  .issues-table td,
  .permit-table th,
  .permit-table td,
  .tag-register-table th,
  .tag-register-table td,
  .form-fields-table th,
  .form-fields-table td,
  .permissions-matrix th,
  .permissions-matrix td {
    min-width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .table-wrap th .column-title,
  .filterable-table th .column-title {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
  .table-wrap input,
  .table-wrap select,
  .table-wrap textarea,
  .issues-table input,
  .issues-table select,
  .issues-table textarea {
    min-width: 150px;
  }
  .table-wrap textarea,
  .issues-table textarea {
    width: 260px;
    min-height: 42px;
    height: 42px;
  }
  .table-wrap::-webkit-scrollbar,
  .overview-table-wrap::-webkit-scrollbar,
  .issues-table::-webkit-scrollbar {
    height: 11px;
  }
}

@media (max-width: 560px) {
  .mobile-topbar-project {
    display: none;
  }
  .mobile-topbar {
    grid-template-columns: 38px auto 1fr;
  }
  .content {
    padding-inline: 8px !important;
  }
  .card {
    padding: 14px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar > .btn,
  .toolbar > a.btn {
    width: 100%;
  }
}

/* v7.1 compact page heroes and Microsoft SSO user header */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  min-height: 56px;
  margin: calc(-1 * var(--page-gutter, 16px)) calc(-1 * var(--page-gutter, 16px)) 16px;
  padding: 8px var(--page-gutter, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(4, 39, 63, 0.12);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(4, 39, 63, 0.07);
}
.app-topbar-context {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.app-topbar-context span {
  color: #607680;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-topbar-context strong {
  color: var(--dark-blue);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-user-menu {
  position: relative;
  flex: 0 0 auto;
}
.header-user-avatar { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.header-user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.header-user-avatar.has-photo .header-user-initials { visibility: hidden; }
.header-user-popover { position: absolute; display: none; text-align: left; }
.header-user-popover.open { display: block; }

/* Reduce the vertical footprint of the page title banner on every route. */
.brand-top,
.brand-top.clean-banner {
  min-height: 0 !important;
  padding: 14px 20px !important;
  margin-bottom: 14px !important;
  border-radius: 16px !important;
}
.brand-top h1,
.brand-top.clean-banner h1 {
  margin: 0 0 3px !important;
  font-size: clamp(23px, 2.2vw, 32px) !important;
  line-height: 1.12 !important;
}
.brand-top p,
.brand-top.clean-banner p {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

@media (max-width: 920px) {
  .app-topbar {
    display: none;
  }
  .mobile-topbar {
    grid-template-columns: 38px auto minmax(0, 1fr) auto;
  }
  .header-user-menu-mobile .header-user-copy {
    display: none;
  }
  .header-user-menu-mobile .header-user-trigger {
    min-height: 36px;
    padding: 1px;
    border-radius: 50%;
  }
  .header-user-menu-mobile .header-user-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 10px;
  }
  .header-user-menu-mobile .header-user-popover {
    right: -2px;
  }
  .brand-top,
  .brand-top.clean-banner {
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
  }
  .brand-top h1,
  .brand-top.clean-banner h1 {
    font-size: clamp(22px, 7vw, 28px) !important;
  }
  .brand-top p,
  .brand-top.clean-banner p {
    font-size: 12px !important;
  }
}

@media (max-width: 560px) {
  .mobile-topbar {
    grid-template-columns: 38px auto minmax(0, 1fr) auto;
  }
}

/* v7.3 flush user header, compact Lucide navigation, and persistent collapsed sidebar */
.app-shell {
  background-color: #e9f1f5;
  background-image: url('/assets/Background_Pattern_Chalk_Layered.svg');
  background-position: center top;
  background-size: 100vw 100vh;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body:has(> #app > .app-shell) {
  background-color: #e9f1f5;
  background-image: none;
}
html.dark .app-shell {
  background-color: #071b2c;
  background-image: url('/assets/Background_Pattern_Chalk_Layered.svg');
  background-position: center top;
  background-size: 100vw 100vh;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-blend-mode: multiply;
}
html.dark body:has(> #app > .app-shell) {
  background-color: #071b2c;
}
.content,
html.dark .content {
  padding: 0 !important;
  background: transparent;
}
.app-topbar {
  position: sticky !important;
  top: 0 !important;
  width: 100%;
  min-height: 56px;
  margin: 0 !important;
  padding: 8px var(--page-gutter, 16px) !important;
  justify-content: space-between;
  box-sizing: border-box;
}
.page-frame {
  padding: var(--page-gutter, 16px) !important;
  box-sizing: border-box;
}
.content > .offline-banner {
  margin: var(--page-gutter, 16px) var(--page-gutter, 16px) 0;
}
.app-topbar-context,
.mobile-topbar-project,
.mobile-sidebar-close,
.desktop-sidebar-reopen {
  display: none !important;
}
.sidebar-header {
  position: relative;
  min-width: 0;
  margin-bottom: 12px;
}
.sidebar-brand-expanded {
  min-width: 0;
  padding-right: 38px;
}
.sidebar-brand-expanded .brand-block {
  margin: 0 !important;
  gap: 7px !important;
}
.sidebar-brand-expanded .shift-logo-img,
.sidebar .sidebar-brand-expanded .shift-logo-img {
  width: 188px !important;
  min-width: 188px !important;
  max-width: 188px !important;
}
.sidebar-brand-expanded .shift-acronym {
  max-width: 188px;
  font-size: 10px;
}
.sidebar-brand-collapsed {
  display: none;
}
.sidebar-brand-collapsed img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}
.sidebar-header .desktop-sidebar-collapse {
  position: absolute;
  top: 0;
  right: 0;
}
.sidebar-toggle-button .lucide-icon {
  width: 17px;
  height: 17px;
}
.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-lucide-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 921px) {
  .app-shell {
    grid-template-columns: 224px minmax(0, 1fr) !important;
    transition: grid-template-columns 180ms ease;
  }
  .app-shell.sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) !important;
  }
  .app-shell .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    width: 224px;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: width 180ms ease, padding 180ms ease;
  }
  .app-shell:not(.sidebar-collapsed) .sidebar {
    padding: 0 8px 8px !important;
  }
  .app-shell.sidebar-collapsed .sidebar {
    width: 64px;
    padding: 10px 8px 14px !important;
  }
  .app-shell:not(.sidebar-collapsed) .sidebar-header {
    margin: 0 -8px 12px;
    padding: 0 16px;
  }
  .app-shell:not(.sidebar-collapsed) .sidebar .product-nameplate {
    padding-right: 12px;
    padding-left: 12px;
  }
  .app-shell.sidebar-collapsed .sidebar-header {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
  }
  .app-shell.sidebar-collapsed .sidebar-brand-expanded,
  .app-shell.sidebar-collapsed .nav-section-label,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .product-nameplate {
    display: none !important;
  }
  .app-shell.sidebar-collapsed .sidebar-brand-collapsed {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .app-shell.sidebar-collapsed .sidebar-header .desktop-sidebar-collapse {
    position: static;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }
  .app-shell.sidebar-collapsed .nav {
    width: 100%;
    gap: 4px !important;
    margin-top: 0 !important;
  }
  .app-shell.sidebar-collapsed .nav button {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    gap: 0;
    padding: 9px !important;
    margin: 0 !important;
  }
  .app-shell.sidebar-collapsed .nav-lucide-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }
  .app-shell.sidebar-collapsed .nav button.project-selection-nav,
  .app-shell.sidebar-collapsed .nav button.platform-admin-nav {
    margin-top: 7px !important;
  }
}

@media (max-width: 920px) {
  .mobile-topbar {
    grid-template-columns: 38px auto minmax(0, 1fr) auto !important;
  }
  .mobile-topbar-spacer {
    min-width: 0;
  }
  .content {
    padding: 0 !important;
  }
  .page-frame {
    padding: 12px !important;
  }
  .content > .offline-banner {
    margin: 12px 12px 0;
  }
  .sidebar-header {
    margin-bottom: 12px;
  }
  .sidebar-brand-expanded {
    display: flex !important;
    padding-right: 0;
  }
  .sidebar-brand-collapsed {
    display: none !important;
  }
  .sidebar-brand-expanded .shift-logo-img,
  .sidebar .sidebar-brand-expanded .shift-logo-img {
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
  }
  .sidebar-brand-expanded .shift-acronym {
    max-width: 220px;
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .mobile-topbar {
    grid-template-columns: 38px auto minmax(0, 1fr) auto !important;
  }
  .page-frame {
    padding: 8px !important;
  }
  .content > .offline-banner {
    margin: 8px 8px 0;
  }
}

/* Project details inline shift-pattern editing */
.project-id-value {
  display: flex;
  align-items: center;
  font-weight: 700;
}
.shift-pattern-table input[type="time"] {
  width: 132px;
  min-width: 132px;
}
.shift-pattern-table .button-row {
  flex-wrap: nowrap;
}

/* v6.14 consistent table column minimums and horizontal overflow at every viewport size */
.table-wrap,
.section-register-card .table-wrap.issues-table,
.operating-time-page .operating-time-table-wrap,
.overview-table-wrap,
.permits-page .permit-table {
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table.resizable-table,
.operating-time-page .operating-time-table-wrap table.resizable-table,
.overview-table-wrap table.resizable-table,
.permits-page .permit-table table.resizable-table {
  table-layout: fixed !important;
  max-width: none !important;
}
.table-wrap table.resizable-table th,
.table-wrap table.resizable-table td {
  min-width: 0;
}
.table-wrap table.resizable-table th .column-title {
  overflow-wrap: normal;
  word-break: normal;
}


/* v12 navigation interaction cleanup */
.nav button,
.nav button:hover,
.nav button:focus,
.nav button.active {
  font-size: 14px !important;
  font-weight: 500 !important;
  transform: none !important;
}
.nav button::before,
.nav button:hover::before,
.nav button:focus::before,
.nav button.active::before {
  content: none !important;
  display: none !important;
}

/* Project Shift Report Settings layout */
.project-specific-report-grid {
  align-items: start;
}
.project-specific-report-settings-column,
.project-specific-report-template-column {
  min-width: 0;
}
.project-specific-report-template-column .settings-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #d8e7ee;
}
.project-specific-report-template-column .settings-subsection h3 {
  margin: 0 0 14px;
  color: var(--dark-blue);
}

/* v15 keep navigation hover and active backgrounds inside the sidebar */
.sidebar .nav {
  width: 100%;
  min-width: 0;
}
.sidebar .nav button {
  width: calc(100% - 8px) !important;
  max-width: calc(100% - 8px);
  min-width: 0;
  margin-left: 4px !important;
  margin-right: 4px !important;
}
@media (min-width: 921px) {
  .app-shell.sidebar-collapsed .nav button {
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px);
    margin-left: 4px !important;
    margin-right: 4px !important;
  }
}


/* Trend Builder time navigation and touch interaction */
.trend-card {
  overflow: hidden;
}
.trend-plot-shell {
  position: relative;
  min-width: 0;
}
#trendCanvas {
  display: block;
  width: 100%;
  height: 600px;
  max-width: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: contain;
}
#trendCanvas.is-interacting {
  cursor: grabbing;
}
#trendCanvas:focus-visible {
  outline: 3px solid rgba(39, 170, 225, 0.35);
  outline-offset: 2px;
  border-radius: 8px;
}
.trend-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 40px));
  transform: translate(-50%, -50%);
  margin: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(4, 39, 63, 0.12);
  box-shadow: 0 8px 24px rgba(4, 39, 63, 0.08);
}
.trend-range-toolbar {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(4, 39, 63, 0.12);
}
.trend-range-toolbar-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.trend-range-toolbar-heading .section-title {
  margin: 0 0 2px;
  font-size: 0.9rem;
}
.trend-range-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.trend-gesture-help {
  max-width: 430px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: right;
}
.trend-range-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.trend-range-presets {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px;
}
.trend-range-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(4, 39, 63, 0.18);
  border-radius: 7px;
  background: #fff;
  color: var(--dark-blue);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
}
.trend-range-button:hover,
.trend-range-button:focus-visible {
  border-color: var(--bright-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(39, 170, 225, 0.14);
}
.trend-range-button.active {
  border-color: var(--dark-blue);
  background: var(--dark-blue);
  color: #fff;
}
.trend-custom-range {
  display: flex;
  flex: 1 1 520px;
  align-items: flex-end;
  gap: 8px;
}
.trend-custom-range .form-row {
  flex: 1 1 190px;
  min-width: 170px;
  margin: 0;
}
.trend-custom-range label {
  margin-bottom: 3px;
  font-size: 0.7rem;
  line-height: 1.2;
}
.trend-custom-range input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.trend-custom-apply {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 0.76rem;
  white-space: nowrap;
}
.trend-axis-config-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(4, 39, 63, 0.12);
}
.trend-axis-config-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.trend-axis-config-heading .section-title,
.trend-axis-config-heading .help-text {
  margin-top: 0;
}
.trend-axis-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.trend-axis-config-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(4, 39, 63, 0.14);
  border-radius: 10px;
  background: rgba(247, 251, 253, 0.72);
}
.trend-axis-config-card.secondary {
  border-color: rgba(4, 39, 63, 0.18);
}
.trend-axis-config-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.trend-axis-config-title h3 {
  margin: 0;
  color: var(--dark-blue);
  font-size: 0.9rem;
}
.trend-axis-config-card.secondary .trend-axis-config-title h3 {
  color: #5a3795;
}
.trend-axis-config-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: right;
}
.trend-axis-config-fields {
  display: grid;
  grid-template-columns: minmax(125px, 1.2fr) repeat(3, minmax(90px, 1fr));
  gap: 8px;
}
.trend-axis-config-fields .form-row {
  min-width: 0;
  margin: 0;
}
.trend-axis-config-fields label {
  margin-bottom: 3px;
  font-size: 0.7rem;
}
.trend-axis-config-fields input,
.trend-axis-config-fields select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.trend-axis-config-fields input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}
.trend-axis-validation {
  display: none;
  margin: 7px 0 0;
  color: #a52a2a;
  font-size: 0.72rem;
  font-weight: 600;
}
.trend-axis-config-card.invalid {
  border-color: rgba(165, 42, 42, 0.62);
}
.trend-axis-config-card.invalid .trend-axis-validation {
  display: block;
}
.trend-axis-config-card.invalid .trend-axis-limit {
  border-color: rgba(165, 42, 42, 0.72);
}
@media (max-width: 920px) {
  .trend-axis-config-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trend-axis-config-title {
    display: block;
  }
  .trend-axis-config-title p {
    margin-top: 3px;
    text-align: left;
  }
  .trend-range-toolbar-heading {
    display: grid;
  }
  .trend-gesture-help {
    max-width: none;
    text-align: left;
  }
  .trend-range-controls {
    display: grid;
  }
  .trend-custom-range {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
  }
  #trendCanvas {
    height: 500px;
  }
}
@media (max-width: 620px) {
  .trend-axis-config-grid {
    grid-template-columns: 1fr;
  }
  .trend-axis-config-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trend-range-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .trend-range-button {
    width: 100%;
    padding-left: 5px;
    padding-right: 5px;
  }
  .trend-custom-range {
    grid-template-columns: 1fr 1fr;
  }
  .trend-custom-range .form-row {
    min-width: 0;
  }
  .trend-custom-apply {
    grid-column: 1 / -1;
    justify-self: start;
  }
  #trendCanvas {
    height: 450px;
  }
}
@media (max-width: 430px) {
  .trend-axis-config-fields {
    grid-template-columns: 1fr;
  }
  .trend-custom-range {
    grid-template-columns: 1fr;
  }
  .trend-custom-apply {
    grid-column: auto;
    width: 100%;
  }
}


/* Trend Configuration layout */
.trend-configuration-card > summary {
  align-items: center;
}
.trend-config-major-title {
  margin: 0;
}
.trend-config-content {
  margin-top: 18px;
}
.trend-config-subsection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.trend-config-subsection-heading .section-title,
.trend-config-subsection-heading .help-text {
  margin-top: 0;
}
.trend-series-add-control {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 780px;
  padding: 12px;
  border: 1px solid rgba(4, 39, 63, 0.14);
  border-radius: 10px;
  background: rgba(247, 251, 253, 0.72);
}
.trend-series-add-control .form-row {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.trend-series-add-control label {
  margin-bottom: 4px;
  font-size: 0.75rem;
}
.trend-series-add-control select {
  min-height: 38px;
}
.trend-add-series-button {
  min-height: 38px;
  white-space: nowrap;
}
.trend-series-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.trend-series-card {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(500px, 3fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(4, 39, 63, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(4, 39, 63, 0.04);
}
.trend-series-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.trend-series-number {
  display: inline-flex;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--chalk);
  color: var(--dark-blue);
  font-size: 0.72rem;
  font-weight: 800;
}
.trend-series-identity-text {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 6px;
  white-space: nowrap;
}
.trend-series-identity h3 {
  flex: 0 0 auto;
  margin: 0;
  color: var(--dark-blue);
  font-size: 0.94rem;
  line-height: 1.25;
}
.trend-series-identity-text span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}
.trend-remove-series-button {
  flex: 0 0 auto;
}
.trend-series-fields {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) repeat(3, minmax(130px, 1fr));
  gap: 8px;
}
.trend-series-fields .form-row {
  min-width: 0;
  margin: 0;
}
.trend-series-fields label {
  margin-bottom: 3px;
  font-size: 0.7rem;
}
.trend-series-fields input,
.trend-series-fields select {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 0.78rem;
}
.trend-series-fields input[type="color"] {
  width: 100%;
  min-width: 64px;
  padding: 3px;
}
.trend-series-empty {
  padding: 20px;
  border: 1px dashed rgba(4, 39, 63, 0.22);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(247, 251, 253, 0.56);
  text-align: center;
}
.trend-save-view-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(4, 39, 63, 0.12);
}
.trend-save-view-section .section-title,
.trend-save-view-section .help-text {
  margin-top: 0;
}
.trend-save-view-section .help-text {
  max-width: 760px;
  margin-bottom: 0;
}
.trend-save-view-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
@media (max-width: 920px) {
  .trend-series-card {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .trend-series-fields {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trend-save-view-section {
    display: grid;
    align-items: start;
  }
}
@media (max-width: 620px) {
  .trend-series-add-control {
    display: grid;
  }
  .trend-add-series-button {
    width: 100%;
  }
  .trend-remove-series-button {
    justify-self: end;
  }
  .trend-series-fields {
    grid-template-columns: 1fr;
  }
  .trend-save-view-actions {
    display: grid;
    width: 100%;
  }
  .trend-save-view-actions .btn {
    width: 100%;
  }
}
@media (max-width: 430px) {
  .trend-series-fields,
  .trend-remove-series-button {
    padding-left: 0;
    margin-left: 0;
  }
}

.auth-note { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(0, 91, 172, .24); border-radius: 8px; background: rgba(0, 91, 172, .07); color: #164a72; font-size: .9rem; line-height: 1.4; }

/* TRACE-aligned sign-in experience */
@property --login-glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes login-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes login-pill-glow {
  0%, 100% { border-color: rgba(255, 255, 255, .08); }
  50% { border-color: rgba(77, 154, 255, .2); }
}
@keyframes login-rotate-logo-glow {
  to { --login-glow-angle: 360deg; }
}
.login-animate-fade-up {
  animation: login-fade-up .7s ease-out var(--login-delay, 0s) both;
}
.login-animate-fade-in {
  animation: login-fade-in .8s ease-out var(--login-delay, 0s) both;
}
.login-sso-shell {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  background: #fff;
}
.login-visual-panel {
  position: relative;
  display: flex;
  width: 52%;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 48px 56px;
  background-color: #0a1628;
  background-image:
    radial-gradient(circle at 90% -5%, rgba(0, 82, 204, .18), transparent 31%),
    radial-gradient(circle at -5% 98%, rgba(77, 154, 255, .1), transparent 25%),
    radial-gradient(ellipse at 30% 50%, transparent 22%, rgba(10, 22, 40, .6) 65%, rgba(10, 22, 40, .92) 100%);
  color: #fff;
}
.login-visual-panel::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='60' viewBox='0 0 52 60'%3E%3Cpath d='M26 0L52 15L26 30L0 15Z' fill='none' stroke='%234d9aff' stroke-opacity='.25' stroke-width='.7'/%3E%3Cpath d='M0 15L26 30L26 60L0 45Z' fill='none' stroke='%234d9aff' stroke-opacity='.18' stroke-width='.7'/%3E%3Cpath d='M52 15L26 30L26 60L52 45Z' fill='none' stroke='%234d9aff' stroke-opacity='.13' stroke-width='.7'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 52px 60px;
  opacity: 1;
  filter: none;
  content: "";
}
.login-brand-top {
  position: absolute;
  top: 40px;
  left: 56px;
  z-index: 2;
  width: auto;
  min-height: 0;
}
.login-brand-top-glow {
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  background: linear-gradient(135deg, #04273f, #5f8fa8);
  filter: blur(12px);
  opacity: .4;
}
.login-brand-top-inner {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 16px;
  background: #0d1f3c;
  padding: 8px;
}
.login-brand-top img {
  display: block;
  width: 160px;
  height: auto;
  max-height: none;
  object-fit: contain;
}
.login-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  max-width: 520px;
  gap: 28px;
  margin: 0;
}
.login-logo-glow {
  position: relative;
  isolation: isolate;
  width: max-content;
  padding: 2px;
  border-radius: 14px;
  background: conic-gradient(
    from var(--login-glow-angle),
    transparent 0 12%,
    #8b5cf6 21%,
    #3b82f6 31%,
    #06b6d4 40%,
    #22c55e 48%,
    transparent 60% 100%
  );
  box-shadow: 0 0 28px rgba(59, 130, 246, .18);
  animation: login-rotate-logo-glow 4.5s linear infinite;
}
.login-logo-glow::before {
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: 20px;
  background: inherit;
  filter: blur(15px);
  opacity: .72;
  content: "";
}
.login-logo-glow-inner {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 12px;
  background: #0d1f3c;
  padding: 10px 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.login-logo-glow img {
  display: block;
  width: 150px;
  height: auto;
  object-fit: contain;
}
.login-hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.08;
  text-transform: none;
}
.login-gradient-line {
  position: relative;
  display: inline-block;
}
.login-gradient-aura {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #7c3aed, #4d9aff, #00d4ff, #22c55e);
  background-clip: text;
  color: transparent;
  filter: blur(13px);
  opacity: .58;
  user-select: none;
}
.login-gradient-text {
  position: relative;
  background: linear-gradient(90deg, #7c3aed, #4d9aff, #00d4ff, #22c55e);
  background-clip: text;
  color: transparent;
}
.login-hero-copy > p {
  max-width: 390px;
  margin: -2px 0 0;
  color: rgba(154, 177, 192, .72);
  font-size: .94rem;
  line-height: 1.65;
}
.login-feature-pills {
  display: flex;
  max-width: 500px;
  flex-wrap: wrap;
  gap: 10px;
}
.login-feature-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(77, 154, 255, .25);
  border-radius: 999px;
  background: rgba(13, 31, 60, .58);
  color: rgba(154, 177, 192, .78);
  font-size: .72rem;
  line-height: 1;
  animation: login-pill-glow 3s ease-in-out infinite;
}
.login-feature-pills span:nth-child(2) { animation-delay: .3s; }
.login-feature-pills span:nth-child(3) { animation-delay: .6s; }
.login-feature-pills span:nth-child(4) { animation-delay: .9s; }
.login-feature-pills span:nth-child(5) { animation-delay: 1.2s; }
.login-feature-pills svg {
  width: 14px;
  height: 14px;
  color: #4d9aff;
}
.login-copyright {
  position: absolute;
  bottom: 36px;
  left: 56px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(154, 177, 192, .55);
  font-size: .7rem;
}
.login-copyright > span:first-child {
  width: 32px;
  height: 1px;
  background: rgba(77, 154, 255, .25);
}
.login-access-panel {
  display: flex;
  width: 48%;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #fff;
}
.login-card-sso {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
.login-mobile-product,
.login-mobile-copyright {
  display: none;
}
.login-welcome-copy {
  display: block;
  margin: 0;
}
.login-welcome-copy h2 {
  margin: 0;
  color: #0a1628;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.2;
  text-transform: none;
}
.login-welcome-copy p {
  margin: 11px 0 0;
  color: #647184;
  font-size: .93rem;
  line-height: 1.55;
}
.login-card-sso .auth-error,
.login-card-sso .auth-note {
  margin: 18px 0 0;
  font-size: .84rem;
  line-height: 1.45;
}
.login-auth-actions,
.login-recovery-actions {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
.microsoft-sso-btn {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #0d1f3c;
  border-radius: 9px;
  background: #062f48;
  color: #fff;
  box-shadow: 0 1px 2px rgba(10, 22, 40, .1);
  font-size: .91rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: none;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.microsoft-sso-btn:hover {
  background: #0a4161;
  box-shadow: 0 8px 20px rgba(6, 47, 72, .16);
  transform: translateY(-1px);
}
.microsoft-sso-btn:focus-visible {
  outline: 3px solid rgba(77, 154, 255, .38);
  outline-offset: 3px;
}
.microsoft-button-label {
  letter-spacing: 0;
  text-transform: none;
}
.login-sso-meta {
  margin-top: 28px;
  text-align: center;
}
.sso-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: #a4adba;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sso-divider::before,
.sso-divider::after {
  height: 1px;
  flex: 1;
  background: #e9edf2;
  content: "";
}
.sso-note {
  max-width: 330px;
  margin: 0 auto;
  color: #7a8492;
  font-size: .78rem;
  line-height: 1.52;
}
.dev-login-details {
  margin-top: 0;
}
@media (max-width: 1023px) {
  .login-sso-shell {
    display: block;
    overflow: auto;
  }
  .login-visual-panel {
    display: none;
  }
  .login-access-panel {
    width: 100%;
    min-height: 100vh;
    padding: 32px 24px 24px;
  }
  .login-mobile-product {
    display: block;
    width: max-content;
    margin: 0 0 32px;
  }
  .login-logo-glow-light {
    box-shadow: 0 0 16px rgba(77, 154, 255, .23), 0 0 34px rgba(0, 212, 255, .1);
  }
  .login-logo-glow-light::before {
    opacity: .35;
  }
  .login-logo-glow-light .login-logo-glow-inner {
    background: #fff;
  }
  .login-logo-glow-light img {
    width: 132px;
  }
  .login-mobile-copyright {
    display: block;
    margin-top: 48px;
    color: #9aa4b1;
    font-size: .68rem;
    text-align: center;
  }
}
@media (max-width: 430px) {
  .login-access-panel {
    justify-content: flex-start;
    padding-top: max(32px, 8vh);
  }
  .login-card-sso {
    max-width: 100%;
  }
  .login-welcome-copy h2 {
    font-size: 1.45rem;
  }
}
@media (min-width: 1024px) and (max-height: 720px) {
  .login-visual-panel {
    padding-top: 38px;
    padding-bottom: 38px;
  }
  .login-brand-top {
    top: 28px;
  }
  .login-hero-copy {
    gap: 20px;
  }
  .login-copyright {
    bottom: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-animate-fade-up,
  .login-animate-fade-in,
  .login-logo-glow,
  .login-feature-pills span {
    animation: none;
  }
  .microsoft-sso-btn {
    transition: none;
  }
}

/* Pulse reference parity for the public landing and login pages */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Inter-Variable-Latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}
html:has(.landing-shell),
html:has(.login-sso-shell) {
  overflow-y: auto;
  scrollbar-gutter: auto;
}
.landing-shell,
.login-sso-shell {
  font-family: Inter, "Inter Fallback", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.landing-shell,
.landing-shell *,
.login-sso-shell,
.login-sso-shell * {
  box-sizing: border-box;
}
.pulse-reference-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.pulse-cube-mosaic,
.pulse-depth-fade,
.pulse-glow-orb {
  position: absolute;
}
.pulse-cube-mosaic,
.pulse-depth-fade {
  inset: 0;
}
.pulse-cube-mosaic {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='60' viewBox='0 0 52 60'%3E%3Cpath d='M26 0L52 15L26 30L0 15Z' fill='none' stroke='rgba(77,154,255,0.25)' stroke-width='0.7'/%3E%3Cpath d='M0 15L26 30L26 60L0 45Z' fill='none' stroke='rgba(77,154,255,0.18)' stroke-width='0.7'/%3E%3Cpath d='M52 15L26 30L26 60L52 45Z' fill='none' stroke='rgba(77,154,255,0.13)' stroke-width='0.7'/%3E%3C/svg%3E");
  background-size: 52px 60px;
}
.pulse-depth-fade {
  background: radial-gradient(ellipse at 30% 50%, transparent 20%, rgba(10, 22, 40, .6) 65%, rgba(10, 22, 40, .92) 100%);
}
.landing-background .pulse-depth-fade {
  background: radial-gradient(ellipse at 50% 50%, transparent 20%, rgba(10, 22, 40, .6) 65%, rgba(10, 22, 40, .92) 100%);
}
.pulse-glow-orb {
  border-radius: 9999px;
}
.pulse-glow-orb-top {
  top: -128px;
  right: -128px;
  width: 384px;
  height: 384px;
  background: rgba(4, 39, 63, .15);
  filter: blur(140px);
}
.pulse-glow-orb-bottom {
  bottom: -96px;
  left: -96px;
  width: 288px;
  height: 288px;
  background: rgba(95, 143, 168, .1);
  filter: blur(120px);
}
.landing-shell {
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: #0a1628;
}
.landing-shell::before,
.landing-shell::after,
.login-visual-panel::before {
  content: none;
  display: none;
}
.landing-header {
  padding: 24px 32px;
}
.landing-header > img {
  width: 160px;
}
.landing-sign-in {
  min-height: 36px;
  padding: 8px 20px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}
.landing-sign-in:hover {
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1);
  transform: none;
}
.landing-hero {
  max-width: none;
  margin: 0;
  padding: 0 24px;
}
.landing-product {
  margin-bottom: 32px;
}
.landing-product .login-logo-glow img,
.login-logo-glow img {
  width: 150px;
  height: 75.7734375px;
  object-fit: contain;
}
.landing-hero h1 {
  max-width: 672px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.landing-gradient-text {
  background: linear-gradient(90deg, #5f8fa8, #48bb78);
  background-clip: text;
  color: transparent;
}
.landing-hero > p {
  max-width: 512px;
  margin-top: 24px;
  color: #71717a;
  font-size: 16px;
  line-height: 1.625;
}
.landing-feature-pills {
  gap: 12px;
  margin-top: 32px;
}
.landing-feature-pills span {
  padding: 8px 16px;
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: rgba(113, 113, 122, .5);
  font-size: 14px;
}
.landing-cta {
  min-height: 52px;
  gap: 8px;
  margin-top: 40px;
  padding: 14px 32px;
  border-color: #04273f;
  border-radius: 12px;
  background: #04273f;
  box-shadow: 0 10px 15px -3px rgba(4, 39, 63, .25), 0 4px 6px -4px rgba(4, 39, 63, .25);
  font-size: 16px;
  font-weight: 600;
}
.landing-cta:hover {
  border-color: #031f32;
  background: #031f32;
  box-shadow: 0 20px 25px -5px rgba(4, 39, 63, .3), 0 8px 10px -6px rgba(4, 39, 63, .3);
  transform: none;
}
.landing-footer {
  padding: 24px 32px;
  color: #71717a;
  font-size: 13px;
}
.landing-footer a,
.login-copyright a,
.login-mobile-copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.landing-footer a:hover,
.login-copyright a:hover {
  color: #fff;
}
@media (min-width: 640px) {
  .landing-header,
  .landing-footer {
    padding-right: 48px;
    padding-left: 48px;
  }
  .landing-hero h1 {
    font-size: 48px;
  }
  .landing-hero > p {
    font-size: 18px;
  }
}
@media (min-width: 1024px) {
  .landing-hero h1 {
    font-size: 60px;
  }
}

.login-sso-shell {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow: visible;
  background: #fff;
}
.login-visual-panel {
  display: none;
}
.login-mobile-visual {
  position: relative;
  display: flex;
  height: 40svh;
  min-height: 250px;
  max-height: 360px;
  flex: 0 0 auto;
  align-items: center;
  overflow: hidden;
  background: #0a1628;
}
.login-mobile-hero {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: 390px;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  margin: 0 auto;
  padding: 0 24px;
}
.login-mobile-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.025em;
  text-transform: none;
}
.login-access-panel {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 24px;
}
.login-card-sso {
  display: grid;
  width: 100%;
  max-width: 360px;
  gap: 28px;
  margin: auto 0;
}
.login-welcome-copy h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -.025em;
}
.login-welcome-copy p {
  margin-top: 8px;
  color: #71717a;
  font-size: 15px;
  line-height: 1.5;
}
.login-auth-actions,
.login-recovery-actions,
.login-sso-meta {
  margin-top: 0;
}
.login-auth-actions {
  gap: 16px;
}
.microsoft-sso-btn {
  display: inline-flex;
  height: 48px;
  min-height: 48px;
  gap: 12px;
  padding: 8px 16px;
  border: 1px solid #04273f;
  border-radius: 12px !important;
  background: #04273f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.microsoft-button-label {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.microsoft-sso-btn:hover {
  border-color: #0b3a59;
  background: #0b3a59;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);
  transform: none;
}
.microsoft-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.sso-divider {
  gap: 12px;
  margin-bottom: 16px;
  color: rgba(113, 113, 122, .5);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .1em;
}
.sso-divider::before,
.sso-divider::after {
  background: #f5f5f4;
}
.sso-note {
  max-width: none;
  margin: 0 !important;
  color: #71717a;
  font-size: 13px !important;
  line-height: 1.625 !important;
}
.login-mobile-copyright {
  display: block;
  flex: 0 0 auto;
  margin-top: 32px;
  color: #71717a;
  font-size: 13px;
  line-height: 1.5;
}
.login-mobile-product {
  display: none;
}
@media (min-width: 640px) and (max-width: 1023px) {
  .login-access-panel {
    padding-right: 48px;
    padding-left: 48px;
  }
}
@media (min-width: 1024px) {
  .login-sso-shell {
    min-height: 100vh;
    flex-direction: row;
    overflow: hidden;
  }
  .login-mobile-visual,
  .login-mobile-copyright {
    display: none;
  }
  .login-visual-panel {
    display: flex;
    width: 52%;
    padding: 48px 56px;
  }
  .login-brand-top {
    display: block;
    top: 40px;
    left: 56px;
    width: max-content;
    min-height: 0;
    padding: 0;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none;
  }
  .login-brand-top-inner {
    display: block;
  }
  .login-hero-copy {
    max-width: 512px;
    gap: 28px;
  }
  .login-hero-copy h1 {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.025em;
  }
  .login-gradient-aura {
    filter: blur(18px);
    opacity: .5;
  }
  .login-hero-copy > p {
    max-width: 384px;
    margin: 0;
    color: #71717a;
    font-size: 15px;
    line-height: 1.7;
  }
  .login-feature-pills {
    width: 100%;
    max-width: 512px;
    gap: 10px;
    padding-top: 4px;
  }
  .login-feature-pills span {
    gap: 6px;
    padding: 6px 14px;
    border-color: rgba(255, 255, 255, .08);
    border-radius: 9999px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .01) 100%);
    color: rgba(113, 113, 122, .5);
    font-size: 13px;
    line-height: 1.5;
    animation-duration: 6s;
  }
  .login-feature-pills svg {
    color: rgba(95, 143, 168, .6);
  }
  .login-copyright {
    bottom: 40px;
    left: 56px;
    gap: 12px;
    color: #71717a;
    font-size: 13px;
  }
  .login-copyright > span:first-child {
    background: rgba(51, 65, 85, .6);
  }
  .login-access-panel {
    width: 48%;
    min-height: 100vh;
    justify-content: center;
    padding: 0 48px;
  }
  .login-card-sso {
    gap: 32px;
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-logo-glow {
    --login-glow-angle: 125deg;
  }
}

/* Engineurs App Builder table treatment */
.table-wrap:has(> .enhanced-table-toolbar):has(> .enhanced-table-scroll) {
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
.enhanced-table-toolbar {
  display: flex;
  min-height: 52px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #cddbe2;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.enhanced-table-search {
  position: relative;
  display: block;
  min-width: 200px;
  flex: 1;
  margin: 0;
}
.enhanced-table-search svg {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #71717a;
  stroke-width: 1.8;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}
.enhanced-table-search input {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 7px 12px 7px 36px;
  border: 1px solid #e7e5e4;
  border-radius: 6px;
  background: #fff;
  color: #09090b;
  font: inherit;
  font-size: 14px;
}
.enhanced-table-search input:focus {
  border-color: #04273f;
  outline: 2px solid rgba(4, 39, 63, .15);
  outline-offset: 0;
}
.enhanced-table-clear {
  display: inline-flex;
  height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.enhanced-table-clear[hidden] {
  display: none;
}
.enhanced-table-clear:hover {
  background: #f5f5f4;
}
.enhanced-table-clear svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.enhanced-table-count {
  margin: 0 0 0 auto;
  color: #71838e;
  font-size: 11px;
  white-space: nowrap;
}
.enhanced-table-scroll {
  min-width: 0;
  scrollbar-width: auto;
  max-width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.enhanced-table-scroll .filterable-table {
  border-radius: 0;
}
.filterable-table th {
  height: 39px;
  padding: 0 6px !important;
  background: #f2f7f9;
  color: #31465a;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.column-header-layout {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 2px;
}
.column-drag-handle {
  display: inline-grid;
  width: 18px;
  height: 20px;
  flex: 0 0 18px;
  place-items: center;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #879aa6;
  cursor: grab;
}
.column-drag-handle:active {
  cursor: grabbing;
}
.column-drag-handle:hover,
.column-drag-handle:focus-visible {
  background: #e3edf1;
}
.column-drag-handle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.column-sort-button {
  display: inline-flex;
  width: auto;
  min-width: 0;
  height: auto;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 5px 3px;
  border-radius: 4px;
  color: inherit;
  text-align: left;
}
.column-sort-button:hover,
.column-sort-button:focus {
  background: #e3edf1;
  color: #04273f;
  outline: none;
}
.column-sort-button .column-title {
  display: block;
  max-width: none;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
}
.column-sort-button > svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 0;
  fill: none;
  stroke: #71838e;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.column-sort-button.active,
.column-sort-button.active .column-title {
  color: #1d4ed8;
  font-weight: 600;
}
.column-sort-button.active > svg {
  stroke: #2563eb;
}
.column-sort-button[data-sort-dir="asc"] > svg path:last-child,
.column-sort-button[data-sort-dir="desc"] > svg path:first-child {
  opacity: .18;
}
.filterable-table th .column-filter-button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  margin: 0;
  padding: 3px;
  border-radius: 4px;
  color: #71838e;
}
.filterable-table th .column-filter-button:hover,
.filterable-table th .column-filter-button:focus {
  background: #dceef6;
  color: #1873a5;
  outline: none;
}
.filterable-table th .column-filter-button svg {
  width: 12px;
  height: 12px;
}
.filterable-table th.column-filter-active .column-filter-button.active,
.table-wrap table.filterable-table th.column-filter-active .column-filter-button.active {
  border: 0 !important;
  border-radius: 4px;
  background: #eff6ff !important;
  color: #2563eb !important;
  box-shadow: none !important;
}
.filterable-table th.column-dragging {
  opacity: .55;
}
.filterable-table th.column-drag-over {
  box-shadow: inset 3px 0 #3b82f6;
}
.enhanced-table-scroll .column-resize-handle {
  right: 0;
  width: 6px;
  opacity: 0;
  transition: opacity .15s ease;
}
.enhanced-table-scroll th:hover > .column-resize-handle,
.enhanced-table-scroll .column-resize-handle:hover,
.column-resizing .enhanced-table-scroll .column-resize-handle {
  background: #60a5fa;
  opacity: 1;
}
.enhanced-table-scroll .column-resize-handle::after {
  content: none;
}
.enhanced-table-scroll + .table-pagination {
  border-top: 0;
  background: var(--card);
}
.column-filter-menu {
  border-color: #e7e5e4;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}
@media (max-width: 640px) {
  .enhanced-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .enhanced-table-search {
    width: 100%;
  }
  .enhanced-table-clear {
    align-self: flex-start;
  }
  .enhanced-table-count {
  margin: 0 0 8px;
    align-self: flex-end;
  }
}

/* Pulse reference parity for the public privacy page */
.privacy-page {
  min-height: 100vh;
  background: #fafaf9;
  color: #09090b;
  font-family: Inter, "Inter Fallback", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.privacy-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e7e5e4;
  background: #04273f;
}
.privacy-header-inner {
  display: flex;
  width: 100%;
  max-width: 1024px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
}
.privacy-header img {
  display: block;
  width: 140px;
  height: 40px;
  object-fit: contain;
}
.privacy-header a:last-child {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-underline-offset: 4px;
}
.privacy-header a:last-child:hover { text-decoration: underline; }
.privacy-main {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 48px 24px;
}
.privacy-intro {
  max-width: 100%;
  margin-bottom: 40px;
}
.privacy-kicker {
  margin: 0 0 12px;
  color: #71717a;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.privacy-intro h1 {
  margin: 0 0 12px;
  color: #09090b;
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: normal;
}
.privacy-intro > p:last-child {
  max-width: 768px;
  margin: 0;
  color: #71717a;
  font-size: 14px;
  line-height: 1.625;
}
.privacy-policy > h2 {
  margin: 0 0 16px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e7e5e4;
  color: #09090b;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}
.privacy-section-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.privacy-updated {
  margin: 0;
  color: #71717a;
  font-size: 14px;
  line-height: 20px;
}
.privacy-subsection { scroll-margin-top: 24px; }
.privacy-subsection h3 {
  margin: 0 0 12px;
  color: #09090b;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}
.privacy-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #09090b;
  font-size: 14px;
  line-height: 1.625;
}
.privacy-copy p { margin: 0; }
.privacy-copy ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}
.privacy-copy a,
.privacy-footer a { color: inherit; text-decoration: underline; }
.privacy-table-wrap {
  overflow-x: auto;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
}
.privacy-table-wrap table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #09090b;
  font-size: 14px;
  text-align: left;
}
.privacy-table-wrap thead { background: rgb(245 245 244 / .7); }
.privacy-table-wrap th,
.privacy-table-wrap td {
  padding: 8px 12px;
  border-bottom: 1px solid #e7e5e4;
  vertical-align: top;
}
.privacy-table-wrap th { font-weight: 600; }
.privacy-table-wrap tbody tr:nth-child(even) { background: rgb(245 245 244 / .3); }
.privacy-table-wrap tbody tr:last-child td { border-bottom: 0; }
.privacy-callout {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid;
  border-radius: 8px;
}
.privacy-callout.info { border-color: #bfdbfe; background: #eff6ff; }
.privacy-callout.warning { border-color: #fde68a; background: #fffbeb; }
.privacy-callout > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 2px;
}
.privacy-callout.info > svg { color: #3b82f6; }
.privacy-callout.warning > svg { color: #f59e0b; }
.privacy-callout strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
.privacy-callout.info strong { color: #1e40af; }
.privacy-callout.warning strong { color: #92400e; }
.privacy-callout p { color: #09090b; }
.privacy-footer {
  padding: 24px;
  border-top: 1px solid #e7e5e4;
  color: #71717a;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}
@media (max-width: 640px) {
  .privacy-header { padding: 16px; }
  .privacy-main { padding: 32px 16px; }
  .privacy-intro h1 { font-size: 30px; line-height: 36px; }
  .privacy-footer { padding-right: 16px; padding-left: 16px; }
}

/* BM Platform aligned delayed page loading feedback. */
@keyframes page-loading-bar-trace {
  from { transform: translateX(-115%); }
  to { transform: translateX(165%); }
}
@keyframes page-loading-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}
.page-loading-screen {
  position: fixed;
  z-index: 9000;
  inset: 0;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background-color: #eef6fa;
  background-image:
    linear-gradient(140deg, rgb(247 251 253 / 20%) 0%, rgb(238 246 250 / 14%) 52%, rgb(255 255 255 / 22%) 100%),
    url('/assets/loading-background-hex.png');
  background-size: cover, cover;
  background-position: center, center top;
  background-repeat: no-repeat, repeat-y;
  opacity: 0;
  pointer-events: none;
}
.page-loading-screen[hidden] { display: none !important; }
.page-loading-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
  animation: page-loading-reveal 120ms ease both;
}
.page-loading-mark {
  display: flex;
  width: min(80vw, 220px);
  align-items: center;
  flex-direction: column;
  gap: 14px;
}
.page-loading-logo {
  display: block;
  width: auto;
  height: 112px;
  max-width: min(80vw, 220px);
  object-fit: contain;
}
.page-loading-bar {
  position: relative;
  display: block;
  width: 112px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(4 39 63 / 14%);
}
.page-loading-bar > span {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 72%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, #8b5cf6 14%, #3b82f6 36%, #06b6d4 58%, #22c55e 80%, transparent 100%);
  animation: page-loading-bar-trace 1.6s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
  .page-loading-screen.is-visible { animation: none; }
  .page-loading-bar > span {
    animation: none;
    transform: none;
  }
}

html.dark .log-field-row > label, html.dark .form-row > label { border-color: var(--border); background: #22303a; color: var(--text); }

@media (max-width: 920px) {
  .mobile-topbar { display: flex !important; grid-template-columns: none !important; height: 48px; min-height: 48px; padding: 0 16px; align-items: center; justify-content: space-between; }
  .mobile-topbar-left { display: flex; min-width: 0; align-items: center; gap: 12px; }
  .mobile-topbar .header-actions { margin-left: auto; }
  .header-user-menu-mobile .header-user-trigger { min-height: 0; padding: 4px; border-radius: 999px; }
  .header-user-menu-mobile .header-user-avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 12px; }
  .header-user-menu-mobile .header-user-popover { right: 0; }
}

html.dark .enhanced-table-scroll,
html.dark .enhanced-table-scroll + .table-pagination { border-color: var(--border); background: var(--card); color: var(--text); }
html.dark table { background: var(--card); color: var(--text); }
html.dark .enhanced-table-search input { border-color: var(--border); background: #0f171e; color: var(--text); }
html.dark .filterable-table th { border-color: var(--border); background: #22303a; color: var(--text); }
html.dark .column-sort-button, html.dark .column-sort-button .column-title { color: var(--text); }
html.dark .column-sort-button > svg { stroke: #c1cdd8; }
html.dark .column-drag-handle, html.dark .filterable-table th .column-filter-button, html.dark .enhanced-table-count { color: var(--muted); }
html.dark .column-drag-handle:hover, html.dark .column-drag-handle:focus-visible, html.dark .filterable-table th .column-filter-button:hover, html.dark .filterable-table th .column-filter-button:focus { background: #31404c; }
html.dark .tabs button:not(.active), html.dark .btn.secondary { border-color: var(--border); background: #22303a; color: var(--text); }
html.dark .tabs button:not(.active):hover, html.dark .btn.secondary:hover { background: #31404c; }

/* Shared Pulse project list and plain page headings. */
.page-heading { margin: 0 0 24px; }
.page-heading h1 { margin: 0; color: var(--text); font-size: 24px; font-weight: 700; letter-spacing: -.6px; }
.page-heading::after { content: ''; display: block; width: 40px; height: 4px; margin-top: 8px; border-radius: 4px; background: #2563eb; }
.project-selection-help { margin: -16px 0 24px; font-size: 14px; }
.project-selection-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.project-selection-toolbar > input { max-width: 384px; flex: 1 1 220px; }
.project-selection-toolbar > select { width: 160px; }
.project-switch { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.project-list-group { margin-bottom: 24px; }
.project-list-group h2, .project-list-group summary { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.project-list-group h2 span { margin-left: 8px; font-weight: 400; }
.project-list-row { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.project-list-row:hover { background: #eaf5f9; }
html.dark .project-list-row:hover { background: #193344; }
.project-favourite { border: 0; background: transparent; padding: 4px; color: var(--muted); cursor: pointer; }
.project-favourite svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.project-favourite.selected { color: #d97706; }
.project-favourite.selected svg { fill: currentColor; }
.project-open { display: flex; flex: 1; min-width: 0; align-items: center; gap: 12px; padding: 0; text-align: left; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.project-open:disabled { cursor: default; opacity: .65; }
.project-open img { width: 32px; height: 32px; object-fit: contain; }
.project-number { max-width: 144px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.project-summary { min-width: 0; flex: 1; }
.project-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.project-summary small { display: block; color: var(--muted); font-size: 12px; }
.project-empty { padding: 64px 16px; text-align: center; color: var(--muted); }
.table-tool.btn.secondary { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; box-shadow: none; }
.table-columns-menu { position: fixed; z-index: 6000; width: 264px; max-height: min(420px, calc(100vh - 16px)); overflow: auto; padding: 12px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 24px #0002; }
.table-columns-menu label { font-weight: 400; display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.table-columns-menu input { width: 16px; height: 16px; }
.enhanced-table-scroll [hidden] { display: none !important; }
.enhanced-table-scroll .filterable-table td { font-family: Inter, 'Inter Fallback', Arial, sans-serif; font-size: 14px; font-weight: 400; padding: 8px; line-height: 20px; }
.enhanced-table-scroll .filterable-table th { font-family: Inter, 'Inter Fallback', Arial, sans-serif; font-size: 12px; font-weight: 500; }
.enhanced-table-scroll th[aria-sort='ascending'], .enhanced-table-scroll th[aria-sort='descending'] { background: #eff6ff; }
html.dark .enhanced-table-scroll th[aria-sort='ascending'], html.dark .enhanced-table-scroll th[aria-sort='descending'] { background: #172d49; }
@media (max-width: 640px) {
  .project-selection-toolbar > input, .project-selection-toolbar > select { max-width: none; width: 100%; flex-basis: 100%; }
  .project-list-row { padding: 12px; gap: 8px; }
  .project-open { flex-wrap: wrap; gap: 8px; }
  .project-summary { flex-basis: calc(100% - 48px); }
  .enhanced-table-toolbar { flex-direction: row; align-items: center; }
  .enhanced-table-search { flex-basis: 100%; }
}

input.bm-toggle[role="switch"] {
  appearance: none !important;
  display: inline-block;
  flex: 0 0 32px;
  width: 32px !important;
  min-width: 32px !important;
  height: 18px !important;
  min-height: 18px !important;
  padding: 2px !important;
  border: 1px solid #748897 !important;
  border-radius: 999px !important;
  background: #748897 !important;
  vertical-align: middle;
  cursor: pointer;
}
input.bm-toggle[role="switch"]::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  transition: transform 120ms ease;
}
input.bm-toggle[role="switch"]:checked {
  border-color: #04273f !important;
  background: #04273f !important;
}
input.bm-toggle[role="switch"]:checked::before { transform: translateX(14px); }
input.bm-toggle[role="switch"]:focus-visible { outline: 2px solid #168dc0; outline-offset: 3px; }
input.bm-toggle[role="switch"]:disabled { opacity: .5; cursor: not-allowed; }
.record-unarchive-toggle {
  position: relative;
  display: inline-block;
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 2px solid #04273f;
  border-radius: 999px;
  background: #04273f;
  box-shadow: 0 1px 2px #0001;
  vertical-align: middle;
  cursor: pointer;
}
.record-unarchive-toggle > span {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(16px);
  transition: transform 120ms ease;
}
.record-unarchive-toggle:hover { border-color: #31566d; background: #31566d; }
.record-unarchive-toggle:focus-visible { outline: 2px solid #168dc0; outline-offset: 3px; }
html.dark .record-unarchive-toggle { border-color: #80c0e9; background: #80c0e9; }
html.dark .record-unarchive-toggle > span { background: #071b2c; }
@media (prefers-reduced-motion: reduce) {
  input.bm-toggle[role="switch"]::before { transition: none; }
  .record-unarchive-toggle > span { transition: none; }
}
.enabled-setting { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; cursor: pointer; }
.admin-section-tabs { display: flex; gap: 6px; margin: 14px 0 8px; padding: 5px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.admin-section-tabs button { flex: 0 0 auto; padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .74rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.admin-section-tabs button[aria-selected="true"] { background: #04273f; color: white; }
.admin-section-tabs button:hover { background: #eef6fa; color: #04273f; }
.admin-section-tabs button[aria-selected="true"]:hover { background: #04273f; color: white; }
.admin-section-tabs button:focus-visible { outline: 2px solid #168dc0; outline-offset: -2px; }
html.dark .admin-section-tabs button:hover { background: #22303a; color: white; }

/* Pulse sizing and readable wrapped columns. */
.app-shell { font-size: 14px; }
.app-shell .btn { font-size: 14px; font-weight: 500; border-radius: 6px; min-height: 36px; padding: 8px 12px; }
.app-shell .card h2, .app-shell .section-title { font-size: 18px; line-height: 24px; font-weight: 600; }
.app-shell .card p, .app-shell input, .app-shell select, .app-shell textarea { font-size: 14px; }
.app-shell .form-row > label, .app-shell .log-field-row > label { font-size: 14px; font-weight: 500; }
.enhanced-table-scroll table.resizable-table { table-layout: fixed; }
.enhanced-table-scroll .filterable-table td, .enhanced-table-scroll .filterable-table th { white-space: normal !important; overflow-wrap: anywhere; word-break: normal; min-width: 0; overflow: hidden; }
.enhanced-table-scroll td input, .enhanced-table-scroll td select, .enhanced-table-scroll td textarea { min-width: 0; max-width: 100%; }
[data-icon-decorated] > svg, .btn svg, .action-icon-only svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
.app-shell .btn.action-icon-only, .action-icon-only { display: inline-grid; place-items: center; width: 36px; min-width: 36px; height: 36px; padding: 8px; }
.app-shell .remove-action { color: #dc2626; background: transparent; border: 0; }
.app-shell .remove-action:hover { color: #b91c1c; background: #fee2e2; }
.app-shell .sidebar .nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.app-shell .sidebar .nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.sidebar-bottom-links { border-top: 1px solid var(--border); padding: 10px 0; flex-shrink: 0; }
.sidebar-bottom-links + .sidebar-bottom-links { border-top: 0; padding-top: 0; }
.sidebar-resource { display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 8px; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; text-decoration: none; border-radius: 6px; cursor: pointer; }
.sidebar-resource { font-weight: 500; }
.sidebar-resource:hover { background: #ffffff18; }
.sidebar-resource svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-resource small { display: block; font-size: 11px; opacity: .7; }
.sidebar-links-empty { display: block; padding: 6px 8px; font-size: 12px; opacity: .7; }
.sidebar-collapsed .sidebar-bottom-links .nav-section-label, .sidebar-collapsed .sidebar-resource span, .sidebar-collapsed .sidebar-links-empty { display: none; }
.page-save-status { display: inline-flex; margin-left: auto; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 6px; background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 600; white-space: nowrap; }
.page-save-status[hidden] { display: none; }
.page-save-status svg { width: 14px; height: 14px; }
.page-save-status.is-saving svg { animation: page-save-spin 1s linear infinite; }
@keyframes page-save-spin { to { transform: rotate(360deg); } }
html.dark .page-save-status { background: #713f12; color: #fef3c7; }
.page-shortcut-button { display: inline-grid; place-items: center; margin-left: auto; border: 0; border-radius: 6px; width: 32px; height: 32px; background: transparent; color: var(--muted); cursor: pointer; }
.page-save-status:not([hidden]) + .page-shortcut-button { margin-left: 8px; }
.page-shortcut-button svg { width: 16px; height: 16px; }
.page-shortcut-button.selected { color: #04273f; background: rgb(4 39 63 / 10%); }
html.dark .page-shortcut-button.selected { color: #d5e9f5; background: rgb(213 233 245 / 15%); }
.page-shortcut-button.selected svg { fill: currentColor; }
.project-list-row { min-height: 78px; padding: 14px 16px; gap: 14px; }
.project-favourite { display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; }
.project-favourite.selected { color: #f59e0b; }
.project-favourite:disabled { cursor: wait; }
.project-open { gap: 14px; }
.project-open img { width: 42px; height: 42px; }
.project-open > svg { width: 18px; height: 18px; flex-shrink: 0; }
.project-summary { flex: 1 1 220px; }
.project-row-metric { display: inline-flex; min-width: 48px; align-items: center; justify-content: center; gap: 5px; color: var(--text); }
.project-row-metric svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.project-row-metric b { font-size: 13px; font-weight: 500; line-height: 1; }
@media (max-width: 768px) {
  .project-open { flex-wrap: wrap; }
  .project-summary { flex-basis: calc(100% - 60px); }
  .project-row-metric { flex: 0 0 auto; margin-top: 6px; }
  .project-open > svg { display: none; }
}

.admin-section-tabs button[data-icon-decorated] { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 920px) {
  .app-shell .app-topbar { display: flex !important; min-height: 40px; position: static; gap: 8px; }
  .app-topbar > .header-actions, .app-topbar > .page-save-status { display: none; }
  .app-topbar-breadcrumbs { flex: 1; min-width: 0; flex-wrap: wrap; gap: 4px; }
  .app-topbar-breadcrumbs span { white-space: normal; overflow-wrap: anywhere; max-width: 100%; font-size: 12px; }
  .app-topbar-breadcrumbs button { font-size: 12px; }
}

/* Pulse project-directory toolbar, retaining the SHIFT dark-blue theme. */
.project-selection-toolbar { gap: 12px; }
.project-search-field { position: relative; flex: 1 1 240px; width: 100%; max-width: 384px; }
.project-search-field > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #71717a; opacity: .8; pointer-events: none; }
.project-search-field > input { width: 100%; height: 36px; padding: 8px 12px 8px 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font: 400 14px/20px Inter, Arial, sans-serif; color: var(--text); }
.project-search-field > input::placeholder { color: #71717a; opacity: 1; }
.project-selection-toolbar > select { width: 160px; flex: 0 0 160px; height: 36px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background-color: var(--card); color: var(--text); font: 400 14px/20px Inter, Arial, sans-serif; }
:is(.project-selection-toolbar, .toolbar) .project-switch { gap: 8px; margin: 0; font: 400 12px/16px Inter, Arial, sans-serif; color: var(--muted); white-space: nowrap; text-transform: none; }
:is(.project-selection-toolbar, .toolbar) input.bm-toggle[role="switch"] { flex-basis: 36px; width: 36px !important; min-width: 36px !important; height: 20px !important; min-height: 20px !important; padding: 0 !important; border: 2px solid #e4e4e7 !important; background: #e4e4e7 !important; box-shadow: 0 1px 2px #0001; }
:is(.project-selection-toolbar, .toolbar) input.bm-toggle[role="switch"]::before { width: 16px; height: 16px; }
:is(.project-selection-toolbar, .toolbar) input.bm-toggle[role="switch"]:checked { border-color: #04273f !important; background: #04273f !important; }
:is(.project-selection-toolbar, .toolbar) input.bm-toggle[role="switch"]:checked::before { transform: translateX(16px); }
.app-shell .new-project-button { margin-left: auto; min-height: 32px; height: 32px; padding: 0 12px; gap: 8px; font: 500 14px/20px Inter, Arial, sans-serif; background: #04273f; color: white; }
@media (max-width: 640px) {
  .project-search-field { flex-basis: 100%; max-width: none; }
  .project-selection-toolbar > select { width: 100%; flex-basis: 100%; }
  .app-shell .new-project-button { width: 100%; }
}

.section-action-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-action-header .section-title { margin: 0; }
.section-action-header > .section-add-button, .toolbar > .section-add-button { margin-left: auto; flex-shrink: 0; }
.section-action-footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; grid-column: 1 / -1; }
.section-save-button, .section-add-button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.section-save-button svg, .section-add-button svg { width: 16px; height: 16px; }
.table-wrap th.actions-heading, .table-wrap th.actions-heading .column-title { text-transform: none !important; }
.actions-cell .section-save-button { margin-left: auto; }

.header-user-popover, .table-pagination { --text: #09090b; --border: #e7e5e4; }
html.dark .header-user-popover, html.dark .table-pagination { --text: #f5f5f4; --border: #27272a; }
.app-shell .table-pagination-nav .btn:hover { background: #f5f5f4; color: #18181b; }
html.dark .app-shell .table-pagination-nav .btn:hover { background: #1c1c22; color: #f5f5f4; }

/* Pulse control sizing, retaining the Engineurs palette. */
:root { --save-teal: #4CA092; }
.page-save-status, html.dark .page-save-status { color: var(--save-teal); background: none; border: 0; border-radius: 0; padding: 0; }
.btn.section-save-button { background: var(--save-teal); border-color: var(--save-teal); color: #fff; }
.btn.section-save-button:hover { background: #40887c; border-color: #40887c; }
.table-wrap table th, .enhanced-table-scroll .filterable-table th { vertical-align: middle; text-transform: none; font: 500 .7rem/1rem Inter, Arial, sans-serif; color: var(--muted); background: var(--card); padding: 8px; }
.column-header-content, .column-header-main { align-items: center; }
.enhanced-table-search input { font-weight: 400 !important; }
.enhanced-table-count { font-size: 12px; line-height: 16px; }
.table-pagination, .table-pagination label, .table-pagination select, .table-pagination input, .table-pagination button { font: 400 12px/16px Inter, Arial, sans-serif !important; }
.table-pagination select, .table-pagination input { color: var(--text); }
.settings-editor-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.settings-editor-table th:last-child { width: 80px; }
.settings-editor-table td { padding: 8px; vertical-align: middle; font-size: 14px; }
.settings-editor-table button { color: #dc2626; background: transparent; border: 0; }
.settings-editor-table button svg { width: 16px; height: 16px; }
.table-columns-menu { width: 192px; padding: 4px; max-height: calc(100vh - 24px); border-radius: 6px; }
.table-columns-menu strong { display: block; padding: 6px 8px; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.table-columns-menu label { position: relative; gap: 8px; padding: 6px 8px; font-size: 12px; line-height: 16px; cursor: pointer; border-radius: 2px; }
.table-columns-menu label:hover, .table-columns-menu label:focus-within { background: var(--bg); }
.table-columns-menu input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.column-check { width: 16px; height: 16px; flex: 0 0 16px; }
.column-check svg { width: 16px; height: 16px; visibility: hidden; }
.table-columns-menu input:checked + .column-check svg { visibility: visible; }
.sidebar-header { height: 63px; min-height: 63px; display: flex; align-items: center; justify-content: space-between; margin: -18px -18px 0; padding: 0 16px; border-bottom: 1px solid #ffffff20; }
.sidebar-brand-expanded { padding: 0; margin-left: -4px; }
.sidebar-brand-button { appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer; }
.sidebar-brand-button:focus-visible { outline: 2px solid var(--pale-blue); outline-offset: 2px; border-radius: 6px; }
.sidebar .sidebar-brand-expanded .shift-logo-img { width: 110px !important; min-width: 110px !important; max-width: 110px !important; height: auto !important; display: block; }
.sidebar-header .desktop-sidebar-collapse { position: static; width: 28px; height: 28px; min-height: 28px; padding: 6px; background: transparent; border: 0; box-shadow: none; color: #9db0bb; border-radius: 6px; }
.sidebar-toggle-button .lucide-icon { width: 16px; height: 16px; }
.sidebar-toggle-button:hover { background: #ffffff15; color: #fff; }
.sidebar .product-nameplate { display: block; padding: 14px 2px 12px; margin: 0; border: 0; background: none; }
.sidebar .product-nameplate > span { display: none; }
.sidebar .product-nameplate small { display: block; color: var(--pale-blue); font: 700 14px/20px Inter, Arial, sans-serif; letter-spacing: 0; text-transform: none; }
@media (min-width: 921px) {
 .app-shell.sidebar-collapsed .sidebar-header { height: 107px; min-height: 107px; margin: -10px -8px 0; padding: 0; gap: 0; justify-content: flex-start; }
 .app-shell.sidebar-collapsed .sidebar-brand-collapsed { height: 63px; width: 64px; border-bottom: 1px solid #ffffff20; flex-shrink: 0; }
 .app-shell.sidebar-collapsed .sidebar-brand-collapsed img { width: 28px; height: 28px; }
 .app-shell.sidebar-collapsed .sidebar-header .desktop-sidebar-collapse { width: 28px; height: 28px; flex: 0 0 28px; margin: 8px 0; }
}
.standing-instructions-toolbar { display: flex; align-items: center; gap: 12px; }
.standing-instructions-toolbar .section-title { margin: 0; }
.standing-instructions-toolbar .button-row { margin-left: auto; align-items: center; }
.standing-instructions-toolbar .section-add-button { order: 2; }
.overview-kpi-carousel { padding-top: 4px; padding-bottom: 4px; }
.overview-kpi-grid > .card.kpi:hover { transform: none; outline-offset: -1px; }
.modal-card, .datetime-modal-card, html.dark .datetime-modal-card { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: 0 12px 36px #0003; }
.modal-header, .datetime-modal-header { align-items: center; margin-bottom: 16px; }
.modal-header h2, .datetime-modal-header h2, .unsaved-navigation-card h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.modal-header p, .datetime-modal-header p, .unsaved-navigation-body { font-size: 14px; line-height: 20px; color: var(--muted); }
.datetime-modal-card { width: min(420px, calc(100vw - 32px)); }
.datetime-modal-preview { font-size: 14px; font-weight: 500; border-radius: 6px; background: var(--bg); color: var(--text); }
.datetime-modal-grid input[type="date"], .datetime-modal-grid input[type="time"] { min-height: 36px; font-size: 14px; }
.datetime-picker-button { width: 32px; height: 32px; color: var(--muted); border-radius: 6px; }
.datetime-picker-button svg { width: 16px; height: 16px; }
.sidebar-link-list { border: 1px solid var(--border); border-radius: 8px; }
.sidebar-link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sidebar-link-row:last-child { border-bottom: 0; }
.sidebar-link-description { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar-link-description svg { width: 16px; flex-shrink: 0; }
.sidebar-link-description strong { font-size: 14px; font-weight: 500; }
.sidebar-link-description small { display: block; font: 12px/18px monospace; color: var(--muted); overflow-wrap: anywhere; }
.sidebar-link-editor { width: 100%; display: grid; gap: 8px; padding: 12px 16px; }

.sidebar .product-nameplate { display: block !important; }
.app-shell.sidebar-collapsed .sidebar .product-nameplate { display: none !important; }
.column-header-layout, .column-sort-button { align-items: center; }
.column-sort-button, .column-sort-button .column-title { font-size: max(var(--ctr-min-font-size, 0px), .68rem); font-weight: 600; color: var(--muted); }
.datetime-native-input { bottom: 0; right: 0; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; }
.standing-instructions-toolbar .section-title { flex: 1; }
.standing-instructions-toolbar .button-row { margin-left: 0; }

.modal-card .modal-header { background: none !important; color: var(--text); padding: 0; border: 0; border-radius: 0; }
.modal-card .modal-header h2 { color: var(--text); text-transform: none; letter-spacing: 0; }
.modal-card .modal-header p { color: var(--muted); margin: 6px 0 0; }
.unsaved-navigation-body { padding: 0; }
.modal-card .modal-actions { padding: 16px 0 0; border: 0; background: none; gap: 8px; }
.modal-card .modal-actions .btn { font-size: 14px; font-weight: 500; border-radius: 6px; text-transform: none; }
.table-wrap table th, .table-wrap table th .column-title { text-transform: none !important; }
.standing-instructions-toolbar { flex-wrap: wrap; }
.standing-instructions-toolbar .section-title { flex: 1 0 auto; }

/* Shared wall-clock date and datetime fields. */
.datetime-picker-wrap { position: relative; display: block; min-width: 0; }
.datetime-picker-wrap .datetime-text-input { width: 100%; padding-left: 34px; padding-right: 32px; cursor: text; }
.datetime-leading-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; pointer-events: none; color: var(--text); }
.datetime-leading-icon svg { width: 16px; height: 16px; }
.datetime-picker-wrap .datetime-picker-button { position: absolute; right: 1px; top: 50%; transform: translateY(-50%); min-width: 30px; width: 30px; height: 30px; padding: 6px; border: 0; background: transparent; color: var(--text); }
.datetime-picker-button:focus-visible { outline: 2px solid #04273f; outline-offset: -2px; }
.calendar-popup { position: fixed; z-index: 10000; width: 326px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; padding: 12px; background: #fff; color: #04273f; border: 1px solid #e1e3e5; border-radius: 8px; box-shadow: 0 8px 24px #04273f20; font-family: inherit; font-size: 13px; }
.calendar-popup.calendar-with-time { width: 504px; }
.calendar-body { display: flex; gap: 12px; }
.calendar-main { flex: 1; min-width: 0; }
.calendar-header { display: flex; gap: 5px; align-items: center; margin-bottom: 10px; }
.calendar-popup button, .calendar-popup select { font-family: inherit; font-size: 13px; font-weight: 400; color: inherit; background: #fff; border: 1px solid #e1e3e5; border-radius: 5px; min-width: 0; box-shadow: none; }
.calendar-header select { height: 32px; padding: 3px; width: 0; flex: 1.5; }
.calendar-header select[aria-label="Year"] { flex: 1; }
.calendar-header button { display: flex; justify-content: center; align-items: center; width: 28px; height: 32px; padding: 3px; flex-shrink: 0; }
.calendar-header svg { width: 16px; height: 16px; }
.calendar-week { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 2px; text-align: center; }
.calendar-week span { padding: 5px 0; color: #747b82; font-size: 12px; }
.calendar-week button { height: 34px; padding: 0; border: 1px solid transparent; }
.calendar-week button.adjacent { color: #989da3; }
.calendar-popup button[aria-current="date"] { border-color: #8b9eaa; }
.calendar-popup button:hover:not(:disabled), .calendar-popup button:focus-visible, .calendar-popup select:focus-visible { background: #edf3f7; outline: 2px solid #04273f; outline-offset: -2px; }
.calendar-popup button[aria-selected="true"] { background: #04273f; color: #fff; }
.calendar-popup button:disabled { opacity: .35; cursor: not-allowed; }
.calendar-time { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; width: 144px; flex-shrink: 0; border-left: 1px solid #e1e3e5; padding-left: 12px; }
.calendar-time-heading { background: #04273f; color: white; text-align: center; border-radius: 5px; padding: 8px 0; font-size: 13px; }
.calendar-time-list { height: 239px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; position: relative; margin-top: 5px; }
.calendar-time-list button { display: block; width: 100%; height: 34px; border: 0; margin-bottom: 2px; padding: 0; }
.calendar-footer { display: flex; justify-content: space-between; margin-top: 10px; }
.calendar-footer button { border: 0; padding: 6px 10px; font-weight: 600; }
@media (max-width: 480px) {
  .calendar-popup { padding: 8px; }
  .calendar-body { gap: 6px; }
  .calendar-time { width: 90px; padding-left: 6px; gap: 3px; }
  .calendar-header { gap: 2px; }
  .calendar-header select, .calendar-header button { font-size: 11px; }
  .calendar-header button { width: 21px; }
}

/* Shared BM Platform section, table, and action treatment. */
.app-shell .card {
  box-shadow: none;
}
.app-shell .card:has(> .section-title),
.app-shell .card:has(> .toolbar:first-of-type),
.app-shell .card:has(> .section-action-header:first-of-type),
.app-shell .card:has(> .compact-section-header:first-of-type) {
  padding: 0;
}
.app-shell .card > .section-title,
.app-shell .card > .toolbar:first-of-type,
.app-shell .card > .section-action-header:first-of-type,
.app-shell .card > .compact-section-header:first-of-type {
  width: 100%;
  height: 56px;
  min-height: 56px;
  border-bottom: 1px solid #aebfca;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--chalk);
  color: var(--dark-blue);
  box-sizing: border-box;
}
.app-shell .card > .section-title {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.app-shell .card > .toolbar:first-of-type,
.app-shell .card > .section-action-header:first-of-type,
.app-shell .card > .compact-section-header:first-of-type {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  margin: 0;
  padding: 0 16px;
}
.app-shell .card > :is(.toolbar:first-of-type, .section-action-header:first-of-type, .compact-section-header:first-of-type) .section-title {
  margin: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.app-shell .card > :is(.toolbar:first-of-type, .section-action-header:first-of-type) .button-row {
  min-height: 32px;
  align-items: center;
  margin: 0 0 0 auto;
}
.app-shell .card > :is(.section-title, .toolbar:first-of-type, .section-action-header:first-of-type, .compact-section-header:first-of-type) ~ :not(.table-wrap):not(input[type="hidden"]) {
  width: calc(100% - 32px) !important;
  margin-right: 16px !important;
  margin-left: 16px !important;
  box-sizing: border-box;
}
.app-shell .card > input[type="hidden"] {
  margin: 0 !important;
}
.app-shell .card > .section-card-content-start {
  margin-top: 16px;
}
.app-shell .card > :not(.section-title):not(.toolbar):not(.section-action-header):not(.compact-section-header):not(.table-wrap):last-child {
  margin-bottom: 16px;
}
.shift-log-form-header .shift-log-header-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 0 auto;
}
.shift-log-form-header .shift-log-header-actions .btn {
  min-height: 32px;
  white-space: nowrap;
}
.audit-history-card {
  overflow: hidden;
}
.audit-history-card > .empty {
  margin: 16px;
}
@media (max-width: 640px) {
  .app-shell .card > .shift-log-form-header {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .shift-log-form-header .section-title {
    flex: 1 1 160px;
  }
  .shift-log-form-header .shift-log-header-actions {
    flex: 0 0 auto;
  }
}
.standing-instructions-toolbar {
  flex-wrap: nowrap;
}
.card:has(> .table-wrap > .enhanced-table-toolbar) {
  overflow: hidden;
  padding: 0;
}
.card:has(> .table-wrap > .enhanced-table-toolbar) > .section-title,
.card:has(> .table-wrap > .enhanced-table-toolbar) > .toolbar:first-of-type,
.card:has(> .table-wrap > .enhanced-table-toolbar) > .section-action-header:first-of-type,
.card:has(> .table-wrap > .enhanced-table-toolbar) > .compact-section-header:first-of-type {
  margin: 0;
}
.card:has(> .table-wrap > .enhanced-table-toolbar) > :not(.section-title):not(.toolbar):not(.section-action-header):not(.compact-section-header):not(.table-wrap) {
  margin-right: 16px;
  margin-left: 16px;
}
.card:has(> .table-wrap > .enhanced-table-toolbar) > .section-title,
.card:has(> .table-wrap > .enhanced-table-toolbar) > .section-action-header,
.card:has(> .table-wrap > .enhanced-table-toolbar) > .compact-section-header {
  margin-right: 0;
  margin-left: 0;
}
.card:has(> .table-wrap > .enhanced-table-toolbar) > .section-action-footer {
  margin: 16px;
}
.card:has(> .table-wrap > .enhanced-table-toolbar) > .inline-form:last-child {
  margin-bottom: 16px;
}
.card > .table-wrap:has(> .enhanced-table-toolbar) {
  border: 0 !important;
  border-radius: 0 !important;
}
.table-wrap:has(> .enhanced-table-toolbar) {
  overflow: hidden !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  background: var(--card);
}
.app-shell table thead, .app-shell table thead th, .privacy-table-wrap thead th,
html.dark .app-shell table thead th { background: #f2f7f9 !important; color: #31465a !important; }
.enhanced-table-scroll .filterable-table { font-size: .875rem; line-height: 1.25rem; }
.enhanced-table-scroll .filterable-table td { min-height: 2.5rem; padding: .5rem .65rem; font-size: .875rem; line-height: 1.25rem; }
.enhanced-table-scroll .filterable-table th,
.enhanced-table-scroll .filterable-table th .column-title,
.enhanced-table-scroll .filterable-table .column-sort-button,
.app-shell .table-wrap table th,
.app-shell .table-wrap table th .column-title { font-size: max(var(--ctr-min-font-size, 0px), .875rem); font-weight: 500; line-height: 1.25rem; }
.app-shell .table-wrap table td { font-size: .875rem; line-height: 1.25rem; }
.table-pagination { min-height: 48px; padding: 9px 13px; }
.app-shell table thead .column-sort-button,
.app-shell table thead .column-title,
html.dark .app-shell table thead .column-sort-button,
html.dark .app-shell table thead .column-title { color: #31465a; }
.app-shell table tbody tr { transition: background-color 120ms ease; }
.app-shell table tbody tr:nth-child(even), .app-shell table tbody tr:nth-child(even) > td { background-color: color-mix(in srgb, var(--card) 96%, var(--text) 4%); }
.app-shell table tbody tr:hover, .app-shell table tbody tr:hover > td { background-color: #eaf5f9; }
html.dark .app-shell table tbody tr:hover, html.dark .app-shell table tbody tr:hover > td { background-color: #24242b; }
.sidebar .nav button { min-height: 34px; flex-shrink: 0; color: #fff; }
.sidebar .nav-section-label { flex-shrink: 0; text-transform: uppercase; }
.sidebar .nav.nav-compact button { min-height: 30px; padding-top: 5px !important; padding-bottom: 5px !important; }
.documentation-shell { grid-template-columns: 224px minmax(0,1fr) !important; }
.documentation-shell.sidebar-collapsed { grid-template-columns: 64px minmax(0,1fr) !important; }
.documentation-shell > .content, .documentation-shell .page-frame { padding: 0 !important; margin: 0; }
.documentation-shell .app-topbar { margin: 0; }
.documentation-page { display: grid; grid-template-columns: 256px minmax(0,1fr); min-height: calc(100vh - 56px); background: #fafafa; color: var(--text); }
.documentation-toc { position: sticky; top: 56px; height: calc(100dvh - 56px); overflow-y: auto; padding: 18px 12px; border-right: 1px solid var(--border); background: var(--card); scrollbar-width: thin; }
.documentation-toc h2 { font-size: 14px; font-weight: 700; letter-spacing: .04em; margin: 0 0 16px; }
.documentation-page nav a { display: block; text-decoration: none; border-radius: 5px; font-size: 12px; line-height: 17px; padding: 4px 8px; color: var(--muted); }
.documentation-page nav .doc-group-link { font-size: 14px; font-weight: 600; color: var(--text); padding: 6px 12px; margin-top: 5px; }
.documentation-page nav a:hover, .documentation-page nav a[aria-current] { background: #f1f1f1; color: var(--text); }
.doc-toc-children { border-left: 1px solid var(--border); padding-left: 8px; margin-left: 12px; }
.doc-return { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; color: var(--text); margin-top: 20px; padding: 8px; font-size: 13px; }
.doc-return svg { width: 16px; height: 16px; }
.documentation-content { padding: 32px 24px 96px; min-width: 0; font-size: 14px; line-height: 1.65; }
.documentation-content h1 { margin: 0 0 4px; font-size: 30px; line-height: 38px; font-weight: 700; }
.documentation-content > header p { margin: 0; color: var(--muted); }
.documentation-content > section { margin-top: 44px; }
.documentation-content h2 { font-size: 24px; line-height: 32px; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.documentation-content h3 { font-size: 18px; line-height: 26px; font-weight: 600; margin: 24px 0 12px; }
.documentation-content [id] { scroll-margin-top: 80px; }
.documentation-content p { margin: 10px 0; }
.documentation-content ul, .documentation-content ol { padding-left: 22px; margin: 12px 0; }
.documentation-content li { margin: 5px 0; }
.doc-callout { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid #bdd6e2; border-radius: 6px; background: #edf4f8; margin: 16px 0 24px; color: #04273f; }
.doc-callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 4px; color: #46788f; }
.doc-callout p { margin: 0; }
.doc-callout.tip { border-color: #a5d9c9; background: #edf9f4; }
.doc-table-scroll { overflow-x: auto; }
.doc-table-scroll table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table-scroll th, .doc-table-scroll td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table-scroll th { font-weight: 600; text-transform: none; }
.documentation-mobile-toc { display: none; }
html.dark .documentation-page { background: var(--card); }
html.dark .documentation-page nav a:hover, html.dark .documentation-page nav a[aria-current] { background: #24242b; }
html.dark .doc-callout { background: #1b303c; color: #e2edf2; border-color: #365569; }
html.dark .doc-callout.tip { background: #183b34; border-color: #3d7568; }
@media(max-width:1023px) {
  .documentation-page { grid-template-columns: minmax(0,1fr); }
  .documentation-toc { display: none; }
  .documentation-mobile-toc { display: block; padding: 12px; border: 1px solid var(--border); border-radius: 6px; margin-top: 24px; }
  .documentation-mobile-toc summary { cursor: pointer; font-weight: 600; }
  .documentation-content { padding: 24px 16px 64px; }
  .documentation-content h1 { font-size: 26px; }
}

/* Shared narrow-screen containment for tables, section actions, and HSE forms. */
@media (max-width: 640px) {
  .enhanced-table-scroll table.resizable-table {
    width: max-content !important;
    max-width: none !important;
  }
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .table-pagination-size,
  .table-pagination-nav {
    width: 100%;
    justify-content: space-between;
  }
  .standing-instructions-toolbar {
    height: auto !important;
    min-height: 56px;
    flex-wrap: wrap !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  .standing-instructions-toolbar .section-title {
    flex: 1 1 180px;
  }
  .standing-instructions-toolbar .button-row {
    width: 100%;
    justify-content: flex-end;
  }
}

/* HSE form spacing follows the BM form layout within SHIFT's width limit. */
.app-shell .hse-report-form .log-form-card { border-radius: 16px; }
.app-shell .hse-report-form .log-form-card > .section-title { border-radius: 15px 15px 0 0; padding-inline: 20px; }
.app-shell .hse-report-form .log-form-card > .section-title ~ :not(input[type="hidden"]) {
  width: calc(100% - 40px) !important;
  margin-inline: 20px !important;
}
.hse-report-form .log-form-card > .muted { max-width: 800px; margin-block: 20px; }
.hse-report-form .safety-evidence { margin-top: 24px; }
.hse-report-form .datetime-picker-wrap { min-height: 40px; }
@media (max-width: 640px) {
  .app-shell .hse-report-form .log-form-card > .section-title { padding-inline: 14px; }
  .app-shell .hse-report-form .log-form-card > .section-title ~ :not(input[type="hidden"]) {
    width: calc(100% - 28px) !important;
    margin-inline: 14px !important;
  }
  .hse-report-form .log-form-card > .muted { margin-block: 16px 24px; }
}
dialog.shift-confirm-dialog {
  max-height: calc(100vh - 32px);
  overflow: auto;
  max-width: min(480px, calc(100vw - 32px));
  border: 1px solid #4ca092;
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  color: #04273f;
  font: inherit;
}
dialog.shift-confirm-dialog::backdrop { background: rgb(4 39 63 / 65%); }
.dark dialog.shift-confirm-dialog { background: #071b2c; color: #fff; }
dialog.shift-confirm-dialog p { overflow-wrap: anywhere; white-space: pre-line; }

.reading-tag-link { appearance:none; border:0; background:none; padding:0; color:var(--primary, #005b7f); font:inherit; font-weight:700; text-align:left; text-decoration:underline; cursor:pointer; }
.reading-tag-link:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
/* Direct numerical entry and categorical tag configuration. */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tag-value-editor { min-width: 190px; }
.tag-value-toggle { display: flex; align-items: center; gap: 8px; }
.tag-value-toggle input { width: auto; }
.tag-value-editor textarea { margin-top: 8px; min-width: 190px; }
.tag-value-editor textarea[hidden] { display: none; }
