/* =====================================================================
   HOKKAN MES & WI — Design system mirrored 1:1 from NewInvestigasi
   Sources: design-tokens/tokens.css, ui/styles.css, ui/EnterpriseDataGrid.css,
   backoffice/App.css and Fluent UI (webLightTheme + createLightTheme(brand)).
   ===================================================================== */
:root {
  color-scheme: light;
  --sja-font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-family: var(--sja-font-family);
  font-synthesis: none;
  --sja-brand: #006cba;
  --sja-brand-hover: #0f5d9f;
  --sja-brand-pressed: #164e84;
  --sja-canvas: #f5f6f8;
  --sja-surface: #ffffff;
  --sja-border: #e0e3e8;
  --sja-text: #242424;
  --sja-muted: #616161;
  --sja-nav-width: 248px;
  --sja-appbar-height: 48px;
  --f-stroke1: #d1d1d1;
  --f-stroke2: #e0e0e0;
  --f-stroke-acc: #616161;
  --f-fg2: #424242;
  --f-bg3: #f5f5f5;
  --f-shadow16: 0 0 2px rgb(0 0 0 / 12%), 0 8px 16px rgb(0 0 0 / 14%);
  --f-shadow64: 0 0 8px rgb(0 0 0 / 12%), 0 32px 64px rgb(0 0 0 / 14%);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
html { background: #f5f6f8; }
body { background: var(--sja-canvas); color: var(--sja-text); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.fui-icon { flex: none; display: inline-block; vertical-align: middle; }

/* ------------------------------ Fluent controls ------------------------------ */
.fui-Button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 96px; height: 32px; padding: 5px 12px; border: 1px solid var(--f-stroke1); border-radius: 4px;
  background: #fff; color: #242424; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap; box-sizing: border-box; user-select: none;
}
.fui-Button:hover:not(:disabled) { background: #f5f5f5; border-color: #c7c7c7; color: #242424; }
.fui-Button:active:not(:disabled) { background: #e0e0e0; border-color: #b3b3b3; }
.fui-Button:focus-visible { outline: 2px solid #006cba; outline-offset: 1px; }
.fui-Button:disabled, .fui-Button[aria-disabled="true"] { background: #f0f0f0; color: #bdbdbd; border-color: #e0e0e0; cursor: not-allowed; }
.fui-Button--primary { background: var(--sja-brand); border-color: transparent; color: #fff; }
.fui-Button--primary:hover:not(:disabled) { background: var(--sja-brand-hover); border-color: transparent; color: #fff; }
.fui-Button--primary:active:not(:disabled) { background: var(--sja-brand-pressed); }
.fui-Button--subtle, .fui-Button--transparent { background: transparent; border-color: transparent; color: #424242; }
.fui-Button--subtle:hover:not(:disabled) { background: #f5f5f5; border-color: transparent; }
.fui-Button--transparent:hover:not(:disabled) { background: transparent; border-color: transparent; }
.fui-Button--icon { min-width: 32px; width: 32px; padding: 0; }
.fui-Button--small { min-width: 64px; height: 24px; padding: 0 8px; font-size: 12px; line-height: 16px; gap: 4px; }
.fui-Button--small.fui-Button--icon { min-width: 24px; width: 24px; padding: 0; }
.fui-Button--large { min-width: 96px; height: 40px; padding: 0 16px; font-size: 16px; line-height: 22px; }
.fui-Button--touch { height: 56px; min-width: 120px; padding: 0 22px; font-size: 18px; border-radius: 6px; }

/* Explicit action colors (NewInvestigasi data-action annotations) */
[data-action="save"] { --a-bg: #107c41; --a-hover: #0c6635; --a-active: #09512a; --a-fg: #fff; --a-border: #107c41; }
[data-action="search"], [data-action="primary"] { --a-bg: #075b9b; --a-hover: #064c82; --a-active: #043b66; --a-fg: #fff; --a-border: #075b9b; }
[data-action="refresh"] { --a-bg: #9a4b00; --a-hover: #803e00; --a-active: #663200; --a-fg: #fff; --a-border: #9a4b00; }
[data-action="back"] { --a-bg: #edf0f4; --a-hover: #dce2e9; --a-active: #cbd4de; --a-fg: #334155; --a-border: #b4bfcc; }
[data-action="danger"] { --a-bg: #b42318; --a-hover: #971d14; --a-active: #7c180f; --a-fg: #fff; --a-border: #b42318; }
[data-action="operator"] { --a-bg: #c2410c; --a-hover: #9a3412; --a-active: #7c2d12; --a-fg: #fff; --a-border: #c2410c; }
button[data-action], a[data-action] { background-color: var(--a-bg); color: var(--a-fg); border-color: var(--a-border); }
button[data-action]:hover:not(:disabled):not([aria-disabled="true"]), a[data-action]:hover { background-color: var(--a-hover); color: var(--a-fg); border-color: var(--a-border); }
button[data-action]:active:not(:disabled):not([aria-disabled="true"]) { background-color: var(--a-active); color: var(--a-fg); }
button[data-action]:focus-visible { outline: 3px solid #075b9b; outline-offset: 3px; }
button[data-action]:disabled, button[data-action][aria-disabled="true"] { background-color: #edf0f3; color: #6b7280; border-color: #d0d7df; }

.fui-Input {
  position: relative; display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 32px; padding: 0 10px;
  border: 1px solid var(--f-stroke1); border-bottom-color: var(--f-stroke-acc); border-radius: 4px; background: #fff; color: #242424;
}
.fui-Input:hover { border-color: #c7c7c7; border-bottom-color: var(--f-stroke-acc); }
.fui-Input:focus-within { border-color: var(--f-stroke1); border-bottom-color: transparent; }
.fui-Input::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 2px; border-radius: 0 0 4px 4px; background: var(--sja-brand); transform: scaleX(0); transition: transform .15s ease-out; }
.fui-Input:focus-within::after { transform: scaleX(1); }
.fui-Input input, .fui-Input textarea { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 2px; border: 0; outline: 0; background: transparent; color: inherit; font-size: 14px; }
.fui-Input .fui-Input__icon { display: inline-flex; color: #616161; }
.fui-Input--large { height: 40px; }
.fui-Input--textarea { height: auto; align-items: flex-start; padding: 6px 10px; }
.fui-Input--textarea textarea { min-height: 76px; resize: vertical; line-height: 20px; }
.fui-Input--block { display: flex; width: 100%; }
.fui-Input--touch { height: 52px; font-size: 20px; }
.fui-Input--touch input { font-size: 20px; }

.fui-Select { position: relative; display: inline-flex; min-width: 0; }
.fui-Select select {
  appearance: none; -webkit-appearance: none; height: 32px; width: 100%; padding: 0 28px 0 10px; border: 1px solid var(--f-stroke1);
  border-bottom-color: var(--f-stroke-acc); border-radius: 4px; background: #fff; color: #242424; font-size: 14px; cursor: pointer;
}
.fui-Select select:hover { border-color: #c7c7c7; border-bottom-color: var(--f-stroke-acc); }
.fui-Select select:focus { outline: 0; border-bottom: 2px solid var(--sja-brand); padding-bottom: 0; }
.fui-Select::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23424242'%3E%3Cpath d='M2.22 4.22a.75.75 0 0 1 1.06 0L6 6.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L2.22 5.28a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E") center/12px no-repeat;
}
.fui-Select--block { display: flex; width: 100%; }
.fui-Select--touch select { height: 52px; font-size: 18px; }

.fui-Checkbox { appearance: none; -webkit-appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--f-stroke-acc); border-radius: 2px; background: #fff; cursor: pointer; display: inline-grid; place-content: center; vertical-align: middle; }
.fui-Checkbox:hover { border-color: #424242; }
.fui-Checkbox:checked, .fui-Checkbox:indeterminate { background: var(--sja-brand); border-color: var(--sja-brand); }
.fui-Checkbox:checked::before { content: ""; width: 10px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23fff'%3E%3Cpath d='M9.76 3.2c.3.29.32.76.04 1.06l-4.25 4.5a.75.75 0 0 1-1.08.02L2.22 6.53a.75.75 0 0 1 1.06-1.06l1.7 1.7 3.72-3.94a.75.75 0 0 1 1.06-.03Z'/%3E%3C/svg%3E") center/10px no-repeat; }
.fui-Checkbox:indeterminate::before { content: ""; width: 8px; height: 2px; background: #fff; }
.fui-CheckboxLabel { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.fui-Badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 20px; min-width: 20px; padding: 0 6px; border: 1px solid transparent; border-radius: 9999px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; box-sizing: border-box; }
.fui-Badge--brand { background: #e2efff; color: #0f5d9f; border-color: #a8cefa; }
.fui-Badge--success { background: #f1faf1; color: #0e700e; border-color: #9fd89f; }
.fui-Badge--warning { background: #fff9f5; color: #bc4b09; border-color: #fdcfb4; }
.fui-Badge--danger { background: #fdf3f4; color: #b10e1c; border-color: #eeacb2; }
.fui-Badge--informative { background: #f5f5f5; color: #616161; border-color: #e0e0e0; }
.fui-Badge--subtle { background: #fff; color: #616161; border-color: #e0e0e0; }
.fui-Badge--important { background: #0f5d9f; color: #fff; }

.fui-Field { display: grid; gap: 4px; min-width: 0; }
.fui-Field__label { font-size: 14px; line-height: 20px; color: #242424; }
.fui-Field__label .req { color: #b10e1c; margin-left: 2px; }
.fui-Field__hint { font-size: 12px; line-height: 16px; color: #616161; }

.fui-MessageBar { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 10px; padding: 7px 12px; border: 1px solid var(--f-stroke1); border-radius: 4px; background: #f5f5f5; font-size: 14px; }
.fui-MessageBar--error { background: #fdf3f4; border-color: #eeacb2; }
.fui-MessageBar--error .fui-icon { color: #b10e1c; }
.fui-MessageBar--success { background: #f1faf1; border-color: #9fd89f; }
.fui-MessageBar--success .fui-icon { color: #0e700e; }
.fui-MessageBar--warning { background: #fff9f5; border-color: #fdcfb4; }
.fui-MessageBar--warning .fui-icon { color: #bc4b09; }
.fui-MessageBar--info { background: #f5f5f5; }

.fui-Spinner { display: inline-flex; align-items: center; gap: 8px; color: #424242; font-size: 14px; }
.fui-Spinner::before { content: ""; width: 20px; height: 20px; border: 2px solid #e0e0e0; border-top-color: var(--sja-brand); border-radius: 50%; animation: fui-spin .8s linear infinite; }
@keyframes fui-spin { to { transform: rotate(360deg); } }

.fui-Avatar { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; background: #c7e0f4; color: #0f3c63; font-size: 12px; font-weight: 600; }

.fui-MenuPopover { position: fixed; z-index: 500; min-width: 160px; max-width: 320px; padding: 4px; border-radius: 4px; background: #fff; border: 1px solid transparent; box-shadow: var(--f-shadow16); color: #242424; }
.fui-MenuItem { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: #242424; font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap; }
.fui-MenuItem:hover { background: #f5f5f5; }
.fui-MenuItem .fui-icon { color: #424242; }
.fui-MenuLabel { padding: 6px 8px; font-size: 12px; color: #616161; }
.fui-MenuDivider { height: 1px; margin: 4px -4px; background: #e0e0e0; }

/* Centered Popup Modal (converted from OverlayDrawer per user request) */
.fui-DrawerOverlay { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgb(15 23 42 / 50%); animation: fui-fade .15s ease-out; }
@keyframes fui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fui-pop { from { transform: scale(0.97); opacity: .7; } to { transform: scale(1); opacity: 1; } }
.fui-OverlayDrawer { width: min(640px, 95vw); max-height: 90vh; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: var(--f-shadow64); animation: fui-pop .15s ease-out; }
.fui-OverlayDrawer.entry-drawer { width: min(860px, 95vw); }
.fui-DrawerHeader { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.entry-drawer .fui-DrawerHeader { border-bottom: 1px solid #d9dce1; padding-bottom: 14px; }
.fui-DrawerHeader__title { font-size: 20px; line-height: 28px; font-weight: 600; min-width: 0; }
.fui-DrawerBody { flex: 1; min-height: 0; overflow: auto; padding: 8px 24px 16px; }
.entry-drawer .fui-DrawerBody { background: #f7f8fa; padding-top: 14px; }
.fui-DrawerFooter { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 56px; padding: 10px 24px; border-top: 1px solid #d1d5da; background: #fff; }
.drawer-record-context { display: grid; gap: 2px; padding: 0 2px 10px; color: #616161; font-size: 12px; }
.drawer-record-context strong { color: #242424; font-size: 13px; font-weight: 600; }

/* ------------------------------ App shell (styles.css) ------------------------------ */
.sja-shell { min-height: 100vh; display: grid; grid-template: var(--sja-appbar-height) 1fr / var(--sja-nav-width) minmax(0, 1fr); background: var(--sja-canvas); }
.sja-shell.has-app-rail { grid-template-columns: 52px 224px minmax(0, 1fr); }
.sja-topbar { grid-column: 1 / -1; display: grid; grid-template-columns: 40px minmax(170px, 224px) minmax(160px, 1fr) max-content; align-items: center; gap: 8px; padding: 0 10px 0 4px; background: #123b63; color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 22%); z-index: 20; position: sticky; top: 0; }
.sja-topbar button { color: #fff; }
.sja-topbar .fui-Button--subtle:hover:not(:disabled) { background: rgb(255 255 255 / 12%); }
.sja-product-mark { display: flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
.sja-product-logo { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 55%); border-radius: 3px; background: #fff; color: #123b63; font-size: 15px; }
.sja-search { position: relative; width: min(100%, 640px); justify-self: center; min-width: 0; }
.sja-search > span { width: 100%; background: rgb(255 255 255 / 96%); display: flex; }
.sja-search-results { position: absolute; z-index: 80; inset: calc(100% + 6px) 0 auto; max-height: 420px; overflow: auto; padding: 6px; border: 1px solid #d1d1d1; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px rgb(0 0 0 / 18%); }
.sja-search-results button { display: grid; grid-template-columns: 28px 1fr; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: #242424; text-align: left; cursor: pointer; }
.sja-search-results button:hover, .sja-search-results button:focus-visible { background: #f0f6fc; outline: none; }
.sja-search-results button div { display: grid; gap: 2px; }
.sja-search-results small { color: #616161; }
.sja-search-results p { margin: 8px 10px; color: #616161; }
.sja-top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1px; min-width: 0; }
.sja-top-actions .sja-top-action { width: 40px; min-width: 40px; height: 40px; flex: 0 0 40px; border-radius: 4px; transition: none !important; transform: none !important; position: relative; }
.sja-top-actions .sja-top-action:active { background: rgb(255 255 255 / 18%); }
.sja-top-actions .sja-top-action:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.sja-top-actions .sja-account-action { width: 44px; min-width: 44px; flex-basis: 44px; }
.sja-top-actions .sja-badge-dot { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 3px; border: 2px solid #123b63; border-radius: 9px; background: #d13438; color: #fff; font-size: 8px; line-height: 1; font-weight: 700; pointer-events: none; }
.sja-context-switcher { max-width: 210px; min-width: 0; }
.sja-context-switcher span.label { overflow: hidden; text-overflow: ellipsis; }
.sja-app-rail { grid-column: 1; grid-row: 2; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 5px; background: #f0f2f5; border-right: 1px solid #d7dbe0; z-index: 4; }
.sja-rail-item { position: relative; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #424242; text-decoration: none; cursor: pointer; }
.sja-rail-item:hover { background: #e1e5ea; }
.sja-rail-item.is-active { background: #fff; color: #005ea6; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.sja-rail-item.is-active::before { content: ''; position: absolute; inset: 8px auto 8px -5px; width: 3px; border-radius: 0 2px 2px 0; background: #006cba; }
.sja-rail-item.rail-bottom { margin-top: auto; }
.sja-sidebar { grid-column: 1; grid-row: 2; min-width: 0; padding: 15px 8px; background: var(--sja-surface); border-right: 1px solid var(--sja-border); overflow-y: auto; z-index: 3; }
.has-app-rail .sja-sidebar { grid-column: 2; }
.sja-app-name { padding: 0 9px; font-size: 16px; font-weight: 600; }
.sja-context-label { padding: 4px 9px 12px; color: var(--sja-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sja-sidebar nav { display: grid; gap: 1px; }
.sja-nav-group { margin: 15px 9px 5px; color: #616161; font-size: 11px; font-weight: 600; letter-spacing: .25px; text-transform: uppercase; }
.sja-nav-item { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 9px; padding: 6px 9px; border: 0; border-radius: 3px; background: transparent; color: var(--sja-text); text-align: left; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.sja-nav-item:hover { background: #f1f3f5; }
.sja-nav-item.is-active { background: #e5f1fb; color: #004e8c; font-weight: 600; box-shadow: inset 3px 0 #006cba; }
.sja-nav-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; }
.sja-nav-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sja-nav-badge { min-width: 20px; padding: 1px 5px; border-radius: 10px; background: #e1e5ea; color: #424242; font-size: 11px; text-align: center; }
.sja-nav-item.is-active .sja-nav-badge { background: #fff; color: #004e8c; }
.sja-main { grid-column: 2; grid-row: 2; min-width: 0; padding: 18px 20px 28px; overflow: auto; }
.has-app-rail .sja-main { grid-column: 3; }
.sja-nav-scrim { display: none; }

@media (max-width: 1050px) {
  .sja-topbar { grid-template-columns: 40px minmax(160px, 1fr) minmax(220px, 420px) auto; }
  .sja-top-actions .sja-context-switcher { display: none !important; }
}
@media (max-width: 800px) {
  .sja-shell, .sja-shell.has-app-rail { display: block; padding-top: var(--sja-appbar-height); }
  .sja-topbar { position: fixed; inset: 0 0 auto; grid-template-columns: 40px 1fr auto; }
  .sja-product-mark span:not(.sja-product-logo), .sja-search { display: none; }
  .sja-top-actions > button { display: none; }
  .sja-top-actions > .sja-account-action { display: inline-flex; }
  .sja-app-rail { display: none; }
  .sja-sidebar, .has-app-rail .sja-sidebar { position: fixed; inset: var(--sja-appbar-height) auto 0 0; width: min(286px, 86vw); display: block; transform: translateX(-102%); transition: transform 120ms ease-out; box-shadow: 4px 0 16px rgb(0 0 0 / 14%); z-index: 19; }
  .sja-sidebar.is-open { transform: translateX(0); }
  .sja-nav-scrim { position: fixed; inset: var(--sja-appbar-height) 0 0; display: block; border: 0; background: rgb(0 0 0 / 30%); z-index: 18; }
  .sja-main, .has-app-rail .sja-main { padding: 14px; }
}
@media (max-width: 1250px) {
  .sja-shell { --sja-appbar-height: 96px; }
  .sja-topbar { grid-template-columns: 40px minmax(90px, 1fr) minmax(180px, 380px); grid-template-rows: 40px 44px; gap: 4px 8px; padding: 4px 10px; }
  .sja-topbar > button { grid-column: 1; grid-row: 1; }
  .sja-product-mark { grid-column: 2; grid-row: 1; min-width: 0; }
  .sja-search { grid-column: 3; grid-row: 1; display: block; width: 100%; }
  .sja-top-actions { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
  .sja-top-actions > button { display: inline-flex; }
  .sja-top-actions .sja-top-action { width: 32px; min-width: 32px; height: 34px; flex-basis: 32px; }
}
@media (max-width: 800px) {
  .sja-top-actions > button:not(.sja-account-action) { display: none; }
}
@media (max-width: 540px) {
  .sja-shell { --sja-appbar-height: 128px; }
  .sja-topbar { grid-template-columns: 38px 38px minmax(0, 1fr); grid-template-rows: 40px 80px; }
  .sja-top-actions { align-content: center; justify-content: flex-end; }
}

/* ------------------------------ Enterprise data grid ------------------------------ */
.enterprise-grid { background: #fff; border: 1px solid #d9dce1; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 4%); margin-bottom: 14px; }
.grid-commandbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px; border-bottom: 1px solid #e0e3e8; }
.grid-commandbar__start, .grid-commandbar__end { display: flex; align-items: center; gap: 6px; }
.grid-title { padding: 0 6px; font-size: 14px; font-weight: 600; }
.grid-search { width: min(280px, 26vw); }
.selection-count { padding: 4px 8px; color: #005a9e; background: #e5f1fb; border-radius: 3px; font-size: 12px; font-weight: 600; }
.grid-scroll { width: 100%; max-height: calc(100vh - 330px); min-height: 260px; overflow: auto; }
.enterprise-grid table { min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.enterprise-grid th { position: sticky; top: 0; height: 36px; padding: 0 4px 0 10px; background: #f7f8fa; border-right: 1px solid #edebe9; border-bottom: 1px solid #cfd3d8; color: #323130; text-align: left; font-weight: 600; z-index: 3; }
.enterprise-grid td { height: 36px; padding: 5px 10px; background: #fff; border-right: 1px solid #f2f2f2; border-bottom: 1px solid #edebe9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enterprise-grid.density-standard td { height: 44px; padding-block: 8px; }
.enterprise-grid tbody tr:hover td { background: #f5f9fd; }
.enterprise-grid tbody tr[data-selected] td { background: #e5f1fb; }
.enterprise-grid th.is-pinned { z-index: 5; box-shadow: 1px 0 #cfd3d8; }
.enterprise-grid td.is-pinned { position: sticky; z-index: 2; box-shadow: 1px 0 #e0e3e8; }
.enterprise-grid tbody tr:hover td.is-pinned { background: #f5f9fd; }
.enterprise-grid tbody tr[data-selected] td.is-pinned { background: #e5f1fb; }
.enterprise-grid td.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.enterprise-grid td.is-actions { overflow: visible; }
.enterprise-grid td .fui-Button--small { min-width: 0; }
.enterprise-grid tr.row-ok td { background: #f3fbf3; }
.enterprise-grid tr.row-warning td { background: #fffaf0; }
.enterprise-grid tr.row-error td { background: #fdf3f4; }
.grid-header-cell { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.grid-header-label { min-width: 0; flex: 1; height: 100%; display: flex; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.grid-header-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-header-label:disabled { cursor: default; }
.grid-header-label > svg { flex: none; }
.sort-idle { opacity: 0; }
.grid-header-cell:hover .sort-idle { opacity: .5; }
.column-resizer { position: absolute; inset: 0 -3px 0 auto; width: 6px; cursor: col-resize; touch-action: none; z-index: 6; }
.column-resizer:hover { background: #006cba; }
.grid-empty { height: 180px !important; color: #616161; text-align: center; white-space: normal; }
.grid-footer { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; color: #616161; font-size: 12px; }
.grid-pagination { display: flex; align-items: center; gap: 6px; }
.grid-pagination label { display: flex; align-items: center; gap: 6px; }
.grid-pagination .fui-Select select { min-width: 62px; height: 28px; font-size: 12px; }
.column-list { display: grid; gap: 3px; margin-top: 14px; }
.column-list__item { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 38px; padding: 2px 4px; border-bottom: 1px solid #edebe9; }
.column-filter-list { display: grid; gap: 12px; }
.column-filter-list label, .named-view-panel { display: grid; gap: 6px; }
.column-filter-list label > span, .named-view-panel > strong { font-size: 12px; font-weight: 600; color: #424242; }
.named-view-panel { margin-top: 22px; padding-top: 16px; border-top: 1px solid #e1dfdd; }
.named-view-panel > div { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.column-panel-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding: 12px 0; background: #fff; }
@media (max-width: 800px) { .grid-commandbar { align-items: stretch; } .grid-commandbar__end { flex: 1; } .grid-search { width: 100%; } .grid-scroll { max-height: none; } .grid-footer { align-items: flex-start; gap: 8px; flex-wrap: wrap; } }

/* ------------------------------ Page header, toolbar, cards (App.css) ------------------------------ */
.page-container { width: 100%; max-width: 1680px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.page-header__copy { min-width: 0; flex: 1 1 320px; }
.breadcrumb { margin-bottom: 5px; color: #616161; font-size: 12px; }
.page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.2px; }
.page-header p { margin: 4px 0 0; color: #616161; font-size: 13px; }
.page-header__actions { display: flex; align-items: center; gap: 7px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.record-count { padding: 2px 7px; border-radius: 10px; background: #e8eaed; color: #424242; font-size: 11px; font-weight: 600; }
.global-search-hint { margin: -6px 0 12px; padding: 7px 10px; border-left: 3px solid #0f6cbd; background: #eff6fc; color: #424242; font-size: 12px; }
.workflow-table-toolbar { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; min-height: 46px; margin: 0 0 10px; padding: 7px 10px; overflow-x: auto; border: 1px solid #d6dbe1; border-radius: 4px; background: #fff; }
.workflow-table-toolbar__search { flex: 1 1 220px; min-width: 190px; max-width: 340px; }
.workflow-table-toolbar label { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 6px; color: #424242; font-size: 11px; white-space: nowrap; }
.workflow-table-toolbar label > .fui-Select { min-width: 140px; }
.workflow-table-toolbar__actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; }
.section-heading h2 { font-size: 16px; line-height: 22px; font-weight: 600; }
.section-heading p { color: #616161; font-size: 12px; }
.workspace-loading { padding: 18px 0; }
.cell-link { min-width: 0 !important; height: auto !important; padding: 0 !important; color: #005ea6 !important; font-size: 13px !important; font-weight: 600 !important; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 14px; }
.record-card { padding: 11px 12px; border: 1px solid #d1d5da; border-radius: 3px; background: #fff; }
.record-card.is-clickable { cursor: pointer; }
.record-card.is-clickable:hover { background: #f8fafc; }
.record-card.accent-danger { border-left: 3px solid #b42318; }
.record-card.accent-warning { border-left: 3px solid #d83b01; }
.record-card.accent-success { border-left: 3px solid #107c10; }
.record-card.accent-brand { border-left: 3px solid #006cba; }
.record-card h2 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.record-metric-label { color: #616161; font-size: 12px; }
.record-metric-value { margin-top: 2px; font-size: 24px; line-height: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.record-metric-note { margin-top: 2px; color: #616161; font-size: 11px; }
.progress-track { height: 6px; margin-top: 8px; border-radius: 3px; background: #e8eaed; overflow: hidden; }
.progress-fill { height: 100%; background: #006cba; }
.attention-card { border-left: 3px solid #d83b01; background: #fff9f5; }

/* ------------------------------ Entry form (FastTabs) ------------------------------ */
.form-success { margin-bottom: 10px; padding: 7px 10px; border-left: 3px solid #107c10; background: #dff6dd; color: #0e5f0e; font-size: 12px; }
.fasttab { margin: 0 0 10px; border: 1px solid #d1d5da; border-radius: 3px; background: #fff; }
.fasttab__header { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 11px; border-bottom: 1px solid #e5e5e5; background: #f4f5f7; }
.fasttab__header h3 { margin: 0; font-size: 13px; font-weight: 600; }
.fasttab__header span { display: block; margin-top: 2px; color: #616161; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; padding: 12px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.checkbox-row { min-height: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; border-top: 1px solid #edebe9; padding-top: 9px; }
.native-file { width: 100%; min-height: 32px; padding: 5px; border: 1px solid #b3b3b3; border-radius: 2px; background: #fff; font: inherit; }
.draft-state { margin-right: auto; color: #616161; font-size: 11px; }
.step-card { margin: 12px; padding: 12px; border: 1px solid #e0e3e8; border-radius: 3px; background: #fff; }
.step-card.needs-review { background: #fff9c4; border-left: 4px solid #fbc02d; }
.step-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-weight: 600; }
.step-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.param-line { margin-top: 8px; color: #424242; font-size: 12px; }
.compact-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.compact-table th { padding: 8px 10px; border-bottom: 1px solid #cfd3d8; background: #f7f8fa; text-align: left; font-weight: 600; }
.compact-table td { padding: 8px 10px; border-bottom: 1px solid #edebe9; }
.media-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; background: #e5f1fb; color: #005a9e; font-size: 11px; font-weight: 600; }
.wi-image { max-width: 100%; max-height: 340px; border: 1px solid #d9dce1; border-radius: 3px; cursor: zoom-in; transition: transform .2s; }
.upload-hint { color: #616161; font-size: 12px; }

/* ------------------------------ Tablet operator workspace ------------------------------ */
.tablet-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
.tablet-hero__product { margin-top: 4px; font-size: 24px; line-height: 30px; font-weight: 600; }
.tablet-hero__meta { color: #616161; font-size: 13px; }
.tablet-step { min-height: 200px; padding: 16px; border: 1px solid #d9dce1; border-radius: 3px; background: #fafbfc; }
.tablet-step h3 { margin-bottom: 8px; font-size: 18px; line-height: 24px; font-weight: 600; }
.tablet-step p { white-space: pre-line; font-size: 18px; line-height: 28px; margin-bottom: 12px; }
.tablet-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.step-jumps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.param-box { padding: 12px; margin-bottom: 10px; border: 1px solid #d9dce1; border-radius: 3px; background: #fff; }
.param-box__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.param-box__head span { color: #616161; font-size: 12px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; align-items: start; }
.verify-result { margin-top: 12px; }

/* ------------------------------ Toast ------------------------------ */
.sja-toaster { position: fixed; right: 20px; bottom: 20px; z-index: 700; display: grid; gap: 8px; }
.sja-toast { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 4px; background: #fff; box-shadow: var(--f-shadow16); border-left: 4px solid #006cba; font-size: 14px; animation: fui-slide .18s ease-out; }
.sja-toast.is-success { border-left-color: #107c41; }
.sja-toast.is-error { border-left-color: #b10e1c; }
.sja-toast.is-warning { border-left-color: #d83b01; }

/* ------------------------------ Login page (App.css) ------------------------------ */
.login-provider { min-height: 100vh; font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .92fr) minmax(500px, 1.08fr); background: #fff; }
.login-brand-panel { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 38px 48px 42px; color: #fff; background: linear-gradient(145deg, #063866 0%, #075d9c 54%, #0078d4 100%); }
.login-brand-panel::before { content: ''; position: absolute; width: 520px; height: 520px; right: -210px; bottom: -190px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 50%; box-shadow: 0 0 0 80px rgb(255 255 255 / 4%), 0 0 0 160px rgb(255 255 255 / 3%); }
.login-brand-panel::after { content: ''; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgb(255 255 255 / 10%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 10%) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, transparent, #000 35%, #000); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000); }
.login-brand-mark { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 11px; font-size: 16px; }
.login-brand-mark > span, .login-mobile-brand > span { width: 34px; height: 34px; display: grid; place-items: center; background: #fff; color: #0067b8; font-size: 19px; font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / 15%); }
.login-brand-copy { position: relative; z-index: 1; max-width: 580px; margin: auto 0; }
.login-eyebrow { display: block; margin-bottom: 17px; color: #c7e9ff; font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.login-brand-copy h1 { max-width: 550px; margin: 0 0 20px; font-size: clamp(34px, 4vw, 55px); line-height: 1.08; font-weight: 600; letter-spacing: -.025em; }
.login-brand-copy p { max-width: 535px; margin: 0; color: #e4f3fc; font-size: 15px; line-height: 1.65; }
.login-security-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: #e4f3fc; font-size: 12px; }
.login-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 48px; background: #f7f8fa; }
.login-card { width: min(100%, 410px); display: grid; gap: 23px; padding: 38px 40px 34px; border: 1px solid #d6dbe1; border-radius: 4px; background: #fff; box-shadow: 0 12px 34px rgb(0 32 64 / 9%); }
.login-card header > span { display: block; margin-bottom: 7px; color: #0067b8; font-size: 12px; font-weight: 600; }
.login-card h2 { margin: 0 0 8px; color: #242424; font-size: 27px; line-height: 34px; font-weight: 600; }
.login-card header p { margin: 0; color: #616161; font-size: 13px; line-height: 20px; }
.login-fields { display: grid; gap: 17px; }
.login-fields .fui-Input { min-height: 42px; border-radius: 2px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -7px; }
.login-options > span { color: #767676; font-size: 10px; text-align: right; }
.login-card .fui-Button--primary { min-height: 42px; border-radius: 2px; background: #0f6cbd; }
.login-card .fui-Button--primary:hover:not(:disabled) { background: #115ea3; }
.login-card footer { padding-top: 16px; border-top: 1px solid #edebe9; color: #767676; font-size: 11px; text-align: center; }
.login-demo { padding: 8px 10px; border-left: 3px solid #0f6cbd; background: #eff6fc; color: #424242; font-size: 12px; }
.login-mobile-brand { display: none; align-items: center; gap: 9px; margin-bottom: 27px; color: #242424; font-weight: 600; }
.auth-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 24px; background: #f5f6f8; color: #242424; }
.auth-loading .login-brand-mark > span { color: #fff; background: #0067b8; }
@media (max-width: 850px) { .login-page { grid-template-columns: 1fr; } .login-brand-panel { display: none; } .login-form-panel { padding: 24px; } .login-mobile-brand { display: flex; } }
@media (max-width: 480px) { .login-form-panel { align-items: start; padding: 0; background: #fff; } .login-card { min-height: 100vh; align-content: center; padding: 28px 24px; border: 0; box-shadow: none; } }

/* Page loading skeleton (App.css) */
.page-loading { display: grid; gap: 10px; padding: 8px 0; }
.page-loading span { height: 18px; border-radius: 2px; background: linear-gradient(90deg, #e9ebee 25%, #f5f6f8 50%, #e9ebee 75%); background-size: 200% 100%; animation: page-loading 1.2s infinite; }
.page-loading span:first-child { width: 28%; height: 28px; }
.page-loading span:nth-child(2) { width: 55%; }
.page-loading span:last-child { height: 320px; margin-top: 10px; }
@keyframes page-loading { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .field-span-2, .field-span-3 { grid-column: span 1; }
  .workflow-table-toolbar { flex-wrap: wrap; }
}

/* ------------------------------ Dark Mode Theme ------------------------------ */
[data-theme="dark"] {
  color-scheme: dark;
  --sja-canvas: #12151a;
  --sja-surface: #1b2028;
  --sja-border: #2c3340;
  --sja-text: #eef1f5;
  --sja-muted: #9aa4b2;
  --f-stroke1: #37404e;
  --f-stroke2: #2a313d;
  --f-stroke-acc: #8a94a6;
  --f-fg2: #cfd6e0;
  --f-bg3: #232933;
}
[data-theme="dark"] body { background: var(--sja-canvas); color: var(--sja-text); }
[data-theme="dark"] .sja-topbar,
[data-theme="dark"] .sja-sidebar,
[data-theme="dark"] .sja-app-rail,
[data-theme="dark"] .record-card,
[data-theme="dark"] .fasttab,
[data-theme="dark"] .fui-OverlayDrawer,
[data-theme="dark"] .fui-MenuList,
[data-theme="dark"] .enterprise-grid {
  background: var(--sja-surface);
  color: var(--sja-text);
  border-color: var(--sja-border);
}
[data-theme="dark"] .sja-nav-item,
[data-theme="dark"] .sja-rail-item,
[data-theme="dark"] .fui-Button:not(.fui-Button--primary):not(.fui-Button--subtle):not(.fui-Button--transparent) {
  background: #232933;
  color: var(--sja-text);
  border-color: var(--f-stroke1);
}
[data-theme="dark"] .sja-nav-item:hover,
[data-theme="dark"] .sja-rail-item:hover,
[data-theme="dark"] .fui-Button--subtle:hover:not(:disabled) {
  background: #2a323f;
  color: #fff;
}
[data-theme="dark"] .sja-nav-item.is-active {
  background: #173454;
  color: #6cb8ff;
}
[data-theme="dark"] .fui-Input,
[data-theme="dark"] .fui-Select,
[data-theme="dark"] .fui-Textarea,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #14181f;
  color: var(--sja-text);
  border-color: var(--f-stroke1);
}
[data-theme="dark"] .enterprise-grid th,
[data-theme="dark"] .compact-table th {
  background: #222832;
  color: var(--sja-text);
  border-color: var(--sja-border);
}
[data-theme="dark"] .enterprise-grid td,
[data-theme="dark"] .compact-table td {
  border-color: var(--sja-border);
  color: var(--sja-text);
}
[data-theme="dark"] .enterprise-grid tbody tr:hover td { background: #232a36; }
[data-theme="dark"] .step-card,
[data-theme="dark"] .fui-DrawerHeader,
[data-theme="dark"] .fui-DrawerFooter,
[data-theme="dark"] .fasttab__header {
  background: #202630;
  border-color: var(--sja-border);
  color: var(--sja-text);
}
